diff options
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/ad7887.c | 16 | ||||
-rw-r--r-- | drivers/iio/adc/at91_adc.c | 1 | ||||
-rw-r--r-- | drivers/iio/adc/mcp3422.c | 8 | ||||
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 7 |
4 files changed, 24 insertions, 8 deletions
diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c index acb7f90359a3..749a6cadab8b 100644 --- a/drivers/iio/adc/ad7887.c +++ b/drivers/iio/adc/ad7887.c | |||
@@ -200,7 +200,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { | |||
200 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), | 200 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), |
201 | .address = 1, | 201 | .address = 1, |
202 | .scan_index = 1, | 202 | .scan_index = 1, |
203 | .scan_type = IIO_ST('u', 12, 16, 0), | 203 | .scan_type = { |
204 | .sign = 'u', | ||
205 | .realbits = 12, | ||
206 | .storagebits = 16, | ||
207 | .shift = 0, | ||
208 | .endianness = IIO_BE, | ||
209 | }, | ||
204 | }, | 210 | }, |
205 | .channel[1] = { | 211 | .channel[1] = { |
206 | .type = IIO_VOLTAGE, | 212 | .type = IIO_VOLTAGE, |
@@ -210,7 +216,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { | |||
210 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), | 216 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), |
211 | .address = 0, | 217 | .address = 0, |
212 | .scan_index = 0, | 218 | .scan_index = 0, |
213 | .scan_type = IIO_ST('u', 12, 16, 0), | 219 | .scan_type = { |
220 | .sign = 'u', | ||
221 | .realbits = 12, | ||
222 | .storagebits = 16, | ||
223 | .shift = 0, | ||
224 | .endianness = IIO_BE, | ||
225 | }, | ||
214 | }, | 226 | }, |
215 | .channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2), | 227 | .channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2), |
216 | .int_vref_mv = 2500, | 228 | .int_vref_mv = 2500, |
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 17df74908db1..5b1aa027c034 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
@@ -1047,6 +1047,7 @@ static int at91_adc_probe(struct platform_device *pdev) | |||
1047 | } else { | 1047 | } else { |
1048 | if (!st->caps->has_tsmr) { | 1048 | if (!st->caps->has_tsmr) { |
1049 | dev_err(&pdev->dev, "We don't support non-TSMR adc\n"); | 1049 | dev_err(&pdev->dev, "We don't support non-TSMR adc\n"); |
1050 | ret = -ENODEV; | ||
1050 | goto error_disable_adc_clk; | 1051 | goto error_disable_adc_clk; |
1051 | } | 1052 | } |
1052 | 1053 | ||
diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c index 12948325431c..c8c1baaec6c1 100644 --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c | |||
@@ -88,10 +88,10 @@ static const int mcp3422_sample_rates[4] = { | |||
88 | 88 | ||
89 | /* sample rates to sign extension table */ | 89 | /* sample rates to sign extension table */ |
90 | static const int mcp3422_sign_extend[4] = { | 90 | static const int mcp3422_sign_extend[4] = { |
91 | [MCP3422_SRATE_240] = 12, | 91 | [MCP3422_SRATE_240] = 11, |
92 | [MCP3422_SRATE_60] = 14, | 92 | [MCP3422_SRATE_60] = 13, |
93 | [MCP3422_SRATE_15] = 16, | 93 | [MCP3422_SRATE_15] = 15, |
94 | [MCP3422_SRATE_3] = 18 }; | 94 | [MCP3422_SRATE_3] = 17 }; |
95 | 95 | ||
96 | /* Client data (each client gets its own) */ | 96 | /* Client data (each client gets its own) */ |
97 | struct mcp3422 { | 97 | struct mcp3422 { |
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 728411ec7642..d4d748214e4b 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -229,12 +229,15 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev, | |||
229 | unsigned long flags, | 229 | unsigned long flags, |
230 | const struct iio_buffer_setup_ops *setup_ops) | 230 | const struct iio_buffer_setup_ops *setup_ops) |
231 | { | 231 | { |
232 | struct iio_buffer *buffer; | ||
232 | int ret; | 233 | int ret; |
233 | 234 | ||
234 | indio_dev->buffer = iio_kfifo_allocate(indio_dev); | 235 | buffer = iio_kfifo_allocate(indio_dev); |
235 | if (!indio_dev->buffer) | 236 | if (!buffer) |
236 | return -ENOMEM; | 237 | return -ENOMEM; |
237 | 238 | ||
239 | iio_device_attach_buffer(indio_dev, buffer); | ||
240 | |||
238 | ret = request_threaded_irq(irq, pollfunc_th, pollfunc_bh, | 241 | ret = request_threaded_irq(irq, pollfunc_th, pollfunc_bh, |
239 | flags, indio_dev->name, indio_dev); | 242 | flags, indio_dev->name, indio_dev); |
240 | if (ret) | 243 | if (ret) |