lkml.org 
[lkml]   [2020]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/3] pinctrl: mcp23s08: Fixup mcp23x17 regmap_config
On Fri, Aug 14, 2020 at 1:35 PM Thomas Preston
<thomas.preston@codethink.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

\
 
 \ /
  Last update: 2020-08-28 12:09    [W:0.442 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site