* [PATCH] i2c: mux: reg: Remove class-based device auto-detection support
@ 2023-11-08 6:38 Heiner Kallweit
2023-12-19 21:44 ` Heiner Kallweit
2023-12-20 20:45 ` Wolfram Sang
0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2023-11-08 6:38 UTC (permalink / raw)
To: Peter Rosin; +Cc: linux-i2c@vger.kernel.org
Legacy class-based device auto-detection shouldn't be used in new code.
Therefore remove support in i2c-mux-reg as long as we don't have a
user of this feature yet.
Link: https://lore.kernel.org/linux-i2c/a22978a4-88e4-46f4-b71c-032b22321599@gmail.com/
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/i2c/muxes/i2c-mux-reg.c | 4 +---
include/linux/platform_data/i2c-mux-reg.h | 2 --
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index 9efc1ed01..8489971ba 100644
--- a/drivers/i2c/muxes/i2c-mux-reg.c
+++ b/drivers/i2c/muxes/i2c-mux-reg.c
@@ -159,7 +159,6 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
struct regmux *mux;
struct i2c_adapter *parent;
struct resource *res;
- unsigned int class;
int i, ret, nr;
mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL);
@@ -213,9 +212,8 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
for (i = 0; i < mux->data.n_values; i++) {
nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0;
- 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 err_del_mux_adapters;
}
diff --git a/include/linux/platform_data/i2c-mux-reg.h b/include/linux/platform_data/i2c-mux-reg.h
index 2543c2a1c..e2e895768 100644
--- a/include/linux/platform_data/i2c-mux-reg.h
+++ b/include/linux/platform_data/i2c-mux-reg.h
@@ -17,7 +17,6 @@
* @n_values: Number of multiplexer channels
* @little_endian: Indicating if the register is in little endian
* @write_only: Reading the register is not allowed by hardware
- * @classes: Optional I2C auto-detection classes
* @idle: Value to write to mux when idle
* @idle_in_use: indicate if idle value is in use
* @reg: Virtual address of the register to switch channel
@@ -30,7 +29,6 @@ struct i2c_mux_reg_platform_data {
int n_values;
bool little_endian;
bool write_only;
- const unsigned int *classes;
u32 idle;
bool idle_in_use;
void __iomem *reg;
--
2.42.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: mux: reg: Remove class-based device auto-detection support
2023-11-08 6:38 [PATCH] i2c: mux: reg: Remove class-based device auto-detection support Heiner Kallweit
@ 2023-12-19 21:44 ` Heiner Kallweit
2023-12-20 20:45 ` Wolfram Sang
1 sibling, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2023-12-19 21:44 UTC (permalink / raw)
To: Peter Rosin; +Cc: linux-i2c@vger.kernel.org
On 08.11.2023 07:38, Heiner Kallweit wrote:
> Legacy class-based device auto-detection shouldn't be used in new code.
> Therefore remove support in i2c-mux-reg as long as we don't have a
> user of this feature yet.
>
> Link: https://lore.kernel.org/linux-i2c/a22978a4-88e4-46f4-b71c-032b22321599@gmail.com/
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/i2c/muxes/i2c-mux-reg.c | 4 +---
> include/linux/platform_data/i2c-mux-reg.h | 2 --
> 2 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
> index 9efc1ed01..8489971ba 100644
> --- a/drivers/i2c/muxes/i2c-mux-reg.c
> +++ b/drivers/i2c/muxes/i2c-mux-reg.c
> @@ -159,7 +159,6 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
> struct regmux *mux;
> struct i2c_adapter *parent;
> struct resource *res;
> - unsigned int class;
> int i, ret, nr;
>
> mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL);
> @@ -213,9 +212,8 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
>
> for (i = 0; i < mux->data.n_values; i++) {
> nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0;
> - 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 err_del_mux_adapters;
> }
> diff --git a/include/linux/platform_data/i2c-mux-reg.h b/include/linux/platform_data/i2c-mux-reg.h
> index 2543c2a1c..e2e895768 100644
> --- a/include/linux/platform_data/i2c-mux-reg.h
> +++ b/include/linux/platform_data/i2c-mux-reg.h
> @@ -17,7 +17,6 @@
> * @n_values: Number of multiplexer channels
> * @little_endian: Indicating if the register is in little endian
> * @write_only: Reading the register is not allowed by hardware
> - * @classes: Optional I2C auto-detection classes
> * @idle: Value to write to mux when idle
> * @idle_in_use: indicate if idle value is in use
> * @reg: Virtual address of the register to switch channel
> @@ -30,7 +29,6 @@ struct i2c_mux_reg_platform_data {
> int n_values;
> bool little_endian;
> bool write_only;
> - const unsigned int *classes;
> u32 idle;
> bool idle_in_use;
> void __iomem *reg;
Any feedback on this patch? We're at 6.7-rc6 and I if there's any
feedback I'd like to incorporate it before the 6.8 merge window.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: mux: reg: Remove class-based device auto-detection support
2023-11-08 6:38 [PATCH] i2c: mux: reg: Remove class-based device auto-detection support Heiner Kallweit
2023-12-19 21:44 ` Heiner Kallweit
@ 2023-12-20 20:45 ` Wolfram Sang
2023-12-20 20:58 ` Heiner Kallweit
1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2023-12-20 20:45 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Peter Rosin, linux-i2c@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 498 bytes --]
On Wed, Nov 08, 2023 at 07:38:07AM +0100, Heiner Kallweit wrote:
> Legacy class-based device auto-detection shouldn't be used in new code.
> Therefore remove support in i2c-mux-reg as long as we don't have a
> user of this feature yet.
>
> Link: https://lore.kernel.org/linux-i2c/a22978a4-88e4-46f4-b71c-032b22321599@gmail.com/
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied to for-next, thanks!
I guess i2c-mux-gpio is more difficult because it has users already?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: mux: reg: Remove class-based device auto-detection support
2023-12-20 20:45 ` Wolfram Sang
@ 2023-12-20 20:58 ` Heiner Kallweit
0 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2023-12-20 20:58 UTC (permalink / raw)
To: Wolfram Sang, Peter Rosin, linux-i2c@vger.kernel.org,
Jean Delvare
On 20.12.2023 21:45, Wolfram Sang wrote:
> On Wed, Nov 08, 2023 at 07:38:07AM +0100, Heiner Kallweit wrote:
>> Legacy class-based device auto-detection shouldn't be used in new code.
>> Therefore remove support in i2c-mux-reg as long as we don't have a
>> user of this feature yet.
>>
>> Link: https://lore.kernel.org/linux-i2c/a22978a4-88e4-46f4-b71c-032b22321599@gmail.com/
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> Applied to for-next, thanks!
>
> I guess i2c-mux-gpio is more difficult because it has users already?
>
Right. i801 has a special handling for certain Asus server models with
> 8 memory slots where the smbus to the SPD eeproms is gpio-muxed.
I2C_CLASS_HWMON is passed to the child adapters to probe for DIMM
thermal sensors.
For getting rid of the class-based probing we have to:
- Extend i2c_register_spd() for use on muxed smbus segments.
Then i2c_register_spd() instantiates at24 to handle the SPD eeprom (for DDR3)
- at24 then checks the SPD for an advertised thermal sensor, and instantiates
jc42 to handle the thermal sensor -> a patch for this has been submitted
The extension of i2c_register_spd() needs some more thoughts.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-20 20:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 6:38 [PATCH] i2c: mux: reg: Remove class-based device auto-detection support Heiner Kallweit
2023-12-19 21:44 ` Heiner Kallweit
2023-12-20 20:45 ` Wolfram Sang
2023-12-20 20:58 ` Heiner Kallweit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox