diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-05 11:25:37 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-05 11:25:37 -0800 |
commit | 4e98fcfb95dfd9c40976dcfa2f3b878eeec4dbaa (patch) | |
tree | 8afe7ff2f2a3bf960dfd637bfa1ae56838f9f0bb /drivers/iio/adc | |
parent | cc400e185c07c15a42d2635995f422de5b94b696 (diff) | |
parent | 6cb2afd7c0abb93bd9dc6d36b858b1e312e2407d (diff) | |
download | op-kernel-dev-4e98fcfb95dfd9c40976dcfa2f3b878eeec4dbaa.zip op-kernel-dev-4e98fcfb95dfd9c40976dcfa2f3b878eeec4dbaa.tar.gz |
Merge tag 'iio-for-3.9c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
"Third set of IIO new drivers, cleanups and fixes for the 3.9 cycle
New drivers
1) A driver for ST microelectronics sensors. This driver already covers
a large set of new parts (20 gyros, accelerometer and magnetometers)
not currently covered by the existing drivers. The intent moving forward
is to merge this with the other drivers for similar parts already in tree.
The lis3l02dq driver currently in staging/iio will be trivial, the lis3
driver in misc more complex as it has a number of additional interfaces.
Any merging in of the lis3 driver will rely on the not currently
merged iio_input bridge driver and handling of freefall notifications
etc.
2) A driver for the itg3200 gyroscope.
Graduations from staging
1) Cleanup and move out of staging of the adxrs450 gyroscope driver. The
cleanup required was all minor but there were a couple of fixes hidden in
there.
Core and driver additions
1) Initial work from Guenter Roeck on device tree support for IIO's provider/
consumer code. Focuses on the iio_hwmon driver and the max1363 adc driver.
The full device tree syntax is currently under discussion but should
follow shortly.
Cleanups and fixes
1) Remove a noop function __iio_update_buffer
2) Couple of small fixes and cleanups for the max1363
"
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/lp8788_adc.c | 12 | ||||
-rw-r--r-- | drivers/iio/adc/max1363.c | 12 |
2 files changed, 9 insertions, 15 deletions
diff --git a/drivers/iio/adc/lp8788_adc.c b/drivers/iio/adc/lp8788_adc.c index f8bcb1f..763f575 100644 --- a/drivers/iio/adc/lp8788_adc.c +++ b/drivers/iio/adc/lp8788_adc.c @@ -187,12 +187,6 @@ static int lp8788_iio_map_register(struct iio_dev *indio_dev, return 0; } -static inline void lp8788_iio_map_unregister(struct iio_dev *indio_dev, - struct lp8788_adc *adc) -{ - iio_map_array_unregister(indio_dev, adc->map); -} - static int lp8788_adc_probe(struct platform_device *pdev) { struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); @@ -208,6 +202,7 @@ static int lp8788_adc_probe(struct platform_device *pdev) adc->lp = lp; platform_set_drvdata(pdev, indio_dev); + indio_dev->dev.of_node = pdev->dev.of_node; ret = lp8788_iio_map_register(indio_dev, lp->pdata, adc); if (ret) goto err_iio_map; @@ -230,7 +225,7 @@ static int lp8788_adc_probe(struct platform_device *pdev) return 0; err_iio_device: - lp8788_iio_map_unregister(indio_dev, adc); + iio_map_array_unregister(indio_dev); err_iio_map: iio_device_free(indio_dev); return ret; @@ -239,10 +234,9 @@ err_iio_map: static int lp8788_adc_remove(struct platform_device *pdev) { struct iio_dev *indio_dev = platform_get_drvdata(pdev); - struct lp8788_adc *adc = iio_priv(indio_dev); iio_device_unregister(indio_dev); - lp8788_iio_map_unregister(indio_dev, adc); + iio_map_array_unregister(indio_dev); iio_device_free(indio_dev); return 0; diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c index 5db56f5..08e4feb 100644 --- a/drivers/iio/adc/max1363.c +++ b/drivers/iio/adc/max1363.c @@ -335,7 +335,7 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev, { int ret = 0; s32 data; - char rxbuf[2]; + u8 rxbuf[2]; struct max1363_state *st = iio_priv(indio_dev); struct i2c_client *client = st->client; @@ -367,7 +367,8 @@ static int max1363_read_single_chan(struct iio_dev *indio_dev, ret = data; goto error_ret; } - data = (s32)(rxbuf[1]) | ((s32)(rxbuf[0] & 0x0F)) << 8; + data = (rxbuf[1] | rxbuf[0] << 8) & + ((1 << st->chip_info->bits) - 1); } else { /* Get reading */ data = i2c_master_recv(client, rxbuf, 1); @@ -1496,6 +1497,7 @@ static int max1363_probe(struct i2c_client *client, goto error_out; } + indio_dev->dev.of_node = client->dev.of_node; ret = iio_map_array_register(indio_dev, client->dev.platform_data); if (ret < 0) goto error_free_device; @@ -1529,8 +1531,6 @@ static int max1363_probe(struct i2c_client *client, indio_dev->num_channels = st->chip_info->num_channels; indio_dev->info = st->chip_info->info; indio_dev->modes = INDIO_DIRECT_MODE; - indio_dev->channels = st->chip_info->channels; - indio_dev->num_channels = st->chip_info->num_channels; ret = max1363_initial_setup(st); if (ret < 0) goto error_free_available_scan_masks; @@ -1569,7 +1569,7 @@ error_disable_reg: error_put_reg: regulator_put(st->reg); error_unregister_map: - iio_map_array_unregister(indio_dev, client->dev.platform_data); + iio_map_array_unregister(indio_dev); error_free_device: iio_device_free(indio_dev); error_out: @@ -1588,7 +1588,7 @@ static int max1363_remove(struct i2c_client *client) kfree(indio_dev->available_scan_masks); regulator_disable(st->reg); regulator_put(st->reg); - iio_map_array_unregister(indio_dev, client->dev.platform_data); + iio_map_array_unregister(indio_dev); iio_device_free(indio_dev); return 0; |