mcdt 118 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_update(struct sprd_mcdt_dev *mcdt, u32 reg, u32 val, mcdt 121 sound/soc/sprd/sprd-mcdt.c u32 orig = readl_relaxed(mcdt->base + reg); mcdt 125 sound/soc/sprd/sprd-mcdt.c writel_relaxed(tmp, mcdt->base + reg); mcdt 128 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_dac_set_watermark(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 136 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, water_mark, mcdt 140 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_adc_set_watermark(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 148 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, water_mark, mcdt 152 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_dac_dma_enable(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 158 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_EN, BIT(shift), BIT(shift)); mcdt 160 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_EN, 0, BIT(shift)); mcdt 163 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_adc_dma_enable(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 167 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_EN, BIT(channel), BIT(channel)); mcdt 169 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_EN, 0, BIT(channel)); mcdt 172 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_ap_int_enable(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 176 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_INT_MSK_CFG0, BIT(channel), mcdt 179 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_INT_MSK_CFG0, 0, BIT(channel)); mcdt 182 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_dac_write_fifo(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 187 sound/soc/sprd/sprd-mcdt.c writel_relaxed(val, mcdt->base + reg); mcdt 190 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_adc_read_fifo(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 195 sound/soc/sprd/sprd-mcdt.c *val = readl_relaxed(mcdt->base + reg); mcdt 198 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_dac_dma_chn_select(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 203 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG0, mcdt 209 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG0, mcdt 215 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG0, mcdt 221 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG0, mcdt 227 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG0, mcdt 234 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_adc_dma_chn_select(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 239 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG1, mcdt 245 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG1, mcdt 251 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG1, mcdt 257 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG1, mcdt 263 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_DMA_CFG1, mcdt 295 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_dac_dma_ack_select(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 313 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, ack << shift, mcdt 317 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_adc_dma_ack_select(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 335 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, ack << shift, mcdt 339 sound/soc/sprd/sprd-mcdt.c static bool sprd_mcdt_chan_fifo_sts(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 385 sound/soc/sprd/sprd-mcdt.c return !!(readl_relaxed(mcdt->base + reg) & BIT(shift)); mcdt 388 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_dac_fifo_clear(struct sprd_mcdt_dev *mcdt, u8 channel) mcdt 390 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_FIFO_CLR, BIT(channel), BIT(channel)); mcdt 393 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_adc_fifo_clear(struct sprd_mcdt_dev *mcdt, u8 channel) mcdt 397 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, MCDT_FIFO_CLR, BIT(shift), BIT(shift)); mcdt 400 sound/soc/sprd/sprd-mcdt.c static u32 sprd_mcdt_dac_fifo_avail(struct sprd_mcdt_dev *mcdt, u8 channel) mcdt 403 sound/soc/sprd/sprd-mcdt.c u32 r_addr = (readl_relaxed(mcdt->base + reg) >> mcdt 405 sound/soc/sprd/sprd-mcdt.c u32 w_addr = readl_relaxed(mcdt->base + reg) & MCDT_CH_FIFO_ADDR_MASK; mcdt 413 sound/soc/sprd/sprd-mcdt.c static u32 sprd_mcdt_adc_fifo_avail(struct sprd_mcdt_dev *mcdt, u8 channel) mcdt 416 sound/soc/sprd/sprd-mcdt.c u32 r_addr = (readl_relaxed(mcdt->base + reg) >> mcdt 418 sound/soc/sprd/sprd-mcdt.c u32 w_addr = readl_relaxed(mcdt->base + reg) & MCDT_CH_FIFO_ADDR_MASK; mcdt 453 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_chan_int_en(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 473 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, BIT(shift), BIT(shift)); mcdt 475 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, 0, BIT(shift)); mcdt 478 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_chan_int_clear(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 497 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_update(mcdt, reg, BIT(shift), BIT(shift)); mcdt 500 sound/soc/sprd/sprd-mcdt.c static bool sprd_mcdt_chan_int_sts(struct sprd_mcdt_dev *mcdt, u8 channel, mcdt 519 sound/soc/sprd/sprd-mcdt.c return !!(readl_relaxed(mcdt->base + reg) & BIT(shift)); mcdt 524 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = (struct sprd_mcdt_dev *)dev_id; mcdt 527 sound/soc/sprd/sprd-mcdt.c spin_lock(&mcdt->lock); mcdt 530 sound/soc/sprd/sprd-mcdt.c if (sprd_mcdt_chan_int_sts(mcdt, i, MCDT_ADC_FIFO_AF_INT)) { mcdt 531 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_chan *chan = &mcdt->chan[i]; mcdt 533 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_clear(mcdt, i, MCDT_ADC_FIFO_AF_INT); mcdt 540 sound/soc/sprd/sprd-mcdt.c if (sprd_mcdt_chan_int_sts(mcdt, i, MCDT_DAC_FIFO_AE_INT)) { mcdt 542 sound/soc/sprd/sprd-mcdt.c &mcdt->chan[i + MCDT_ADC_CHANNEL_NUM]; mcdt 544 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_clear(mcdt, i, MCDT_DAC_FIFO_AE_INT); mcdt 550 sound/soc/sprd/sprd-mcdt.c spin_unlock(&mcdt->lock); mcdt 571 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = chan->mcdt; mcdt 576 sound/soc/sprd/sprd-mcdt.c spin_lock_irqsave(&mcdt->lock, flags); mcdt 579 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, mcdt 581 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 585 sound/soc/sprd/sprd-mcdt.c if (sprd_mcdt_chan_fifo_sts(mcdt, chan->id, MCDT_DAC_FIFO_REAL_FULL)) { mcdt 586 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Channel fifo is full now\n"); mcdt 587 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 591 sound/soc/sprd/sprd-mcdt.c avail = sprd_mcdt_dac_fifo_avail(mcdt, chan->id); mcdt 593 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, mcdt 595 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 600 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_write_fifo(mcdt, chan->id, *buf++); mcdt 602 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 622 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = chan->mcdt; mcdt 627 sound/soc/sprd/sprd-mcdt.c spin_lock_irqsave(&mcdt->lock, flags); mcdt 630 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Can not read data when DMA mode enabled\n"); mcdt 631 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 635 sound/soc/sprd/sprd-mcdt.c if (sprd_mcdt_chan_fifo_sts(mcdt, chan->id, MCDT_ADC_FIFO_REAL_EMPTY)) { mcdt 636 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Channel fifo is empty\n"); mcdt 637 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 641 sound/soc/sprd/sprd-mcdt.c avail = sprd_mcdt_adc_fifo_avail(mcdt, chan->id); mcdt 646 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_read_fifo(mcdt, chan->id, buf++); mcdt 648 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 674 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = chan->mcdt; mcdt 678 sound/soc/sprd/sprd-mcdt.c spin_lock_irqsave(&mcdt->lock, flags); mcdt 681 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Failed to set interrupt mode.\n"); mcdt 682 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 688 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_fifo_clear(mcdt, chan->id); mcdt 689 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_set_watermark(mcdt, chan->id, water_mark, mcdt 691 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_en(mcdt, chan->id, mcdt 693 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_ap_int_enable(mcdt, chan->id, true); mcdt 697 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_fifo_clear(mcdt, chan->id); mcdt 698 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_set_watermark(mcdt, chan->id, mcdt 700 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_en(mcdt, chan->id, mcdt 702 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_ap_int_enable(mcdt, chan->id, true); mcdt 706 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Unsupported channel type\n"); mcdt 715 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 727 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = chan->mcdt; mcdt 730 sound/soc/sprd/sprd-mcdt.c spin_lock_irqsave(&mcdt->lock, flags); mcdt 733 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 739 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_en(mcdt, chan->id, mcdt 741 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_clear(mcdt, chan->id, MCDT_ADC_FIFO_AF_INT); mcdt 742 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_ap_int_enable(mcdt, chan->id, false); mcdt 746 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_en(mcdt, chan->id, mcdt 748 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_chan_int_clear(mcdt, chan->id, MCDT_DAC_FIFO_AE_INT); mcdt 749 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_ap_int_enable(mcdt, chan->id, false); mcdt 757 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 777 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = chan->mcdt; mcdt 781 sound/soc/sprd/sprd-mcdt.c spin_lock_irqsave(&mcdt->lock, flags); mcdt 785 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Failed to set DMA mode\n"); mcdt 786 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 792 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_fifo_clear(mcdt, chan->id); mcdt 793 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_set_watermark(mcdt, chan->id, mcdt 795 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_dma_enable(mcdt, chan->id, true); mcdt 796 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_dma_chn_select(mcdt, chan->id, dma_chan); mcdt 797 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_dma_ack_select(mcdt, chan->id, dma_chan); mcdt 801 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_fifo_clear(mcdt, chan->id); mcdt 802 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_set_watermark(mcdt, chan->id, mcdt 804 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_dma_enable(mcdt, chan->id, true); mcdt 805 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_dma_chn_select(mcdt, chan->id, dma_chan); mcdt 806 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_dma_ack_select(mcdt, chan->id, dma_chan); mcdt 810 sound/soc/sprd/sprd-mcdt.c dev_err(mcdt->dev, "Unsupported channel type\n"); mcdt 817 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 829 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt = chan->mcdt; mcdt 832 sound/soc/sprd/sprd-mcdt.c spin_lock_irqsave(&mcdt->lock, flags); mcdt 835 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 841 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_dma_enable(mcdt, chan->id, false); mcdt 842 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_adc_fifo_clear(mcdt, chan->id); mcdt 846 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_dma_enable(mcdt, chan->id, false); mcdt 847 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_dac_fifo_clear(mcdt, chan->id); mcdt 855 sound/soc/sprd/sprd-mcdt.c spin_unlock_irqrestore(&mcdt->lock, flags); mcdt 914 sound/soc/sprd/sprd-mcdt.c static void sprd_mcdt_init_chans(struct sprd_mcdt_dev *mcdt, mcdt 920 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_chan *chan = &mcdt->chan[i]; mcdt 933 sound/soc/sprd/sprd-mcdt.c chan->mcdt = mcdt; mcdt 944 sound/soc/sprd/sprd-mcdt.c struct sprd_mcdt_dev *mcdt; mcdt 948 sound/soc/sprd/sprd-mcdt.c mcdt = devm_kzalloc(&pdev->dev, sizeof(*mcdt), GFP_KERNEL); mcdt 949 sound/soc/sprd/sprd-mcdt.c if (!mcdt) mcdt 953 sound/soc/sprd/sprd-mcdt.c mcdt->base = devm_ioremap_resource(&pdev->dev, res); mcdt 954 sound/soc/sprd/sprd-mcdt.c if (IS_ERR(mcdt->base)) mcdt 955 sound/soc/sprd/sprd-mcdt.c return PTR_ERR(mcdt->base); mcdt 957 sound/soc/sprd/sprd-mcdt.c mcdt->dev = &pdev->dev; mcdt 958 sound/soc/sprd/sprd-mcdt.c spin_lock_init(&mcdt->lock); mcdt 959 sound/soc/sprd/sprd-mcdt.c platform_set_drvdata(pdev, mcdt); mcdt 966 sound/soc/sprd/sprd-mcdt.c 0, "sprd-mcdt", mcdt); mcdt 972 sound/soc/sprd/sprd-mcdt.c sprd_mcdt_init_chans(mcdt, res); mcdt 40 sound/soc/sprd/sprd-mcdt.h struct sprd_mcdt_dev *mcdt;