public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] i2c: Remove I2C_CLASS_SPD
@ 2024-04-15 20:47 Heiner Kallweit
  2024-04-15 20:47 ` [PATCH 1/4] i2c: i801: Remove usage of I2C_CLASS_SPD Heiner Kallweit
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Heiner Kallweit @ 2024-04-15 20:47 UTC (permalink / raw)
  To: Andi Shyti, Jean Delvare, Wolfram Sang, Peter Korsgaard,
	Peter Rosin, Guenter Roeck
  Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org

Only remaining client driver supporting I2C_CLASS_SPD is jc42. This
type of thermal sensor can be found on several DDR3/DDR4 modules.
i2c_register_spd() instantiates also such thermal sensor i2c devices.
Since 71b494e043d2 ("i2c: i801: Call i2c_register_spd for muxed child
segments") i2c_register_spd() is called also for the remaining use case,
systems with muxed SMBUS segments for SPD EEPROMs. i801 was the last
bus driver supporting I2C_CLASS_SPD.
Therefore I2C_CLASS_SPD class-based instantiation isn't needed any longer,
and we can remove it completely.

I propose to handle this series via the I2C tree.

Heiner Kallweit (4):
  i2c: i801: Remove usage of I2C_CLASS_SPD
  i2c: mux: gpio: remove support for class-based device instantiation
  hwmon: jc42: Remove I2C_CLASS_SPD support
  i2c: Remove I2C_CLASS_SPD

 drivers/hwmon/jc42.c                       | 2 +-
 drivers/i2c/busses/i2c-i801.c              | 4 ----
 drivers/i2c/muxes/i2c-mux-gpio.c           | 3 +--
 include/linux/i2c.h                        | 1 -
 include/linux/platform_data/i2c-mux-gpio.h | 2 --
 5 files changed, 2 insertions(+), 10 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] i2c: i801: Remove usage of I2C_CLASS_SPD
  2024-04-15 20:47 [PATCH 0/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
@ 2024-04-15 20:47 ` Heiner Kallweit
  2024-04-15 20:48 ` [PATCH 2/4] i2c: mux: gpio: remove support for class-based device instantiation Heiner Kallweit
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Heiner Kallweit @ 2024-04-15 20:47 UTC (permalink / raw)
  To: Andi Shyti, Jean Delvare, Wolfram Sang, Peter Korsgaard,
	Peter Rosin, Guenter Roeck
  Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org

Only remaining client driver supporting I2C_CLASS_SPD is jc42. This
type of thermal sensor can be found on several DDR3/DDR4 modules.
i2c_register_spd() instantiates also such thermal sensor i2c devices.
Since 71b494e043d2 ("i2c: i801: Call i2c_register_spd for muxed child
segments") i2c_register_spd() is called also for the remaining use case,
systems with muxed SMBUS segments for SPD EEPROMs.
Therefore I2C_CLASS_SPD class-based instantiation isn't needed any longer
in this driver, so remove it.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/i2c/busses/i2c-i801.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ab17e76e3..e577abc77 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -264,7 +264,6 @@ struct i801_mux_config {
 	char *gpio_chip;
 	unsigned values[3];
 	int n_values;
-	unsigned classes[3];
 	unsigned gpios[2];		/* Relative to gpio_chip->base */
 	int n_gpios;
 };
@@ -1315,7 +1314,6 @@ static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
 	.gpio_chip = "gpio_ich",
 	.values = { 0x02, 0x03 },
 	.n_values = 2,
-	.classes = { I2C_CLASS_SPD, I2C_CLASS_SPD },
 	.gpios = { 52, 53 },
 	.n_gpios = 2,
 };
@@ -1324,7 +1322,6 @@ static struct i801_mux_config i801_mux_config_asus_z8_d18 = {
 	.gpio_chip = "gpio_ich",
 	.values = { 0x02, 0x03, 0x01 },
 	.n_values = 3,
-	.classes = { I2C_CLASS_SPD, I2C_CLASS_SPD, I2C_CLASS_SPD },
 	.gpios = { 52, 53 },
 	.n_gpios = 2,
 };
@@ -1434,7 +1431,6 @@ static void i801_add_mux(struct i801_priv *priv)
 	gpio_data.parent = priv->adapter.nr;
 	gpio_data.values = mux_config->values;
 	gpio_data.n_values = mux_config->n_values;
-	gpio_data.classes = mux_config->classes;
 	gpio_data.idle = I2C_MUX_GPIO_NO_IDLE;
 
 	/* Register GPIO descriptor lookup table */
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] i2c: mux: gpio: remove support for class-based device instantiation
  2024-04-15 20:47 [PATCH 0/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
  2024-04-15 20:47 ` [PATCH 1/4] i2c: i801: Remove usage of I2C_CLASS_SPD Heiner Kallweit
@ 2024-04-15 20:48 ` Heiner Kallweit
  2024-04-15 20:49 ` [PATCH 3/4] hwmon: jc42: Remove I2C_CLASS_SPD support Heiner Kallweit
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Heiner Kallweit @ 2024-04-15 20:48 UTC (permalink / raw)
  To: Andi Shyti, Jean Delvare, Wolfram Sang, Peter Korsgaard,
	Peter Rosin, Guenter Roeck
  Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org

i801 as only user of gpio i2c mux removed support for class-based device
instantiation on muxed busses. Class-based device instantiation is a
legacy mechanism and shouldn't be used in new code, therefore remove
support also here.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/i2c/muxes/i2c-mux-gpio.c           | 3 +--
 include/linux/platform_data/i2c-mux-gpio.h | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 6b979a0a6..0fbb33a3d 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -206,9 +206,8 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
 
 	for (i = 0; i < mux->data.n_values; i++) {
 		u32 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0;
-		unsigned int class = mux->data.classes ? mux->data.classes[i] : 0;
 
-		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class);
+		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], 0);
 		if (ret)
 			goto add_adapter_failed;
 	}
diff --git a/include/linux/platform_data/i2c-mux-gpio.h b/include/linux/platform_data/i2c-mux-gpio.h
index 5e4c2c272..816a4cd3c 100644
--- a/include/linux/platform_data/i2c-mux-gpio.h
+++ b/include/linux/platform_data/i2c-mux-gpio.h
@@ -18,7 +18,6 @@
  * @values: Array of bitmasks of GPIO settings (low/high) for each
  *	position
  * @n_values: Number of multiplexer positions (busses to instantiate)
- * @classes: Optional I2C auto-detection classes
  * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
  */
 struct i2c_mux_gpio_platform_data {
@@ -26,7 +25,6 @@ struct i2c_mux_gpio_platform_data {
 	int base_nr;
 	const unsigned *values;
 	int n_values;
-	const unsigned *classes;
 	unsigned idle;
 };
 
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] hwmon: jc42: Remove I2C_CLASS_SPD support
  2024-04-15 20:47 [PATCH 0/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
  2024-04-15 20:47 ` [PATCH 1/4] i2c: i801: Remove usage of I2C_CLASS_SPD Heiner Kallweit
  2024-04-15 20:48 ` [PATCH 2/4] i2c: mux: gpio: remove support for class-based device instantiation Heiner Kallweit
@ 2024-04-15 20:49 ` Heiner Kallweit
  2024-04-15 21:43   ` Guenter Roeck
  2024-04-15 20:50 ` [PATCH 4/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
  2024-04-16 22:46 ` (subset) [PATCH 0/4] " Andi Shyti
  4 siblings, 1 reply; 9+ messages in thread
From: Heiner Kallweit @ 2024-04-15 20:49 UTC (permalink / raw)
  To: Andi Shyti, Jean Delvare, Wolfram Sang, Peter Korsgaard,
	Peter Rosin, Guenter Roeck
  Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org

Last host driver supporting I2C_CLASS_SPD was i801. Now that I2C_CLASS_SPD
support has been removed there, we can remove it here too.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/hwmon/jc42.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 75dc25df0..a00168fe5 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -623,7 +623,7 @@ MODULE_DEVICE_TABLE(of, jc42_of_ids);
 #endif
 
 static struct i2c_driver jc42_driver = {
-	.class		= I2C_CLASS_SPD | I2C_CLASS_HWMON,
+	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "jc42",
 		.pm = JC42_DEV_PM_OPS,
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] i2c: Remove I2C_CLASS_SPD
  2024-04-15 20:47 [PATCH 0/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
                   ` (2 preceding siblings ...)
  2024-04-15 20:49 ` [PATCH 3/4] hwmon: jc42: Remove I2C_CLASS_SPD support Heiner Kallweit
@ 2024-04-15 20:50 ` Heiner Kallweit
  2024-04-17  8:05   ` Andi Shyti
  2024-04-16 22:46 ` (subset) [PATCH 0/4] " Andi Shyti
  4 siblings, 1 reply; 9+ messages in thread
From: Heiner Kallweit @ 2024-04-15 20:50 UTC (permalink / raw)
  To: Andi Shyti, Jean Delvare, Wolfram Sang, Peter Korsgaard,
	Peter Rosin, Guenter Roeck
  Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org

Remove this class after all users have been gone.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 include/linux/i2c.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5e6cd43a6..970953737 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -852,7 +852,6 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap)
 
 /* i2c adapter classes (bitmask) */
 #define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
-#define I2C_CLASS_SPD		(1<<7)	/* Memory modules */
 /* Warn users that the adapter doesn't support classes anymore */
 #define I2C_CLASS_DEPRECATED	(1<<8)
 
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] hwmon: jc42: Remove I2C_CLASS_SPD support
  2024-04-15 20:49 ` [PATCH 3/4] hwmon: jc42: Remove I2C_CLASS_SPD support Heiner Kallweit
@ 2024-04-15 21:43   ` Guenter Roeck
  0 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2024-04-15 21:43 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andi Shyti, Jean Delvare, Wolfram Sang, Peter Korsgaard,
	Peter Rosin, linux-i2c@vger.kernel.org,
	linux-hwmon@vger.kernel.org

On Mon, Apr 15, 2024 at 10:49:35PM +0200, Heiner Kallweit wrote:
> Last host driver supporting I2C_CLASS_SPD was i801. Now that I2C_CLASS_SPD
> support has been removed there, we can remove it here too.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied to hwmon-next.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (subset) [PATCH 0/4] i2c: Remove I2C_CLASS_SPD
  2024-04-15 20:47 [PATCH 0/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
                   ` (3 preceding siblings ...)
  2024-04-15 20:50 ` [PATCH 4/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
@ 2024-04-16 22:46 ` Andi Shyti
  4 siblings, 0 replies; 9+ messages in thread
From: Andi Shyti @ 2024-04-16 22:46 UTC (permalink / raw)
  To: Jean Delvare, Peter Korsgaard, Peter Rosin, Guenter Roeck,
	Wolfram Sang, Heiner Kallweit
  Cc: linux-i2c, linux-hwmon

Hi

On Mon, 15 Apr 2024 22:47:04 +0200, Heiner Kallweit wrote:
> Only remaining client driver supporting I2C_CLASS_SPD is jc42. This
> type of thermal sensor can be found on several DDR3/DDR4 modules.
> i2c_register_spd() instantiates also such thermal sensor i2c devices.
> Since 71b494e043d2 ("i2c: i801: Call i2c_register_spd for muxed child
> segments") i2c_register_spd() is called also for the remaining use case,
> systems with muxed SMBUS segments for SPD EEPROMs. i801 was the last
> bus driver supporting I2C_CLASS_SPD.
> Therefore I2C_CLASS_SPD class-based instantiation isn't needed any longer,
> and we can remove it completely.
> 
> [...]

Applied to i2c/i2c-host on

git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

Thank you,
Andi

Patches applied
===============
[1/4] i2c: i801: Remove usage of I2C_CLASS_SPD
      commit: 8bae811210b77e2cd1b62d9fb20d2e6126103135
[2/4] i2c: mux: gpio: remove support for class-based device instantiation
      commit: 1dfb192a687fded0f5e92518024baa673c297885
[4/4] i2c: Remove I2C_CLASS_SPD
      commit: f7ece6320f6f028873649b9aa836c5bc5abf2cb3


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] i2c: Remove I2C_CLASS_SPD
  2024-04-15 20:50 ` [PATCH 4/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
@ 2024-04-17  8:05   ` Andi Shyti
  2024-04-17 10:27     ` Heiner Kallweit
  0 siblings, 1 reply; 9+ messages in thread
From: Andi Shyti @ 2024-04-17  8:05 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Jean Delvare, Wolfram Sang, Peter Korsgaard, Peter Rosin,
	Guenter Roeck, linux-i2c@vger.kernel.org,
	linux-hwmon@vger.kernel.org

Hi Heiner and Guenter,

On Mon, Apr 15, 2024 at 10:50:27PM +0200, Heiner Kallweit wrote:
> Remove this class after all users have been gone.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  include/linux/i2c.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index 5e6cd43a6..970953737 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -852,7 +852,6 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap)
>  
>  /* i2c adapter classes (bitmask) */
>  #define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
> -#define I2C_CLASS_SPD		(1<<7)	/* Memory modules */

I missed the fact that we need some synchronization, as I'm
getting a build failure.

I will revert this and apply it after Guenter has merged his part
into the mainline.

Guenter, if you have a spare Post-it, could you please note to CC
me when this part is sent as a pull request?

Andi

>  /* Warn users that the adapter doesn't support classes anymore */
>  #define I2C_CLASS_DEPRECATED	(1<<8)
>  
> -- 
> 2.44.0
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] i2c: Remove I2C_CLASS_SPD
  2024-04-17  8:05   ` Andi Shyti
@ 2024-04-17 10:27     ` Heiner Kallweit
  0 siblings, 0 replies; 9+ messages in thread
From: Heiner Kallweit @ 2024-04-17 10:27 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Jean Delvare, Wolfram Sang, Peter Korsgaard, Peter Rosin,
	Guenter Roeck, linux-i2c@vger.kernel.org,
	linux-hwmon@vger.kernel.org

On Wed, Apr 17, 2024 at 10:05 AM Andi Shyti <andi.shyti@kernel.org> wrote:
>
> Hi Heiner and Guenter,
>
> On Mon, Apr 15, 2024 at 10:50:27PM +0200, Heiner Kallweit wrote:
> > Remove this class after all users have been gone.
> >
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> > ---
> >  include/linux/i2c.h | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> > index 5e6cd43a6..970953737 100644
> > --- a/include/linux/i2c.h
> > +++ b/include/linux/i2c.h
> > @@ -852,7 +852,6 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap)
> >
> >  /* i2c adapter classes (bitmask) */
> >  #define I2C_CLASS_HWMON              (1<<0)  /* lm_sensors, ... */
> > -#define I2C_CLASS_SPD                (1<<7)  /* Memory modules */
>
> I missed the fact that we need some synchronization, as I'm
> getting a build failure.
>
> I will revert this and apply it after Guenter has merged his part
> into the mainline.
>
In order to cope with this dependency I proposed in the cover letter
to handle the full series via i2c tree. With Guenter's Ab for the
hwmon patch. Maybe this can still be done as an alternative.
Whatever is easier for both of you.

> Guenter, if you have a spare Post-it, could you please note to CC
> me when this part is sent as a pull request?
>
> Andi
>
> >  /* Warn users that the adapter doesn't support classes anymore */
> >  #define I2C_CLASS_DEPRECATED (1<<8)
> >
> > --
> > 2.44.0
> >
> >

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-17 10:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 20:47 [PATCH 0/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
2024-04-15 20:47 ` [PATCH 1/4] i2c: i801: Remove usage of I2C_CLASS_SPD Heiner Kallweit
2024-04-15 20:48 ` [PATCH 2/4] i2c: mux: gpio: remove support for class-based device instantiation Heiner Kallweit
2024-04-15 20:49 ` [PATCH 3/4] hwmon: jc42: Remove I2C_CLASS_SPD support Heiner Kallweit
2024-04-15 21:43   ` Guenter Roeck
2024-04-15 20:50 ` [PATCH 4/4] i2c: Remove I2C_CLASS_SPD Heiner Kallweit
2024-04-17  8:05   ` Andi Shyti
2024-04-17 10:27     ` Heiner Kallweit
2024-04-16 22:46 ` (subset) [PATCH 0/4] " Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox