Thread (25 messages) 25 messages, 2 authors, 2022-08-05

Re: [PATCH v15 mfd 9/9] mfd: ocelot: add support for the vsc7512 chip via spi

From: Colin Foster <colin.foster@in-advantage.com>
Date: 2022-08-03 17:31:35
Also in: linux-arm-kernel, linux-devicetree, linux-gpio, lkml

On Wed, Aug 03, 2022 at 07:10:38PM +0200, Andy Shevchenko wrote:
On Wed, Aug 3, 2022 at 5:56 PM Colin Foster
[off-list ref] wrote:
quoted
On Wed, Aug 03, 2022 at 01:45:04PM +0200, Andy Shevchenko wrote:
quoted
On Wed, Aug 3, 2022 at 7:48 AM Colin Foster
[off-list ref] wrote:
...
quoted
quoted
quoted
+       regmap_config.max_register = res->end - res->start;
Hmm... First of all, resource_size() is for that (with - 1 to the
result). But don't you need to use stride in the calculations?
DEFINE_RES_NAMED populates the resource .end with (_start) + (_size) - 1
so I don't think resource_size is correct to use here.
Have you read what I put in parentheses? Basically it becomes very
well the same as a result, but in a cleaner manner (you calculate
resource size - 1 which will be exactly the last byte offset of the
register file), no?
Ahh... I see your point. I agree with your suggestion and will clean it
up.
quoted
reg_stride gets handled at the top of regmap_read(), so I don't think
that's really needed either.
Okay.
quoted
For reference:

#define VSC7512_DEVCPU_ORG_RES_START    0x71000000
#define VSC7512_DEVCPU_ORG_RES_SIZE     0x38
Right, for 0x38 you supply 0x37, which is exactly resource_size() - 1.
quoted
# cat range
0-34
-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help