mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCHv2] gpio-lynxpoint: enable input sensing in resume
  2014-08-19 11:00 [PATCHv2] gpio-lynxpoint: enable input sensing in resume Mathias Nyman
@ 2014-08-19 10:50 ` Mika Westerberg
  2014-08-21 12:42 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2014-08-19 10:50 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Linus, linux-kernel

On Tue, Aug 19, 2014 at 02:00:01PM +0300, Mathias Nyman wrote:
> It appears that input sensing bit might be reset during
> suspend/resume. Set input sensing again for all requested gpios
> in resume
> 
> Tested-by: Jerome Blin <jerome.blin@intel.com>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCHv2] gpio-lynxpoint: enable input sensing in resume
@ 2014-08-19 11:00 Mathias Nyman
  2014-08-19 10:50 ` Mika Westerberg
  2014-08-21 12:42 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Mathias Nyman @ 2014-08-19 11:00 UTC (permalink / raw)
  To: Linus; +Cc: mika.westerberg, linux-kernel, Mathias Nyman

It appears that input sensing bit might be reset during
suspend/resume. Set input sensing again for all requested gpios
in resume

Tested-by: Jerome Blin <jerome.blin@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/gpio/gpio-lynxpoint.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c
index ff9eb91..fa945ec 100644
--- a/drivers/gpio/gpio-lynxpoint.c
+++ b/drivers/gpio/gpio-lynxpoint.c
@@ -407,9 +407,27 @@ static int lp_gpio_runtime_resume(struct device *dev)
 	return 0;
 }
 
+static int lp_gpio_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct lp_gpio *lg = platform_get_drvdata(pdev);
+	unsigned long reg;
+	int i;
+
+	/* on some hardware suspend clears input sensing, re-enable it here */
+	for (i = 0; i < lg->chip.ngpio; i++) {
+		if (gpiochip_is_requested(&lg->chip, i) != NULL) {
+			reg = lp_gpio_reg(&lg->chip, i, LP_CONFIG2);
+			outl(inl(reg) & ~GPINDIS_BIT, reg);
+		}
+	}
+	return 0;
+}
+
 static const struct dev_pm_ops lp_gpio_pm_ops = {
 	.runtime_suspend = lp_gpio_runtime_suspend,
 	.runtime_resume = lp_gpio_runtime_resume,
+	.resume = lp_gpio_resume,
 };
 
 static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = {
-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] gpio-lynxpoint: enable input sensing in resume
  2014-08-19 11:00 [PATCHv2] gpio-lynxpoint: enable input sensing in resume Mathias Nyman
  2014-08-19 10:50 ` Mika Westerberg
@ 2014-08-21 12:42 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-08-21 12:42 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Mika Westerberg, linux-kernel

On Tue, Aug 19, 2014 at 6:00 AM, Mathias Nyman
<mathias.nyman@linux.intel.com> wrote:

> It appears that input sensing bit might be reset during
> suspend/resume. Set input sensing again for all requested gpios
> in resume
>
> Tested-by: Jerome Blin <jerome.blin@intel.com>
> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>

This version applied with Mika's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-21 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-19 11:00 [PATCHv2] gpio-lynxpoint: enable input sensing in resume Mathias Nyman
2014-08-19 10:50 ` Mika Westerberg
2014-08-21 12:42 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®