* [PATCH] iio: dac: ad5449: drop support for platform data
@ 2024-08-14 9:26 Bartosz Golaszewski
2024-08-17 11:32 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-08-14 9:26 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron
Cc: linux-kernel, linux-iio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
There are no longer any users of the platform data struct. Remove
support for it from the driver.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/iio/dac/ad5449.c | 15 ++---------
include/linux/platform_data/ad5449.h | 39 ----------------------------
2 files changed, 2 insertions(+), 52 deletions(-)
delete mode 100644 include/linux/platform_data/ad5449.h
diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
index 4572d6f49275..953fcfa2110b 100644
--- a/drivers/iio/dac/ad5449.c
+++ b/drivers/iio/dac/ad5449.c
@@ -20,8 +20,6 @@
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
-#include <linux/platform_data/ad5449.h>
-
#define AD5449_MAX_CHANNELS 2
#define AD5449_MAX_VREFS 2
@@ -268,7 +266,6 @@ static const char *ad5449_vref_name(struct ad5449 *st, int n)
static int ad5449_spi_probe(struct spi_device *spi)
{
- struct ad5449_platform_data *pdata = spi->dev.platform_data;
const struct spi_device_id *id = spi_get_device_id(spi);
struct iio_dev *indio_dev;
struct ad5449 *st;
@@ -306,16 +303,8 @@ static int ad5449_spi_probe(struct spi_device *spi)
mutex_init(&st->lock);
if (st->chip_info->has_ctrl) {
- unsigned int ctrl = 0x00;
- if (pdata) {
- if (pdata->hardware_clear_to_midscale)
- ctrl |= AD5449_CTRL_HCLR_TO_MIDSCALE;
- ctrl |= pdata->sdo_mode << AD5449_CTRL_SDO_OFFSET;
- st->has_sdo = pdata->sdo_mode != AD5449_SDO_DISABLED;
- } else {
- st->has_sdo = true;
- }
- ad5449_write(indio_dev, AD5449_CMD_CTRL, ctrl);
+ st->has_sdo = true;
+ ad5449_write(indio_dev, AD5449_CMD_CTRL, 0x0);
}
ret = iio_device_register(indio_dev);
diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h
deleted file mode 100644
index d687ef5726c2..000000000000
--- a/include/linux/platform_data/ad5449.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog
- * Converter driver.
- *
- * Copyright 2012 Analog Devices Inc.
- * Author: Lars-Peter Clausen <lars@metafoo.de>
- */
-
-#ifndef __LINUX_PLATFORM_DATA_AD5449_H__
-#define __LINUX_PLATFORM_DATA_AD5449_H__
-
-/**
- * enum ad5449_sdo_mode - AD5449 SDO pin configuration
- * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength.
- * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength.
- * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode.
- * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to
- * read back from the device.
- */
-enum ad5449_sdo_mode {
- AD5449_SDO_DRIVE_FULL = 0x0,
- AD5449_SDO_DRIVE_WEAK = 0x1,
- AD5449_SDO_OPEN_DRAIN = 0x2,
- AD5449_SDO_DISABLED = 0x3,
-};
-
-/**
- * struct ad5449_platform_data - Platform data for the ad5449 DAC driver
- * @sdo_mode: SDO pin mode
- * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the
- * outputs to midscale (true) or to zero scale(false).
- */
-struct ad5449_platform_data {
- enum ad5449_sdo_mode sdo_mode;
- bool hardware_clear_to_midscale;
-};
-
-#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iio: dac: ad5449: drop support for platform data
2024-08-14 9:26 [PATCH] iio: dac: ad5449: drop support for platform data Bartosz Golaszewski
@ 2024-08-17 11:32 ` Jonathan Cameron
2024-08-26 10:56 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2024-08-17 11:32 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Lars-Peter Clausen, Michael Hennerich, linux-kernel, linux-iio,
Bartosz Golaszewski
On Wed, 14 Aug 2024 11:26:29 +0200
Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> There are no longer any users of the platform data struct. Remove
> support for it from the driver.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
I'm fine with this but want an ADI ack.
Jonathan
> ---
> drivers/iio/dac/ad5449.c | 15 ++---------
> include/linux/platform_data/ad5449.h | 39 ----------------------------
> 2 files changed, 2 insertions(+), 52 deletions(-)
> delete mode 100644 include/linux/platform_data/ad5449.h
>
> diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
> index 4572d6f49275..953fcfa2110b 100644
> --- a/drivers/iio/dac/ad5449.c
> +++ b/drivers/iio/dac/ad5449.c
> @@ -20,8 +20,6 @@
> #include <linux/iio/iio.h>
> #include <linux/iio/sysfs.h>
>
> -#include <linux/platform_data/ad5449.h>
> -
> #define AD5449_MAX_CHANNELS 2
> #define AD5449_MAX_VREFS 2
>
> @@ -268,7 +266,6 @@ static const char *ad5449_vref_name(struct ad5449 *st, int n)
>
> static int ad5449_spi_probe(struct spi_device *spi)
> {
> - struct ad5449_platform_data *pdata = spi->dev.platform_data;
> const struct spi_device_id *id = spi_get_device_id(spi);
> struct iio_dev *indio_dev;
> struct ad5449 *st;
> @@ -306,16 +303,8 @@ static int ad5449_spi_probe(struct spi_device *spi)
> mutex_init(&st->lock);
>
> if (st->chip_info->has_ctrl) {
> - unsigned int ctrl = 0x00;
> - if (pdata) {
> - if (pdata->hardware_clear_to_midscale)
> - ctrl |= AD5449_CTRL_HCLR_TO_MIDSCALE;
> - ctrl |= pdata->sdo_mode << AD5449_CTRL_SDO_OFFSET;
> - st->has_sdo = pdata->sdo_mode != AD5449_SDO_DISABLED;
> - } else {
> - st->has_sdo = true;
> - }
> - ad5449_write(indio_dev, AD5449_CMD_CTRL, ctrl);
> + st->has_sdo = true;
> + ad5449_write(indio_dev, AD5449_CMD_CTRL, 0x0);
> }
>
> ret = iio_device_register(indio_dev);
> diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h
> deleted file mode 100644
> index d687ef5726c2..000000000000
> --- a/include/linux/platform_data/ad5449.h
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog
> - * Converter driver.
> - *
> - * Copyright 2012 Analog Devices Inc.
> - * Author: Lars-Peter Clausen <lars@metafoo.de>
> - */
> -
> -#ifndef __LINUX_PLATFORM_DATA_AD5449_H__
> -#define __LINUX_PLATFORM_DATA_AD5449_H__
> -
> -/**
> - * enum ad5449_sdo_mode - AD5449 SDO pin configuration
> - * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength.
> - * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength.
> - * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode.
> - * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to
> - * read back from the device.
> - */
> -enum ad5449_sdo_mode {
> - AD5449_SDO_DRIVE_FULL = 0x0,
> - AD5449_SDO_DRIVE_WEAK = 0x1,
> - AD5449_SDO_OPEN_DRAIN = 0x2,
> - AD5449_SDO_DISABLED = 0x3,
> -};
> -
> -/**
> - * struct ad5449_platform_data - Platform data for the ad5449 DAC driver
> - * @sdo_mode: SDO pin mode
> - * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the
> - * outputs to midscale (true) or to zero scale(false).
> - */
> -struct ad5449_platform_data {
> - enum ad5449_sdo_mode sdo_mode;
> - bool hardware_clear_to_midscale;
> -};
> -
> -#endif
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: dac: ad5449: drop support for platform data
2024-08-17 11:32 ` Jonathan Cameron
@ 2024-08-26 10:56 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-08-26 10:56 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Lars-Peter Clausen, Michael Hennerich, linux-kernel, linux-iio,
Bartosz Golaszewski
On Sat, 17 Aug 2024 12:32:10 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On Wed, 14 Aug 2024 11:26:29 +0200
> Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > There are no longer any users of the platform data struct. Remove
> > support for it from the driver.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> I'm fine with this but want an ADI ack.
Well no one screamed no, which probably means anyone seeing the patch
title was fine with the concept and didn't open the thread :)
(or given time of year, they are all on holiday!)
Anyhow, applied. If it turns out it's still needed I might revert
on request.
Jonathan
>
> Jonathan
>
> > ---
> > drivers/iio/dac/ad5449.c | 15 ++---------
> > include/linux/platform_data/ad5449.h | 39 ----------------------------
> > 2 files changed, 2 insertions(+), 52 deletions(-)
> > delete mode 100644 include/linux/platform_data/ad5449.h
> >
> > diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
> > index 4572d6f49275..953fcfa2110b 100644
> > --- a/drivers/iio/dac/ad5449.c
> > +++ b/drivers/iio/dac/ad5449.c
> > @@ -20,8 +20,6 @@
> > #include <linux/iio/iio.h>
> > #include <linux/iio/sysfs.h>
> >
> > -#include <linux/platform_data/ad5449.h>
> > -
> > #define AD5449_MAX_CHANNELS 2
> > #define AD5449_MAX_VREFS 2
> >
> > @@ -268,7 +266,6 @@ static const char *ad5449_vref_name(struct ad5449 *st, int n)
> >
> > static int ad5449_spi_probe(struct spi_device *spi)
> > {
> > - struct ad5449_platform_data *pdata = spi->dev.platform_data;
> > const struct spi_device_id *id = spi_get_device_id(spi);
> > struct iio_dev *indio_dev;
> > struct ad5449 *st;
> > @@ -306,16 +303,8 @@ static int ad5449_spi_probe(struct spi_device *spi)
> > mutex_init(&st->lock);
> >
> > if (st->chip_info->has_ctrl) {
> > - unsigned int ctrl = 0x00;
> > - if (pdata) {
> > - if (pdata->hardware_clear_to_midscale)
> > - ctrl |= AD5449_CTRL_HCLR_TO_MIDSCALE;
> > - ctrl |= pdata->sdo_mode << AD5449_CTRL_SDO_OFFSET;
> > - st->has_sdo = pdata->sdo_mode != AD5449_SDO_DISABLED;
> > - } else {
> > - st->has_sdo = true;
> > - }
> > - ad5449_write(indio_dev, AD5449_CMD_CTRL, ctrl);
> > + st->has_sdo = true;
> > + ad5449_write(indio_dev, AD5449_CMD_CTRL, 0x0);
> > }
> >
> > ret = iio_device_register(indio_dev);
> > diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h
> > deleted file mode 100644
> > index d687ef5726c2..000000000000
> > --- a/include/linux/platform_data/ad5449.h
> > +++ /dev/null
> > @@ -1,39 +0,0 @@
> > -/* SPDX-License-Identifier: GPL-2.0-only */
> > -/*
> > - * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog
> > - * Converter driver.
> > - *
> > - * Copyright 2012 Analog Devices Inc.
> > - * Author: Lars-Peter Clausen <lars@metafoo.de>
> > - */
> > -
> > -#ifndef __LINUX_PLATFORM_DATA_AD5449_H__
> > -#define __LINUX_PLATFORM_DATA_AD5449_H__
> > -
> > -/**
> > - * enum ad5449_sdo_mode - AD5449 SDO pin configuration
> > - * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength.
> > - * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength.
> > - * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode.
> > - * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to
> > - * read back from the device.
> > - */
> > -enum ad5449_sdo_mode {
> > - AD5449_SDO_DRIVE_FULL = 0x0,
> > - AD5449_SDO_DRIVE_WEAK = 0x1,
> > - AD5449_SDO_OPEN_DRAIN = 0x2,
> > - AD5449_SDO_DISABLED = 0x3,
> > -};
> > -
> > -/**
> > - * struct ad5449_platform_data - Platform data for the ad5449 DAC driver
> > - * @sdo_mode: SDO pin mode
> > - * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the
> > - * outputs to midscale (true) or to zero scale(false).
> > - */
> > -struct ad5449_platform_data {
> > - enum ad5449_sdo_mode sdo_mode;
> > - bool hardware_clear_to_midscale;
> > -};
> > -
> > -#endif
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-26 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 9:26 [PATCH] iio: dac: ad5449: drop support for platform data Bartosz Golaszewski
2024-08-17 11:32 ` Jonathan Cameron
2024-08-26 10:56 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox