• Home
  • Raw
  • Download

Lines Matching refs:chan

112 	struct sprd_mcdt_chan chan[MCDT_CHANNEL_NUM];  member
531 struct sprd_mcdt_chan *chan = &mcdt->chan[i]; in sprd_mcdt_irq_handler() local
534 if (chan->cb) in sprd_mcdt_irq_handler()
535 chan->cb->notify(chan->cb->data); in sprd_mcdt_irq_handler()
541 struct sprd_mcdt_chan *chan = in sprd_mcdt_irq_handler() local
542 &mcdt->chan[i + MCDT_ADC_CHANNEL_NUM]; in sprd_mcdt_irq_handler()
545 if (chan->cb) in sprd_mcdt_irq_handler()
546 chan->cb->notify(chan->cb->data); in sprd_mcdt_irq_handler()
569 int sprd_mcdt_chan_write(struct sprd_mcdt_chan *chan, char *tx_buf, u32 size) in sprd_mcdt_chan_write() argument
571 struct sprd_mcdt_dev *mcdt = chan->mcdt; in sprd_mcdt_chan_write()
578 if (chan->dma_enable) { in sprd_mcdt_chan_write()
585 if (sprd_mcdt_chan_fifo_sts(mcdt, chan->id, MCDT_DAC_FIFO_REAL_FULL)) { in sprd_mcdt_chan_write()
591 avail = sprd_mcdt_dac_fifo_avail(mcdt, chan->id); in sprd_mcdt_chan_write()
600 sprd_mcdt_dac_write_fifo(mcdt, chan->id, *buf++); in sprd_mcdt_chan_write()
620 int sprd_mcdt_chan_read(struct sprd_mcdt_chan *chan, char *rx_buf, u32 size) in sprd_mcdt_chan_read() argument
622 struct sprd_mcdt_dev *mcdt = chan->mcdt; in sprd_mcdt_chan_read()
629 if (chan->dma_enable) { in sprd_mcdt_chan_read()
635 if (sprd_mcdt_chan_fifo_sts(mcdt, chan->id, MCDT_ADC_FIFO_REAL_EMPTY)) { in sprd_mcdt_chan_read()
641 avail = sprd_mcdt_adc_fifo_avail(mcdt, chan->id); in sprd_mcdt_chan_read()
646 sprd_mcdt_adc_read_fifo(mcdt, chan->id, buf++); in sprd_mcdt_chan_read()
671 int sprd_mcdt_chan_int_enable(struct sprd_mcdt_chan *chan, u32 water_mark, in sprd_mcdt_chan_int_enable() argument
674 struct sprd_mcdt_dev *mcdt = chan->mcdt; in sprd_mcdt_chan_int_enable()
680 if (chan->dma_enable || chan->int_enable) { in sprd_mcdt_chan_int_enable()
686 switch (chan->type) { in sprd_mcdt_chan_int_enable()
688 sprd_mcdt_adc_fifo_clear(mcdt, chan->id); in sprd_mcdt_chan_int_enable()
689 sprd_mcdt_adc_set_watermark(mcdt, chan->id, water_mark, in sprd_mcdt_chan_int_enable()
691 sprd_mcdt_chan_int_en(mcdt, chan->id, in sprd_mcdt_chan_int_enable()
693 sprd_mcdt_ap_int_enable(mcdt, chan->id, true); in sprd_mcdt_chan_int_enable()
697 sprd_mcdt_dac_fifo_clear(mcdt, chan->id); in sprd_mcdt_chan_int_enable()
698 sprd_mcdt_dac_set_watermark(mcdt, chan->id, in sprd_mcdt_chan_int_enable()
700 sprd_mcdt_chan_int_en(mcdt, chan->id, in sprd_mcdt_chan_int_enable()
702 sprd_mcdt_ap_int_enable(mcdt, chan->id, true); in sprd_mcdt_chan_int_enable()
711 chan->cb = cb; in sprd_mcdt_chan_int_enable()
712 chan->int_enable = true; in sprd_mcdt_chan_int_enable()
725 void sprd_mcdt_chan_int_disable(struct sprd_mcdt_chan *chan) in sprd_mcdt_chan_int_disable() argument
727 struct sprd_mcdt_dev *mcdt = chan->mcdt; in sprd_mcdt_chan_int_disable()
732 if (!chan->int_enable) { in sprd_mcdt_chan_int_disable()
737 switch (chan->type) { in sprd_mcdt_chan_int_disable()
739 sprd_mcdt_chan_int_en(mcdt, chan->id, in sprd_mcdt_chan_int_disable()
741 sprd_mcdt_chan_int_clear(mcdt, chan->id, MCDT_ADC_FIFO_AF_INT); in sprd_mcdt_chan_int_disable()
742 sprd_mcdt_ap_int_enable(mcdt, chan->id, false); in sprd_mcdt_chan_int_disable()
746 sprd_mcdt_chan_int_en(mcdt, chan->id, in sprd_mcdt_chan_int_disable()
748 sprd_mcdt_chan_int_clear(mcdt, chan->id, MCDT_DAC_FIFO_AE_INT); in sprd_mcdt_chan_int_disable()
749 sprd_mcdt_ap_int_enable(mcdt, chan->id, false); in sprd_mcdt_chan_int_disable()
756 chan->int_enable = false; in sprd_mcdt_chan_int_disable()
773 int sprd_mcdt_chan_dma_enable(struct sprd_mcdt_chan *chan, in sprd_mcdt_chan_dma_enable() argument
777 struct sprd_mcdt_dev *mcdt = chan->mcdt; in sprd_mcdt_chan_dma_enable()
783 if (chan->dma_enable || chan->int_enable || in sprd_mcdt_chan_dma_enable()
790 switch (chan->type) { in sprd_mcdt_chan_dma_enable()
792 sprd_mcdt_adc_fifo_clear(mcdt, chan->id); in sprd_mcdt_chan_dma_enable()
793 sprd_mcdt_adc_set_watermark(mcdt, chan->id, in sprd_mcdt_chan_dma_enable()
795 sprd_mcdt_adc_dma_enable(mcdt, chan->id, true); in sprd_mcdt_chan_dma_enable()
796 sprd_mcdt_adc_dma_chn_select(mcdt, chan->id, dma_chan); in sprd_mcdt_chan_dma_enable()
797 sprd_mcdt_adc_dma_ack_select(mcdt, chan->id, dma_chan); in sprd_mcdt_chan_dma_enable()
801 sprd_mcdt_dac_fifo_clear(mcdt, chan->id); in sprd_mcdt_chan_dma_enable()
802 sprd_mcdt_dac_set_watermark(mcdt, chan->id, in sprd_mcdt_chan_dma_enable()
804 sprd_mcdt_dac_dma_enable(mcdt, chan->id, true); in sprd_mcdt_chan_dma_enable()
805 sprd_mcdt_dac_dma_chn_select(mcdt, chan->id, dma_chan); in sprd_mcdt_chan_dma_enable()
806 sprd_mcdt_dac_dma_ack_select(mcdt, chan->id, dma_chan); in sprd_mcdt_chan_dma_enable()
815 chan->dma_enable = true; in sprd_mcdt_chan_dma_enable()
827 void sprd_mcdt_chan_dma_disable(struct sprd_mcdt_chan *chan) in sprd_mcdt_chan_dma_disable() argument
829 struct sprd_mcdt_dev *mcdt = chan->mcdt; in sprd_mcdt_chan_dma_disable()
834 if (!chan->dma_enable) { in sprd_mcdt_chan_dma_disable()
839 switch (chan->type) { in sprd_mcdt_chan_dma_disable()
841 sprd_mcdt_adc_dma_enable(mcdt, chan->id, false); in sprd_mcdt_chan_dma_disable()
842 sprd_mcdt_adc_fifo_clear(mcdt, chan->id); in sprd_mcdt_chan_dma_disable()
846 sprd_mcdt_dac_dma_enable(mcdt, chan->id, false); in sprd_mcdt_chan_dma_disable()
847 sprd_mcdt_dac_fifo_clear(mcdt, chan->id); in sprd_mcdt_chan_dma_disable()
854 chan->dma_enable = false; in sprd_mcdt_chan_dma_disable()
893 void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan) in sprd_mcdt_free_chan() argument
897 sprd_mcdt_chan_dma_disable(chan); in sprd_mcdt_free_chan()
898 sprd_mcdt_chan_int_disable(chan); in sprd_mcdt_free_chan()
903 if (temp == chan) { in sprd_mcdt_free_chan()
909 list_add_tail(&chan->list, &sprd_mcdt_chan_list); in sprd_mcdt_free_chan()
920 struct sprd_mcdt_chan *chan = &mcdt->chan[i]; in sprd_mcdt_init_chans() local
923 chan->id = i; in sprd_mcdt_init_chans()
924 chan->type = SPRD_MCDT_ADC_CHAN; in sprd_mcdt_init_chans()
925 chan->fifo_phys = res->start + MCDT_CH0_RXD + i * 4; in sprd_mcdt_init_chans()
927 chan->id = i - MCDT_ADC_CHANNEL_NUM; in sprd_mcdt_init_chans()
928 chan->type = SPRD_MCDT_DAC_CHAN; in sprd_mcdt_init_chans()
929 chan->fifo_phys = res->start + MCDT_CH0_TXD + in sprd_mcdt_init_chans()
933 chan->mcdt = mcdt; in sprd_mcdt_init_chans()
934 INIT_LIST_HEAD(&chan->list); in sprd_mcdt_init_chans()
937 list_add_tail(&chan->list, &sprd_mcdt_chan_list); in sprd_mcdt_init_chans()
978 struct sprd_mcdt_chan *chan, *temp; in sprd_mcdt_remove() local
982 list_for_each_entry_safe(chan, temp, &sprd_mcdt_chan_list, list) in sprd_mcdt_remove()
983 list_del(&chan->list); in sprd_mcdt_remove()