From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linus.walleij@linaro.org, alexandre.belloni@bootlin.com
Subject: Re: [PATCH] pinctrl: ocelot: Fix alt mode for ocelot
Date: Mon, 6 Feb 2023 22:59:47 +0200 [thread overview]
Message-ID: <CAHp75VcVn2=Xy7P4xgiDKkpOkw+YD1zGwMYARpWV6Eiv0fUakw@mail.gmail.com> (raw)
In-Reply-To: <20230206203720.1177718-1-horatiu.vultur@microchip.com>
On Mon, Feb 6, 2023 at 10:37 PM Horatiu Vultur
<horatiu.vultur@microchip.com> wrote:
>
> In case the driver was trying to set an alternate mode for gpio
> 0 or 32 then the mode was not set correctly. The reason is that
> there is computation error inside the function ocelot_pinmux_set_mux
> because in this case it was trying to shift to left by -1.
> Fix this by actually shifting the function bits and not the position.
>
> Fixes: 4b36082e2e09 ("pinctrl: ocelot: fix pinmuxing for pins after 31")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
...
> regmap_update_bits(info->map, REG_ALT(0, info, pin->pin),
> BIT(p), f << p);
> regmap_update_bits(info->map, REG_ALT(1, info, pin->pin),
> - BIT(p), f << (p - 1));
> + BIT(p), (f >> 1) << p);
I'm not sure I understand how this doesn't break anything that has a
bit 0 set in f. Is it not a problem?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-02-06 21:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 20:37 [PATCH] pinctrl: ocelot: Fix alt mode for ocelot Horatiu Vultur
2023-02-06 20:59 ` Andy Shevchenko [this message]
2023-02-07 7:48 ` Horatiu Vultur
2023-02-27 20:38 ` Horatiu Vultur
2023-03-06 14:18 ` Linus Walleij
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='CAHp75VcVn2=Xy7P4xgiDKkpOkw+YD1zGwMYARpWV6Eiv0fUakw@mail.gmail.com' \
--to=andy.shevchenko@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=horatiu.vultur@microchip.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).