summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-19 22:23:55 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-19 22:23:55 (GMT)
commitbad4f537ee37e9a44dc102a5e383ae53d9eed5bc (patch)
treee43294bfeb286a9ec219116c76625808574687bd /drivers/staging
parent9c6cd3b39048c8bbb83c5cd936f4dffc847321c6 (diff)
parentcc566fd5e52d64554d294b4d36f9d593cbe797d5 (diff)
downloadlinux-fsl-qoriq-bad4f537ee37e9a44dc102a5e383ae53d9eed5bc.tar.xz
Merge tag 'iio-for-3.12b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: Second round of new drivers, features and cleanups for IIO in the 3.12 cycle. New driver: 1) tmp006 IR thermopile driver. This is an unusual temperature sensor and was taken in to IIO with the knowledge and agreement of a hwmon maintainer. It measures remote temperature using infrared emissions. I guess taking this may mean we have to fight off submissions of devices much more suited to hwmon but such is life and we end up doing this from time to time already. 2) twl6030 adc driver. Cleanups: 1) More devm_* cleanups following on from the introduction of devm_iio_device_alloc. Mostly an heroic effort from Sachin Kamat! 2) Introduce devm_iio_trigger_alloc etc to handle trigger allocation and deallocation in a managed fashion. There aren't as many instances of triggers as devices, but this will allow futher reduction in error patch complexity in some of our most complex drivers making it a very good thing. 3) Trivial removal of unused defines in adjd_s311 4) Drop some write_raw_get_fmt callbacks where they were only returning the default value. 5) Change mxs-lradc realbits to 12. Whilst an 18bit register is used on the device, in its current mode only 12 bits of useful data are returned. For now the packing is unchanged in the buffer and this change mainly effects the input support in the driver.
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/iio/adc/mxs-lradc.c12
-rw-r--r--drivers/staging/iio/gyro/adis16060_core.c17
2 files changed, 12 insertions, 17 deletions
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index 863f086..a08c173 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -225,6 +225,9 @@ struct mxs_lradc {
#define LRADC_CTRL4_LRADCSELECT_MASK(n) (0xf << ((n) * 4))
#define LRADC_CTRL4_LRADCSELECT_OFFSET(n) ((n) * 4)
+#define LRADC_RESOLUTION 12
+#define LRADC_SINGLE_SAMPLE_MASK ((1 << LRADC_RESOLUTION) - 1)
+
/*
* Raw I/O operations
*/
@@ -540,9 +543,10 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
__set_bit(EV_ABS, input->evbit);
__set_bit(EV_KEY, input->evbit);
__set_bit(BTN_TOUCH, input->keybit);
- input_set_abs_params(input, ABS_X, 0, LRADC_CH_VALUE_MASK, 0, 0);
- input_set_abs_params(input, ABS_Y, 0, LRADC_CH_VALUE_MASK, 0, 0);
- input_set_abs_params(input, ABS_PRESSURE, 0, LRADC_CH_VALUE_MASK, 0, 0);
+ input_set_abs_params(input, ABS_X, 0, LRADC_SINGLE_SAMPLE_MASK, 0, 0);
+ input_set_abs_params(input, ABS_Y, 0, LRADC_SINGLE_SAMPLE_MASK, 0, 0);
+ input_set_abs_params(input, ABS_PRESSURE, 0, LRADC_SINGLE_SAMPLE_MASK,
+ 0, 0);
lradc->ts_input = input;
input_set_drvdata(input, lradc);
@@ -817,7 +821,7 @@ static const struct iio_buffer_setup_ops mxs_lradc_buffer_ops = {
.channel = (idx), \
.scan_type = { \
.sign = 'u', \
- .realbits = 18, \
+ .realbits = LRADC_RESOLUTION, \
.storagebits = 32, \
}, \
}
diff --git a/drivers/staging/iio/gyro/adis16060_core.c b/drivers/staging/iio/gyro/adis16060_core.c
index c67d3a8..6d3d771 100644
--- a/drivers/staging/iio/gyro/adis16060_core.c
+++ b/drivers/staging/iio/gyro/adis16060_core.c
@@ -151,11 +151,9 @@ static int adis16060_r_probe(struct spi_device *spi)
struct iio_dev *indio_dev;
/* setup the industrialio driver allocated elements */
- indio_dev = iio_device_alloc(sizeof(*st));
- if (indio_dev == NULL) {
- ret = -ENOMEM;
- goto error_ret;
- }
+ indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
+ if (!indio_dev)
+ return -ENOMEM;
/* this is only used for removal purposes */
spi_set_drvdata(spi, indio_dev);
st = iio_priv(indio_dev);
@@ -171,23 +169,16 @@ static int adis16060_r_probe(struct spi_device *spi)
ret = iio_device_register(indio_dev);
if (ret)
- goto error_free_dev;
+ return ret;
adis16060_iio_dev = indio_dev;
return 0;
-
-error_free_dev:
- iio_device_free(indio_dev);
-error_ret:
- return ret;
}
/* fixme, confirm ordering in this function */
static int adis16060_r_remove(struct spi_device *spi)
{
iio_device_unregister(spi_get_drvdata(spi));
- iio_device_free(spi_get_drvdata(spi));
-
return 0;
}