All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Ryan <ryanphilips19@googlemail.com>
Cc: linux-samsung-soc@vger.kernel.org
Subject: Re: pin stats
Date: Thu, 21 Jul 2016 11:10:51 +0200	[thread overview]
Message-ID: <CAJKOXPce+DOM6UQs1g32E4P730F+-Tjm=8XHe93=CxaNVX57kg@mail.gmail.com> (raw)
In-Reply-To: <CANMsd017L1O+huEu=LOcfm2rD-3Qp-kJS32GA0AgTdPFWD_qoQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

On Thu, Jul 21, 2016 at 7:15 AM, Ryan <ryanphilips19@googlemail.com> wrote:
> Hey,
>
> Can i dump the gpio states just before exynos is put to sleep?
>
> What would be the best place to do that? are there any example drivers which
> can do this?

I assume that /sys/kernel/debug/gpio is not sufficient... I got some
old debug code (for 3.10 :) ) for dumping the registers. Feel free to
use it under GPLv2 (derivative work from Linux kernel) - attached. If
you need specific values you would have to decode the data into
something readable.

Best regards,
Krzysztof

[-- Attachment #2: 310-pinctrl-exynos-Dump-GPIO-on-suspend-and-resume.patch --]
[-- Type: text/x-patch, Size: 2104 bytes --]

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(+)

diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c
index 4c84e61f9c44..6931bd024913 100644
--- a/drivers/pinctrl/pinctrl-exynos.c
+++ b/drivers/pinctrl/pinctrl-exynos.c
@@ -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


      reply	other threads:[~2016-07-21  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  5:15 pin stats Ryan
2016-07-21  9:10 ` Krzysztof Kozlowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJKOXPce+DOM6UQs1g32E4P730F+-Tjm=8XHe93=CxaNVX57kg@mail.gmail.com' \
    --to=k.kozlowski@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=ryanphilips19@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.