Commit ed644baa authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'iio-fixes-for-3.10a' of...

Merge tag 'iio-fixes-for-3.10a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First round of IIO fixes for the 3.10 cycle.

The usual mixed bag of little fixes.

1) A fix for mxs-lradc having missed out on some global abi changes that and
   hence being unable to start up buffered output.
2) Clean up error handling in tsl2x7x
3) A build fix for some of the dac drivers when they have spi master support
   built in, but i2c support build as a module.
4) Add a missing disable after a oneshot capture to the st sensor core.
5) Exynos adc driver took a novel an incorrect route to get at its private
   data store.
parents c7b0cf3e 927b4dc3
...@@ -390,8 +390,8 @@ static int exynos_adc_remove(struct platform_device *pdev) ...@@ -390,8 +390,8 @@ static int exynos_adc_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int exynos_adc_suspend(struct device *dev) static int exynos_adc_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct exynos_adc *info = platform_get_drvdata(pdev); struct exynos_adc *info = iio_priv(indio_dev);
u32 con; u32 con;
if (info->version == ADC_V2) { if (info->version == ADC_V2) {
...@@ -413,8 +413,8 @@ static int exynos_adc_suspend(struct device *dev) ...@@ -413,8 +413,8 @@ static int exynos_adc_suspend(struct device *dev)
static int exynos_adc_resume(struct device *dev) static int exynos_adc_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct exynos_adc *info = platform_get_drvdata(pdev); struct exynos_adc *info = iio_priv(indio_dev);
int ret; int ret;
ret = regulator_enable(info->vdd); ret = regulator_enable(info->vdd);
......
...@@ -312,6 +312,8 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev, ...@@ -312,6 +312,8 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev,
goto read_error; goto read_error;
*val = *val >> ch->scan_type.shift; *val = *val >> ch->scan_type.shift;
err = st_sensors_set_enable(indio_dev, false);
} }
mutex_unlock(&indio_dev->mlock); mutex_unlock(&indio_dev->mlock);
......
...@@ -5,7 +5,7 @@ menu "Digital to analog converters" ...@@ -5,7 +5,7 @@ menu "Digital to analog converters"
config AD5064 config AD5064
tristate "Analog Devices AD5064 and similar multi-channel DAC driver" tristate "Analog Devices AD5064 and similar multi-channel DAC driver"
depends on (SPI_MASTER || I2C) depends on (SPI_MASTER && I2C!=m) || I2C
help help
Say yes here to build support for Analog Devices AD5024, AD5025, AD5044, Say yes here to build support for Analog Devices AD5024, AD5025, AD5044,
AD5045, AD5064, AD5064-1, AD5065, AD5628, AD5629R, AD5648, AD5666, AD5668, AD5045, AD5064, AD5064-1, AD5065, AD5628, AD5629R, AD5648, AD5666, AD5668,
...@@ -27,7 +27,7 @@ config AD5360 ...@@ -27,7 +27,7 @@ config AD5360
config AD5380 config AD5380
tristate "Analog Devices AD5380/81/82/83/84/90/91/92 DAC driver" tristate "Analog Devices AD5380/81/82/83/84/90/91/92 DAC driver"
depends on (SPI_MASTER || I2C) depends on (SPI_MASTER && I2C!=m) || I2C
select REGMAP_I2C if I2C select REGMAP_I2C if I2C
select REGMAP_SPI if SPI_MASTER select REGMAP_SPI if SPI_MASTER
help help
...@@ -57,7 +57,7 @@ config AD5624R_SPI ...@@ -57,7 +57,7 @@ config AD5624R_SPI
config AD5446 config AD5446
tristate "Analog Devices AD5446 and similar single channel DACs driver" tristate "Analog Devices AD5446 and similar single channel DACs driver"
depends on (SPI_MASTER || I2C) depends on (SPI_MASTER && I2C!=m) || I2C
help help
Say yes here to build support for Analog Devices AD5300, AD5301, AD5310, Say yes here to build support for Analog Devices AD5300, AD5301, AD5310,
AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453, AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,
......
...@@ -690,7 +690,6 @@ static void mxs_lradc_trigger_remove(struct iio_dev *iio) ...@@ -690,7 +690,6 @@ static void mxs_lradc_trigger_remove(struct iio_dev *iio)
static int mxs_lradc_buffer_preenable(struct iio_dev *iio) static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
{ {
struct mxs_lradc *lradc = iio_priv(iio); struct mxs_lradc *lradc = iio_priv(iio);
struct iio_buffer *buffer = iio->buffer;
int ret = 0, chan, ofs = 0; int ret = 0, chan, ofs = 0;
unsigned long enable = 0; unsigned long enable = 0;
uint32_t ctrl4_set = 0; uint32_t ctrl4_set = 0;
...@@ -698,7 +697,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) ...@@ -698,7 +697,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
uint32_t ctrl1_irq = 0; uint32_t ctrl1_irq = 0;
const uint32_t chan_value = LRADC_CH_ACCUMULATE | const uint32_t chan_value = LRADC_CH_ACCUMULATE |
((LRADC_DELAY_TIMER_LOOP - 1) << LRADC_CH_NUM_SAMPLES_OFFSET); ((LRADC_DELAY_TIMER_LOOP - 1) << LRADC_CH_NUM_SAMPLES_OFFSET);
const int len = bitmap_weight(buffer->scan_mask, LRADC_MAX_TOTAL_CHANS); const int len = bitmap_weight(iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS);
if (!len) if (!len)
return -EINVAL; return -EINVAL;
...@@ -725,7 +724,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) ...@@ -725,7 +724,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR); lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR); writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
for_each_set_bit(chan, buffer->scan_mask, LRADC_MAX_TOTAL_CHANS) { for_each_set_bit(chan, iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS) {
ctrl4_set |= chan << LRADC_CTRL4_LRADCSELECT_OFFSET(ofs); ctrl4_set |= chan << LRADC_CTRL4_LRADCSELECT_OFFSET(ofs);
ctrl4_clr |= LRADC_CTRL4_LRADCSELECT_MASK(ofs); ctrl4_clr |= LRADC_CTRL4_LRADCSELECT_MASK(ofs);
ctrl1_irq |= LRADC_CTRL1_LRADC_IRQ_EN(ofs); ctrl1_irq |= LRADC_CTRL1_LRADC_IRQ_EN(ofs);
......
...@@ -1869,6 +1869,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp, ...@@ -1869,6 +1869,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
dev_info(&chip->client->dev, dev_info(&chip->client->dev,
"%s: i2c device found does not match expected id\n", "%s: i2c device found does not match expected id\n",
__func__); __func__);
ret = -EINVAL;
goto fail1; goto fail1;
} }
...@@ -1907,7 +1908,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp, ...@@ -1907,7 +1908,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
if (ret) { if (ret) {
dev_err(&clientp->dev, dev_err(&clientp->dev,
"%s: irq request failed", __func__); "%s: irq request failed", __func__);
goto fail2; goto fail1;
} }
} }
...@@ -1920,17 +1921,17 @@ static int tsl2x7x_probe(struct i2c_client *clientp, ...@@ -1920,17 +1921,17 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
if (ret) { if (ret) {
dev_err(&clientp->dev, dev_err(&clientp->dev,
"%s: iio registration failed\n", __func__); "%s: iio registration failed\n", __func__);
goto fail1; goto fail2;
} }
dev_info(&clientp->dev, "%s Light sensor found.\n", id->name); dev_info(&clientp->dev, "%s Light sensor found.\n", id->name);
return 0; return 0;
fail1: fail2:
if (clientp->irq) if (clientp->irq)
free_irq(clientp->irq, indio_dev); free_irq(clientp->irq, indio_dev);
fail2: fail1:
iio_device_free(indio_dev); iio_device_free(indio_dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment