Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: mcp23s08: Fix mcp23x17 precious range

On page 23 of the datasheet [0] it says "The register remains unchanged
until the interrupt is cleared via a read of INTCAP or GPIO." Include
INTCAPA and INTCAPB registers in precious range, so that they aren't
accidentally cleared when we read via debugfs.

[0] https://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf

Fixes: 8f38910ba4f6 ("pinctrl: mcp23s08: switch to regmap caching")
Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200828213226.1734264-3-thomas.preston@codethink.co.uk
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Thomas Preston and committed by
Linus Walleij
b9b7fb29 b445f623

+1 -1
+1 -1
drivers/pinctrl/pinctrl-mcp23s08.c
··· 109 109 }; 110 110 111 111 static const struct regmap_range mcp23x17_precious_range = { 112 - .range_min = MCP_GPIO << 1, 112 + .range_min = MCP_INTCAP << 1, 113 113 .range_max = MCP_GPIO << 1, 114 114 }; 115 115