Re: Page select register restrictions in regmap core

From: Guenter Roeck
Date: Tue Jun 18 2024 - 13:02:00 EST


Hi Mark,

On 6/18/24 09:14, Guenter Roeck wrote:
[ ... ]
So surely this means that the entire register map is one window and
there's no point in defining two ranges?  Those registers are paged with
the same selector as the other registers.  At which point you can just
sidestep the issue and be like the other current problematic drivers.


Just define a single range covering the entire window ? That might actually
work if I manipulate the nvmem addresses such that they always point to the
upper 64 bytes. I'll give that a try.


Excellent, that worked. Thanks a lot, and sorry for being slow in understanding
what I needed to do.

[ ... ]

Anyway, this may be all irrelevant in respect to regmap support.
It turns out that at least some i801 controllers don't work with the
access mechanism used by regmap, or maybe the spd5118 chips don't support
I2C_FUNC_SMBUS_I2C_BLOCK. I already found that those chips don't support
auto-incrementing the register address and actually reset the address on byte
reads (i.e., subsequent calls to i2c_smbus_read_byte() always return the data
from the first register). Since regmap doesn't have a means for me to say
"don't use I2C_FUNC_SMBUS_I2C_BLOCK even if the controller supports it",
I may have to drop regmap support entirely anyway. That would be annoying,
but right now I have no idea how to work around that problem.


I think I found a workaround for that problem: All I needed to do
was to define a regmap bus with its own read and write functions.
Please let me know if there is a better way to solve that problem.

Thanks,
Guenter