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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 3, 2022 at 5:56 PM Colin Foster
<colin.foster@xxxxxxxxxxxxxxxx> wrote:
> On Wed, Aug 03, 2022 at 01:45:04PM +0200, Andy Shevchenko wrote:
> > On Wed, Aug 3, 2022 at 7:48 AM Colin Foster
> > <colin.foster@xxxxxxxxxxxxxxxx> wrote:

...

> > > +       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?

> reg_stride gets handled at the top of regmap_read(), so I don't think
> that's really needed either.

Okay.

> 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.

> # cat range
> 0-34

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux