Re: [PATCH RFC] i2c: i801: Add i801_register_jc42, similar to i2c_register_spd

Heiner Kallweit
2023-11-08T10:29:00Z

On 08.11.2023 08:27, Heiner Kallweit wrote:
> As discussed, this is a RFC version of changing jc42 auto-detection
> with the goal to get rid of I2C_CLASS_SPD completely mid-term.
>
> Code of i801_jc42_probe() was copied from jc42 driver, just w/o
> the device id check. I think it's safe enough w/o this check.
>
> I don't have hw to test this, therefore it's compile-tested only.
>
> Link: https://lore.kernel.org/linux-i2c/a22978a4-88e4-46f4-b71c-032b22321599@gmail.com/
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/i2c/busses/i2c-i801.c | 48 ++++++++++++++++++++++++++++++++---
> 1 file changed, 44 insertions(+), 4 deletions(-)
>

That's quite some code for more or less nothing. I2C_CLASS_SPD is
relevant only for users:
- having one of the specific old ASUS machines with i2c-muxing
- having RAM with a jc42-compatible temperature sensor
- manually loading module jc42 to expose the temp sensor

From a maintenance point of view the easiest solution would be:
- set flag I2C_CLASS_DEPRECATED in addition to I2C_CLASS_SPD
to encourage potential users to switch to explicit instantiating
- wait few kernel versions and remove class-based instantiation

What do you think?