From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Colin Foster <colin.foster@in-advantage.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
<kavyasree.kotagiri@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Michael Walle <michael@walle.cc>
Subject: Re: [PATCH v2 2/2] pinctrl: ocelot: Fix pincfg
Date: Mon, 11 Jul 2022 08:55:47 +0200 [thread overview]
Message-ID: <20220711065547.drpgq466ueujkxah@soft-dev3-1.localhost> (raw)
In-Reply-To: <CAHp75Vc0EasS2Z3x=cgTv==osXprPU3Zkc-Q9DMf4BMz2p6oLw@mail.gmail.com>
The 07/09/2022 00:02, Andy Shevchenko wrote:
Hi Colin, Andy,
>
> On Fri, Jul 8, 2022 at 10:17 PM Colin Foster
> <colin.foster@in-advantage.com> wrote:
> > On Fri, Jul 08, 2022 at 09:55:10PM +0200, Horatiu Vultur wrote:
> > > The blamed commit changed to use regmaps instead of __iomem. But it
> > > didn't update the register offsets to be at word offset, so it uses byte
> > > offset.
> > > Another issue with the same commit is that it a limit of 32 registers
>
> it has a limit
>
> > > which is incorrect. The sparx5 has 64 while lan966x has 77.
>
> ...
>
> > > - .max_register = 32,
> >
> > What happens in /sys/kernel/debug/regmap/*-pincfg/{range,registers} when
> > there's no max register?
>
> Good question!
If .max_register is missing then I got the following:
# cd /sys/kernel/debug/regmap/e2004064.pinctrl-pincfg/
# cat range
0-0
# cat registers
0: 00000005
>
> > Should it be this?
> >
> > struct regmap_config regmap_config = {
> > ...
> > };
> > regmap_config.max_register = info->desc->npins * regmap_config.reg_stride;
> >
> > > .name = "pincfg",
> > > };
>
> If regmap configuration may be const, I would prefer to have a
> hardcoded value and different configuration based on the chip, but if
> it's not feasible, then this could suffice.
What about if we do something like:
const struct regmap_config regmap_config = {
...
.max_register = info->desc->npins * 4,
...
};
This is based on what Colin suggested only that we keep the const.
>
> --
> With Best Regards,
> Andy Shevchenko
--
/Horatiu
next prev parent reply other threads:[~2022-07-11 6:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 19:55 [PATCH v2 0/2] pinctrl: ocelot: Add fixes for ocelot driver Horatiu Vultur
2022-07-08 19:55 ` [PATCH v2 1/2] pinctrl: ocelot: Fix pincfg for lan966x Horatiu Vultur
2022-07-08 21:58 ` Andy Shevchenko
2022-07-11 6:49 ` Horatiu Vultur
2022-07-11 8:31 ` Andy Shevchenko
2022-07-08 19:55 ` [PATCH v2 2/2] pinctrl: ocelot: Fix pincfg Horatiu Vultur
2022-07-08 20:16 ` Colin Foster
2022-07-08 22:02 ` Andy Shevchenko
2022-07-11 6:55 ` Horatiu Vultur [this message]
2022-07-11 8:35 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220711065547.drpgq466ueujkxah@soft-dev3-1.localhost \
--to=horatiu.vultur@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andy.shevchenko@gmail.com \
--cc=colin.foster@in-advantage.com \
--cc=kavyasree.kotagiri@microchip.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=michael@walle.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox