diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-23 10:36:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-23 10:36:04 -0400 |
commit | 2f1b11c575acb2fc9e63b8ce11e4a3f6069ba6f6 (patch) | |
tree | 6683af0762643f6f4acaa43ffa4f91d86d3c956f | |
parent | 468b0e0cf84ebb73a4e59beecec975207dd31f92 (diff) | |
parent | 59861701076b0cfac0b5eaa67a380fff6ab85b9e (diff) |
Merge tag 'pinctrl-v4.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij:
"Two last minute fixes for pin controllers, both regressions in
specific drivers:
- Fix a touchpad pin control issue on the AMD affecting Asus laptops
- Fix an interrupt handling regression on the MCP23s08"
* tag 'pinctrl-v4.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: mcp23s08: fix interrupt handling regression
pinctrl/amd: fix masking of GPIO interrupts
-rw-r--r-- | drivers/pinctrl/pinctrl-amd.c | 10 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-mcp23s08.c | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 3f6b34febbf1..433af328d981 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c | |||
@@ -534,8 +534,16 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id) | |||
534 | continue; | 534 | continue; |
535 | irq = irq_find_mapping(gc->irqdomain, irqnr + i); | 535 | irq = irq_find_mapping(gc->irqdomain, irqnr + i); |
536 | generic_handle_irq(irq); | 536 | generic_handle_irq(irq); |
537 | /* Clear interrupt */ | 537 | |
538 | /* Clear interrupt. | ||
539 | * We must read the pin register again, in case the | ||
540 | * value was changed while executing | ||
541 | * generic_handle_irq() above. | ||
542 | */ | ||
543 | raw_spin_lock_irqsave(&gpio_dev->lock, flags); | ||
544 | regval = readl(regs + i); | ||
538 | writel(regval, regs + i); | 545 | writel(regval, regs + i); |
546 | raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); | ||
539 | ret = IRQ_HANDLED; | 547 | ret = IRQ_HANDLED; |
540 | } | 548 | } |
541 | } | 549 | } |
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; |