Lines Matching refs:mcpdm

38 static struct omap_mcpdm *mcpdm;  variable
42 __raw_writel(val, mcpdm->io_base + reg); in omap_mcpdm_write()
47 return __raw_readl(mcpdm->io_base + reg); in omap_mcpdm_read()
52 dev_dbg(mcpdm->dev, "***********************\n"); in omap_mcpdm_reg_dump()
53 dev_dbg(mcpdm->dev, "IRQSTATUS_RAW: 0x%04x\n", in omap_mcpdm_reg_dump()
55 dev_dbg(mcpdm->dev, "IRQSTATUS: 0x%04x\n", in omap_mcpdm_reg_dump()
57 dev_dbg(mcpdm->dev, "IRQENABLE_SET: 0x%04x\n", in omap_mcpdm_reg_dump()
59 dev_dbg(mcpdm->dev, "IRQENABLE_CLR: 0x%04x\n", in omap_mcpdm_reg_dump()
61 dev_dbg(mcpdm->dev, "IRQWAKE_EN: 0x%04x\n", in omap_mcpdm_reg_dump()
63 dev_dbg(mcpdm->dev, "DMAENABLE_SET: 0x%04x\n", in omap_mcpdm_reg_dump()
65 dev_dbg(mcpdm->dev, "DMAENABLE_CLR: 0x%04x\n", in omap_mcpdm_reg_dump()
67 dev_dbg(mcpdm->dev, "DMAWAKEEN: 0x%04x\n", in omap_mcpdm_reg_dump()
69 dev_dbg(mcpdm->dev, "CTRL: 0x%04x\n", in omap_mcpdm_reg_dump()
71 dev_dbg(mcpdm->dev, "DN_DATA: 0x%04x\n", in omap_mcpdm_reg_dump()
73 dev_dbg(mcpdm->dev, "UP_DATA: 0x%04x\n", in omap_mcpdm_reg_dump()
75 dev_dbg(mcpdm->dev, "FIFO_CTRL_DN: 0x%04x\n", in omap_mcpdm_reg_dump()
77 dev_dbg(mcpdm->dev, "FIFO_CTRL_UP: 0x%04x\n", in omap_mcpdm_reg_dump()
79 dev_dbg(mcpdm->dev, "DN_OFFSET: 0x%04x\n", in omap_mcpdm_reg_dump()
81 dev_dbg(mcpdm->dev, "***********************\n"); in omap_mcpdm_reg_dump()
121 ctrl |= mcpdm->up_channels; in omap_mcpdm_start()
123 ctrl |= mcpdm->dn_channels; in omap_mcpdm_start()
137 ctrl &= ~mcpdm->up_channels; in omap_mcpdm_stop()
139 ctrl &= ~mcpdm->dn_channels; in omap_mcpdm_stop()
156 mcpdm->uplink = uplink; in omap_mcpdm_capture_open()
177 mcpdm->up_channels = uplink->channels & (PDM_UP_MASK | PDM_STATUS_MASK); in omap_mcpdm_capture_open()
196 mcpdm->downlink = downlink; in omap_mcpdm_playback_open()
217 mcpdm->dn_channels = downlink->channels & (PDM_DN_MASK | PDM_CMD_MASK); in omap_mcpdm_playback_open()
243 mcpdm->up_channels = 0; in omap_mcpdm_capture_close()
245 mcpdm->uplink = NULL; in omap_mcpdm_capture_close()
269 mcpdm->dn_channels = 0; in omap_mcpdm_playback_close()
271 mcpdm->downlink = NULL; in omap_mcpdm_playback_close()
329 clk_enable(mcpdm->clk); in omap_mcpdm_request()
331 spin_lock(&mcpdm->lock); in omap_mcpdm_request()
333 if (!mcpdm->free) { in omap_mcpdm_request()
334 dev_err(mcpdm->dev, "McPDM interface is in use\n"); in omap_mcpdm_request()
335 spin_unlock(&mcpdm->lock); in omap_mcpdm_request()
339 mcpdm->free = 0; in omap_mcpdm_request()
341 spin_unlock(&mcpdm->lock); in omap_mcpdm_request()
346 ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler, in omap_mcpdm_request()
347 0, "McPDM", (void *)mcpdm); in omap_mcpdm_request()
349 dev_err(mcpdm->dev, "Request for McPDM IRQ failed\n"); in omap_mcpdm_request()
356 clk_disable(mcpdm->clk); in omap_mcpdm_request()
362 spin_lock(&mcpdm->lock); in omap_mcpdm_free()
363 if (mcpdm->free) { in omap_mcpdm_free()
364 dev_err(mcpdm->dev, "McPDM interface is already free\n"); in omap_mcpdm_free()
365 spin_unlock(&mcpdm->lock); in omap_mcpdm_free()
368 mcpdm->free = 1; in omap_mcpdm_free()
369 spin_unlock(&mcpdm->lock); in omap_mcpdm_free()
371 clk_disable(mcpdm->clk); in omap_mcpdm_free()
373 free_irq(mcpdm->irq, (void *)mcpdm); in omap_mcpdm_free()
410 mcpdm = kzalloc(sizeof(struct omap_mcpdm), GFP_KERNEL); in omap_mcpdm_probe()
411 if (!mcpdm) { in omap_mcpdm_probe()
422 spin_lock_init(&mcpdm->lock); in omap_mcpdm_probe()
423 mcpdm->free = 1; in omap_mcpdm_probe()
424 mcpdm->io_base = ioremap(res->start, resource_size(res)); in omap_mcpdm_probe()
425 if (!mcpdm->io_base) { in omap_mcpdm_probe()
430 mcpdm->irq = platform_get_irq(pdev, 0); in omap_mcpdm_probe()
432 mcpdm->clk = clk_get(&pdev->dev, "pdm_ck"); in omap_mcpdm_probe()
433 if (IS_ERR(mcpdm->clk)) { in omap_mcpdm_probe()
434 ret = PTR_ERR(mcpdm->clk); in omap_mcpdm_probe()
439 mcpdm->dev = &pdev->dev; in omap_mcpdm_probe()
440 platform_set_drvdata(pdev, mcpdm); in omap_mcpdm_probe()
445 iounmap(mcpdm->io_base); in omap_mcpdm_probe()
447 kfree(mcpdm); in omap_mcpdm_probe()