[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c4a5fb5c-90b4-488b-8875-a0b819e24bcd@roeck-us.net>
Date: Mon, 17 Jun 2024 14:55:09 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Mark Brown <broonie@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, Armin Wolf <W_Armin@....de>
Subject: Re: Page select register restrictions in regmap core
On 6/17/24 10:22, Mark Brown wrote:
[ ... ]
>
> The range is *entirely* defined within the driver, it is 100% a software
> construct, the hardware only influences our choice of range in that we
> can't place it on top of hardware registers.
>
I _think_ what you are saying is that I'd have to model all registers
which are to be addressed through regmap as virtual registers with an offset
outside the range of real registers. Something like adding 0x100 to the
each register address and then accessing, say, the revision register
not as register 0x02 but as register 0x102. I would then define the matching
range from 0x100 .. 0x17f and the window from 0x00..0x7f.
Hmm, yes, I see that this should work. I don't think it is worth doing though
since I need to be able to access some registers outside regmap, and I'd have
to define two sets of addresses for all those registers. That would simplify
the code a bit but one would have to remember that register addresses through
regmap are different than register addresses when calling smbus functions
directly. I think we'll just stick with the current code and keep the paging
implementation in the driver.
Thanks a lot for the advice.
Guenter
Powered by blists - more mailing lists