Re: regmap I3C support

From: Guenter Roeck
Date: Thu Nov 14 2024 - 09:46:04 EST


On 11/14/24 03:31, Mark Brown wrote:
On Wed, Nov 13, 2024 at 12:16:37PM -0800, Guenter Roeck wrote:
On 11/13/24 06:41, Mark Brown wrote:

That's kind of my question. If we are going to have this sort of stuff
we should also have it for I2C and SPI since it's such a common pattern.

I'll take that as "we are not going to provide a dummy regmap i3c registration
function". Thanks, that is all I needed to know.

It's not a definite no, it's a "is this just going to run into the same
problems we ran into with I2C and SPI and never get used?" or
alternatively "have people figured out a better solution to the problems
we had with I2C and SPI which we can adopt there?" - it's something we
wanted to do before but ran into trouble with.

We now use

config SENSORS_TMP108
tristate "Texas Instruments TMP108"
depends on I2C
depends on I3C || !I3C
select REGMAP_I2C
select REGMAP_I3C if I3C

and in the i3c_probe function

#ifdef CONFIG_REGMAP_I3C
regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
#else
regmap = ERR_PTR(-ENODEV);
#endif
if (IS_ERR(regmap))

Clumsy, and not my preferred solution, but it works.

Guenter