diff options
| author | Dmitry Mastykin <mastichi@gmail.com> | 2017-10-18 10:21:02 -0400 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2017-10-19 04:20:03 -0400 |
| commit | 59861701076b0cfac0b5eaa67a380fff6ab85b9e (patch) | |
| tree | 2e9f229c0748053a91a43a7c09a7efc07379baa1 | |
| parent | 6afb10267c1692ada3a2903e31ea339917ad3ac0 (diff) | |
pinctrl: mcp23s08: fix interrupt handling regression
interrupt handling was broken with conversion to using regmap caching.
cached_gpio value was updated by boolean status instead of gpio reading.
Fixes: 8f38910ba4f6 ("pinctrl: mcp23s08: switch to regmap caching")
Tested-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| -rw-r--r-- | drivers/pinctrl/pinctrl-mcp23s08.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c index 3e40d4245512..9c950bbf07ba 100644 --- a/drivers/pinctrl/pinctrl-mcp23s08.c +++ b/drivers/pinctrl/pinctrl-mcp23s08.c | |||
| @@ -407,10 +407,10 @@ static int mcp23s08_get(struct gpio_chip *chip, unsigned offset) | |||
| 407 | ret = mcp_read(mcp, MCP_GPIO, &status); | 407 | ret = mcp_read(mcp, MCP_GPIO, &status); |
| 408 | if (ret < 0) | 408 | if (ret < 0) |
| 409 | status = 0; | 409 | status = 0; |
| 410 | else | 410 | else { |
| 411 | mcp->cached_gpio = status; | ||
| 411 | status = !!(status & (1 << offset)); | 412 | status = !!(status & (1 << offset)); |
| 412 | 413 | } | |
| 413 | mcp->cached_gpio = status; | ||
| 414 | 414 | ||
| 415 | mutex_unlock(&mcp->lock); | 415 | mutex_unlock(&mcp->lock); |
| 416 | return status; | 416 | return status; |
