From 5750ebab14907f05aa9904ef2f3c1bb8dcb1fd2b Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 2 Dec 2019 10:38:06 +0100 Subject: iio: ad7266: Convert to use GPIO descriptors The AD7266 have no in-tree users making use of the platform data mechanism to pass address GPIO lines when not using a fixed address, so we can easily convert this to use GPIO descriptors instead of the platform data integers currently passed. Lowercase the labels "ad0".."ad2" as this will make a better fit for platform descriptions like device tree that prefer lowercase names such as "ad0-gpios" rather than "AD0-gpios". Board files and other static users of this device can pass the same GPIO descriptors using machine descriptor tables if need be. Cc: Alison Schofield Cc: Lars-Peter Clausen Signed-off-by: Linus Walleij Reviewed-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron --- include/linux/platform_data/ad7266.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/linux/platform_data') diff --git a/include/linux/platform_data/ad7266.h b/include/linux/platform_data/ad7266.h index 7de6c16122df..f0652567afba 100644 --- a/include/linux/platform_data/ad7266.h +++ b/include/linux/platform_data/ad7266.h @@ -40,14 +40,11 @@ enum ad7266_mode { * @range: Reference voltage range the device is configured for * @mode: Sample mode the device is configured for * @fixed_addr: Whether the address pins are hard-wired - * @addr_gpios: GPIOs used for controlling the address pins, only used if - * fixed_addr is set to false. */ struct ad7266_platform_data { enum ad7266_range range; enum ad7266_mode mode; bool fixed_addr; - unsigned int addr_gpios[3]; }; #endif -- cgit v1.2.3-59-g8ed1b From 0cd9ff1535f4339710dfd577a7d91b96fd4b423b Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 5 Dec 2019 19:46:36 +0200 Subject: iio: adc: ti-ads1015: Get rid of legacy platform data Platform data is a legacy interface to supply device properties to the driver. In this case we even don't have in-kernel users for it. Just remove it for good. Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-ads1015.c | 18 ++++++++---------- include/Kbuild | 1 - include/linux/platform_data/ads1015.h | 23 ----------------------- 3 files changed, 8 insertions(+), 34 deletions(-) delete mode 100644 include/linux/platform_data/ads1015.h (limited to 'include/linux/platform_data') diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index a550b132cfb7..3b123b4f0b99 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -21,8 +21,6 @@ #include #include -#include - #include #include #include @@ -33,6 +31,8 @@ #define ADS1015_DRV_NAME "ads1015" +#define ADS1015_CHANNELS 8 + #define ADS1015_CONV_REG 0x00 #define ADS1015_CFG_REG 0x01 #define ADS1015_LO_THRESH_REG 0x02 @@ -219,6 +219,12 @@ static const struct iio_event_spec ads1015_events[] = { .datasheet_name = "AIN"#_chan"-AIN"#_chan2, \ } +struct ads1015_channel_data { + bool enabled; + unsigned int pga; + unsigned int data_rate; +}; + struct ads1015_thresh_data { unsigned int comp_queue; int high_thresh; @@ -903,14 +909,6 @@ static void ads1015_get_channels_config(struct i2c_client *client) struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ads1015_data *data = iio_priv(indio_dev); - struct ads1015_platform_data *pdata = dev_get_platdata(&client->dev); - - /* prefer platform data */ - if (pdata) { - memcpy(data->channel_data, pdata->channel_data, - sizeof(data->channel_data)); - return; - } #ifdef CONFIG_OF if (!ads1015_get_channels_config_of(client)) diff --git a/include/Kbuild b/include/Kbuild index ffba79483cc5..498821e5d9ed 100644 --- a/include/Kbuild +++ b/include/Kbuild @@ -443,7 +443,6 @@ header-test- += linux/platform_data/ad7793.h header-test- += linux/platform_data/ad7887.h header-test- += linux/platform_data/adau17x1.h header-test- += linux/platform_data/adp8870.h -header-test- += linux/platform_data/ads1015.h header-test- += linux/platform_data/ads7828.h header-test- += linux/platform_data/apds990x.h header-test- += linux/platform_data/arm-ux500-pm.h diff --git a/include/linux/platform_data/ads1015.h b/include/linux/platform_data/ads1015.h deleted file mode 100644 index 4cc9ffcafcbf..000000000000 --- a/include/linux/platform_data/ads1015.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Platform Data for ADS1015 12-bit 4-input ADC - * (C) Copyright 2010 - * Dirk Eibach, Guntermann & Drunck GmbH - */ - -#ifndef LINUX_ADS1015_H -#define LINUX_ADS1015_H - -#define ADS1015_CHANNELS 8 - -struct ads1015_channel_data { - bool enabled; - unsigned int pga; - unsigned int data_rate; -}; - -struct ads1015_platform_data { - struct ads1015_channel_data channel_data[ADS1015_CHANNELS]; -}; - -#endif /* LINUX_ADS1015_H */ -- cgit v1.2.3-59-g8ed1b