[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vefo6djXk0x9OLiqJ=jZV8dkTEoPBRwBfcr41txfSGyRw@mail.gmail.com>
Date: Fri, 28 Aug 2020 13:09:03 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Thomas Preston <thomas.preston@...ethink.co.uk>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] pinctrl: mcp23s08: Fixup mcp23x17 regmap_config
On Fri, Aug 14, 2020 at 1:35 PM Thomas Preston
<thomas.preston@...ethink.co.uk> wrote:
>
> - Fix a typo where mcp23x17 configs are referred to as mcp23x16.
I'm not sure it's correct. MPC23016 is an existing I²C IO expander.
> - Fix precious range to include INTCAP{A,B}, which clear on read.
> - Fix precious range to include GPIOB, which clears on read.
> - Fix volatile range to include GPIOB, to fix debugfs registers
> reporting different values than `gpioget gpiochip2 {0..15}`.
I'm wondering if you read all the datasheets before doing these changes.
MPC2308
MPC23016
MPC23017
...
> -static const struct regmap_range mcp23x16_volatile_range = {
> +static const struct regmap_range mcp23x17_volatile_range = {
> .range_min = MCP_INTF << 1,
> - .range_max = MCP_GPIO << 1,
> + .range_max = (MCP_GPIO << 1) + 1,
This looks weird. Usually we do a mask or a bit based mask, like (1 << x) - 1.
> };
...
> +static const struct regmap_range mcp23x17_precious_range = {
> + .range_min = MCP_INTCAP << 1,
> + .range_max = (MCP_GPIO << 1) + 1,
Ditto.
> };
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists