regmap different register size
Hi,
i have a question regarding regmap usage.
I have a i2c multifunction device which does have a register and value width of 8bits except the revision register. The revision can only be read by a i2c block transfer.
Does it makes sense to read the Revision once by the i2c API and let the rest of the device read/write by regmap?
Regmap should reduce code but in this case i had to check the i2c block functionality first then read the revisoin and then init the regmap stuff.
May be in this case it would be better to use the i2c only instead of mixing i2c API and regmap.
Regards
Andy
Hi,
Quoted 5 lines · Andreas Werner
i have a question regarding regmap usage.
I have a i2c multifunction device which does have a register and value width of 8bits except the revision register. The revision can only be read by a i2c block transfer.
read revision during probe using i2c block transfer, cache the value in your own driver structure and all subsequent reads just return the cached value. Everything else should be ok via regmap. This is first thing that came to mind, maybe there's a better way.
Signature · 1 line
balbi
Quoted 5 lines · Felipe Balbi
Hi,
Quoted 2 lines · Andreas Werner
i have a question regarding regmap usage.
Quoted 11 lines
Quoted 3 lines
I have a i2c multifunction device which does have a register and value width of 8bits except the revision register. The revision can only be read by a i2c block transfer.
read revision during probe using i2c block transfer, cache the value in your own driver structure and all subsequent reads just return the cached value. Everything else should be ok via regmap. This is first thing that came to mind, maybe there's a better way.
Signature · 1 line
balbi
This is what I want to do yes and i think this would be the only way to do it because there is no mechanism to handle different register sizes with regmap.
Regards
Andy