aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/at91_adc.c388
1 files changed, 364 insertions, 24 deletions
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 690a560e0dab..17df74908db1 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -11,6 +11,7 @@
11#include <linux/clk.h> 11#include <linux/clk.h>
12#include <linux/err.h> 12#include <linux/err.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/input.h>
14#include <linux/interrupt.h> 15#include <linux/interrupt.h>
15#include <linux/jiffies.h> 16#include <linux/jiffies.h>
16#include <linux/kernel.h> 17#include <linux/kernel.h>
@@ -39,7 +40,23 @@
39#define at91_adc_writel(st, reg, val) \ 40#define at91_adc_writel(st, reg, val) \
40 (writel_relaxed(val, st->reg_base + reg)) 41 (writel_relaxed(val, st->reg_base + reg))
41 42
43#define DRIVER_NAME "at91_adc"
44#define MAX_POS_BITS 12
45
46#define TOUCH_SAMPLE_PERIOD_US 2000 /* 2ms */
47#define TOUCH_PEN_DETECT_DEBOUNCE_US 200
48
42struct at91_adc_caps { 49struct at91_adc_caps {
50 bool has_ts; /* Support touch screen */
51 bool has_tsmr; /* only at91sam9x5, sama5d3 have TSMR reg */
52 /*
53 * Numbers of sampling data will be averaged. Can be 0~3.
54 * Hardware can average (2 ^ ts_filter_average) sample data.
55 */
56 u8 ts_filter_average;
57 /* Pen Detection input pull-up resistor, can be 0~3 */
58 u8 ts_pen_detect_sensitivity;
59
43 /* startup time calculate function */ 60 /* startup time calculate function */
44 u32 (*calc_startup_ticks)(u8 startup_time, u32 adc_clk_khz); 61 u32 (*calc_startup_ticks)(u8 startup_time, u32 adc_clk_khz);
45 62
@@ -47,6 +64,12 @@ struct at91_adc_caps {
47 struct at91_adc_reg_desc registers; 64 struct at91_adc_reg_desc registers;
48}; 65};
49 66
67enum atmel_adc_ts_type {
68 ATMEL_ADC_TOUCHSCREEN_NONE = 0,
69 ATMEL_ADC_TOUCHSCREEN_4WIRE = 4,
70 ATMEL_ADC_TOUCHSCREEN_5WIRE = 5,
71};
72
50struct at91_adc_state { 73struct at91_adc_state {
51 struct clk *adc_clk; 74 struct clk *adc_clk;
52 u16 *buffer; 75 u16 *buffer;
@@ -71,6 +94,26 @@ struct at91_adc_state {
71 bool low_res; /* the resolution corresponds to the lowest one */ 94 bool low_res; /* the resolution corresponds to the lowest one */
72 wait_queue_head_t wq_data_avail; 95 wait_queue_head_t wq_data_avail;
73 struct at91_adc_caps *caps; 96 struct at91_adc_caps *caps;
97
98 /*
99 * Following ADC channels are shared by touchscreen:
100 *
101 * CH0 -- Touch screen XP/UL
102 * CH1 -- Touch screen XM/UR
103 * CH2 -- Touch screen YP/LL
104 * CH3 -- Touch screen YM/Sense
105 * CH4 -- Touch screen LR(5-wire only)
106 *
107 * The bitfields below represents the reserved channel in the
108 * touchscreen mode.
109 */
110#define CHAN_MASK_TOUCHSCREEN_4WIRE (0xf << 0)
111#define CHAN_MASK_TOUCHSCREEN_5WIRE (0x1f << 0)
112 enum atmel_adc_ts_type touchscreen_type;
113 struct input_dev *ts_input;
114
115 u16 ts_sample_period_val;
116 u32 ts_pressure_threshold;
74}; 117};
75 118
76static irqreturn_t at91_adc_trigger_handler(int irq, void *p) 119static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
@@ -99,14 +142,10 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
99 return IRQ_HANDLED; 142 return IRQ_HANDLED;
100} 143}
101 144
102static irqreturn_t at91_adc_eoc_trigger(int irq, void *private) 145/* Handler for classic adc channel eoc trigger */
146void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
103{ 147{
104 struct iio_dev *idev = private;
105 struct at91_adc_state *st = iio_priv(idev); 148 struct at91_adc_state *st = iio_priv(idev);
106 u32 status = at91_adc_readl(st, st->registers->status_register);
107
108 if (!(status & st->registers->drdy_mask))
109 return IRQ_HANDLED;
110 149
111 if (iio_buffer_enabled(idev)) { 150 if (iio_buffer_enabled(idev)) {
112 disable_irq_nosync(irq); 151 disable_irq_nosync(irq);
@@ -116,6 +155,115 @@ static irqreturn_t at91_adc_eoc_trigger(int irq, void *private)
116 st->done = true; 155 st->done = true;
117 wake_up_interruptible(&st->wq_data_avail); 156 wake_up_interruptible(&st->wq_data_avail);
118 } 157 }
158}
159
160static int at91_ts_sample(struct at91_adc_state *st)
161{
162 unsigned int xscale, yscale, reg, z1, z2;
163 unsigned int x, y, pres, xpos, ypos;
164 unsigned int rxp = 1;
165 unsigned int factor = 1000;
166 struct iio_dev *idev = iio_priv_to_dev(st);
167
168 unsigned int xyz_mask_bits = st->res;
169 unsigned int xyz_mask = (1 << xyz_mask_bits) - 1;
170
171 /* calculate position */
172 /* x position = (x / xscale) * max, max = 2^MAX_POS_BITS - 1 */
173 reg = at91_adc_readl(st, AT91_ADC_TSXPOSR);
174 xpos = reg & xyz_mask;
175 x = (xpos << MAX_POS_BITS) - xpos;
176 xscale = (reg >> 16) & xyz_mask;
177 if (xscale == 0) {
178 dev_err(&idev->dev, "Error: xscale == 0!\n");
179 return -1;
180 }
181 x /= xscale;
182
183 /* y position = (y / yscale) * max, max = 2^MAX_POS_BITS - 1 */
184 reg = at91_adc_readl(st, AT91_ADC_TSYPOSR);
185 ypos = reg & xyz_mask;
186 y = (ypos << MAX_POS_BITS) - ypos;
187 yscale = (reg >> 16) & xyz_mask;
188 if (yscale == 0) {
189 dev_err(&idev->dev, "Error: yscale == 0!\n");
190 return -1;
191 }
192 y /= yscale;
193
194 /* calculate the pressure */
195 reg = at91_adc_readl(st, AT91_ADC_TSPRESSR);
196 z1 = reg & xyz_mask;
197 z2 = (reg >> 16) & xyz_mask;
198
199 if (z1 != 0)
200 pres = rxp * (x * factor / 1024) * (z2 * factor / z1 - factor)
201 / factor;
202 else
203 pres = st->ts_pressure_threshold; /* no pen contacted */
204
205 dev_dbg(&idev->dev, "xpos = %d, xscale = %d, ypos = %d, yscale = %d, z1 = %d, z2 = %d, press = %d\n",
206 xpos, xscale, ypos, yscale, z1, z2, pres);
207
208 if (pres < st->ts_pressure_threshold) {
209 dev_dbg(&idev->dev, "x = %d, y = %d, pressure = %d\n",
210 x, y, pres / factor);
211 input_report_abs(st->ts_input, ABS_X, x);
212 input_report_abs(st->ts_input, ABS_Y, y);
213 input_report_abs(st->ts_input, ABS_PRESSURE, pres);
214 input_report_key(st->ts_input, BTN_TOUCH, 1);
215 input_sync(st->ts_input);
216 } else {
217 dev_dbg(&idev->dev, "pressure too low: not reporting\n");
218 }
219
220 return 0;
221}
222
223static irqreturn_t at91_adc_interrupt(int irq, void *private)
224{
225 struct iio_dev *idev = private;
226 struct at91_adc_state *st = iio_priv(idev);
227 u32 status = at91_adc_readl(st, st->registers->status_register);
228 const uint32_t ts_data_irq_mask =
229 AT91_ADC_IER_XRDY |
230 AT91_ADC_IER_YRDY |
231 AT91_ADC_IER_PRDY;
232
233 if (status & st->registers->drdy_mask)
234 handle_adc_eoc_trigger(irq, idev);
235
236 if (status & AT91_ADC_IER_PEN) {
237 at91_adc_writel(st, AT91_ADC_IDR, AT91_ADC_IER_PEN);
238 at91_adc_writel(st, AT91_ADC_IER, AT91_ADC_IER_NOPEN |
239 ts_data_irq_mask);
240 /* Set up period trigger for sampling */
241 at91_adc_writel(st, st->registers->trigger_register,
242 AT91_ADC_TRGR_MOD_PERIOD_TRIG |
243 AT91_ADC_TRGR_TRGPER_(st->ts_sample_period_val));
244 } else if (status & AT91_ADC_IER_NOPEN) {
245 at91_adc_writel(st, st->registers->trigger_register, 0);
246 at91_adc_writel(st, AT91_ADC_IDR, AT91_ADC_IER_NOPEN |
247 ts_data_irq_mask);
248 at91_adc_writel(st, AT91_ADC_IER, AT91_ADC_IER_PEN);
249
250 input_report_key(st->ts_input, BTN_TOUCH, 0);
251 input_sync(st->ts_input);
252 } else if ((status & ts_data_irq_mask) == ts_data_irq_mask) {
253 /* Now all touchscreen data is ready */
254
255 if (status & AT91_ADC_ISR_PENS) {
256 /* validate data by pen contact */
257 at91_ts_sample(st);
258 } else {
259 /* triggered by event that is no pen contact, just read
260 * them to clean the interrupt and discard all.
261 */
262 at91_adc_readl(st, AT91_ADC_TSXPOSR);
263 at91_adc_readl(st, AT91_ADC_TSYPOSR);
264 at91_adc_readl(st, AT91_ADC_TSPRESSR);
265 }
266 }
119 267
120 return IRQ_HANDLED; 268 return IRQ_HANDLED;
121} 269}
@@ -125,6 +273,16 @@ static int at91_adc_channel_init(struct iio_dev *idev)
125 struct at91_adc_state *st = iio_priv(idev); 273 struct at91_adc_state *st = iio_priv(idev);
126 struct iio_chan_spec *chan_array, *timestamp; 274 struct iio_chan_spec *chan_array, *timestamp;
127 int bit, idx = 0; 275 int bit, idx = 0;
276 unsigned long rsvd_mask = 0;
277
278 /* If touchscreen is enable, then reserve the adc channels */
279 if (st->touchscreen_type == ATMEL_ADC_TOUCHSCREEN_4WIRE)
280 rsvd_mask = CHAN_MASK_TOUCHSCREEN_4WIRE;
281 else if (st->touchscreen_type == ATMEL_ADC_TOUCHSCREEN_5WIRE)
282 rsvd_mask = CHAN_MASK_TOUCHSCREEN_5WIRE;
283
284 /* set up the channel mask to reserve touchscreen channels */
285 st->channels_mask &= ~rsvd_mask;
128 286
129 idev->num_channels = bitmap_weight(&st->channels_mask, 287 idev->num_channels = bitmap_weight(&st->channels_mask,
130 st->num_channels) + 1; 288 st->num_channels) + 1;
@@ -473,6 +631,39 @@ static u32 calc_startup_ticks_9x5(u8 startup_time, u32 adc_clk_khz)
473 631
474static const struct of_device_id at91_adc_dt_ids[]; 632static const struct of_device_id at91_adc_dt_ids[];
475 633
634static int at91_adc_probe_dt_ts(struct device_node *node,
635 struct at91_adc_state *st, struct device *dev)
636{
637 int ret;
638 u32 prop;
639
640 ret = of_property_read_u32(node, "atmel,adc-ts-wires", &prop);
641 if (ret) {
642 dev_info(dev, "ADC Touch screen is disabled.\n");
643 return 0;
644 }
645
646 switch (prop) {
647 case 4:
648 case 5:
649 st->touchscreen_type = prop;
650 break;
651 default:
652 dev_err(dev, "Unsupported number of touchscreen wires (%d). Should be 4 or 5.\n", prop);
653 return -EINVAL;
654 }
655
656 prop = 0;
657 of_property_read_u32(node, "atmel,adc-ts-pressure-threshold", &prop);
658 st->ts_pressure_threshold = prop;
659 if (st->ts_pressure_threshold) {
660 return 0;
661 } else {
662 dev_err(dev, "Invalid pressure threshold for the touchscreen\n");
663 return -EINVAL;
664 }
665}
666
476static int at91_adc_probe_dt(struct at91_adc_state *st, 667static int at91_adc_probe_dt(struct at91_adc_state *st,
477 struct platform_device *pdev) 668 struct platform_device *pdev)
478{ 669{
@@ -554,6 +745,12 @@ static int at91_adc_probe_dt(struct at91_adc_state *st,
554 i++; 745 i++;
555 } 746 }
556 747
748 /* Check if touchscreen is supported. */
749 if (st->caps->has_ts)
750 return at91_adc_probe_dt_ts(node, st, &idev->dev);
751 else
752 dev_info(&idev->dev, "not support touchscreen in the adc compatible string.\n");
753
557 return 0; 754 return 0;
558 755
559error_ret: 756error_ret:
@@ -585,6 +782,114 @@ static const struct iio_info at91_adc_info = {
585 .read_raw = &at91_adc_read_raw, 782 .read_raw = &at91_adc_read_raw,
586}; 783};
587 784
785/* Touchscreen related functions */
786static int atmel_ts_open(struct input_dev *dev)
787{
788 struct at91_adc_state *st = input_get_drvdata(dev);
789
790 at91_adc_writel(st, AT91_ADC_IER, AT91_ADC_IER_PEN);
791 return 0;
792}
793
794static void atmel_ts_close(struct input_dev *dev)
795{
796 struct at91_adc_state *st = input_get_drvdata(dev);
797
798 at91_adc_writel(st, AT91_ADC_IDR, AT91_ADC_IER_PEN);
799}
800
801static int at91_ts_hw_init(struct at91_adc_state *st, u32 adc_clk_khz)
802{
803 u32 reg = 0, pendbc;
804 int i = 0;
805
806 if (st->touchscreen_type == ATMEL_ADC_TOUCHSCREEN_4WIRE)
807 reg = AT91_ADC_TSMR_TSMODE_4WIRE_PRESS;
808 else
809 reg = AT91_ADC_TSMR_TSMODE_5WIRE;
810
811 /* a Pen Detect Debounce Time is necessary for the ADC Touch to avoid
812 * pen detect noise.
813 * The formula is : Pen Detect Debounce Time = (2 ^ pendbc) / ADCClock
814 */
815 pendbc = round_up(TOUCH_PEN_DETECT_DEBOUNCE_US * adc_clk_khz / 1000, 1);
816
817 while (pendbc >> ++i)
818 ; /* Empty! Find the shift offset */
819 if (abs(pendbc - (1 << i)) < abs(pendbc - (1 << (i - 1))))
820 pendbc = i;
821 else
822 pendbc = i - 1;
823
824 if (st->caps->has_tsmr) {
825 reg |= AT91_ADC_TSMR_TSAV_(st->caps->ts_filter_average)
826 & AT91_ADC_TSMR_TSAV;
827 reg |= AT91_ADC_TSMR_PENDBC_(pendbc) & AT91_ADC_TSMR_PENDBC;
828 reg |= AT91_ADC_TSMR_NOTSDMA;
829 reg |= AT91_ADC_TSMR_PENDET_ENA;
830 reg |= 0x03 << 8; /* TSFREQ, need bigger than TSAV */
831
832 at91_adc_writel(st, AT91_ADC_TSMR, reg);
833 } else {
834 /* TODO: for 9g45 which has no TSMR */
835 }
836
837 /* Change adc internal resistor value for better pen detection,
838 * default value is 100 kOhm.
839 * 0 = 200 kOhm, 1 = 150 kOhm, 2 = 100 kOhm, 3 = 50 kOhm
840 * option only available on ES2 and higher
841 */
842 at91_adc_writel(st, AT91_ADC_ACR, st->caps->ts_pen_detect_sensitivity
843 & AT91_ADC_ACR_PENDETSENS);
844
845 /* Sample Peroid Time = (TRGPER + 1) / ADCClock */
846 st->ts_sample_period_val = round_up((TOUCH_SAMPLE_PERIOD_US *
847 adc_clk_khz / 1000) - 1, 1);
848
849 return 0;
850}
851
852static int at91_ts_register(struct at91_adc_state *st,
853 struct platform_device *pdev)
854{
855 struct input_dev *input;
856 struct iio_dev *idev = iio_priv_to_dev(st);
857 int ret;
858
859 input = input_allocate_device();
860 if (!input) {
861 dev_err(&idev->dev, "Failed to allocate TS device!\n");
862 return -ENOMEM;
863 }
864
865 input->name = DRIVER_NAME;
866 input->id.bustype = BUS_HOST;
867 input->dev.parent = &pdev->dev;
868 input->open = atmel_ts_open;
869 input->close = atmel_ts_close;
870
871 __set_bit(EV_ABS, input->evbit);
872 __set_bit(EV_KEY, input->evbit);
873 __set_bit(BTN_TOUCH, input->keybit);
874 input_set_abs_params(input, ABS_X, 0, (1 << MAX_POS_BITS) - 1, 0, 0);
875 input_set_abs_params(input, ABS_Y, 0, (1 << MAX_POS_BITS) - 1, 0, 0);
876 input_set_abs_params(input, ABS_PRESSURE, 0, 0xffffff, 0, 0);
877
878 st->ts_input = input;
879 input_set_drvdata(input, st);
880
881 ret = input_register_device(input);
882 if (ret)
883 input_free_device(st->ts_input);
884
885 return ret;
886}
887
888static void at91_ts_unregister(struct at91_adc_state *st)
889{
890 input_unregister_device(st->ts_input);
891}
892
588static int at91_adc_probe(struct platform_device *pdev) 893static int at91_adc_probe(struct platform_device *pdev)
589{ 894{
590 unsigned int prsc, mstrclk, ticks, adc_clk, adc_clk_khz, shtim; 895 unsigned int prsc, mstrclk, ticks, adc_clk, adc_clk_khz, shtim;
@@ -636,7 +941,7 @@ static int at91_adc_probe(struct platform_device *pdev)
636 at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_SWRST); 941 at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_SWRST);
637 at91_adc_writel(st, AT91_ADC_IDR, 0xFFFFFFFF); 942 at91_adc_writel(st, AT91_ADC_IDR, 0xFFFFFFFF);
638 ret = request_irq(st->irq, 943 ret = request_irq(st->irq,
639 at91_adc_eoc_trigger, 944 at91_adc_interrupt,
640 0, 945 0,
641 pdev->dev.driver->name, 946 pdev->dev.driver->name,
642 idev); 947 idev);
@@ -681,6 +986,10 @@ static int at91_adc_probe(struct platform_device *pdev)
681 mstrclk = clk_get_rate(st->clk); 986 mstrclk = clk_get_rate(st->clk);
682 adc_clk = clk_get_rate(st->adc_clk); 987 adc_clk = clk_get_rate(st->adc_clk);
683 adc_clk_khz = adc_clk / 1000; 988 adc_clk_khz = adc_clk / 1000;
989
990 dev_dbg(&pdev->dev, "Master clock is set as: %d Hz, adc_clk should set as: %d Hz\n",
991 mstrclk, adc_clk);
992
684 prsc = (mstrclk / (2 * adc_clk)) - 1; 993 prsc = (mstrclk / (2 * adc_clk)) - 1;
685 994
686 if (!st->startup_time) { 995 if (!st->startup_time) {
@@ -717,30 +1026,52 @@ static int at91_adc_probe(struct platform_device *pdev)
717 init_waitqueue_head(&st->wq_data_avail); 1026 init_waitqueue_head(&st->wq_data_avail);
718 mutex_init(&st->lock); 1027 mutex_init(&st->lock);
719 1028
720 ret = at91_adc_buffer_init(idev); 1029 /*
721 if (ret < 0) { 1030 * Since touch screen will set trigger register as period trigger. So
722 dev_err(&pdev->dev, "Couldn't initialize the buffer.\n"); 1031 * when touch screen is enabled, then we have to disable hardware
723 goto error_disable_adc_clk; 1032 * trigger for classic adc.
724 } 1033 */
1034 if (!st->touchscreen_type) {
1035 ret = at91_adc_buffer_init(idev);
1036 if (ret < 0) {
1037 dev_err(&pdev->dev, "Couldn't initialize the buffer.\n");
1038 goto error_disable_adc_clk;
1039 }
725 1040
726 ret = at91_adc_trigger_init(idev); 1041 ret = at91_adc_trigger_init(idev);
727 if (ret < 0) { 1042 if (ret < 0) {
728 dev_err(&pdev->dev, "Couldn't setup the triggers.\n"); 1043 dev_err(&pdev->dev, "Couldn't setup the triggers.\n");
729 goto error_unregister_buffer; 1044 at91_adc_buffer_remove(idev);
1045 goto error_disable_adc_clk;
1046 }
1047 } else {
1048 if (!st->caps->has_tsmr) {
1049 dev_err(&pdev->dev, "We don't support non-TSMR adc\n");
1050 goto error_disable_adc_clk;
1051 }
1052
1053 ret = at91_ts_register(st, pdev);
1054 if (ret)
1055 goto error_disable_adc_clk;
1056
1057 at91_ts_hw_init(st, adc_clk_khz);
730 } 1058 }
731 1059
732 ret = iio_device_register(idev); 1060 ret = iio_device_register(idev);
733 if (ret < 0) { 1061 if (ret < 0) {
734 dev_err(&pdev->dev, "Couldn't register the device.\n"); 1062 dev_err(&pdev->dev, "Couldn't register the device.\n");
735 goto error_remove_triggers; 1063 goto error_iio_device_register;
736 } 1064 }
737 1065
738 return 0; 1066 return 0;
739 1067
740error_remove_triggers: 1068error_iio_device_register:
741 at91_adc_trigger_remove(idev); 1069 if (!st->touchscreen_type) {
742error_unregister_buffer: 1070 at91_adc_trigger_remove(idev);
743 at91_adc_buffer_remove(idev); 1071 at91_adc_buffer_remove(idev);
1072 } else {
1073 at91_ts_unregister(st);
1074 }
744error_disable_adc_clk: 1075error_disable_adc_clk:
745 clk_disable_unprepare(st->adc_clk); 1076 clk_disable_unprepare(st->adc_clk);
746error_disable_clk: 1077error_disable_clk:
@@ -756,8 +1087,12 @@ static int at91_adc_remove(struct platform_device *pdev)
756 struct at91_adc_state *st = iio_priv(idev); 1087 struct at91_adc_state *st = iio_priv(idev);
757 1088
758 iio_device_unregister(idev); 1089 iio_device_unregister(idev);
759 at91_adc_trigger_remove(idev); 1090 if (!st->touchscreen_type) {
760 at91_adc_buffer_remove(idev); 1091 at91_adc_trigger_remove(idev);
1092 at91_adc_buffer_remove(idev);
1093 } else {
1094 at91_ts_unregister(st);
1095 }
761 clk_disable_unprepare(st->adc_clk); 1096 clk_disable_unprepare(st->adc_clk);
762 clk_disable_unprepare(st->clk); 1097 clk_disable_unprepare(st->clk);
763 free_irq(st->irq, idev); 1098 free_irq(st->irq, idev);
@@ -780,6 +1115,7 @@ static struct at91_adc_caps at91sam9260_caps = {
780}; 1115};
781 1116
782static struct at91_adc_caps at91sam9g45_caps = { 1117static struct at91_adc_caps at91sam9g45_caps = {
1118 .has_ts = true,
783 .calc_startup_ticks = calc_startup_ticks_9260, /* same as 9260 */ 1119 .calc_startup_ticks = calc_startup_ticks_9260, /* same as 9260 */
784 .num_channels = 8, 1120 .num_channels = 8,
785 .registers = { 1121 .registers = {
@@ -793,6 +1129,10 @@ static struct at91_adc_caps at91sam9g45_caps = {
793}; 1129};
794 1130
795static struct at91_adc_caps at91sam9x5_caps = { 1131static struct at91_adc_caps at91sam9x5_caps = {
1132 .has_ts = true,
1133 .has_tsmr = true,
1134 .ts_filter_average = 3,
1135 .ts_pen_detect_sensitivity = 2,
796 .calc_startup_ticks = calc_startup_ticks_9x5, 1136 .calc_startup_ticks = calc_startup_ticks_9x5,
797 .num_channels = 12, 1137 .num_channels = 12,
798 .registers = { 1138 .registers = {
@@ -819,7 +1159,7 @@ static struct platform_driver at91_adc_driver = {
819 .probe = at91_adc_probe, 1159 .probe = at91_adc_probe,
820 .remove = at91_adc_remove, 1160 .remove = at91_adc_remove,
821 .driver = { 1161 .driver = {
822 .name = "at91_adc", 1162 .name = DRIVER_NAME,
823 .of_match_table = of_match_ptr(at91_adc_dt_ids), 1163 .of_match_table = of_match_ptr(at91_adc_dt_ids),
824 }, 1164 },
825}; 1165};