* [PATCH] staging:iio:ad7780: Remove the ad7780_platform_data
@ 2015-11-18 14:16 Dragos Bogdan
2015-11-19 12:07 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Dragos Bogdan @ 2015-11-18 14:16 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald, Lars-Peter Clausen,
Michael Hennerich, linux-iio, Dragos Bogdan
The ad7780_platform_data contains just the reference voltage information.
Since the preferred way of specifying this information is using the Linux
regulator framework and the ad7780 platform_data is not used by other
users, it can be completely removed.
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
---
This patch depends on patch "staging:iio:ad7780: Switch to the gpio
descriptor interface"
---
drivers/staging/iio/adc/ad7780.c | 9 ++-------
drivers/staging/iio/adc/ad7780.h | 29 -----------------------------
2 files changed, 2 insertions(+), 36 deletions(-)
delete mode 100644 drivers/staging/iio/adc/ad7780.h
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index 98b5fc4..498e86b 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -22,8 +22,6 @@
#include <linux/iio/sysfs.h>
#include <linux/iio/adc/ad_sigma_delta.h>
-#include "ad7780.h"
-
#define AD7780_RDY BIT(7)
#define AD7780_FILTER BIT(6)
#define AD7780_ERR BIT(5)
@@ -162,7 +160,6 @@ static const struct iio_info ad7780_info = {
static int ad7780_probe(struct spi_device *spi)
{
- struct ad7780_platform_data *pdata = spi->dev.platform_data;
struct ad7780_state *st;
struct iio_dev *indio_dev;
int ret, voltage_uv = 0;
@@ -188,12 +185,10 @@ static int ad7780_probe(struct spi_device *spi)
st->chip_info =
&ad7780_chip_info_tbl[spi_get_device_id(spi)->driver_data];
- if (pdata && pdata->vref_mv)
- st->int_vref_mv = pdata->vref_mv;
- else if (voltage_uv)
+ if (voltage_uv)
st->int_vref_mv = voltage_uv / 1000;
else
- dev_warn(&spi->dev, "reference voltage unspecified\n");
+ dev_warn(&spi->dev, "Reference voltage unspecified\n");
spi_set_drvdata(spi, indio_dev);
diff --git a/drivers/staging/iio/adc/ad7780.h b/drivers/staging/iio/adc/ad7780.h
deleted file mode 100644
index 46f61c9..0000000
--- a/drivers/staging/iio/adc/ad7780.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * AD7780/AD7781 SPI ADC driver
- *
- * Copyright 2011 Analog Devices Inc.
- *
- * Licensed under the GPL-2.
- */
-#ifndef IIO_ADC_AD7780_H_
-#define IIO_ADC_AD7780_H_
-
-/*
- * TODO: struct ad7780_platform_data needs to go into include/linux/iio
- */
-
-/* NOTE:
- * The AD7780 doesn't feature a dedicated SPI chip select, in addition it
- * features a dual use data out ready DOUT/RDY output.
- * In order to avoid contentions on the SPI bus, it's therefore necessary
- * to use spi bus locking combined with a dedicated GPIO to control the
- * power down reset signal of the AD7780.
- *
- * The DOUT/RDY output must also be wired to an interrupt capable GPIO.
- */
-
-struct ad7780_platform_data {
- u16 vref_mv;
-};
-
-#endif /* IIO_ADC_AD7780_H_ */
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] staging:iio:ad7780: Remove the ad7780_platform_data
2015-11-18 14:16 [PATCH] staging:iio:ad7780: Remove the ad7780_platform_data Dragos Bogdan
@ 2015-11-19 12:07 ` Lars-Peter Clausen
2015-11-21 17:53 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2015-11-19 12:07 UTC (permalink / raw)
To: Dragos Bogdan, Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald, Michael Hennerich, linux-iio
On 11/18/2015 03:16 PM, Dragos Bogdan wrote:
> The ad7780_platform_data contains just the reference voltage information.
> Since the preferred way of specifying this information is using the Linux
> regulator framework and the ad7780 platform_data is not used by other
> users, it can be completely removed.
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Looks good, thanks.
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Just one thing to consider for future patches...
[...]
> - dev_warn(&spi->dev, "reference voltage unspecified\n");
> + dev_warn(&spi->dev, "Reference voltage unspecified\n");
Strictly speaking this is a unrelated change and ideally would have been
split into a separate patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging:iio:ad7780: Remove the ad7780_platform_data
2015-11-19 12:07 ` Lars-Peter Clausen
@ 2015-11-21 17:53 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2015-11-21 17:53 UTC (permalink / raw)
To: Lars-Peter Clausen, Dragos Bogdan
Cc: Hartmut Knaack, Peter Meerwald, Michael Hennerich, linux-iio
On 19/11/15 12:07, Lars-Peter Clausen wrote:
> On 11/18/2015 03:16 PM, Dragos Bogdan wrote:
>> The ad7780_platform_data contains just the reference voltage information.
>> Since the preferred way of specifying this information is using the Linux
>> regulator framework and the ad7780 platform_data is not used by other
>> users, it can be completely removed.
>>
>> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
>
> Looks good, thanks.
>
>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the togreg branch of iio.git - initially pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
>
> Just one thing to consider for future patches...
>
> [...]
>> - dev_warn(&spi->dev, "reference voltage unspecified\n");
>> + dev_warn(&spi->dev, "Reference voltage unspecified\n");
>
> Strictly speaking this is a unrelated change and ideally would have been
> split into a separate patch.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-21 17:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-18 14:16 [PATCH] staging:iio:ad7780: Remove the ad7780_platform_data Dragos Bogdan
2015-11-19 12:07 ` Lars-Peter Clausen
2015-11-21 17:53 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox