From: Guenter Roeck <linux@roeck-us.net>
To: linux-hwmon@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 07/10] hwmon: (shtc1) Drop platform data support
Date: Tue, 10 Nov 2026 10:34:30 -0800 [thread overview]
Message-ID: <20261110183434.181711-8-linux@roeck-us.net> (raw)
In-Reply-To: <20261110183434.181711-1-linux@roeck-us.net>
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
next prev parent reply other threads:[~2026-11-10 18:35 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
2026-11-10 18:34 ` [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-12 18:25 ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
2026-11-10 18:56 ` Arnd Bergmann
2026-11-12 19:06 ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
2026-11-10 19:09 ` Arnd Bergmann
2026-11-12 19:08 ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
2026-11-10 19:11 ` Arnd Bergmann
2026-11-12 19:09 ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
2026-11-10 18:58 ` Arnd Bergmann
2026-11-12 19:11 ` Guenter Roeck
2026-11-11 9:54 ` Nuno Sá
2026-11-10 18:34 ` [PATCH 06/10] hwmon: (mcp3021) " Guenter Roeck
2026-11-10 19:12 ` Arnd Bergmann
2026-11-12 19:14 ` Guenter Roeck
2026-11-10 18:34 ` Guenter Roeck [this message]
2026-11-10 19:00 ` [PATCH 07/10] hwmon: (shtc1) " Arnd Bergmann
2026-11-12 19:18 ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
2026-11-10 19:02 ` Arnd Bergmann
2026-11-12 19:22 ` Guenter Roeck
2026-11-11 9:49 ` Nuno Sá
2026-11-10 18:34 ` [PATCH 09/10] hwmon: (f75375s) Drop platform data support Guenter Roeck
2026-11-10 19:18 ` Arnd Bergmann
2026-11-10 19:43 ` Guenter Roeck
2026-11-12 19:25 ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 10/10] hwmon: (ds620) " Guenter Roeck
2026-11-10 19:07 ` Arnd Bergmann
2026-11-10 19:41 ` Guenter Roeck
2026-11-12 19:29 ` Guenter Roeck
2026-11-11 9:56 ` Nuno Sá
2026-11-10 19:24 ` [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Arnd Bergmann
2026-11-10 19:50 ` Guenter Roeck
2026-11-10 20:31 ` Arnd Bergmann
2026-11-12 19:31 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110183434.181711-8-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=arnd@arndb.de \
--cc=linux-hwmon@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox