From bfd789387cc67eb34752be4c40e4e494e499bec6 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Date: Thu, 13 Feb 2014 15:03:47 +0100
Subject: [PATCH] pinctrl: exynos: Dump GPIO on suspend and resume
---
drivers/pinctrl/pinctrl-exynos.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
@@ -613,12 +613,37 @@ static void exynos_pinctrl_suspend_bank(
pr_debug("%s: save fltcon1 %#010x\n", bank->name, save->eint_fltcon1);
}
+static void exynos_pinctrl_dump(struct samsung_pinctrl_drv_data *drvdata)
+{
+ struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
+ struct samsung_pin_bank *bank = ctrl->pin_banks;
+ void __iomem *regs = drvdata->virt_base;
+ int i;
+
+ for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
+ pr_info("GPIO: %4s %08x: %#010x %#010x %#010x\n",
+ bank->name,
+ bank->pctl_offset,
+ readl(regs + bank->pctl_offset),
+ readl(regs + bank->pctl_offset + 0x04),
+ readl(regs + bank->pctl_offset + 0x08));
+ pr_info("GPIO: %4s %08x: %#010x %#010x %#010x\n",
+ bank->name,
+ bank->pctl_offset,
+ readl(regs + bank->pctl_offset + 0x0c),
+ readl(regs + bank->pctl_offset + 0x10),
+ readl(regs + bank->pctl_offset + 0x14));
+ }
+}
+
static void exynos_pinctrl_suspend(struct samsung_pinctrl_drv_data *drvdata)
{
struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
struct samsung_pin_bank *bank = ctrl->pin_banks;
int i;
+ exynos_pinctrl_dump(drvdata);
+
for (i = 0; i < ctrl->nr_banks; ++i, ++bank)
if (bank->eint_type == EINT_TYPE_GPIO)
exynos_pinctrl_suspend_bank(drvdata, bank);
@@ -658,6 +683,8 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata)
for (i = 0; i < ctrl->nr_banks; ++i, ++bank)
if (bank->eint_type == EINT_TYPE_GPIO)
exynos_pinctrl_resume_bank(drvdata, bank);
+
+ exynos_pinctrl_dump(drvdata);
}
/* pin banks of exynos3250 pin-controller 0 */
--
1.7.9.5