All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-hwmon@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 01/10] hwmon: (ads7828) Drop platform data support
Date: Tue, 10 Nov 2026 10:34:24 -0800	[thread overview]
Message-ID: <20261110183434.181711-2-linux@roeck-us.net> (raw)
In-Reply-To: <20261110183434.181711-1-linux@roeck-us.net>

There are no in-tree users of ads7828_platform_data. The driver already
supports configuring differential input mode and external reference
voltage via devicetree properties ("ti,differential-input" and the
"vref" regulator supply).

Drop platform data support from the driver, remove the unused
platform_data header file, and update the driver documentation.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 Documentation/hwmon/ads7828.rst       | 21 ---------------------
 drivers/hwmon/ads7828.c               | 13 +------------
 include/linux/platform_data/ads7828.h | 26 --------------------------
 3 files changed, 1 insertion(+), 59 deletions(-)
 delete mode 100644 include/linux/platform_data/ads7828.h

diff --git a/Documentation/hwmon/ads7828.rst b/Documentation/hwmon/ads7828.rst
index b830b490cfe4..7aaafa489e4f 100644
--- a/Documentation/hwmon/ads7828.rst
+++ b/Documentation/hwmon/ads7828.rst
@@ -24,27 +24,6 @@ Authors:
 	- Vivien Didelot <vivien.didelot@savoirfairelinux.com>
 	- Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
 
-Platform data
--------------
-
-The ads7828 driver accepts an optional ads7828_platform_data structure (defined
-in include/linux/platform_data/ads7828.h). The structure fields are:
-
-* diff_input: (bool) Differential operation
-    set to true for differential mode, false for default single ended mode.
-
-* ext_vref: (bool) External reference
-    set to true if it operates with an external reference, false for default
-    internal reference.
-
-* vref_mv: (unsigned int) Voltage reference
-    if using an external reference, set this to the reference voltage in mV,
-    otherwise it will default to the internal value (2500mV). This value will be
-    bounded with limits accepted by the chip, described in the datasheet.
-
- If no structure is provided, the configuration defaults to single ended
- operation and internal voltage reference (2.5V).
-
 Description
 -----------
 
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index 261978af17c5..7cc379192375 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/platform_data/ads7828.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
 #include <linux/regulator/consumer.h>
@@ -102,7 +101,6 @@ static const struct regmap_config ads2830_regmap_config = {
 static int ads7828_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
-	struct ads7828_platform_data *pdata = dev_get_platdata(dev);
 	struct ads7828_data *data;
 	struct device *hwmon_dev;
 	unsigned int vref_mv = ADS7828_INT_VREF_MV;
@@ -116,12 +114,7 @@ static int ads7828_probe(struct i2c_client *client)
 	if (!data)
 		return -ENOMEM;
 
-	if (pdata) {
-		diff_input = pdata->diff_input;
-		ext_vref = pdata->ext_vref;
-		if (ext_vref && pdata->vref_mv)
-			vref_mv = pdata->vref_mv;
-	} else if (dev->of_node) {
+	if (dev->of_node) {
 		diff_input = of_property_read_bool(dev->of_node,
 						   "ti,differential-input");
 		vref_uv = devm_regulator_get_enable_read_voltage(dev, "vref");
@@ -139,10 +132,6 @@ static int ads7828_probe(struct i2c_client *client)
 
 	chip = (uintptr_t)i2c_get_match_data(client);
 
-	/* Bound Vref with min/max values */
-	vref_mv = clamp_val(vref_mv, ADS7828_EXT_VREF_MV_MIN,
-			    ADS7828_EXT_VREF_MV_MAX);
-
 	/* ADS7828 uses 12-bit samples, while ADS7830 is 8-bit */
 	if (chip == ads7828) {
 		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096);
diff --git a/include/linux/platform_data/ads7828.h b/include/linux/platform_data/ads7828.h
deleted file mode 100644
index 0fa4186c6171..000000000000
--- a/include/linux/platform_data/ads7828.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * TI ADS7828 A/D Converter platform data definition
- *
- * Copyright (c) 2012 Savoir-faire Linux Inc.
- *          Vivien Didelot <vivien.didelot@savoirfairelinux.com>
- *
- * For further information, see the Documentation/hwmon/ads7828.rst file.
- */
-
-#ifndef _PDATA_ADS7828_H
-#define _PDATA_ADS7828_H
-
-/**
- * struct ads7828_platform_data - optional ADS7828 connectivity info
- * @diff_input:		Differential input mode.
- * @ext_vref:		Use an external voltage reference.
- * @vref_mv:		Voltage reference value, if external.
- */
-struct ads7828_platform_data {
-	bool diff_input;
-	bool ext_vref;
-	unsigned int vref_mv;
-};
-
-#endif /* _PDATA_ADS7828_H */
-- 
2.45.2


  reply	other threads:[~2026-11-10 18:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
2026-11-10 18:34 ` Guenter Roeck [this message]
2026-11-10 18:45   ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Arnd Bergmann
2026-11-10 19:40     ` Guenter Roeck
2026-11-10 19:49       ` Arnd Bergmann
2026-11-12 18:25     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
2026-11-10 18:56   ` Arnd Bergmann
2026-11-12 19:06     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
2026-11-10 19:09   ` Arnd Bergmann
2026-11-12 19:08     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
2026-11-10 19:11   ` Arnd Bergmann
2026-11-12 19:09     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
2026-11-10 18:58   ` Arnd Bergmann
2026-11-12 19:11     ` Guenter Roeck
2026-11-11  9:54   ` Nuno Sá
2026-11-10 18:34 ` [PATCH 06/10] hwmon: (mcp3021) " Guenter Roeck
2026-11-10 19:12   ` Arnd Bergmann
2026-11-12 19:14     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 07/10] hwmon: (shtc1) " Guenter Roeck
2026-11-10 19:00   ` Arnd Bergmann
2026-11-12 19:18     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
2026-11-10 19:02   ` Arnd Bergmann
2026-11-12 19:22     ` Guenter Roeck
2026-11-11  9:49   ` Nuno Sá
2026-11-10 18:34 ` [PATCH 09/10] hwmon: (f75375s) Drop platform data support Guenter Roeck
2026-11-10 19:18   ` Arnd Bergmann
2026-11-10 19:43     ` Guenter Roeck
2026-11-12 19:25     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 10/10] hwmon: (ds620) " Guenter Roeck
2026-11-10 19:07   ` Arnd Bergmann
2026-11-10 19:41     ` Guenter Roeck
2026-11-12 19:29     ` Guenter Roeck
2026-11-11  9:56   ` Nuno Sá
2026-11-10 19:24 ` [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Arnd Bergmann
2026-11-10 19:50   ` Guenter Roeck
2026-11-10 20:31     ` Arnd Bergmann
2026-11-12 19:31   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110183434.181711-2-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=linux-hwmon@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.