* [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver
@ 2026-11-10 18:34 Guenter Roeck
2026-11-10 18:34 ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Guenter Roeck
` (10 more replies)
0 siblings, 11 replies; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon
Cc: Arnd Bergmann, Guenter Roeck, Tim Harvey, Nuno Sá,
Riku Voipio
Several drivers in drivers/hwmon still support configuration through
platform data structures even though no in-tree platform or board code
ever instantiates or supplies that platform data.
Audit all hwmon drivers using dev_get_platdata(), dev->platform_data, or
headers under include/linux/platform_data/ and drop dead platform data
support where it is never provided in-tree:
- ads7828, emc2305, g762, gsc-hwmon, ltc4245, mcp3021, and shtc1 already
support configuring the respective parameters via devicetree / fwnode
properties (and/or hardware registers). Drop platform data support,
remove the unused platform data headers, and update documentation and
MAINTAINERS entries accordingly.
- f75375s already initializes PWM mode and enable state from chip
registers during probe and exposes pwm and pwm_enable via standard
hwmon sysfs attributes. Drop platform data support and remove
include/linux/f75375s.h.
- ds620 clears PO2 by default when no platform data is provided, keeping
the thermostat output pin low as a valid default configuration. Drop
platform data support and remove include/linux/platform_data/ds620.h.
- max197 requires platform data supplying a convert() callback function
pointer and fails to probe without it. Since no in-tree user ever
instantiates the device or provides max197_platform_data, remove the
unused driver along with its platform data header, Kconfig/Makefile
entries, and documentation.
Tooling and Testing Notes
-------------------------
Per Documentation/process/generated-content.rst:
- Tool used: Jetski AI coding assistant (Gemini).
- Prompt summary: Identify all drivers in drivers/hwmon whose platform
data is never supplied in-tree; remove platform data support and
unused platform data headers where an alternate configuration means
exists (including ds620's default PO2 configuration), and remove both
the driver and header where platform data is mandatory.
- Scope of generated content: Code changes, documentation/Kconfig/
MAINTAINERS updates, commit descriptions, and this cover letter.
- Testing: Verified with out-of-tree W=1 builds of drivers/hwmon/ under
both allmodconfig (CONFIG_OF=y) and CONFIG_OF=n, as well as
scripts/checkpatch.pl --strict. Not runtime-tested on hardware.
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Nuno Sá <nuno.sa@analog.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Guenter Roeck (10):
hwmon: (ads7828) Drop platform data support
hwmon: (emc2305) Drop platform data support
hwmon: (g762) Drop platform data support
hwmon: (gsc-hwmon) Drop platform data support
hwmon: (ltc4245) Drop platform data support
hwmon: (mcp3021) Drop platform data support
hwmon: (shtc1) Drop platform data support
hwmon: (max197) Remove driver
hwmon: (f75375s) Drop platform data support
hwmon: (ds620) Drop platform data support
Documentation/hwmon/ads7828.rst | 21 --
Documentation/hwmon/ds620.rst | 12 +-
Documentation/hwmon/g762.rst | 4 +-
Documentation/hwmon/index.rst | 1 -
Documentation/hwmon/ltc4245.rst | 6 +-
Documentation/hwmon/max197.rst | 70 -----
Documentation/hwmon/shtc1.rst | 3 +-
MAINTAINERS | 2 -
drivers/hwmon/Kconfig | 9 -
drivers/hwmon/Makefile | 1 -
drivers/hwmon/ads7828.c | 13 +-
drivers/hwmon/ds620.c | 13 +-
drivers/hwmon/emc2305.c | 44 +--
drivers/hwmon/f75375s.c | 100 +++----
drivers/hwmon/g762.c | 50 +---
drivers/hwmon/gsc-hwmon.c | 72 +++--
drivers/hwmon/ltc4245.c | 21 +-
drivers/hwmon/max197.c | 341 ------------------------
drivers/hwmon/mcp3021.c | 18 +-
drivers/hwmon/shtc1.c | 23 +-
include/linux/f75375s.h | 21 --
include/linux/platform_data/ads7828.h | 26 --
include/linux/platform_data/ds620.h | 22 --
include/linux/platform_data/emc2305.h | 28 --
include/linux/platform_data/g762.h | 24 --
include/linux/platform_data/gsc_hwmon.h | 45 ----
include/linux/platform_data/ltc4245.h | 17 --
include/linux/platform_data/max197.h | 23 --
include/linux/platform_data/shtc1.h | 14 -
29 files changed, 121 insertions(+), 923 deletions(-)
delete mode 100644 Documentation/hwmon/max197.rst
delete mode 100644 drivers/hwmon/max197.c
delete mode 100644 include/linux/f75375s.h
delete mode 100644 include/linux/platform_data/ads7828.h
delete mode 100644 include/linux/platform_data/ds620.h
delete mode 100644 include/linux/platform_data/emc2305.h
delete mode 100644 include/linux/platform_data/g762.h
delete mode 100644 include/linux/platform_data/gsc_hwmon.h
delete mode 100644 include/linux/platform_data/ltc4245.h
delete mode 100644 include/linux/platform_data/max197.h
delete mode 100644 include/linux/platform_data/shtc1.h
--
2.56.0
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH 01/10] hwmon: (ads7828) Drop platform data support
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
2026-11-10 18:45 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
` (9 subsequent siblings)
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck
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
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 02/10] hwmon: (emc2305) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
2026-11-10 18:34 ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 18:56 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
` (8 subsequent siblings)
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck
There are no in-tree users of emc2305_platform_data. Active PWM channel
count is detected from the chip product ID register, and per-channel PWM
and thermal cooling parameters are configurable via devicetree child
nodes.
Move EMC2305_PWM_MAX into the driver, drop platform data support, and
remove the unused platform_data header file.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/emc2305.c | 44 +++++----------------------
include/linux/platform_data/emc2305.h | 28 -----------------
2 files changed, 8 insertions(+), 64 deletions(-)
delete mode 100644 include/linux/platform_data/emc2305.h
diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c
index 434e70e76f5f..4eee52ae38ca 100644
--- a/drivers/hwmon/emc2305.c
+++ b/drivers/hwmon/emc2305.c
@@ -9,7 +9,6 @@
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/module.h>
-#include <linux/platform_data/emc2305.h>
#include <linux/thermal.h>
#include <linux/pwm.h>
#include <linux/of_device.h>
@@ -20,6 +19,7 @@
#define EMC2305_FAN_MAX 0xff
#define EMC2305_FAN_MIN 0x00
#define EMC2305_FAN_MAX_STATE 10
+#define EMC2305_PWM_MAX 5
#define EMC2305_DEVICE 0x34
#define EMC2305_VENDOR 0x5d
#define EMC2305_REG_PRODUCT_ID 0xfd
@@ -627,7 +627,6 @@ static int emc2305_probe(struct i2c_client *client)
struct i2c_adapter *adapter = client->adapter;
struct device *dev = &client->dev;
struct emc2305_data *data;
- struct emc2305_platform_data *pdata;
int vendor;
int ret;
int i;
@@ -657,43 +656,16 @@ static int emc2305_probe(struct i2c_client *client)
pwm_childs = emc2305_probe_childs_from_dt(dev);
- pdata = dev_get_platdata(&client->dev);
+ data->max_state = EMC2305_FAN_MAX_STATE;
+ data->pwm_separate = false;
+ for (i = 0; i < EMC2305_PWM_MAX; i++)
+ data->pwm_min[i] = EMC2305_FAN_MIN;
if (!pwm_childs) {
- if (pdata) {
- if (!pdata->max_state || pdata->max_state > EMC2305_FAN_MAX_STATE)
- return -EINVAL;
- data->max_state = pdata->max_state;
- /*
- * Validate a number of active PWM channels. Note that
- * configured number can be less than the actual maximum
- * supported by the device.
- */
- if (!pdata->pwm_num || pdata->pwm_num > EMC2305_PWM_MAX)
- return -EINVAL;
- data->pwm_num = pdata->pwm_num;
- data->pwm_output_mask = pdata->pwm_output_mask;
- data->pwm_polarity_mask = pdata->pwm_polarity_mask;
- data->pwm_separate = pdata->pwm_separate;
- for (i = 0; i < EMC2305_PWM_MAX; i++) {
- data->pwm_min[i] = pdata->pwm_min[i];
- data->pwm_freq[i] = pdata->pwm_freq[i];
- }
- } else {
- data->max_state = EMC2305_FAN_MAX_STATE;
- data->pwm_separate = false;
- data->pwm_output_mask = EMC2305_DEFAULT_OUTPUT;
- data->pwm_polarity_mask = EMC2305_DEFAULT_POLARITY;
- for (i = 0; i < EMC2305_PWM_MAX; i++) {
- data->pwm_min[i] = EMC2305_FAN_MIN;
- data->pwm_freq[i] = base_freq_table[3];
- }
- }
- } else {
- data->max_state = EMC2305_FAN_MAX_STATE;
- data->pwm_separate = false;
+ data->pwm_output_mask = EMC2305_DEFAULT_OUTPUT;
+ data->pwm_polarity_mask = EMC2305_DEFAULT_POLARITY;
for (i = 0; i < EMC2305_PWM_MAX; i++)
- data->pwm_min[i] = EMC2305_FAN_MIN;
+ data->pwm_freq[i] = base_freq_table[3];
}
data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "emc2305", data,
diff --git a/include/linux/platform_data/emc2305.h b/include/linux/platform_data/emc2305.h
deleted file mode 100644
index 76043a97f975..000000000000
--- a/include/linux/platform_data/emc2305.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __LINUX_PLATFORM_DATA_EMC2305__
-#define __LINUX_PLATFORM_DATA_EMC2305__
-
-#define EMC2305_PWM_MAX 5
-
-/**
- * struct emc2305_platform_data - EMC2305 driver platform data
- * @max_state: maximum cooling state of the cooling device;
- * @pwm_num: number of active channels;
- * @pwm_output_mask: PWM output mask
- * @pwm_polarity_mask: PWM polarity mask
- * @pwm_separate: separate PWM settings for every channel;
- * @pwm_min: array of minimum PWM per channel;
- * @pwm_freq: array of PWM frequency per channel
- */
-struct emc2305_platform_data {
- u8 max_state;
- u8 pwm_num;
- u8 pwm_output_mask;
- u8 pwm_polarity_mask;
- bool pwm_separate;
- u8 pwm_min[EMC2305_PWM_MAX];
- u16 pwm_freq[EMC2305_PWM_MAX];
-};
-
-#endif
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 03/10] hwmon: (g762) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
2026-11-10 18:34 ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Guenter Roeck
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:09 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
` (7 subsequent siblings)
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck
There are no in-tree users of g762_platform_data. All hardware
parameters configurable through platform data (input clock, fan gear
mode, PWM polarity, and fan startup voltage) are already configurable
via devicetree properties.
Drop platform data support and the now-unnecessary CONFIG_OF guards 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/g762.rst | 4 +--
drivers/hwmon/g762.c | 50 ++----------------------------
include/linux/platform_data/g762.h | 24 --------------
3 files changed, 3 insertions(+), 75 deletions(-)
delete mode 100644 include/linux/platform_data/g762.h
diff --git a/Documentation/hwmon/g762.rst b/Documentation/hwmon/g762.rst
index f224552a2d3c..6c95040870b6 100644
--- a/Documentation/hwmon/g762.rst
+++ b/Documentation/hwmon/g762.rst
@@ -17,9 +17,7 @@ done via a userland daemon like fancontrol.
Note that those entries do not provide ways to setup the specific
hardware characteristics of the system (reference clock, pulses per
fan revolution, ...); Those can be modified via devicetree bindings
-documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml or
-using a specific platform_data structure in board initialization
-file (see include/linux/platform_data/g762.h).
+documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml.
fan1_target:
set desired fan speed. This only makes sense in closed-loop
diff --git a/drivers/hwmon/g762.c b/drivers/hwmon/g762.c
index 1a4aeb6db7d4..26ab00f4d130 100644
--- a/drivers/hwmon/g762.c
+++ b/drivers/hwmon/g762.c
@@ -39,7 +39,6 @@
#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/of.h>
-#include <linux/platform_data/g762.h>
#define DRVNAME "g762"
@@ -568,7 +567,6 @@ static int do_set_fan_startv(struct device *dev, unsigned long val)
* those to the chip.
*/
-#ifdef CONFIG_OF
static const struct of_device_id g762_dt_match[] = {
{ .compatible = "gmt,g761" },
{ .compatible = "gmt,g762" },
@@ -695,46 +693,6 @@ static int g762_of_prop_import(struct i2c_client *client)
do_set_fan_startv);
}
-#else
-static int g762_of_prop_import(struct i2c_client *client)
-{
- return 0;
-}
-
-static int g762_of_clock_enable(struct i2c_client *client)
-{
- return 0;
-}
-#endif
-
-/*
- * Helper to import hardware characteristics from .dts file and push
- * those to the chip.
- */
-
-static int g762_pdata_prop_import(struct i2c_client *client)
-{
- struct g762_platform_data *pdata = dev_get_platdata(&client->dev);
- int ret;
-
- if (!pdata)
- return 0;
-
- ret = do_set_fan_gear_mode(&client->dev, pdata->fan_gear_mode);
- if (ret)
- return ret;
-
- ret = do_set_pwm_polarity(&client->dev, pdata->pwm_polarity);
- if (ret)
- return ret;
-
- ret = do_set_fan_startv(&client->dev, pdata->fan_startv);
- if (ret)
- return ret;
-
- return do_set_clk_freq(&client->dev, pdata->clk_freq);
-}
-
/*
* sysfs attributes
*/
@@ -1085,7 +1043,7 @@ static int g762_probe(struct i2c_client *client)
data->client = client;
mutex_init(&data->update_lock);
- /* Get configuration via DT ... */
+ /* Get configuration via DT */
ret = g762_of_clock_enable(client);
if (ret)
return ret;
@@ -1096,10 +1054,6 @@ static int g762_probe(struct i2c_client *client)
return ret;
ret = g762_of_prop_import(client);
- if (ret)
- return ret;
- /* ... or platform_data */
- ret = g762_pdata_prop_import(client);
if (ret)
return ret;
@@ -1111,7 +1065,7 @@ static int g762_probe(struct i2c_client *client)
static struct i2c_driver g762_driver = {
.driver = {
.name = DRVNAME,
- .of_match_table = of_match_ptr(g762_dt_match),
+ .of_match_table = g762_dt_match,
},
.probe = g762_probe,
.id_table = g762_id,
diff --git a/include/linux/platform_data/g762.h b/include/linux/platform_data/g762.h
deleted file mode 100644
index 249257ee2132..000000000000
--- a/include/linux/platform_data/g762.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Platform data structure for g762 fan controller driver
- *
- * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
- */
-#ifndef __LINUX_PLATFORM_DATA_G762_H__
-#define __LINUX_PLATFORM_DATA_G762_H__
-
-/*
- * Following structure can be used to set g762 driver platform specific data
- * during board init. Note that passing a sparse structure is possible but
- * will result in non-specified attributes to be set to default value, hence
- * overloading those installed during boot (e.g. by u-boot).
- */
-
-struct g762_platform_data {
- u32 fan_startv;
- u32 fan_gear_mode;
- u32 pwm_polarity;
- u32 clk_freq;
-};
-
-#endif /* __LINUX_PLATFORM_DATA_G762_H__ */
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 04/10] hwmon: (gsc-hwmon) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (2 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:11 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
` (6 subsequent siblings)
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck, Tim Harvey
There are no in-tree users providing gsc_hwmon_platform_data. Channel
descriptions and the fan controller base address are already obtained
from devicetree / fwnode properties.
Move enum gsc_hwmon_mode and struct gsc_hwmon_channel into the driver,
fold the channel array and fan_base into struct gsc_hwmon_data, drop
platform data support, and remove the unused platform_data header file.
Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
MAINTAINERS | 1 -
drivers/hwmon/gsc-hwmon.c | 72 +++++++++++++++----------
include/linux/platform_data/gsc_hwmon.h | 45 ----------------
3 files changed, 45 insertions(+), 73 deletions(-)
delete mode 100644 include/linux/platform_data/gsc_hwmon.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 476bcd5d0e1c..15d70b72d9a2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11169,7 +11169,6 @@ F: Documentation/hwmon/gsc-hwmon.rst
F: drivers/hwmon/gsc-hwmon.c
F: drivers/mfd/gateworks-gsc.c
F: include/linux/mfd/gsc.h
-F: include/linux/platform_data/gsc_hwmon.h
GCC PLUGINS
M: Kees Cook <kees@kernel.org>
diff --git a/drivers/hwmon/gsc-hwmon.c b/drivers/hwmon/gsc-hwmon.c
index 83005d8ae47e..9424deb98590 100644
--- a/drivers/hwmon/gsc-hwmon.c
+++ b/drivers/hwmon/gsc-hwmon.c
@@ -10,11 +10,10 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>
-#include <linux/platform_data/gsc_hwmon.h>
-
#define GSC_HWMON_MAX_TEMP_CH 16
#define GSC_HWMON_MAX_IN_CH 16
#define GSC_HWMON_MAX_FAN_CH 16
@@ -22,10 +21,35 @@
#define GSC_HWMON_RESOLUTION 12
#define GSC_HWMON_VREF 2500
+enum gsc_hwmon_mode {
+ mode_temperature,
+ mode_voltage_24bit,
+ mode_voltage_raw,
+ mode_voltage_16bit,
+ mode_fan,
+ mode_max,
+};
+
+/**
+ * struct gsc_hwmon_channel - configuration parameters
+ * @reg: I2C register offset
+ * @mode: channel mode
+ * @name: channel name
+ * @mvoffset: voltage offset
+ * @vdiv: voltage divider array (2 resistor values in milli-ohms)
+ */
+struct gsc_hwmon_channel {
+ unsigned int reg;
+ unsigned int mode;
+ const char *name;
+ unsigned int mvoffset;
+ unsigned int vdiv[2];
+};
+
struct gsc_hwmon_data {
struct gsc_dev *gsc;
- struct gsc_hwmon_platform_data *pdata;
struct regmap *regmap;
+ u32 fan_base;
const struct gsc_hwmon_channel *temp_ch[GSC_HWMON_MAX_TEMP_CH];
const struct gsc_hwmon_channel *in_ch[GSC_HWMON_MAX_IN_CH];
const struct gsc_hwmon_channel *fan_ch[GSC_HWMON_MAX_FAN_CH];
@@ -37,6 +61,8 @@ struct gsc_hwmon_data {
struct hwmon_channel_info fan_info;
const struct hwmon_channel_info *info[4];
struct hwmon_chip_info chip;
+ int nchannels;
+ struct gsc_hwmon_channel channels[] __counted_by(nchannels);
};
static const struct regmap_bus gsc_hwmon_regmap_bus = {
@@ -55,7 +81,7 @@ static ssize_t pwm_auto_point_temp_show(struct device *dev,
{
struct gsc_hwmon_data *hwmon = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- u8 reg = hwmon->pdata->fan_base + (2 * attr->index);
+ u8 reg = hwmon->fan_base + (2 * attr->index);
u8 regs[2];
int ret;
@@ -73,7 +99,7 @@ static ssize_t pwm_auto_point_temp_store(struct device *dev,
{
struct gsc_hwmon_data *hwmon = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- u8 reg = hwmon->pdata->fan_base + (2 * attr->index);
+ u8 reg = hwmon->fan_base + (2 * attr->index);
u8 regs[2];
long temp;
int err;
@@ -236,10 +262,9 @@ static const struct hwmon_ops gsc_hwmon_ops = {
.read_string = gsc_hwmon_read_string,
};
-static struct gsc_hwmon_platform_data *
-gsc_hwmon_get_devtree_pdata(struct device *dev)
+static struct gsc_hwmon_data *gsc_hwmon_get_devtree_data(struct device *dev)
{
- struct gsc_hwmon_platform_data *pdata;
+ struct gsc_hwmon_data *hwmon;
struct gsc_hwmon_channel *ch;
struct device_node *fan;
int nchannels;
@@ -248,15 +273,15 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
if (nchannels == 0)
return ERR_PTR(-ENODEV);
- pdata = devm_kzalloc_flex(dev, *pdata, channels, nchannels);
- if (!pdata)
+ hwmon = devm_kzalloc_flex(dev, *hwmon, channels, nchannels);
+ if (!hwmon)
return ERR_PTR(-ENOMEM);
- pdata->nchannels = nchannels;
+ hwmon->nchannels = nchannels;
/* fan controller base address */
of_node_get(dev->parent->of_node);
fan = of_find_compatible_node(dev->parent->of_node, NULL, "gw,gsc-fan");
- if (fan && of_property_read_u32(fan, "reg", &pdata->fan_base)) {
+ if (fan && of_property_read_u32(fan, "reg", &hwmon->fan_base)) {
of_node_put(fan);
dev_err(dev, "fan node without base\n");
return ERR_PTR(-EINVAL);
@@ -264,7 +289,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
of_node_put(fan);
- ch = pdata->channels;
+ ch = hwmon->channels;
/* allocate structures for channels and count instances of each type */
device_for_each_child_node_scoped(dev, child) {
if (fwnode_property_read_string(child, "label", &ch->name)) {
@@ -294,7 +319,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
ch++;
}
- return pdata;
+ return hwmon;
}
static int gsc_hwmon_probe(struct platform_device *pdev)
@@ -302,22 +327,15 @@ static int gsc_hwmon_probe(struct platform_device *pdev)
struct gsc_dev *gsc = dev_get_drvdata(pdev->dev.parent);
struct device *dev = &pdev->dev;
struct device *hwmon_dev;
- struct gsc_hwmon_platform_data *pdata = dev_get_platdata(dev);
struct gsc_hwmon_data *hwmon;
const struct attribute_group **groups;
int i, i_in, i_temp, i_fan;
- if (!pdata) {
- pdata = gsc_hwmon_get_devtree_pdata(dev);
- if (IS_ERR(pdata))
- return PTR_ERR(pdata);
- }
+ hwmon = gsc_hwmon_get_devtree_data(dev);
+ if (IS_ERR(hwmon))
+ return PTR_ERR(hwmon);
- hwmon = devm_kzalloc_obj(dev, *hwmon);
- if (!hwmon)
- return -ENOMEM;
hwmon->gsc = gsc;
- hwmon->pdata = pdata;
hwmon->regmap = devm_regmap_init(dev, &gsc_hwmon_regmap_bus,
gsc->i2c_hwmon,
@@ -325,8 +343,8 @@ static int gsc_hwmon_probe(struct platform_device *pdev)
if (IS_ERR(hwmon->regmap))
return PTR_ERR(hwmon->regmap);
- for (i = 0, i_in = 0, i_temp = 0, i_fan = 0; i < hwmon->pdata->nchannels; i++) {
- const struct gsc_hwmon_channel *ch = &pdata->channels[i];
+ for (i = 0, i_in = 0, i_temp = 0, i_fan = 0; i < hwmon->nchannels; i++) {
+ const struct gsc_hwmon_channel *ch = &hwmon->channels[i];
switch (ch->mode) {
case mode_temperature:
@@ -380,7 +398,7 @@ static int gsc_hwmon_probe(struct platform_device *pdev)
hwmon->fan_info.type = hwmon_fan;
hwmon->fan_info.config = hwmon->fan_config;
- groups = pdata->fan_base ? gsc_hwmon_groups : NULL;
+ groups = hwmon->fan_base ? gsc_hwmon_groups : NULL;
hwmon_dev = devm_hwmon_device_register_with_info(dev,
KBUILD_MODNAME, hwmon,
&hwmon->chip, groups);
diff --git a/include/linux/platform_data/gsc_hwmon.h b/include/linux/platform_data/gsc_hwmon.h
deleted file mode 100644
index 70e8a6bec0f6..000000000000
--- a/include/linux/platform_data/gsc_hwmon.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _GSC_HWMON_H
-#define _GSC_HWMON_H
-
-enum gsc_hwmon_mode {
- mode_temperature,
- mode_voltage_24bit,
- mode_voltage_raw,
- mode_voltage_16bit,
- mode_fan,
- mode_max,
-};
-
-/**
- * struct gsc_hwmon_channel - configuration parameters
- * @reg: I2C register offset
- * @mode: channel mode
- * @name: channel name
- * @mvoffset: voltage offset
- * @vdiv: voltage divider array (2 resistor values in milli-ohms)
- */
-struct gsc_hwmon_channel {
- unsigned int reg;
- unsigned int mode;
- const char *name;
- unsigned int mvoffset;
- unsigned int vdiv[2];
-};
-
-/**
- * struct gsc_hwmon_platform_data - platform data for gsc_hwmon driver
- * @nchannels: number of elements in @channels array
- * @vreference: voltage reference (mV)
- * @resolution: ADC bit resolution
- * @fan_base: register base for FAN controller
- * @channels: array of gsc_hwmon_channel structures describing channels
- */
-struct gsc_hwmon_platform_data {
- int nchannels;
- unsigned int resolution;
- unsigned int vreference;
- unsigned int fan_base;
- struct gsc_hwmon_channel channels[] __counted_by(nchannels);
-};
-#endif
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 05/10] hwmon: (ltc4245) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (3 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 18:58 ` Arnd Bergmann
2026-11-11 9:54 ` Nuno Sá
2026-11-10 18:34 ` [PATCH 06/10] hwmon: (mcp3021) " Guenter Roeck
` (5 subsequent siblings)
10 siblings, 2 replies; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck, Nuno Sá
There are no in-tree users of ltc4245_platform_data. Sampling all GPIO
pins as analog voltages is already configurable via the
"ltc4245,use-extra-gpios" devicetree property.
Drop platform data support from the driver, remove the unused
platform_data header file, and update the driver documentation.
Cc: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Documentation/hwmon/ltc4245.rst | 6 ++----
drivers/hwmon/ltc4245.c | 21 +++------------------
include/linux/platform_data/ltc4245.h | 17 -----------------
3 files changed, 5 insertions(+), 39 deletions(-)
delete mode 100644 include/linux/platform_data/ltc4245.h
diff --git a/Documentation/hwmon/ltc4245.rst b/Documentation/hwmon/ltc4245.rst
index 3dafd08a4e87..0c3b823169b9 100644
--- a/Documentation/hwmon/ltc4245.rst
+++ b/Documentation/hwmon/ltc4245.rst
@@ -103,9 +103,7 @@ then they will be sampled in round-robin fashion. If userspace reads too
slowly, -EAGAIN will be returned when you read the sysfs attribute containing
the sensor reading.
-The LTC4245 chip can be configured to sample all GPIO pins with two methods:
-
-1) platform data -- see include/linux/platform_data/ltc4245.h
-2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip
+The LTC4245 chip can be configured to sample all GPIO pins by adding the
+"ltc4245,use-extra-gpios" OF device tree property to each chip.
The default mode of operation is to sample a single GPIO pin.
diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
index e7fcf607a05e..7425c801cfe5 100644
--- a/drivers/hwmon/ltc4245.c
+++ b/drivers/hwmon/ltc4245.c
@@ -19,7 +19,7 @@
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/jiffies.h>
-#include <linux/platform_data/ltc4245.h>
+#include <linux/of.h>
/* Here are names of the chip's registers (a.k.a. commands) */
enum ltc4245_cmd {
@@ -418,22 +418,6 @@ static const struct hwmon_chip_info ltc4245_chip_info = {
.info = ltc4245_info,
};
-static bool ltc4245_use_extra_gpios(struct i2c_client *client)
-{
- struct ltc4245_platform_data *pdata = dev_get_platdata(&client->dev);
- struct device_node *np = client->dev.of_node;
-
- /* prefer platform data */
- if (pdata)
- return pdata->use_extra_gpios;
-
- /* fallback on OF */
- if (of_property_read_bool(np, "ltc4245,use-extra-gpios"))
- return true;
-
- return false;
-}
-
static int ltc4245_probe(struct i2c_client *client)
{
struct i2c_adapter *adapter = client->adapter;
@@ -448,7 +432,8 @@ static int ltc4245_probe(struct i2c_client *client)
return -ENOMEM;
data->client = client;
- data->use_extra_gpios = ltc4245_use_extra_gpios(client);
+ data->use_extra_gpios = of_property_read_bool(client->dev.of_node,
+ "ltc4245,use-extra-gpios");
/* Initialize the LTC4245 chip */
i2c_smbus_write_byte_data(client, LTC4245_FAULT1, 0x00);
diff --git a/include/linux/platform_data/ltc4245.h b/include/linux/platform_data/ltc4245.h
deleted file mode 100644
index f07fa05ea6c4..000000000000
--- a/include/linux/platform_data/ltc4245.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Platform Data for LTC4245 hardware monitor chip
- *
- * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
- */
-
-#ifndef LINUX_LTC4245_H
-#define LINUX_LTC4245_H
-
-#include <linux/types.h>
-
-struct ltc4245_platform_data {
- bool use_extra_gpios;
-};
-
-#endif /* LINUX_LTC4245_H */
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 06/10] hwmon: (mcp3021) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (4 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:12 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 07/10] hwmon: (shtc1) " Guenter Roeck
` (4 subsequent siblings)
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck
No in-tree boards supply platform data to the mcp3021 driver. Reference
voltage is already configurable via the "reference-voltage-microvolt"
devicetree property, defaulting to 3300 mV otherwise.
Drop platform data handling from mcp3021_probe().
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/mcp3021.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/hwmon/mcp3021.c b/drivers/hwmon/mcp3021.c
index 087b595bf5ad..82b1363ab1c6 100644
--- a/drivers/hwmon/mcp3021.c
+++ b/drivers/hwmon/mcp3021.c
@@ -132,20 +132,10 @@ static int mcp3021_probe(struct i2c_client *client)
i2c_set_clientdata(client, data);
- if (np) {
- if (!of_property_read_u32(np, "reference-voltage-microvolt",
- &data->vdd))
- data->vdd /= 1000;
- else
- data->vdd = MCP3021_VDD_REF_DEFAULT;
- } else {
- u32 *pdata = dev_get_platdata(&client->dev);
-
- if (pdata)
- data->vdd = *pdata;
- else
- data->vdd = MCP3021_VDD_REF_DEFAULT;
- }
+ if (!of_property_read_u32(np, "reference-voltage-microvolt", &data->vdd))
+ data->vdd /= 1000;
+ else
+ data->vdd = MCP3021_VDD_REF_DEFAULT;
type = (uintptr_t)i2c_get_match_data(client);
switch (type) {
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 07/10] hwmon: (shtc1) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (5 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 06/10] hwmon: (mcp3021) " Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:00 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
` (3 subsequent siblings)
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck
There are no in-tree users of shtc1_platform_data. Blocking I/O and
measurement precision modes are already configurable via the
"sensirion,blocking-io" and "sensirion,low-precision" devicetree
properties.
Move blocking_io and high_precision directly into struct shtc1_data,
drop platform data support, remove the unused platform_data header file,
and update the driver documentation.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Documentation/hwmon/shtc1.rst | 3 ++-
drivers/hwmon/shtc1.c | 23 ++++++++++-------------
include/linux/platform_data/shtc1.h | 14 --------------
3 files changed, 12 insertions(+), 28 deletions(-)
delete mode 100644 include/linux/platform_data/shtc1.h
diff --git a/Documentation/hwmon/shtc1.rst b/Documentation/hwmon/shtc1.rst
index f38c4c9d2f74..d2c6d9b8f0e0 100644
--- a/Documentation/hwmon/shtc1.rst
+++ b/Documentation/hwmon/shtc1.rst
@@ -48,7 +48,8 @@ The device communicates with the I2C protocol. All sensors are set to I2C
address 0x70. See Documentation/i2c/instantiating-devices.rst for methods to
instantiate the device.
-There are two options configurable by means of shtc1_platform_data:
+There are two options configurable via devicetree properties (see
+Documentation/devicetree/bindings/hwmon/sensirion,shtc1.yaml):
1. blocking (pull the I2C clock line down while performing the measurement) or
non-blocking mode. Blocking mode will guarantee the fastest result but
diff --git a/drivers/hwmon/shtc1.c b/drivers/hwmon/shtc1.c
index 54c240ca66f7..73613c882933 100644
--- a/drivers/hwmon/shtc1.c
+++ b/drivers/hwmon/shtc1.c
@@ -14,7 +14,6 @@
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/ktime.h>
-#include <linux/platform_data/shtc1.h>
#include <linux/of.h>
/* commands (high precision mode) */
@@ -62,7 +61,8 @@ struct shtc1_data {
const unsigned char *command;
unsigned int nonblocking_wait_time; /* in us */
- struct shtc1_platform_data setup;
+ bool blocking_io;
+ bool high_precision;
enum shtcx_chips chip;
int temperature; /* 1000 * temperature in dgr C */
@@ -85,7 +85,7 @@ static int shtc1_update_values(struct i2c_client *client,
* will wait until the data is ready. For non blocking mode, we
* have to wait ourselves.
*/
- if (!data->setup.blocking_io)
+ if (!data->blocking_io)
usleep_range(data->nonblocking_wait_time,
data->nonblocking_wait_time + 1000);
@@ -171,15 +171,15 @@ ATTRIBUTE_GROUPS(shtc1);
static void shtc1_select_command(struct shtc1_data *data)
{
- if (data->setup.high_precision) {
- data->command = data->setup.blocking_io ?
+ if (data->high_precision) {
+ data->command = data->blocking_io ?
shtc1_cmd_measure_blocking_hpm :
shtc1_cmd_measure_nonblocking_hpm;
data->nonblocking_wait_time = (data->chip == shtc1) ?
SHTC1_NONBLOCKING_WAIT_TIME_HPM :
SHTC3_NONBLOCKING_WAIT_TIME_HPM;
} else {
- data->command = data->setup.blocking_io ?
+ data->command = data->blocking_io ?
shtc1_cmd_measure_blocking_lpm :
shtc1_cmd_measure_nonblocking_lpm;
data->nonblocking_wait_time = (data->chip == shtc1) ?
@@ -231,17 +231,14 @@ static int shtc1_probe(struct i2c_client *client)
if (!data)
return -ENOMEM;
- data->setup.blocking_io = false;
- data->setup.high_precision = true;
+ data->blocking_io = false;
+ data->high_precision = true;
data->client = client;
data->chip = chip;
if (np) {
- data->setup.blocking_io = of_property_read_bool(np, "sensirion,blocking-io");
- data->setup.high_precision = !of_property_read_bool(np, "sensirion,low-precision");
- } else {
- if (client->dev.platform_data)
- data->setup = *(struct shtc1_platform_data *)dev->platform_data;
+ data->blocking_io = of_property_read_bool(np, "sensirion,blocking-io");
+ data->high_precision = !of_property_read_bool(np, "sensirion,low-precision");
}
shtc1_select_command(data);
diff --git a/include/linux/platform_data/shtc1.h b/include/linux/platform_data/shtc1.h
deleted file mode 100644
index 5ba6f8f9a9a1..000000000000
--- a/include/linux/platform_data/shtc1.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2014 Sensirion AG, Switzerland
- * Author: Johannes Winkelmann <johannes.winkelmann@sensirion.com>
- */
-
-#ifndef __SHTC1_H_
-#define __SHTC1_H_
-
-struct shtc1_platform_data {
- bool blocking_io;
- bool high_precision;
-};
-#endif /* __SHTC1_H_ */
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 08/10] hwmon: (max197) Remove driver
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (6 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 07/10] hwmon: (shtc1) " Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:02 ` Arnd Bergmann
2026-11-11 9:49 ` Nuno Sá
2026-11-10 18:34 ` [PATCH 09/10] hwmon: (f75375s) Drop platform data support Guenter Roeck
` (2 subsequent siblings)
10 siblings, 2 replies; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck, Nuno Sá
The max197 driver requires platform data providing a convert() callback
function pointer and fails to probe without it. No in-tree platform ever
instantiates max197 or supplies struct max197_platform_data, and there
is no alternative mechanism to access the chip.
Remove the unused driver, its platform_data header file, Kconfig/Makefile
entries, and documentation.
Cc: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Documentation/hwmon/index.rst | 1 -
Documentation/hwmon/max197.rst | 70 ------
drivers/hwmon/Kconfig | 9 -
drivers/hwmon/Makefile | 1 -
drivers/hwmon/max197.c | 341 ---------------------------
include/linux/platform_data/max197.h | 23 --
6 files changed, 445 deletions(-)
delete mode 100644 Documentation/hwmon/max197.rst
delete mode 100644 drivers/hwmon/max197.c
delete mode 100644 include/linux/platform_data/max197.h
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index 7ce1a6f42ddc..e364e051457f 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -168,7 +168,6 @@ Hardware Monitoring Kernel Drivers
max16601
max1668
max17616
- max197
max20730
max20751
max20826
diff --git a/Documentation/hwmon/max197.rst b/Documentation/hwmon/max197.rst
deleted file mode 100644
index 00e16056823f..000000000000
--- a/Documentation/hwmon/max197.rst
+++ /dev/null
@@ -1,70 +0,0 @@
-Kernel driver max197
-====================
-
-Author:
-
- * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
-
-Supported chips:
-
- * Maxim MAX197
-
- Prefix: 'max197'
-
- Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX197.pdf
-
- * Maxim MAX199
-
- Prefix: 'max199'
-
- Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX199.pdf
-
-Description
------------
-
-The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
-12-Bit DAS with 8+4 Bus Interface and Fault Protection.
-
-The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
-while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
-
-Platform data
--------------
-
-The MAX197 platform data (defined in linux/platform_data/max197.h) should be
-filled with a pointer to a conversion function, defined like::
-
- int convert(u8 ctrl);
-
-ctrl is the control byte to write to start a new conversion.
-On success, the function must return the 12-bit raw value read from the chip,
-or a negative error code otherwise.
-
-Control byte format:
-
-======= ========== ============================================
-Bit Name Description
-7,6 PD1,PD0 Clock and Power-Down modes
-5 ACQMOD Internal or External Controlled Acquisition
-4 RNG Full-scale voltage magnitude at the input
-3 BIP Unipolar or Bipolar conversion mode
-2,1,0 A2,A1,A0 Channel
-======= ========== ============================================
-
-Sysfs interface
----------------
-
- ============== ==============================================================
- in[0-7]_input The conversion value for the corresponding channel.
- RO
-
- in[0-7]_min The lower limit (in mV) for the corresponding channel.
- For the MAX197, it will be adjusted to -10000, -5000, or 0.
- For the MAX199, it will be adjusted to -4000, -2000, or 0.
- RW
-
- in[0-7]_max The higher limit (in mV) for the corresponding channel.
- For the MAX197, it will be adjusted to 0, 5000, or 10000.
- For the MAX199, it will be adjusted to 0, 2000, or 4000.
- RW
- ============== ==============================================================
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 9979958a59a2..1612a408c287 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1342,15 +1342,6 @@ config SENSORS_MAX1668
This driver can also be built as a module. If so, the module
will be called max1668.
-config SENSORS_MAX197
- tristate "Maxim MAX197 and compatibles"
- help
- Support for the Maxim MAX197 A/D converter.
- Support will include, but not be limited to, MAX197, and MAX199.
-
- This driver can also be built as a module. If so, the module
- will be called max197.
-
config SENSORS_MAX31722
tristate "MAX31722 temperature sensor"
depends on SPI
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index ec4b0de8cf47..56776df17cfd 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -164,7 +164,6 @@ obj-$(CONFIG_SENSORS_MAX127) += max127.o
obj-$(CONFIG_SENSORS_MAX16065) += max16065.o
obj-$(CONFIG_SENSORS_MAX1619) += max1619.o
obj-$(CONFIG_SENSORS_MAX1668) += max1668.o
-obj-$(CONFIG_SENSORS_MAX197) += max197.o
obj-$(CONFIG_SENSORS_MAX31722) += max31722.o
obj-$(CONFIG_SENSORS_MAX31730) += max31730.o
obj-$(CONFIG_SENSORS_MAX31760) += max31760.o
diff --git a/drivers/hwmon/max197.c b/drivers/hwmon/max197.c
deleted file mode 100644
index a613abfdc2db..000000000000
--- a/drivers/hwmon/max197.c
+++ /dev/null
@@ -1,341 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Maxim MAX197 A/D Converter driver
- *
- * Copyright (c) 2012 Savoir-faire Linux Inc.
- * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
- *
- * For further information, see the Documentation/hwmon/max197.rst file.
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/err.h>
-#include <linux/slab.h>
-#include <linux/mutex.h>
-#include <linux/device.h>
-#include <linux/sysfs.h>
-#include <linux/hwmon.h>
-#include <linux/hwmon-sysfs.h>
-#include <linux/platform_device.h>
-#include <linux/platform_data/max197.h>
-
-#define MAX199_LIMIT 4000 /* 4V */
-#define MAX197_LIMIT 10000 /* 10V */
-
-#define MAX197_NUM_CH 8 /* 8 Analog Input Channels */
-
-/* Control byte format */
-#define MAX197_BIP (1 << 3) /* Bipolarity */
-#define MAX197_RNG (1 << 4) /* Full range */
-
-#define MAX197_SCALE 12207 /* Scale coefficient for raw data */
-
-/* List of supported chips */
-enum max197_chips { max197, max199 };
-
-/**
- * struct max197_data - device instance specific data
- * @pdata: Platform data.
- * @hwmon_dev: The hwmon device.
- * @lock: Read/Write mutex.
- * @limit: Max range value (10V for MAX197, 4V for MAX199).
- * @scale: Need to scale.
- * @ctrl_bytes: Channels control byte.
- */
-struct max197_data {
- struct max197_platform_data *pdata;
- struct device *hwmon_dev;
- struct mutex lock;
- int limit;
- bool scale;
- u8 ctrl_bytes[MAX197_NUM_CH];
-};
-
-static inline void max197_set_unipolarity(struct max197_data *data, int channel)
-{
- data->ctrl_bytes[channel] &= ~MAX197_BIP;
-}
-
-static inline void max197_set_bipolarity(struct max197_data *data, int channel)
-{
- data->ctrl_bytes[channel] |= MAX197_BIP;
-}
-
-static inline void max197_set_half_range(struct max197_data *data, int channel)
-{
- data->ctrl_bytes[channel] &= ~MAX197_RNG;
-}
-
-static inline void max197_set_full_range(struct max197_data *data, int channel)
-{
- data->ctrl_bytes[channel] |= MAX197_RNG;
-}
-
-static inline bool max197_is_bipolar(struct max197_data *data, int channel)
-{
- return data->ctrl_bytes[channel] & MAX197_BIP;
-}
-
-static inline bool max197_is_full_range(struct max197_data *data, int channel)
-{
- return data->ctrl_bytes[channel] & MAX197_RNG;
-}
-
-/* Function called on read access on in{0,1,2,3,4,5,6,7}_{min,max} */
-static ssize_t max197_show_range(struct device *dev,
- struct device_attribute *devattr, char *buf)
-{
- struct max197_data *data = dev_get_drvdata(dev);
- struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
- int channel = attr->index;
- bool is_min = attr->nr;
- int range;
-
- if (mutex_lock_interruptible(&data->lock))
- return -ERESTARTSYS;
-
- range = max197_is_full_range(data, channel) ?
- data->limit : data->limit / 2;
- if (is_min) {
- if (max197_is_bipolar(data, channel))
- range = -range;
- else
- range = 0;
- }
-
- mutex_unlock(&data->lock);
-
- return sprintf(buf, "%d\n", range);
-}
-
-/* Function called on write access on in{0,1,2,3,4,5,6,7}_{min,max} */
-static ssize_t max197_store_range(struct device *dev,
- struct device_attribute *devattr,
- const char *buf, size_t count)
-{
- struct max197_data *data = dev_get_drvdata(dev);
- struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
- int channel = attr->index;
- bool is_min = attr->nr;
- long value;
- int half = data->limit / 2;
- int full = data->limit;
-
- if (kstrtol(buf, 10, &value))
- return -EINVAL;
-
- if (is_min) {
- if (value <= -full)
- value = -full;
- else if (value < 0)
- value = -half;
- else
- value = 0;
- } else {
- if (value >= full)
- value = full;
- else
- value = half;
- }
-
- if (mutex_lock_interruptible(&data->lock))
- return -ERESTARTSYS;
-
- if (value == 0) {
- /* We can deduce only the polarity */
- max197_set_unipolarity(data, channel);
- } else if (value == -half) {
- max197_set_bipolarity(data, channel);
- max197_set_half_range(data, channel);
- } else if (value == -full) {
- max197_set_bipolarity(data, channel);
- max197_set_full_range(data, channel);
- } else if (value == half) {
- /* We can deduce only the range */
- max197_set_half_range(data, channel);
- } else if (value == full) {
- /* We can deduce only the range */
- max197_set_full_range(data, channel);
- }
-
- mutex_unlock(&data->lock);
-
- return count;
-}
-
-/* Function called on read access on in{0,1,2,3,4,5,6,7}_input */
-static ssize_t max197_show_input(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct max197_data *data = dev_get_drvdata(dev);
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- int channel = attr->index;
- s32 value;
- int ret;
-
- if (mutex_lock_interruptible(&data->lock))
- return -ERESTARTSYS;
-
- ret = data->pdata->convert(data->ctrl_bytes[channel]);
- if (ret < 0) {
- dev_err(dev, "conversion failed\n");
- goto unlock;
- }
- value = ret;
-
- /*
- * Coefficient to apply on raw value.
- * See Table 1. Full Scale and Zero Scale in the MAX197 datasheet.
- */
- if (data->scale) {
- value *= MAX197_SCALE;
- if (max197_is_full_range(data, channel))
- value *= 2;
- value /= 10000;
- }
-
- ret = sprintf(buf, "%d\n", value);
-
-unlock:
- mutex_unlock(&data->lock);
- return ret;
-}
-
-static ssize_t name_show(struct device *dev, struct device_attribute *attr,
- char *buf)
-{
- struct platform_device *pdev = to_platform_device(dev);
- return sprintf(buf, "%s\n", pdev->name);
-}
-
-#define MAX197_SENSOR_DEVICE_ATTR_CH(chan) \
- static SENSOR_DEVICE_ATTR(in##chan##_input, S_IRUGO, \
- max197_show_input, NULL, chan); \
- static SENSOR_DEVICE_ATTR_2(in##chan##_min, S_IRUGO | S_IWUSR, \
- max197_show_range, \
- max197_store_range, \
- true, chan); \
- static SENSOR_DEVICE_ATTR_2(in##chan##_max, S_IRUGO | S_IWUSR, \
- max197_show_range, \
- max197_store_range, \
- false, chan)
-
-#define MAX197_SENSOR_DEV_ATTR_IN(chan) \
- &sensor_dev_attr_in##chan##_input.dev_attr.attr, \
- &sensor_dev_attr_in##chan##_max.dev_attr.attr, \
- &sensor_dev_attr_in##chan##_min.dev_attr.attr
-
-static DEVICE_ATTR_RO(name);
-
-MAX197_SENSOR_DEVICE_ATTR_CH(0);
-MAX197_SENSOR_DEVICE_ATTR_CH(1);
-MAX197_SENSOR_DEVICE_ATTR_CH(2);
-MAX197_SENSOR_DEVICE_ATTR_CH(3);
-MAX197_SENSOR_DEVICE_ATTR_CH(4);
-MAX197_SENSOR_DEVICE_ATTR_CH(5);
-MAX197_SENSOR_DEVICE_ATTR_CH(6);
-MAX197_SENSOR_DEVICE_ATTR_CH(7);
-
-static const struct attribute_group max197_sysfs_group = {
- .attrs = (struct attribute *[]) {
- &dev_attr_name.attr,
- MAX197_SENSOR_DEV_ATTR_IN(0),
- MAX197_SENSOR_DEV_ATTR_IN(1),
- MAX197_SENSOR_DEV_ATTR_IN(2),
- MAX197_SENSOR_DEV_ATTR_IN(3),
- MAX197_SENSOR_DEV_ATTR_IN(4),
- MAX197_SENSOR_DEV_ATTR_IN(5),
- MAX197_SENSOR_DEV_ATTR_IN(6),
- MAX197_SENSOR_DEV_ATTR_IN(7),
- NULL
- },
-};
-
-static int max197_probe(struct platform_device *pdev)
-{
- int ch, ret;
- struct max197_data *data;
- struct max197_platform_data *pdata = dev_get_platdata(&pdev->dev);
- enum max197_chips chip = platform_get_device_id(pdev)->driver_data;
-
- if (pdata == NULL) {
- dev_err(&pdev->dev, "no platform data supplied\n");
- return -EINVAL;
- }
-
- if (pdata->convert == NULL) {
- dev_err(&pdev->dev, "no convert function supplied\n");
- return -EINVAL;
- }
-
- data = devm_kzalloc_obj(&pdev->dev, struct max197_data);
- if (!data)
- return -ENOMEM;
-
- data->pdata = pdata;
- mutex_init(&data->lock);
-
- if (chip == max197) {
- data->limit = MAX197_LIMIT;
- data->scale = true;
- } else {
- data->limit = MAX199_LIMIT;
- data->scale = false;
- }
-
- for (ch = 0; ch < MAX197_NUM_CH; ch++)
- data->ctrl_bytes[ch] = (u8) ch;
-
- platform_set_drvdata(pdev, data);
-
- ret = sysfs_create_group(&pdev->dev.kobj, &max197_sysfs_group);
- if (ret) {
- dev_err(&pdev->dev, "sysfs create group failed\n");
- return ret;
- }
-
- data->hwmon_dev = hwmon_device_register(&pdev->dev);
- if (IS_ERR(data->hwmon_dev)) {
- ret = PTR_ERR(data->hwmon_dev);
- dev_err(&pdev->dev, "hwmon device register failed\n");
- goto error;
- }
-
- return 0;
-
-error:
- sysfs_remove_group(&pdev->dev.kobj, &max197_sysfs_group);
- return ret;
-}
-
-static void max197_remove(struct platform_device *pdev)
-{
- struct max197_data *data = platform_get_drvdata(pdev);
-
- hwmon_device_unregister(data->hwmon_dev);
- sysfs_remove_group(&pdev->dev.kobj, &max197_sysfs_group);
-}
-
-static const struct platform_device_id max197_device_ids[] = {
- { .name = "max197", .driver_data = max197 },
- { .name = "max199", .driver_data = max199 },
- { }
-};
-MODULE_DEVICE_TABLE(platform, max197_device_ids);
-
-static struct platform_driver max197_driver = {
- .driver = {
- .name = "max197",
- },
- .probe = max197_probe,
- .remove = max197_remove,
- .id_table = max197_device_ids,
-};
-module_platform_driver(max197_driver);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Savoir-faire Linux Inc. <kernel@savoirfairelinux.com>");
-MODULE_DESCRIPTION("Maxim MAX197 A/D Converter driver");
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h
deleted file mode 100644
index 03ef46f9cd65..000000000000
--- a/include/linux/platform_data/max197.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Maxim MAX197 A/D Converter Driver
- *
- * Copyright (c) 2012 Savoir-faire Linux Inc.
- * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
- *
- * For further information, see the Documentation/hwmon/max197.rst file.
- */
-
-#ifndef _PDATA_MAX197_H
-#define _PDATA_MAX197_H
-
-/**
- * struct max197_platform_data - MAX197 connectivity info
- * @convert: Function used to start a conversion with control byte ctrl.
- * It must return the raw data, or a negative error code.
- */
-struct max197_platform_data {
- int (*convert)(u8 ctrl);
-};
-
-#endif /* _PDATA_MAX197_H */
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 09/10] hwmon: (f75375s) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (7 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:18 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 10/10] hwmon: (ds620) " Guenter Roeck
2026-11-10 19:24 ` [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Arnd Bergmann
10 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck, Riku Voipio
There are no in-tree users of f75375s_platform_data. Initial PWM mode
and enable settings are read from the chip registers during probe, and
both pwm and pwm_enable are configurable through standard hwmon sysfs
attributes.
Drop platform data support from the driver and remove
include/linux/f75375s.h.
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
MAINTAINERS | 1 -
drivers/hwmon/f75375s.c | 94 ++++++++++++++++-------------------------
include/linux/f75375s.h | 21 ---------
3 files changed, 37 insertions(+), 79 deletions(-)
delete mode 100644 include/linux/f75375s.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 15d70b72d9a2..8d103c0b86b7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10415,7 +10415,6 @@ M: Riku Voipio <riku.voipio@iki.fi>
L: linux-hwmon@vger.kernel.org
S: Maintained
F: drivers/hwmon/f75375s.c
-F: include/linux/f75375s.h
FINTEK F81604 USB to 2xCANBUS DEVICE DRIVER
M: Ji-Ze Hong (Peter Hong) <peter_hong@fintek.com.tw>
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index b67a0db680ee..a0c778c5e0a5 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -23,7 +23,6 @@
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/mutex.h>
-#include <linux/f75375s.h>
#include <linux/slab.h>
/* Addresses to scan */
@@ -724,75 +723,56 @@ static const struct attribute_group f75375_group = {
.attrs = f75375_attributes,
};
-static void f75375_init(struct i2c_client *client, struct f75375_data *data,
- struct f75375s_platform_data *f75375s_pdata)
+static void f75375_init(struct i2c_client *client, struct f75375_data *data)
{
+ u8 conf, mode;
int nr;
- if (!f75375s_pdata) {
- u8 conf, mode;
- int nr;
+ conf = f75375_read8(client, F75375_REG_CONFIG1);
+ mode = f75375_read8(client, F75375_REG_FAN_TIMER);
+ for (nr = 0; nr < 2; nr++) {
+ if (data->kind == f75387) {
+ bool manu, duty;
- conf = f75375_read8(client, F75375_REG_CONFIG1);
- mode = f75375_read8(client, F75375_REG_FAN_TIMER);
- for (nr = 0; nr < 2; nr++) {
- if (data->kind == f75387) {
- bool manu, duty;
+ if (!(mode & (1 << F75387_FAN_CTRL_LINEAR(nr))))
+ data->pwm_mode[nr] = 1;
- if (!(mode & (1 << F75387_FAN_CTRL_LINEAR(nr))))
- data->pwm_mode[nr] = 1;
+ manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1);
+ duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1);
+ if (!manu && duty)
+ /* auto, pwm */
+ data->pwm_enable[nr] = 4;
+ else if (manu && !duty)
+ /* manual, speed */
+ data->pwm_enable[nr] = 3;
+ else if (!manu && !duty)
+ /* automatic, speed */
+ data->pwm_enable[nr] = 2;
+ else
+ /* manual, pwm */
+ data->pwm_enable[nr] = 1;
+ } else {
+ if (!(conf & (1 << F75375_FAN_CTRL_LINEAR(nr))))
+ data->pwm_mode[nr] = 1;
- manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1);
- duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1);
- if (!manu && duty)
- /* auto, pwm */
- data->pwm_enable[nr] = 4;
- else if (manu && !duty)
- /* manual, speed */
- data->pwm_enable[nr] = 3;
- else if (!manu && !duty)
- /* automatic, speed */
- data->pwm_enable[nr] = 2;
- else
- /* manual, pwm */
- data->pwm_enable[nr] = 1;
- } else {
- if (!(conf & (1 << F75375_FAN_CTRL_LINEAR(nr))))
- data->pwm_mode[nr] = 1;
-
- switch ((mode >> FAN_CTRL_MODE(nr)) & 3) {
- case 0: /* speed */
- data->pwm_enable[nr] = 3;
- break;
- case 1: /* automatic */
- data->pwm_enable[nr] = 2;
- break;
- default: /* manual */
- data->pwm_enable[nr] = 1;
- break;
- }
+ switch ((mode >> FAN_CTRL_MODE(nr)) & 3) {
+ case 0: /* speed */
+ data->pwm_enable[nr] = 3;
+ break;
+ case 1: /* automatic */
+ data->pwm_enable[nr] = 2;
+ break;
+ default: /* manual */
+ data->pwm_enable[nr] = 1;
+ break;
}
}
- return;
}
-
- set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]);
- set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]);
- for (nr = 0; nr < 2; nr++) {
- if (auto_mode_enabled(f75375s_pdata->pwm_enable[nr]) ||
- !duty_mode_enabled(f75375s_pdata->pwm_enable[nr]))
- continue;
- data->pwm[nr] = clamp_val(f75375s_pdata->pwm[nr], 0, 255);
- f75375_write_pwm(client, nr);
- }
-
}
static int f75375_probe(struct i2c_client *client)
{
struct f75375_data *data;
- struct f75375s_platform_data *f75375s_pdata =
- dev_get_platdata(&client->dev);
int err;
if (!i2c_check_functionality(client->adapter,
@@ -829,7 +809,7 @@ static int f75375_probe(struct i2c_client *client)
goto exit_remove;
}
- f75375_init(client, data, f75375s_pdata);
+ f75375_init(client, data);
return 0;
diff --git a/include/linux/f75375s.h b/include/linux/f75375s.h
deleted file mode 100644
index e99e22500668..000000000000
--- a/include/linux/f75375s.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * f75375s.h - platform data structure for f75375s sensor
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2007, Riku Voipio <riku.voipio@iki.fi>
- */
-
-#ifndef __LINUX_F75375S_H
-#define __LINUX_F75375S_H
-
-/* We want to set fans spinning on systems where there is no
- * BIOS to do that for us */
-struct f75375s_platform_data {
- u8 pwm[2];
- u8 pwm_enable[2];
-};
-
-#endif /* __LINUX_F75375S_H */
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 10/10] hwmon: (ds620) Drop platform data support
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (8 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 09/10] hwmon: (f75375s) Drop platform data support Guenter Roeck
@ 2026-11-10 18:34 ` Guenter Roeck
2026-11-10 19:07 ` Arnd Bergmann
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
10 siblings, 2 replies; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 18:34 UTC (permalink / raw)
To: linux-hwmon; +Cc: Arnd Bergmann, Guenter Roeck, Nuno Sá
There are no in-tree users of ds620_platform_data. Without platform
data, the driver clears PO2 to keep the thermostat output pin low,
which is the default valid configuration.
Drop platform data support from the driver, remove the unused
platform_data header file, and update the driver documentation.
Cc: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Documentation/hwmon/ds620.rst | 12 +-----------
drivers/hwmon/ds620.c | 13 ++-----------
include/linux/platform_data/ds620.h | 22 ----------------------
3 files changed, 3 insertions(+), 44 deletions(-)
delete mode 100644 include/linux/platform_data/ds620.h
diff --git a/Documentation/hwmon/ds620.rst b/Documentation/hwmon/ds620.rst
index e2d915a988a2..6a18ecea5c4f 100644
--- a/Documentation/hwmon/ds620.rst
+++ b/Documentation/hwmon/ds620.rst
@@ -25,14 +25,4 @@ into non-volatile on-chip registers). Temperature range is -55 degree Celsius
to +125. Between 0 and 70 degree Celsius, accuracy is 0.5 Kelvin. The value
returned via sysfs displays post decimal positions.
-The thermostat function works as follows: When configured via platform_data
-(struct ds620_platform_data) .pomode == 0 (default), the thermostat output pin
-PO is always low. If .pomode == 1, the thermostat is in PO_LOW mode. I.e., the
-output pin PO becomes active when the temperature falls below temp1_min and
-stays active until the temperature goes above temp1_max.
-
-Likewise, with .pomode == 2, the thermostat is in PO_HIGH mode. I.e., the PO
-output pin becomes active when the temperature goes above temp1_max and stays
-active until the temperature falls below temp1_min.
-
-The PO output pin of the DS620 operates active-low.
+The thermostat output pin PO is configured to be always low.
diff --git a/drivers/hwmon/ds620.c b/drivers/hwmon/ds620.c
index efb005bedabb..17ae9cc72761 100644
--- a/drivers/hwmon/ds620.c
+++ b/drivers/hwmon/ds620.c
@@ -17,7 +17,6 @@
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
-#include <linux/platform_data/ds620.h>
/*
* Many DS620 constants specified below
@@ -64,7 +63,6 @@ struct ds620_data {
static void ds620_init_client(struct i2c_client *client)
{
- struct ds620_platform_data *ds620_info = dev_get_platdata(&client->dev);
u16 conf, new_conf;
new_conf = conf =
@@ -72,15 +70,8 @@ static void ds620_init_client(struct i2c_client *client)
/* switch to continuous conversion mode */
new_conf &= ~DS620_REG_CONFIG_1SHOT;
- /* already high at power-on, but don't trust the BIOS! */
- new_conf |= DS620_REG_CONFIG_PO2;
- /* thermostat mode according to platform data */
- if (ds620_info && ds620_info->pomode == 1)
- new_conf &= ~DS620_REG_CONFIG_PO1; /* PO_LOW */
- else if (ds620_info && ds620_info->pomode == 2)
- new_conf |= DS620_REG_CONFIG_PO1; /* PO_HIGH */
- else
- new_conf &= ~DS620_REG_CONFIG_PO2; /* always low */
+ /* thermostat output pin always low */
+ new_conf &= ~DS620_REG_CONFIG_PO2;
/* with highest precision */
new_conf |= DS620_REG_CONFIG_R1 | DS620_REG_CONFIG_R0;
diff --git a/include/linux/platform_data/ds620.h b/include/linux/platform_data/ds620.h
deleted file mode 100644
index f0ce22a78bb8..000000000000
--- a/include/linux/platform_data/ds620.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _LINUX_DS620_H
-#define _LINUX_DS620_H
-
-#include <linux/types.h>
-#include <linux/i2c.h>
-
-/* platform data for the DS620 temperature sensor and thermostat */
-
-struct ds620_platform_data {
- /*
- * Thermostat output pin PO mode:
- * 0 = always low (default)
- * 1 = PO_LOW
- * 2 = PO_HIGH
- *
- * (see Documentation/hwmon/ds620.rst)
- */
- int pomode;
-};
-
-#endif /* _LINUX_DS620_H */
--
2.45.2
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH 01/10] hwmon: (ads7828) Drop platform data support
2026-11-10 18:34 ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Guenter Roeck
@ 2026-11-10 18:45 ` Arnd Bergmann
2026-11-10 19:40 ` Guenter Roeck
0 siblings, 1 reply; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 18:45 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> 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>
Acked-by: Arnd Bergmann <arnd@arndb.de>
My patch is almost the same, with two minor differences:
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=board-remove-7.4&id=94ec070cdb5fdfbcd22d5533970423ecaf7b3e4a
> - } else if (dev->of_node) {
> + if (dev->of_node) {
> diff_input = of_property_read_bool(dev->of_node,
> "ti,differential-input");
Since only DT support remains, I removed the check for of_node here,
and also the conditional on the match table:
@@ -199,7 +190,7 @@ MODULE_DEVICE_TABLE(of, ads7828_of_match);
static struct i2c_driver ads7828_driver = {
.driver = {
.name = "ads7828",
- .of_match_table = of_match_ptr(ads7828_of_match),
+ .of_match_table = ads7828_of_match,
},
.id_table = ads7828_device_ids,
I hope to eventually remove all of those, but there is no need
to respin your patch just for that.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/10] hwmon: (emc2305) Drop platform data support
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
@ 2026-11-10 18:56 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 18:56 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users of emc2305_platform_data. Active PWM channel
> count is detected from the chip product ID register, and per-channel PWM
> and thermal cooling parameters are configurable via devicetree child
> nodes.
>
> Move EMC2305_PWM_MAX into the driver, drop platform data support, and
> remove the unused platform_data header file.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Again, your patch is very similar to mine, but yours is a little nicer.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/10] hwmon: (ltc4245) Drop platform data support
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
@ 2026-11-10 18:58 ` Arnd Bergmann
2026-11-11 9:54 ` Nuno Sá
1 sibling, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 18:58 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Nuno Sá
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users of ltc4245_platform_data. Sampling all GPIO
> pins as analog voltages is already configurable via the
> "ltc4245,use-extra-gpios" devicetree property.
>
> Drop platform data support from the driver, remove the unused
> platform_data header file, and update the driver documentation.
>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Mine is the functionally the same, but I missed the documentation
change and did not open-code ltc4245_use_extra_gpios(), so your
version is better.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 07/10] hwmon: (shtc1) Drop platform data support
2026-11-10 18:34 ` [PATCH 07/10] hwmon: (shtc1) " Guenter Roeck
@ 2026-11-10 19:00 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:00 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users of shtc1_platform_data. Blocking I/O and
> measurement precision modes are already configurable via the
> "sensirion,blocking-io" and "sensirion,low-precision" devicetree
> properties.
>
> Move blocking_io and high_precision directly into struct shtc1_data,
> drop platform data support, remove the unused platform_data header file,
> and update the driver documentation.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> if (np) {
> - data->setup.blocking_io = of_property_read_bool(np,
> "sensirion,blocking-io");
> - data->setup.high_precision = !of_property_read_bool(np,
> "sensirion,low-precision");
The only difference in my patch is that I removed the redundant
'if (np) {}' check.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 08/10] hwmon: (max197) Remove driver
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
@ 2026-11-10 19:02 ` Arnd Bergmann
2026-11-11 9:49 ` Nuno Sá
1 sibling, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:02 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Nuno Sá
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> The max197 driver requires platform data providing a convert() callback
> function pointer and fails to probe without it. No in-tree platform ever
> instantiates max197 or supplies struct max197_platform_data, and there
> is no alternative mechanism to access the chip.
>
> Remove the unused driver, its platform_data header file, Kconfig/Makefile
> entries, and documentation.
>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
My patch is identical, though your changelog text is slightly inaccurate,
as there actually was an in-tree user in arch/x86/platform/ts5500/ts5500.c
until linux-7.1.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 10/10] hwmon: (ds620) Drop platform data support
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-11 9:56 ` Nuno Sá
1 sibling, 1 reply; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:07 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Nuno Sá, Roland Stigge
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users of ds620_platform_data. Without platform
> data, the driver clears PO2 to keep the thermostat output pin low,
> which is the default valid configuration.
>
> Drop platform data support from the driver, remove the unused
> platform_data header file, and update the driver documentation.
>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
My patch here was different, as I concluded that this was
likely never used upstream and removed the whole thing.
Your patch looks fine though, so if you want to keep the driver:
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 03/10] hwmon: (g762) Drop platform data support
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
@ 2026-11-10 19:09 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:09 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users of g762_platform_data. All hardware
> parameters configurable through platform data (input clock, fan gear
> mode, PWM polarity, and fan startup voltage) are already configurable
> via devicetree properties.
>
> Drop platform data support and the now-unnecessary CONFIG_OF guards from
> the driver, remove the unused platform_data header file, and update the
> driver documentation.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
My patch is entirely identical except that your changelog text
is a bit nicer.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 04/10] hwmon: (gsc-hwmon) Drop platform data support
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
@ 2026-11-10 19:11 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:11 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Tim Harvey
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users providing gsc_hwmon_platform_data. Channel
> descriptions and the fan controller base address are already obtained
> from devicetree / fwnode properties.
>
> Move enum gsc_hwmon_mode and struct gsc_hwmon_channel into the driver,
> fold the channel array and fan_base into struct gsc_hwmon_data, drop
> platform data support, and remove the unused platform_data header file.
>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
My patch is a little simpler here as I kept the platform_data
definition and just moved it into the .c file, so yours is
a nice cleanup on top.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 06/10] hwmon: (mcp3021) Drop platform data support
2026-11-10 18:34 ` [PATCH 06/10] hwmon: (mcp3021) " Guenter Roeck
@ 2026-11-10 19:12 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:12 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> No in-tree boards supply platform data to the mcp3021 driver. Reference
> voltage is already configurable via the "reference-voltage-microvolt"
> devicetree property, defaulting to 3300 mV otherwise.
>
> Drop platform data handling from mcp3021_probe().
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
but I would suggest including this extra bit from my version:
diff --git a/drivers/hwmon/mcp3021.c b/drivers/hwmon/mcp3021.c
index d6b0ebf27941..b0839b2c2e53 100644
--- a/drivers/hwmon/mcp3021.c
+++ b/drivers/hwmon/mcp3021.c
@@ -183,19 +174,17 @@ static const struct i2c_device_id mcp3021_id[] = {
};
MODULE_DEVICE_TABLE(i2c, mcp3021_id);
-#ifdef CONFIG_OF
static const struct of_device_id of_mcp3021_match[] = {
{ .compatible = "microchip,mcp3021", .data = (void *)mcp3021 },
{ .compatible = "microchip,mcp3221", .data = (void *)mcp3221 },
{ }
};
MODULE_DEVICE_TABLE(of, of_mcp3021_match);
-#endif
static struct i2c_driver mcp3021_driver = {
.driver = {
.name = "mcp3021",
- .of_match_table = of_match_ptr(of_mcp3021_match),
+ .of_match_table = of_mcp3021_match,
},
.probe = mcp3021_probe,
.id_table = mcp3021_id,
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH 09/10] hwmon: (f75375s) Drop platform data support
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
0 siblings, 1 reply; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:18 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Riku Voipio
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> There are no in-tree users of f75375s_platform_data. Initial PWM mode
> and enable settings are read from the chip registers during probe, and
> both pwm and pwm_enable are configurable through standard hwmon sysfs
> attributes.
>
> Drop platform data support from the driver and remove
> include/linux/f75375s.h.
>
> Cc: Riku Voipio <riku.voipio@iki.fi>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Once more, I took a different route here and removed the whole driver.
Here is my explanation:
hwmon: remove unused f75375s
This was used on the iop32x platform but has no references
left in the kernel and has no devicetree support, so there
is no longer a way to use it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Note also that f75375_init() runs into a NULL pointer dereference
when there is no platdata. Your patch fixes this, but I don't
see how this would help anyone.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
` (9 preceding siblings ...)
2026-11-10 18:34 ` [PATCH 10/10] hwmon: (ds620) " Guenter Roeck
@ 2026-11-10 19:24 ` Arnd Bergmann
2026-11-10 19:50 ` Guenter Roeck
10 siblings, 1 reply; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:24 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Tim Harvey, Nuno Sá, Riku Voipio
On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
> Several drivers in drivers/hwmon still support configuration through
> platform data structures even though no in-tree platform or board code
> ever instantiates or supplies that platform data.
>
> Audit all hwmon drivers using dev_get_platdata(), dev->platform_data, or
> headers under include/linux/platform_data/ and drop dead platform data
> support where it is never provided in-tree:
Hi Guenter,
I already commented on the individual patches, and this looks all
ok to me as I did almost exactly the same thing.
Obviously it's a bit unfortunate that we duplicated the work, but
it does give the chance to compare both and find possible mistakes.
My patches are in
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=board-remove-7.4
337dd938a3b0 hwmon: shtc1: remove platform_data based probing
ab1c9ff391ad hwmon: emc2305: remove platform_data based probing
985a7d241616 hwmon: ltc4245: remove platform data probing
8b300deafa72 hwmon: g762: remove pdata based probing
489bafe5cfb8 hwmon: gsc: remove pdata based probing
94ec070cdb5f hwmon: asd7828: remove pdata based probing
296048203f0b hwmon: mcp3021: remove platform_data probe support
93ce98eff9b5 hwmon: remove unused max1111 driver
9d4791700bb8 hwmon: remove unused max197 driver
190ba99436ff hwmon: remove unused ds620 driver
157784eaf3df hwmon: remove unused f75375s
The main difference was that I ended up being a little more
aggressive about removing drivers entirely.
The max1111 driver is technically still used in mainline, but
I remove the last reference from the pxa board files earlier
in that branch.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 01/10] hwmon: (ads7828) Drop platform data support
2026-11-10 18:45 ` Arnd Bergmann
@ 2026-11-10 19:40 ` Guenter Roeck
2026-11-10 19:49 ` Arnd Bergmann
0 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 19:40 UTC (permalink / raw)
To: Arnd Bergmann, linux-hwmon
On 11/10/26 10:45, Arnd Bergmann wrote:
> On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
>> 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>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> My patch is almost the same, with two minor differences:
>
Did you copy me (or linux-hwmon) on your series ? I don't recall seeing it.
Sorry, I didn't mean to duplicate your work. I'll look it up and apply
your patches instead where possible.
Guenter
> https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=board-remove-7.4&id=94ec070cdb5fdfbcd22d5533970423ecaf7b3e4a
>
>> - } else if (dev->of_node) {
>> + if (dev->of_node) {
>> diff_input = of_property_read_bool(dev->of_node,
>> "ti,differential-input");
>
> Since only DT support remains, I removed the check for of_node here,
> and also the conditional on the match table:
>
> @@ -199,7 +190,7 @@ MODULE_DEVICE_TABLE(of, ads7828_of_match);
> static struct i2c_driver ads7828_driver = {
> .driver = {
> .name = "ads7828",
> - .of_match_table = of_match_ptr(ads7828_of_match),
> + .of_match_table = ads7828_of_match,
> },
>
> .id_table = ads7828_device_ids,
>
> I hope to eventually remove all of those, but there is no need
> to respin your patch just for that.
>
> Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 10/10] hwmon: (ds620) Drop platform data support
2026-11-10 19:07 ` Arnd Bergmann
@ 2026-11-10 19:41 ` Guenter Roeck
0 siblings, 0 replies; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 19:41 UTC (permalink / raw)
To: Arnd Bergmann, linux-hwmon; +Cc: Nuno Sá, Roland Stigge
On 11/10/26 11:07, Arnd Bergmann wrote:
> On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
>> There are no in-tree users of ds620_platform_data. Without platform
>> data, the driver clears PO2 to keep the thermostat output pin low,
>> which is the default valid configuration.
>>
>> Drop platform data support from the driver, remove the unused
>> platform_data header file, and update the driver documentation.
>>
>> Cc: Nuno Sá <nuno.sa@analog.com>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>
> My patch here was different, as I concluded that this was
> likely never used upstream and removed the whole thing.
>
> Your patch looks fine though, so if you want to keep the driver:
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
The Analog web site states that the chip is still in production,
so I didn't just want to remove the driver. Let's wait to see
if Nuno has a comment.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 09/10] hwmon: (f75375s) Drop platform data support
2026-11-10 19:18 ` Arnd Bergmann
@ 2026-11-10 19:43 ` Guenter Roeck
0 siblings, 0 replies; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 19:43 UTC (permalink / raw)
To: Arnd Bergmann, linux-hwmon; +Cc: Riku Voipio
On 11/10/26 11:18, Arnd Bergmann wrote:
> On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
>> There are no in-tree users of f75375s_platform_data. Initial PWM mode
>> and enable settings are read from the chip registers during probe, and
>> both pwm and pwm_enable are configurable through standard hwmon sysfs
>> attributes.
>>
>> Drop platform data support from the driver and remove
>> include/linux/f75375s.h.
>>
>> Cc: Riku Voipio <riku.voipio@iki.fi>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>
> Once more, I took a different route here and removed the whole driver.
> Here is my explanation:
>
> hwmon: remove unused f75375s
>
> This was used on the iop32x platform but has no references
> left in the kernel and has no devicetree support, so there
> is no longer a way to use it.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Note also that f75375_init() runs into a NULL pointer dereference
> when there is no platdata. Your patch fixes this, but I don't
> see how this would help anyone.
>
Makes sense. FWIW, I am all for removing drivers, and if this one crashed
without platform data I think we have a good argument for removing it.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 01/10] hwmon: (ads7828) Drop platform data support
2026-11-10 19:40 ` Guenter Roeck
@ 2026-11-10 19:49 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 19:49 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon
On Tue, Nov 10, 2026, at 20:40, Guenter Roeck wrote:
> On 11/10/26 10:45, Arnd Bergmann wrote:
>> On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
>>> 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>
>>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>
>> My patch is almost the same, with two minor differences:
>>
>
> Did you copy me (or linux-hwmon) on your series ? I don't recall seeing it.
> Sorry, I didn't mean to duplicate your work. I'll look it up and apply
> your patches instead where possible.
I have been slow with posting these, so none of the hwmon patches
have made it to the list so far.
My plan was to start with just the board removal in 7.4, and that
is now pushed back to 7.5.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver
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
0 siblings, 1 reply; 31+ messages in thread
From: Guenter Roeck @ 2026-11-10 19:50 UTC (permalink / raw)
To: Arnd Bergmann, linux-hwmon; +Cc: Tim Harvey, Nuno Sá, Riku Voipio
On 11/10/26 11:24, Arnd Bergmann wrote:
> On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
>> Several drivers in drivers/hwmon still support configuration through
>> platform data structures even though no in-tree platform or board code
>> ever instantiates or supplies that platform data.
>>
>> Audit all hwmon drivers using dev_get_platdata(), dev->platform_data, or
>> headers under include/linux/platform_data/ and drop dead platform data
>> support where it is never provided in-tree:
>
> Hi Guenter,
>
> I already commented on the individual patches, and this looks all
> ok to me as I did almost exactly the same thing.
>
> Obviously it's a bit unfortunate that we duplicated the work, but
> it does give the chance to compare both and find possible mistakes.
>
At least on my side it took maybe 30 minutes, so not much time lost.
All I did was to ask Gemini to do the work for me (see the Summary
patch).
> My patches are in
> https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=board-remove-7.4
>
> 337dd938a3b0 hwmon: shtc1: remove platform_data based probing
> ab1c9ff391ad hwmon: emc2305: remove platform_data based probing
> 985a7d241616 hwmon: ltc4245: remove platform data probing
> 8b300deafa72 hwmon: g762: remove pdata based probing
> 489bafe5cfb8 hwmon: gsc: remove pdata based probing
> 94ec070cdb5f hwmon: asd7828: remove pdata based probing
> 296048203f0b hwmon: mcp3021: remove platform_data probe support
> 93ce98eff9b5 hwmon: remove unused max1111 driver
> 9d4791700bb8 hwmon: remove unused max197 driver
> 190ba99436ff hwmon: remove unused ds620 driver
> 157784eaf3df hwmon: remove unused f75375s
>
> The main difference was that I ended up being a little more
> aggressive about removing drivers entirely.
>
> The max1111 driver is technically still used in mainline, but
> I remove the last reference from the pxa board files earlier
> in that branch.
>
I'll look into your patches later and pick the ones I like better
(including the removals).
Again, sorry, I did not intend to duplicate your work.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver
2026-11-10 19:50 ` Guenter Roeck
@ 2026-11-10 20:31 ` Arnd Bergmann
0 siblings, 0 replies; 31+ messages in thread
From: Arnd Bergmann @ 2026-11-10 20:31 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon; +Cc: Tim Harvey, Nuno Sá, Riku Voipio
On Tue, Nov 10, 2026, at 20:50, Guenter Roeck wrote:
> On 11/10/26 11:24, Arnd Bergmann wrote:
>> On Tue, Nov 10, 2026, at 19:34, Guenter Roeck wrote:
>>
>> Obviously it's a bit unfortunate that we duplicated the work, but
>> it does give the chance to compare both and find possible mistakes.
>>
>
> At least on my side it took maybe 30 minutes, so not much time lost.
> All I did was to ask Gemini to do the work for me (see the Summary
> patch).
I probably took me a little longer for these, but I also did 300
patches in total, and a lot of these were more complex.
>> My patches are in
>> https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=board-remove-7.4
>>
>> 337dd938a3b0 hwmon: shtc1: remove platform_data based probing
>> ab1c9ff391ad hwmon: emc2305: remove platform_data based probing
>> 985a7d241616 hwmon: ltc4245: remove platform data probing
>> 8b300deafa72 hwmon: g762: remove pdata based probing
>> 489bafe5cfb8 hwmon: gsc: remove pdata based probing
>> 94ec070cdb5f hwmon: asd7828: remove pdata based probing
>> 296048203f0b hwmon: mcp3021: remove platform_data probe support
>> 93ce98eff9b5 hwmon: remove unused max1111 driver
>> 9d4791700bb8 hwmon: remove unused max197 driver
>> 190ba99436ff hwmon: remove unused ds620 driver
>> 157784eaf3df hwmon: remove unused f75375s
>>
>> The main difference was that I ended up being a little more
>> aggressive about removing drivers entirely.
>>
>> The max1111 driver is technically still used in mainline, but
>> I remove the last reference from the pxa board files earlier
>> in that branch.
>>
>
> I'll look into your patches later and pick the ones I like better
> (including the removals).
>
> Again, sorry, I did not intend to duplicate your work.
No worries, I'm mainly glad to see the patches get merged, no matter
which version. It is very nice to see that we arrived at essentially
the same list of drivers.
Arnd
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 08/10] hwmon: (max197) Remove driver
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
2026-11-10 19:02 ` Arnd Bergmann
@ 2026-11-11 9:49 ` Nuno Sá
1 sibling, 0 replies; 31+ messages in thread
From: Nuno Sá @ 2026-11-11 9:49 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-hwmon, Arnd Bergmann
On Tue, Nov 10, 2026 at 10:34:31AM -0800, Guenter Roeck wrote:
> The max197 driver requires platform data providing a convert() callback
> function pointer and fails to probe without it. No in-tree platform ever
> instantiates max197 or supplies struct max197_platform_data, and there
> is no alternative mechanism to access the chip.
>
> Remove the unused driver, its platform_data header file, Kconfig/Makefile
> entries, and documentation.
>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
This one is still in production but looking at it I agree it would be
not so straight to make this driver usable. Hence,
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> Documentation/hwmon/index.rst | 1 -
> Documentation/hwmon/max197.rst | 70 ------
> drivers/hwmon/Kconfig | 9 -
> drivers/hwmon/Makefile | 1 -
> drivers/hwmon/max197.c | 341 ---------------------------
> include/linux/platform_data/max197.h | 23 --
> 6 files changed, 445 deletions(-)
> delete mode 100644 Documentation/hwmon/max197.rst
> delete mode 100644 drivers/hwmon/max197.c
> delete mode 100644 include/linux/platform_data/max197.h
>
> diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
> index 7ce1a6f42ddc..e364e051457f 100644
> --- a/Documentation/hwmon/index.rst
> +++ b/Documentation/hwmon/index.rst
> @@ -168,7 +168,6 @@ Hardware Monitoring Kernel Drivers
> max16601
> max1668
> max17616
> - max197
> max20730
> max20751
> max20826
> diff --git a/Documentation/hwmon/max197.rst b/Documentation/hwmon/max197.rst
> deleted file mode 100644
> index 00e16056823f..000000000000
> --- a/Documentation/hwmon/max197.rst
> +++ /dev/null
> @@ -1,70 +0,0 @@
> -Kernel driver max197
> -====================
> -
> -Author:
> -
> - * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> -
> -Supported chips:
> -
> - * Maxim MAX197
> -
> - Prefix: 'max197'
> -
> - Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX197.pdf
> -
> - * Maxim MAX199
> -
> - Prefix: 'max199'
> -
> - Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX199.pdf
> -
> -Description
> ------------
> -
> -The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
> -12-Bit DAS with 8+4 Bus Interface and Fault Protection.
> -
> -The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
> -while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
> -
> -Platform data
> --------------
> -
> -The MAX197 platform data (defined in linux/platform_data/max197.h) should be
> -filled with a pointer to a conversion function, defined like::
> -
> - int convert(u8 ctrl);
> -
> -ctrl is the control byte to write to start a new conversion.
> -On success, the function must return the 12-bit raw value read from the chip,
> -or a negative error code otherwise.
> -
> -Control byte format:
> -
> -======= ========== ============================================
> -Bit Name Description
> -7,6 PD1,PD0 Clock and Power-Down modes
> -5 ACQMOD Internal or External Controlled Acquisition
> -4 RNG Full-scale voltage magnitude at the input
> -3 BIP Unipolar or Bipolar conversion mode
> -2,1,0 A2,A1,A0 Channel
> -======= ========== ============================================
> -
> -Sysfs interface
> ----------------
> -
> - ============== ==============================================================
> - in[0-7]_input The conversion value for the corresponding channel.
> - RO
> -
> - in[0-7]_min The lower limit (in mV) for the corresponding channel.
> - For the MAX197, it will be adjusted to -10000, -5000, or 0.
> - For the MAX199, it will be adjusted to -4000, -2000, or 0.
> - RW
> -
> - in[0-7]_max The higher limit (in mV) for the corresponding channel.
> - For the MAX197, it will be adjusted to 0, 5000, or 10000.
> - For the MAX199, it will be adjusted to 0, 2000, or 4000.
> - RW
> - ============== ==============================================================
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index 9979958a59a2..1612a408c287 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -1342,15 +1342,6 @@ config SENSORS_MAX1668
> This driver can also be built as a module. If so, the module
> will be called max1668.
>
> -config SENSORS_MAX197
> - tristate "Maxim MAX197 and compatibles"
> - help
> - Support for the Maxim MAX197 A/D converter.
> - Support will include, but not be limited to, MAX197, and MAX199.
> -
> - This driver can also be built as a module. If so, the module
> - will be called max197.
> -
> config SENSORS_MAX31722
> tristate "MAX31722 temperature sensor"
> depends on SPI
> diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
> index ec4b0de8cf47..56776df17cfd 100644
> --- a/drivers/hwmon/Makefile
> +++ b/drivers/hwmon/Makefile
> @@ -164,7 +164,6 @@ obj-$(CONFIG_SENSORS_MAX127) += max127.o
> obj-$(CONFIG_SENSORS_MAX16065) += max16065.o
> obj-$(CONFIG_SENSORS_MAX1619) += max1619.o
> obj-$(CONFIG_SENSORS_MAX1668) += max1668.o
> -obj-$(CONFIG_SENSORS_MAX197) += max197.o
> obj-$(CONFIG_SENSORS_MAX31722) += max31722.o
> obj-$(CONFIG_SENSORS_MAX31730) += max31730.o
> obj-$(CONFIG_SENSORS_MAX31760) += max31760.o
> diff --git a/drivers/hwmon/max197.c b/drivers/hwmon/max197.c
> deleted file mode 100644
> index a613abfdc2db..000000000000
> --- a/drivers/hwmon/max197.c
> +++ /dev/null
> @@ -1,341 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Maxim MAX197 A/D Converter driver
> - *
> - * Copyright (c) 2012 Savoir-faire Linux Inc.
> - * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> - *
> - * For further information, see the Documentation/hwmon/max197.rst file.
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/init.h>
> -#include <linux/err.h>
> -#include <linux/slab.h>
> -#include <linux/mutex.h>
> -#include <linux/device.h>
> -#include <linux/sysfs.h>
> -#include <linux/hwmon.h>
> -#include <linux/hwmon-sysfs.h>
> -#include <linux/platform_device.h>
> -#include <linux/platform_data/max197.h>
> -
> -#define MAX199_LIMIT 4000 /* 4V */
> -#define MAX197_LIMIT 10000 /* 10V */
> -
> -#define MAX197_NUM_CH 8 /* 8 Analog Input Channels */
> -
> -/* Control byte format */
> -#define MAX197_BIP (1 << 3) /* Bipolarity */
> -#define MAX197_RNG (1 << 4) /* Full range */
> -
> -#define MAX197_SCALE 12207 /* Scale coefficient for raw data */
> -
> -/* List of supported chips */
> -enum max197_chips { max197, max199 };
> -
> -/**
> - * struct max197_data - device instance specific data
> - * @pdata: Platform data.
> - * @hwmon_dev: The hwmon device.
> - * @lock: Read/Write mutex.
> - * @limit: Max range value (10V for MAX197, 4V for MAX199).
> - * @scale: Need to scale.
> - * @ctrl_bytes: Channels control byte.
> - */
> -struct max197_data {
> - struct max197_platform_data *pdata;
> - struct device *hwmon_dev;
> - struct mutex lock;
> - int limit;
> - bool scale;
> - u8 ctrl_bytes[MAX197_NUM_CH];
> -};
> -
> -static inline void max197_set_unipolarity(struct max197_data *data, int channel)
> -{
> - data->ctrl_bytes[channel] &= ~MAX197_BIP;
> -}
> -
> -static inline void max197_set_bipolarity(struct max197_data *data, int channel)
> -{
> - data->ctrl_bytes[channel] |= MAX197_BIP;
> -}
> -
> -static inline void max197_set_half_range(struct max197_data *data, int channel)
> -{
> - data->ctrl_bytes[channel] &= ~MAX197_RNG;
> -}
> -
> -static inline void max197_set_full_range(struct max197_data *data, int channel)
> -{
> - data->ctrl_bytes[channel] |= MAX197_RNG;
> -}
> -
> -static inline bool max197_is_bipolar(struct max197_data *data, int channel)
> -{
> - return data->ctrl_bytes[channel] & MAX197_BIP;
> -}
> -
> -static inline bool max197_is_full_range(struct max197_data *data, int channel)
> -{
> - return data->ctrl_bytes[channel] & MAX197_RNG;
> -}
> -
> -/* Function called on read access on in{0,1,2,3,4,5,6,7}_{min,max} */
> -static ssize_t max197_show_range(struct device *dev,
> - struct device_attribute *devattr, char *buf)
> -{
> - struct max197_data *data = dev_get_drvdata(dev);
> - struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
> - int channel = attr->index;
> - bool is_min = attr->nr;
> - int range;
> -
> - if (mutex_lock_interruptible(&data->lock))
> - return -ERESTARTSYS;
> -
> - range = max197_is_full_range(data, channel) ?
> - data->limit : data->limit / 2;
> - if (is_min) {
> - if (max197_is_bipolar(data, channel))
> - range = -range;
> - else
> - range = 0;
> - }
> -
> - mutex_unlock(&data->lock);
> -
> - return sprintf(buf, "%d\n", range);
> -}
> -
> -/* Function called on write access on in{0,1,2,3,4,5,6,7}_{min,max} */
> -static ssize_t max197_store_range(struct device *dev,
> - struct device_attribute *devattr,
> - const char *buf, size_t count)
> -{
> - struct max197_data *data = dev_get_drvdata(dev);
> - struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
> - int channel = attr->index;
> - bool is_min = attr->nr;
> - long value;
> - int half = data->limit / 2;
> - int full = data->limit;
> -
> - if (kstrtol(buf, 10, &value))
> - return -EINVAL;
> -
> - if (is_min) {
> - if (value <= -full)
> - value = -full;
> - else if (value < 0)
> - value = -half;
> - else
> - value = 0;
> - } else {
> - if (value >= full)
> - value = full;
> - else
> - value = half;
> - }
> -
> - if (mutex_lock_interruptible(&data->lock))
> - return -ERESTARTSYS;
> -
> - if (value == 0) {
> - /* We can deduce only the polarity */
> - max197_set_unipolarity(data, channel);
> - } else if (value == -half) {
> - max197_set_bipolarity(data, channel);
> - max197_set_half_range(data, channel);
> - } else if (value == -full) {
> - max197_set_bipolarity(data, channel);
> - max197_set_full_range(data, channel);
> - } else if (value == half) {
> - /* We can deduce only the range */
> - max197_set_half_range(data, channel);
> - } else if (value == full) {
> - /* We can deduce only the range */
> - max197_set_full_range(data, channel);
> - }
> -
> - mutex_unlock(&data->lock);
> -
> - return count;
> -}
> -
> -/* Function called on read access on in{0,1,2,3,4,5,6,7}_input */
> -static ssize_t max197_show_input(struct device *dev,
> - struct device_attribute *devattr,
> - char *buf)
> -{
> - struct max197_data *data = dev_get_drvdata(dev);
> - struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
> - int channel = attr->index;
> - s32 value;
> - int ret;
> -
> - if (mutex_lock_interruptible(&data->lock))
> - return -ERESTARTSYS;
> -
> - ret = data->pdata->convert(data->ctrl_bytes[channel]);
> - if (ret < 0) {
> - dev_err(dev, "conversion failed\n");
> - goto unlock;
> - }
> - value = ret;
> -
> - /*
> - * Coefficient to apply on raw value.
> - * See Table 1. Full Scale and Zero Scale in the MAX197 datasheet.
> - */
> - if (data->scale) {
> - value *= MAX197_SCALE;
> - if (max197_is_full_range(data, channel))
> - value *= 2;
> - value /= 10000;
> - }
> -
> - ret = sprintf(buf, "%d\n", value);
> -
> -unlock:
> - mutex_unlock(&data->lock);
> - return ret;
> -}
> -
> -static ssize_t name_show(struct device *dev, struct device_attribute *attr,
> - char *buf)
> -{
> - struct platform_device *pdev = to_platform_device(dev);
> - return sprintf(buf, "%s\n", pdev->name);
> -}
> -
> -#define MAX197_SENSOR_DEVICE_ATTR_CH(chan) \
> - static SENSOR_DEVICE_ATTR(in##chan##_input, S_IRUGO, \
> - max197_show_input, NULL, chan); \
> - static SENSOR_DEVICE_ATTR_2(in##chan##_min, S_IRUGO | S_IWUSR, \
> - max197_show_range, \
> - max197_store_range, \
> - true, chan); \
> - static SENSOR_DEVICE_ATTR_2(in##chan##_max, S_IRUGO | S_IWUSR, \
> - max197_show_range, \
> - max197_store_range, \
> - false, chan)
> -
> -#define MAX197_SENSOR_DEV_ATTR_IN(chan) \
> - &sensor_dev_attr_in##chan##_input.dev_attr.attr, \
> - &sensor_dev_attr_in##chan##_max.dev_attr.attr, \
> - &sensor_dev_attr_in##chan##_min.dev_attr.attr
> -
> -static DEVICE_ATTR_RO(name);
> -
> -MAX197_SENSOR_DEVICE_ATTR_CH(0);
> -MAX197_SENSOR_DEVICE_ATTR_CH(1);
> -MAX197_SENSOR_DEVICE_ATTR_CH(2);
> -MAX197_SENSOR_DEVICE_ATTR_CH(3);
> -MAX197_SENSOR_DEVICE_ATTR_CH(4);
> -MAX197_SENSOR_DEVICE_ATTR_CH(5);
> -MAX197_SENSOR_DEVICE_ATTR_CH(6);
> -MAX197_SENSOR_DEVICE_ATTR_CH(7);
> -
> -static const struct attribute_group max197_sysfs_group = {
> - .attrs = (struct attribute *[]) {
> - &dev_attr_name.attr,
> - MAX197_SENSOR_DEV_ATTR_IN(0),
> - MAX197_SENSOR_DEV_ATTR_IN(1),
> - MAX197_SENSOR_DEV_ATTR_IN(2),
> - MAX197_SENSOR_DEV_ATTR_IN(3),
> - MAX197_SENSOR_DEV_ATTR_IN(4),
> - MAX197_SENSOR_DEV_ATTR_IN(5),
> - MAX197_SENSOR_DEV_ATTR_IN(6),
> - MAX197_SENSOR_DEV_ATTR_IN(7),
> - NULL
> - },
> -};
> -
> -static int max197_probe(struct platform_device *pdev)
> -{
> - int ch, ret;
> - struct max197_data *data;
> - struct max197_platform_data *pdata = dev_get_platdata(&pdev->dev);
> - enum max197_chips chip = platform_get_device_id(pdev)->driver_data;
> -
> - if (pdata == NULL) {
> - dev_err(&pdev->dev, "no platform data supplied\n");
> - return -EINVAL;
> - }
> -
> - if (pdata->convert == NULL) {
> - dev_err(&pdev->dev, "no convert function supplied\n");
> - return -EINVAL;
> - }
> -
> - data = devm_kzalloc_obj(&pdev->dev, struct max197_data);
> - if (!data)
> - return -ENOMEM;
> -
> - data->pdata = pdata;
> - mutex_init(&data->lock);
> -
> - if (chip == max197) {
> - data->limit = MAX197_LIMIT;
> - data->scale = true;
> - } else {
> - data->limit = MAX199_LIMIT;
> - data->scale = false;
> - }
> -
> - for (ch = 0; ch < MAX197_NUM_CH; ch++)
> - data->ctrl_bytes[ch] = (u8) ch;
> -
> - platform_set_drvdata(pdev, data);
> -
> - ret = sysfs_create_group(&pdev->dev.kobj, &max197_sysfs_group);
> - if (ret) {
> - dev_err(&pdev->dev, "sysfs create group failed\n");
> - return ret;
> - }
> -
> - data->hwmon_dev = hwmon_device_register(&pdev->dev);
> - if (IS_ERR(data->hwmon_dev)) {
> - ret = PTR_ERR(data->hwmon_dev);
> - dev_err(&pdev->dev, "hwmon device register failed\n");
> - goto error;
> - }
> -
> - return 0;
> -
> -error:
> - sysfs_remove_group(&pdev->dev.kobj, &max197_sysfs_group);
> - return ret;
> -}
> -
> -static void max197_remove(struct platform_device *pdev)
> -{
> - struct max197_data *data = platform_get_drvdata(pdev);
> -
> - hwmon_device_unregister(data->hwmon_dev);
> - sysfs_remove_group(&pdev->dev.kobj, &max197_sysfs_group);
> -}
> -
> -static const struct platform_device_id max197_device_ids[] = {
> - { .name = "max197", .driver_data = max197 },
> - { .name = "max199", .driver_data = max199 },
> - { }
> -};
> -MODULE_DEVICE_TABLE(platform, max197_device_ids);
> -
> -static struct platform_driver max197_driver = {
> - .driver = {
> - .name = "max197",
> - },
> - .probe = max197_probe,
> - .remove = max197_remove,
> - .id_table = max197_device_ids,
> -};
> -module_platform_driver(max197_driver);
> -
> -MODULE_LICENSE("GPL");
> -MODULE_AUTHOR("Savoir-faire Linux Inc. <kernel@savoirfairelinux.com>");
> -MODULE_DESCRIPTION("Maxim MAX197 A/D Converter driver");
> diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h
> deleted file mode 100644
> index 03ef46f9cd65..000000000000
> --- a/include/linux/platform_data/max197.h
> +++ /dev/null
> @@ -1,23 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * Maxim MAX197 A/D Converter Driver
> - *
> - * Copyright (c) 2012 Savoir-faire Linux Inc.
> - * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> - *
> - * For further information, see the Documentation/hwmon/max197.rst file.
> - */
> -
> -#ifndef _PDATA_MAX197_H
> -#define _PDATA_MAX197_H
> -
> -/**
> - * struct max197_platform_data - MAX197 connectivity info
> - * @convert: Function used to start a conversion with control byte ctrl.
> - * It must return the raw data, or a negative error code.
> - */
> -struct max197_platform_data {
> - int (*convert)(u8 ctrl);
> -};
> -
> -#endif /* _PDATA_MAX197_H */
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/10] hwmon: (ltc4245) Drop platform data support
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
2026-11-10 18:58 ` Arnd Bergmann
@ 2026-11-11 9:54 ` Nuno Sá
1 sibling, 0 replies; 31+ messages in thread
From: Nuno Sá @ 2026-11-11 9:54 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-hwmon, Arnd Bergmann
On Tue, Nov 10, 2026 at 10:34:28AM -0800, Guenter Roeck wrote:
> There are no in-tree users of ltc4245_platform_data. Sampling all GPIO
> pins as analog voltages is already configurable via the
> "ltc4245,use-extra-gpios" devicetree property.
>
> Drop platform data support from the driver, remove the unused
> platform_data header file, and update the driver documentation.
>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
Thanks!
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> Documentation/hwmon/ltc4245.rst | 6 ++----
> drivers/hwmon/ltc4245.c | 21 +++------------------
> include/linux/platform_data/ltc4245.h | 17 -----------------
> 3 files changed, 5 insertions(+), 39 deletions(-)
> delete mode 100644 include/linux/platform_data/ltc4245.h
>
> diff --git a/Documentation/hwmon/ltc4245.rst b/Documentation/hwmon/ltc4245.rst
> index 3dafd08a4e87..0c3b823169b9 100644
> --- a/Documentation/hwmon/ltc4245.rst
> +++ b/Documentation/hwmon/ltc4245.rst
> @@ -103,9 +103,7 @@ then they will be sampled in round-robin fashion. If userspace reads too
> slowly, -EAGAIN will be returned when you read the sysfs attribute containing
> the sensor reading.
>
> -The LTC4245 chip can be configured to sample all GPIO pins with two methods:
> -
> -1) platform data -- see include/linux/platform_data/ltc4245.h
> -2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip
> +The LTC4245 chip can be configured to sample all GPIO pins by adding the
> +"ltc4245,use-extra-gpios" OF device tree property to each chip.
>
> The default mode of operation is to sample a single GPIO pin.
> diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
> index e7fcf607a05e..7425c801cfe5 100644
> --- a/drivers/hwmon/ltc4245.c
> +++ b/drivers/hwmon/ltc4245.c
> @@ -19,7 +19,7 @@
> #include <linux/i2c.h>
> #include <linux/hwmon.h>
> #include <linux/jiffies.h>
> -#include <linux/platform_data/ltc4245.h>
> +#include <linux/of.h>
>
> /* Here are names of the chip's registers (a.k.a. commands) */
> enum ltc4245_cmd {
> @@ -418,22 +418,6 @@ static const struct hwmon_chip_info ltc4245_chip_info = {
> .info = ltc4245_info,
> };
>
> -static bool ltc4245_use_extra_gpios(struct i2c_client *client)
> -{
> - struct ltc4245_platform_data *pdata = dev_get_platdata(&client->dev);
> - struct device_node *np = client->dev.of_node;
> -
> - /* prefer platform data */
> - if (pdata)
> - return pdata->use_extra_gpios;
> -
> - /* fallback on OF */
> - if (of_property_read_bool(np, "ltc4245,use-extra-gpios"))
> - return true;
> -
> - return false;
> -}
> -
> static int ltc4245_probe(struct i2c_client *client)
> {
> struct i2c_adapter *adapter = client->adapter;
> @@ -448,7 +432,8 @@ static int ltc4245_probe(struct i2c_client *client)
> return -ENOMEM;
>
> data->client = client;
> - data->use_extra_gpios = ltc4245_use_extra_gpios(client);
> + data->use_extra_gpios = of_property_read_bool(client->dev.of_node,
> + "ltc4245,use-extra-gpios");
>
> /* Initialize the LTC4245 chip */
> i2c_smbus_write_byte_data(client, LTC4245_FAULT1, 0x00);
> diff --git a/include/linux/platform_data/ltc4245.h b/include/linux/platform_data/ltc4245.h
> deleted file mode 100644
> index f07fa05ea6c4..000000000000
> --- a/include/linux/platform_data/ltc4245.h
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * Platform Data for LTC4245 hardware monitor chip
> - *
> - * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
> - */
> -
> -#ifndef LINUX_LTC4245_H
> -#define LINUX_LTC4245_H
> -
> -#include <linux/types.h>
> -
> -struct ltc4245_platform_data {
> - bool use_extra_gpios;
> -};
> -
> -#endif /* LINUX_LTC4245_H */
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 10/10] hwmon: (ds620) Drop platform data support
2026-11-10 18:34 ` [PATCH 10/10] hwmon: (ds620) " Guenter Roeck
2026-11-10 19:07 ` Arnd Bergmann
@ 2026-11-11 9:56 ` Nuno Sá
1 sibling, 0 replies; 31+ messages in thread
From: Nuno Sá @ 2026-11-11 9:56 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-hwmon, Arnd Bergmann
On Tue, Nov 10, 2026 at 10:34:33AM -0800, Guenter Roeck wrote:
> There are no in-tree users of ds620_platform_data. Without platform
> data, the driver clears PO2 to keep the thermostat output pin low,
> which is the default valid configuration.
>
> Drop platform data support from the driver, remove the unused
> platform_data header file, and update the driver documentation.
>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
For whatever patch you end up applying...
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> Documentation/hwmon/ds620.rst | 12 +-----------
> drivers/hwmon/ds620.c | 13 ++-----------
> include/linux/platform_data/ds620.h | 22 ----------------------
> 3 files changed, 3 insertions(+), 44 deletions(-)
> delete mode 100644 include/linux/platform_data/ds620.h
>
> diff --git a/Documentation/hwmon/ds620.rst b/Documentation/hwmon/ds620.rst
> index e2d915a988a2..6a18ecea5c4f 100644
> --- a/Documentation/hwmon/ds620.rst
> +++ b/Documentation/hwmon/ds620.rst
> @@ -25,14 +25,4 @@ into non-volatile on-chip registers). Temperature range is -55 degree Celsius
> to +125. Between 0 and 70 degree Celsius, accuracy is 0.5 Kelvin. The value
> returned via sysfs displays post decimal positions.
>
> -The thermostat function works as follows: When configured via platform_data
> -(struct ds620_platform_data) .pomode == 0 (default), the thermostat output pin
> -PO is always low. If .pomode == 1, the thermostat is in PO_LOW mode. I.e., the
> -output pin PO becomes active when the temperature falls below temp1_min and
> -stays active until the temperature goes above temp1_max.
> -
> -Likewise, with .pomode == 2, the thermostat is in PO_HIGH mode. I.e., the PO
> -output pin becomes active when the temperature goes above temp1_max and stays
> -active until the temperature falls below temp1_min.
> -
> -The PO output pin of the DS620 operates active-low.
> +The thermostat output pin PO is configured to be always low.
> diff --git a/drivers/hwmon/ds620.c b/drivers/hwmon/ds620.c
> index efb005bedabb..17ae9cc72761 100644
> --- a/drivers/hwmon/ds620.c
> +++ b/drivers/hwmon/ds620.c
> @@ -17,7 +17,6 @@
> #include <linux/err.h>
> #include <linux/mutex.h>
> #include <linux/sysfs.h>
> -#include <linux/platform_data/ds620.h>
>
> /*
> * Many DS620 constants specified below
> @@ -64,7 +63,6 @@ struct ds620_data {
>
> static void ds620_init_client(struct i2c_client *client)
> {
> - struct ds620_platform_data *ds620_info = dev_get_platdata(&client->dev);
> u16 conf, new_conf;
>
> new_conf = conf =
> @@ -72,15 +70,8 @@ static void ds620_init_client(struct i2c_client *client)
>
> /* switch to continuous conversion mode */
> new_conf &= ~DS620_REG_CONFIG_1SHOT;
> - /* already high at power-on, but don't trust the BIOS! */
> - new_conf |= DS620_REG_CONFIG_PO2;
> - /* thermostat mode according to platform data */
> - if (ds620_info && ds620_info->pomode == 1)
> - new_conf &= ~DS620_REG_CONFIG_PO1; /* PO_LOW */
> - else if (ds620_info && ds620_info->pomode == 2)
> - new_conf |= DS620_REG_CONFIG_PO1; /* PO_HIGH */
> - else
> - new_conf &= ~DS620_REG_CONFIG_PO2; /* always low */
> + /* thermostat output pin always low */
> + new_conf &= ~DS620_REG_CONFIG_PO2;
> /* with highest precision */
> new_conf |= DS620_REG_CONFIG_R1 | DS620_REG_CONFIG_R0;
>
> diff --git a/include/linux/platform_data/ds620.h b/include/linux/platform_data/ds620.h
> deleted file mode 100644
> index f0ce22a78bb8..000000000000
> --- a/include/linux/platform_data/ds620.h
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef _LINUX_DS620_H
> -#define _LINUX_DS620_H
> -
> -#include <linux/types.h>
> -#include <linux/i2c.h>
> -
> -/* platform data for the DS620 temperature sensor and thermostat */
> -
> -struct ds620_platform_data {
> - /*
> - * Thermostat output pin PO mode:
> - * 0 = always low (default)
> - * 1 = PO_LOW
> - * 2 = PO_HIGH
> - *
> - * (see Documentation/hwmon/ds620.rst)
> - */
> - int pomode;
> -};
> -
> -#endif /* _LINUX_DS620_H */
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2026-11-11 9:57 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
2026-11-10 18:34 ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Guenter Roeck
2026-11-10 18:45 ` Arnd Bergmann
2026-11-10 19:40 ` Guenter Roeck
2026-11-10 19:49 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
2026-11-10 18:56 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
2026-11-10 19:09 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
2026-11-10 19:11 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
2026-11-10 18:58 ` Arnd Bergmann
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-10 18:34 ` [PATCH 07/10] hwmon: (shtc1) " Guenter Roeck
2026-11-10 19:00 ` Arnd Bergmann
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
2026-11-10 19:02 ` Arnd Bergmann
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-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-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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox