4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <linux/kernel.h>
17 #include <linux/err.h>
18 #include <linux/module.h>
19 #include <linux/slab.h>
20 #include <linux/interrupt.h>
21 #include <linux/platform_device.h>
23 #include <linux/iio/iio.h>
25 #include <linux/of_device.h>
26 #include <linux/iio/machine.h>
27 #include <linux/iio/driver.h>
29 #include <linux/mfd/ti_am335x_tscadc.h>
30 #include <linux/iio/buffer.h>
31 #include <linux/iio/kfifo_buf.h>
33 #include <linux/dmaengine.h>
34 #include <linux/dma-mapping.h>
36 #define DMA_BUFFER_SIZE SZ_2K
39 struct dma_slave_config conf
;
40 struct dma_chan
*chan
;
50 struct ti_tscadc_dev
*mfd_tscadc
;
52 struct mutex fifo1_lock
; /* to protect fifo access */
57 int buffer_en_ch_steps
;
59 u32 open_delay
[8], sample_delay
[8], step_avg
[8];
62 static unsigned int tiadc_readl(struct tiadc_device
*adc
, unsigned int reg
)
64 return readl(adc
->mfd_tscadc
->tscadc_base
+ reg
);
67 static void tiadc_writel(struct tiadc_device
*adc
, unsigned int reg
,
70 writel(val
, adc
->mfd_tscadc
->tscadc_base
+ reg
);
73 static u32
get_adc_step_mask(struct tiadc_device
*adc_dev
)
77 step_en
= ((1 << adc_dev
->channels
) - 1);
78 step_en
<<= TOTAL_STEPS
- adc_dev
->channels
+ 1;
82 static u32
get_adc_chan_step_mask(struct tiadc_device
*adc_dev
,
83 struct iio_chan_spec
const *chan
)
87 for (i
= 0; i
< ARRAY_SIZE(adc_dev
->channel_step
); i
++) {
88 if (chan
->channel
== adc_dev
->channel_line
[i
]) {
91 step
= adc_dev
->channel_step
[i
];
92 /* +1 for the charger */
93 return 1 << (step
+ 1);
100 static u32
get_adc_step_bit(struct tiadc_device
*adc_dev
, int chan
)
102 return 1 << adc_dev
->channel_step
[chan
];
105 static void tiadc_step_config(struct iio_dev
*indio_dev
)
107 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
108 struct device
*dev
= adc_dev
->mfd_tscadc
->dev
;
109 unsigned int stepconfig
;
113 * There are 16 configurable steps and 8 analog input
114 * lines available which are shared between Touchscreen and ADC.
116 * Steps forwards i.e. from 0 towards 16 are used by ADC
117 * depending on number of input lines needed.
118 * Channel would represent which analog input
119 * needs to be given to ADC to digitalize data.
123 for (i
= 0; i
< adc_dev
->channels
; i
++) {
126 chan
= adc_dev
->channel_line
[i
];
128 if (adc_dev
->step_avg
[i
] > STEPCONFIG_AVG_16
) {
129 dev_warn(dev
, "chan %d step_avg truncating to %d\n",
130 chan
, STEPCONFIG_AVG_16
);
131 adc_dev
->step_avg
[i
] = STEPCONFIG_AVG_16
;
134 if (adc_dev
->step_avg
[i
])
136 STEPCONFIG_AVG(ffs(adc_dev
->step_avg
[i
]) - 1) |
139 stepconfig
= STEPCONFIG_FIFO1
;
141 if (iio_buffer_enabled(indio_dev
))
142 stepconfig
|= STEPCONFIG_MODE_SWCNT
;
144 tiadc_writel(adc_dev
, REG_STEPCONFIG(steps
),
145 stepconfig
| STEPCONFIG_INP(chan
));
147 if (adc_dev
->open_delay
[i
] > STEPDELAY_OPEN_MASK
) {
148 dev_warn(dev
, "chan %d open delay truncating to 0x3FFFF\n",
150 adc_dev
->open_delay
[i
] = STEPDELAY_OPEN_MASK
;
153 if (adc_dev
->sample_delay
[i
] > 0xFF) {
154 dev_warn(dev
, "chan %d sample delay truncating to 0xFF\n",
156 adc_dev
->sample_delay
[i
] = 0xFF;
159 tiadc_writel(adc_dev
, REG_STEPDELAY(steps
),
160 STEPDELAY_OPEN(adc_dev
->open_delay
[i
]) |
161 STEPDELAY_SAMPLE(adc_dev
->sample_delay
[i
]));
163 adc_dev
->channel_step
[i
] = steps
;
168 static irqreturn_t
tiadc_irq_h(int irq
, void *private)
170 struct iio_dev
*indio_dev
= private;
171 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
172 unsigned int status
, config
;
173 status
= tiadc_readl(adc_dev
, REG_IRQSTATUS
);
176 * ADC and touchscreen share the IRQ line.
177 * FIFO0 interrupts are used by TSC. Handle FIFO1 IRQs here only
179 if (status
& IRQENB_FIFO1OVRRUN
) {
180 /* FIFO Overrun. Clear flag. Disable/Enable ADC to recover */
181 config
= tiadc_readl(adc_dev
, REG_CTRL
);
182 config
&= ~(CNTRLREG_TSCSSENB
);
183 tiadc_writel(adc_dev
, REG_CTRL
, config
);
184 tiadc_writel(adc_dev
, REG_IRQSTATUS
, IRQENB_FIFO1OVRRUN
185 | IRQENB_FIFO1UNDRFLW
| IRQENB_FIFO1THRES
);
186 tiadc_writel(adc_dev
, REG_CTRL
, (config
| CNTRLREG_TSCSSENB
));
188 } else if (status
& IRQENB_FIFO1THRES
) {
189 /* Disable irq and wake worker thread */
190 tiadc_writel(adc_dev
, REG_IRQCLR
, IRQENB_FIFO1THRES
);
191 return IRQ_WAKE_THREAD
;
197 static irqreturn_t
tiadc_worker_h(int irq
, void *private)
199 struct iio_dev
*indio_dev
= private;
200 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
201 int i
, k
, fifo1count
, read
;
202 u16
*data
= adc_dev
->data
;
204 fifo1count
= tiadc_readl(adc_dev
, REG_FIFO1CNT
);
205 for (k
= 0; k
< fifo1count
; k
= k
+ i
) {
206 for (i
= 0; i
< (indio_dev
->scan_bytes
)/2; i
++) {
207 read
= tiadc_readl(adc_dev
, REG_FIFO1
);
208 data
[i
] = read
& FIFOREAD_DATA_MASK
;
210 iio_push_to_buffers(indio_dev
, (u8
*) data
);
213 tiadc_writel(adc_dev
, REG_IRQSTATUS
, IRQENB_FIFO1THRES
);
214 tiadc_writel(adc_dev
, REG_IRQENABLE
, IRQENB_FIFO1THRES
);
219 static void tiadc_dma_rx_complete(void *param
)
221 struct iio_dev
*indio_dev
= param
;
222 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
223 struct tiadc_dma
*dma
= &adc_dev
->dma
;
227 data
= dma
->buf
+ dma
->current_period
* dma
->period_size
;
228 dma
->current_period
= 1 - dma
->current_period
; /* swap the buffer ID */
230 for (i
= 0; i
< dma
->period_size
; i
+= indio_dev
->scan_bytes
) {
231 iio_push_to_buffers(indio_dev
, data
);
232 data
+= indio_dev
->scan_bytes
;
236 static int tiadc_start_dma(struct iio_dev
*indio_dev
)
238 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
239 struct tiadc_dma
*dma
= &adc_dev
->dma
;
240 struct dma_async_tx_descriptor
*desc
;
242 dma
->current_period
= 0; /* We start to fill period 0 */
244 * Make the fifo thresh as the multiple of total number of
245 * channels enabled, so make sure that cyclic DMA period
246 * length is also a multiple of total number of channels
247 * enabled. This ensures that no invalid data is reported
248 * to the stack via iio_push_to_buffers().
250 dma
->fifo_thresh
= rounddown(FIFO1_THRESHOLD
+ 1,
251 adc_dev
->total_ch_enabled
) - 1;
252 /* Make sure that period length is multiple of fifo thresh level */
253 dma
->period_size
= rounddown(DMA_BUFFER_SIZE
/ 2,
254 (dma
->fifo_thresh
+ 1) * sizeof(u16
));
256 dma
->conf
.src_maxburst
= dma
->fifo_thresh
+ 1;
257 dmaengine_slave_config(dma
->chan
, &dma
->conf
);
259 desc
= dmaengine_prep_dma_cyclic(dma
->chan
, dma
->addr
,
260 dma
->period_size
* 2,
261 dma
->period_size
, DMA_DEV_TO_MEM
,
266 desc
->callback
= tiadc_dma_rx_complete
;
267 desc
->callback_param
= indio_dev
;
269 dma
->cookie
= dmaengine_submit(desc
);
271 dma_async_issue_pending(dma
->chan
);
273 tiadc_writel(adc_dev
, REG_FIFO1THR
, dma
->fifo_thresh
);
274 tiadc_writel(adc_dev
, REG_DMA1REQ
, dma
->fifo_thresh
);
275 tiadc_writel(adc_dev
, REG_DMAENABLE_SET
, DMA_FIFO1
);
280 static int tiadc_buffer_preenable(struct iio_dev
*indio_dev
)
282 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
283 int i
, fifo1count
, read
;
285 tiadc_writel(adc_dev
, REG_IRQCLR
, (IRQENB_FIFO1THRES
|
287 IRQENB_FIFO1UNDRFLW
));
289 /* Flush FIFO. Needed in corner cases in simultaneous tsc/adc use */
290 fifo1count
= tiadc_readl(adc_dev
, REG_FIFO1CNT
);
291 for (i
= 0; i
< fifo1count
; i
++)
292 read
= tiadc_readl(adc_dev
, REG_FIFO1
);
297 static int tiadc_buffer_postenable(struct iio_dev
*indio_dev
)
299 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
300 struct tiadc_dma
*dma
= &adc_dev
->dma
;
301 unsigned int irq_enable
;
302 unsigned int enb
= 0;
305 tiadc_step_config(indio_dev
);
306 for_each_set_bit(bit
, indio_dev
->active_scan_mask
, adc_dev
->channels
) {
307 enb
|= (get_adc_step_bit(adc_dev
, bit
) << 1);
308 adc_dev
->total_ch_enabled
++;
310 adc_dev
->buffer_en_ch_steps
= enb
;
313 tiadc_start_dma(indio_dev
);
315 am335x_tsc_se_set_cache(adc_dev
->mfd_tscadc
, enb
);
317 tiadc_writel(adc_dev
, REG_IRQSTATUS
, IRQENB_FIFO1THRES
318 | IRQENB_FIFO1OVRRUN
| IRQENB_FIFO1UNDRFLW
);
320 irq_enable
= IRQENB_FIFO1OVRRUN
;
322 irq_enable
|= IRQENB_FIFO1THRES
;
323 tiadc_writel(adc_dev
, REG_IRQENABLE
, irq_enable
);
328 static int tiadc_buffer_predisable(struct iio_dev
*indio_dev
)
330 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
331 struct tiadc_dma
*dma
= &adc_dev
->dma
;
332 int fifo1count
, i
, read
;
334 tiadc_writel(adc_dev
, REG_IRQCLR
, (IRQENB_FIFO1THRES
|
335 IRQENB_FIFO1OVRRUN
| IRQENB_FIFO1UNDRFLW
));
336 am335x_tsc_se_clr(adc_dev
->mfd_tscadc
, adc_dev
->buffer_en_ch_steps
);
337 adc_dev
->buffer_en_ch_steps
= 0;
338 adc_dev
->total_ch_enabled
= 0;
340 tiadc_writel(adc_dev
, REG_DMAENABLE_CLEAR
, 0x2);
341 dmaengine_terminate_async(dma
->chan
);
344 /* Flush FIFO of leftover data in the time it takes to disable adc */
345 fifo1count
= tiadc_readl(adc_dev
, REG_FIFO1CNT
);
346 for (i
= 0; i
< fifo1count
; i
++)
347 read
= tiadc_readl(adc_dev
, REG_FIFO1
);
352 static int tiadc_buffer_postdisable(struct iio_dev
*indio_dev
)
354 tiadc_step_config(indio_dev
);
359 static const struct iio_buffer_setup_ops tiadc_buffer_setup_ops
= {
360 .preenable
= &tiadc_buffer_preenable
,
361 .postenable
= &tiadc_buffer_postenable
,
362 .predisable
= &tiadc_buffer_predisable
,
363 .postdisable
= &tiadc_buffer_postdisable
,
366 static int tiadc_iio_buffered_hardware_setup(struct iio_dev
*indio_dev
,
367 irqreturn_t (*pollfunc_bh
)(int irq
, void *p
),
368 irqreturn_t (*pollfunc_th
)(int irq
, void *p
),
371 const struct iio_buffer_setup_ops
*setup_ops
)
373 struct iio_buffer
*buffer
;
376 buffer
= iio_kfifo_allocate();
380 iio_device_attach_buffer(indio_dev
, buffer
);
382 ret
= request_threaded_irq(irq
, pollfunc_th
, pollfunc_bh
,
383 flags
, indio_dev
->name
, indio_dev
);
385 goto error_kfifo_free
;
387 indio_dev
->setup_ops
= setup_ops
;
388 indio_dev
->modes
|= INDIO_BUFFER_SOFTWARE
;
393 iio_kfifo_free(indio_dev
->buffer
);
397 static void tiadc_iio_buffered_hardware_remove(struct iio_dev
*indio_dev
)
399 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
401 free_irq(adc_dev
->mfd_tscadc
->irq
, indio_dev
);
402 iio_kfifo_free(indio_dev
->buffer
);
406 static const char * const chan_name_ain
[] = {
417 static int tiadc_channel_init(struct iio_dev
*indio_dev
, int channels
)
419 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
420 struct iio_chan_spec
*chan_array
;
421 struct iio_chan_spec
*chan
;
424 indio_dev
->num_channels
= channels
;
425 chan_array
= kcalloc(channels
, sizeof(*chan_array
), GFP_KERNEL
);
426 if (chan_array
== NULL
)
430 for (i
= 0; i
< channels
; i
++, chan
++) {
432 chan
->type
= IIO_VOLTAGE
;
434 chan
->channel
= adc_dev
->channel_line
[i
];
435 chan
->info_mask_separate
= BIT(IIO_CHAN_INFO_RAW
);
436 chan
->datasheet_name
= chan_name_ain
[chan
->channel
];
437 chan
->scan_index
= i
;
438 chan
->scan_type
.sign
= 'u';
439 chan
->scan_type
.realbits
= 12;
440 chan
->scan_type
.storagebits
= 16;
443 indio_dev
->channels
= chan_array
;
448 static void tiadc_channels_remove(struct iio_dev
*indio_dev
)
450 kfree(indio_dev
->channels
);
453 static int tiadc_read_raw(struct iio_dev
*indio_dev
,
454 struct iio_chan_spec
const *chan
,
455 int *val
, int *val2
, long mask
)
457 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
458 int ret
= IIO_VAL_INT
;
460 unsigned int fifo1count
, read
, stepid
;
463 unsigned long timeout
;
465 if (iio_buffer_enabled(indio_dev
))
468 step_en
= get_adc_chan_step_mask(adc_dev
, chan
);
472 mutex_lock(&adc_dev
->fifo1_lock
);
473 fifo1count
= tiadc_readl(adc_dev
, REG_FIFO1CNT
);
475 tiadc_readl(adc_dev
, REG_FIFO1
);
477 am335x_tsc_se_set_once(adc_dev
->mfd_tscadc
, step_en
);
479 timeout
= jiffies
+ msecs_to_jiffies
480 (IDLE_TIMEOUT
* adc_dev
->channels
);
481 /* Wait for Fifo threshold interrupt */
483 fifo1count
= tiadc_readl(adc_dev
, REG_FIFO1CNT
);
487 if (time_after(jiffies
, timeout
)) {
488 am335x_tsc_se_adc_done(adc_dev
->mfd_tscadc
);
493 map_val
= adc_dev
->channel_step
[chan
->scan_index
];
496 * We check the complete FIFO. We programmed just one entry but in case
497 * something went wrong we left empty handed (-EAGAIN previously) and
498 * then the value apeared somehow in the FIFO we would have two entries.
499 * Therefore we read every item and keep only the latest version of the
502 for (i
= 0; i
< fifo1count
; i
++) {
503 read
= tiadc_readl(adc_dev
, REG_FIFO1
);
504 stepid
= read
& FIFOREAD_CHNLID_MASK
;
505 stepid
= stepid
>> 0x10;
507 if (stepid
== map_val
) {
508 read
= read
& FIFOREAD_DATA_MASK
;
513 am335x_tsc_se_adc_done(adc_dev
->mfd_tscadc
);
519 mutex_unlock(&adc_dev
->fifo1_lock
);
523 static const struct iio_info tiadc_info
= {
524 .read_raw
= &tiadc_read_raw
,
525 .driver_module
= THIS_MODULE
,
528 static int tiadc_request_dma(struct platform_device
*pdev
,
529 struct tiadc_device
*adc_dev
)
531 struct tiadc_dma
*dma
= &adc_dev
->dma
;
534 /* Default slave configuration parameters */
535 dma
->conf
.direction
= DMA_DEV_TO_MEM
;
536 dma
->conf
.src_addr_width
= DMA_SLAVE_BUSWIDTH_2_BYTES
;
537 dma
->conf
.src_addr
= adc_dev
->mfd_tscadc
->tscadc_phys_base
+ REG_FIFO1
;
540 dma_cap_set(DMA_CYCLIC
, mask
);
542 /* Get a channel for RX */
543 dma
->chan
= dma_request_chan(adc_dev
->mfd_tscadc
->dev
, "fifo1");
544 if (IS_ERR(dma
->chan
)) {
545 int ret
= PTR_ERR(dma
->chan
);
552 dma
->buf
= dma_alloc_coherent(dma
->chan
->device
->dev
, DMA_BUFFER_SIZE
,
553 &dma
->addr
, GFP_KERNEL
);
559 dma_release_channel(dma
->chan
);
563 static int tiadc_parse_dt(struct platform_device
*pdev
,
564 struct tiadc_device
*adc_dev
)
566 struct device_node
*node
= pdev
->dev
.of_node
;
567 struct property
*prop
;
572 of_property_for_each_u32(node
, "ti,adc-channels", prop
, cur
, val
) {
573 adc_dev
->channel_line
[channels
] = val
;
575 /* Set Default values for optional DT parameters */
576 adc_dev
->open_delay
[channels
] = STEPCONFIG_OPENDLY
;
577 adc_dev
->sample_delay
[channels
] = STEPCONFIG_SAMPLEDLY
;
578 adc_dev
->step_avg
[channels
] = 16;
583 of_property_read_u32_array(node
, "ti,chan-step-avg",
584 adc_dev
->step_avg
, channels
);
585 of_property_read_u32_array(node
, "ti,chan-step-opendelay",
586 adc_dev
->open_delay
, channels
);
587 of_property_read_u32_array(node
, "ti,chan-step-sampledelay",
588 adc_dev
->sample_delay
, channels
);
590 adc_dev
->channels
= channels
;
594 static int tiadc_probe(struct platform_device
*pdev
)
596 struct iio_dev
*indio_dev
;
597 struct tiadc_device
*adc_dev
;
598 struct device_node
*node
= pdev
->dev
.of_node
;
602 dev_err(&pdev
->dev
, "Could not find valid DT data.\n");
606 indio_dev
= devm_iio_device_alloc(&pdev
->dev
, sizeof(*indio_dev
));
607 if (indio_dev
== NULL
) {
608 dev_err(&pdev
->dev
, "failed to allocate iio device\n");
611 adc_dev
= iio_priv(indio_dev
);
613 adc_dev
->mfd_tscadc
= ti_tscadc_dev_get(pdev
);
614 tiadc_parse_dt(pdev
, adc_dev
);
616 indio_dev
->dev
.parent
= &pdev
->dev
;
617 indio_dev
->name
= dev_name(&pdev
->dev
);
618 indio_dev
->modes
= INDIO_DIRECT_MODE
;
619 indio_dev
->info
= &tiadc_info
;
621 tiadc_step_config(indio_dev
);
622 tiadc_writel(adc_dev
, REG_FIFO1THR
, FIFO1_THRESHOLD
);
623 mutex_init(&adc_dev
->fifo1_lock
);
625 err
= tiadc_channel_init(indio_dev
, adc_dev
->channels
);
629 err
= tiadc_iio_buffered_hardware_setup(indio_dev
,
632 adc_dev
->mfd_tscadc
->irq
,
634 &tiadc_buffer_setup_ops
);
637 goto err_free_channels
;
639 err
= iio_device_register(indio_dev
);
641 goto err_buffer_unregister
;
643 platform_set_drvdata(pdev
, indio_dev
);
645 err
= tiadc_request_dma(pdev
, adc_dev
);
646 if (err
&& err
== -EPROBE_DEFER
)
652 iio_device_unregister(indio_dev
);
653 err_buffer_unregister
:
654 tiadc_iio_buffered_hardware_remove(indio_dev
);
656 tiadc_channels_remove(indio_dev
);
660 static int tiadc_remove(struct platform_device
*pdev
)
662 struct iio_dev
*indio_dev
= platform_get_drvdata(pdev
);
663 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
664 struct tiadc_dma
*dma
= &adc_dev
->dma
;
668 dma_free_coherent(dma
->chan
->device
->dev
, DMA_BUFFER_SIZE
,
669 dma
->buf
, dma
->addr
);
670 dma_release_channel(dma
->chan
);
672 iio_device_unregister(indio_dev
);
673 tiadc_iio_buffered_hardware_remove(indio_dev
);
674 tiadc_channels_remove(indio_dev
);
676 step_en
= get_adc_step_mask(adc_dev
);
677 am335x_tsc_se_clr(adc_dev
->mfd_tscadc
, step_en
);
682 static int __maybe_unused
tiadc_suspend(struct device
*dev
)
684 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
685 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
686 struct ti_tscadc_dev
*tscadc_dev
;
689 tscadc_dev
= ti_tscadc_dev_get(to_platform_device(dev
));
690 if (!device_may_wakeup(tscadc_dev
->dev
)) {
691 idle
= tiadc_readl(adc_dev
, REG_CTRL
);
692 idle
&= ~(CNTRLREG_TSCSSENB
);
693 tiadc_writel(adc_dev
, REG_CTRL
, (idle
|
694 CNTRLREG_POWERDOWN
));
700 static int __maybe_unused
tiadc_resume(struct device
*dev
)
702 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
703 struct tiadc_device
*adc_dev
= iio_priv(indio_dev
);
704 unsigned int restore
;
706 /* Make sure ADC is powered up */
707 restore
= tiadc_readl(adc_dev
, REG_CTRL
);
708 restore
&= ~(CNTRLREG_POWERDOWN
);
709 tiadc_writel(adc_dev
, REG_CTRL
, restore
);
711 tiadc_step_config(indio_dev
);
712 am335x_tsc_se_set_cache(adc_dev
->mfd_tscadc
,
713 adc_dev
->buffer_en_ch_steps
);
717 static SIMPLE_DEV_PM_OPS(tiadc_pm_ops
, tiadc_suspend
, tiadc_resume
);
719 static const struct of_device_id ti_adc_dt_ids
[] = {
720 { .compatible
= "ti,am3359-adc", },
723 MODULE_DEVICE_TABLE(of
, ti_adc_dt_ids
);
725 static struct platform_driver tiadc_driver
= {
727 .name
= "TI-am335x-adc",
729 .of_match_table
= ti_adc_dt_ids
,
731 .probe
= tiadc_probe
,
732 .remove
= tiadc_remove
,
734 module_platform_driver(tiadc_driver
);
736 MODULE_DESCRIPTION("TI ADC controller driver");
737 MODULE_AUTHOR("Rachna Patil <rachna@ti.com>");
738 MODULE_LICENSE("GPL");