]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
i2c: use client addresses directly in ATR interface
authorRomain Gantois <romain.gantois@bootlin.com>
Thu, 6 Mar 2025 16:23:25 +0000 (17:23 +0100)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 18 Apr 2025 21:33:46 +0000 (23:33 +0200)
commit818bd489f137e9257d701c0d4bf11efdfd02ca5f
tree7732249c0b8287d537964e43135f1915778d74ae
parent3ec29d51b546f69de0b0d10642c9aaaf5e3704eb
i2c: use client addresses directly in ATR interface

The I2C Address Translator (ATR) module defines mappings from i2c_client
structs to aliases. However, only the physical address of each i2c_client
struct is actually relevant to the workings of the ATR module. Moreover,
some drivers require address translation functionality but do not allocate
i2c_client structs, accessing the adapter directly instead. The SFP
subsystem is an example of this.

Replace the "i2c_client" field of the i2c_atr_alias_pair struct with a u16
"addr" field. Rewrite helper functions and callbacks as needed.

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-atr.c
drivers/media/i2c/ds90ub960.c
include/linux/i2c-atr.h