From patchwork Thu Jul 21 09:10:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9241251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44CD1602F0 for ; Thu, 21 Jul 2016 09:10:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ECFC200F5 for ; Thu, 21 Jul 2016 09:10:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EAE526253; Thu, 21 Jul 2016 09:10:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0772F200F5 for ; Thu, 21 Jul 2016 09:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbcGUJKy (ORCPT ); Thu, 21 Jul 2016 05:10:54 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:36190 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbcGUJKx (ORCPT ); Thu, 21 Jul 2016 05:10:53 -0400 Received: by mail-oi0-f53.google.com with SMTP id w18so108714321oiw.3 for ; Thu, 21 Jul 2016 02:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Q6p6bQnhLHKOTt8rwXFj7y5uoxLQCxjhan+7sgm4LdA=; b=WtadqNFttJHoICP7C2haW7kcMOO/6Mhe9RHpBLZvg58vh8SuonQM2tY3rMrIJ0t+z/ zBElAA0AHTVA8eWolA7TtEElaQ3fzDGNSbXPJ1piMofvZlrhveRJHLFCpBWDaYlJ0dHO oT+U2u9TAGswgkCjJYuO1Lwi6WCw1aA2A2ydKkP+BOxDAzlXONpcxRkGIR6WiKQgR7Ji jzSak55A1++36Ts0ApeVoJLBY8pFhN3qF5TPPsE9TN9NLY626j53Fhup9CmcNLN6nt8e K0OEDnUMTrjhbCXTuGvQPqWTKKRjzmPFq0CY9wjj7PkFnISm0Jsxgds6+UVYFj3S6Vep WYIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Q6p6bQnhLHKOTt8rwXFj7y5uoxLQCxjhan+7sgm4LdA=; b=KxCRdAMcFgDjlZKc1+r5pS6gG2j5NuwDne2zVzFw5f3dwbrI2yvF8JbkWqmI6hToCs ERTxQkOivk3weKoCC4EyEqOvfjjmDYeopeCpIqt4Xx2WkkjogMiyIljJGS9lhTi+gtIm R/eHO/wA8vhoKpWHXDhSibCTfBxLeCru5qw2rzoVSCg5qQU0GM8YmEgaQ2RDH7/Vynu1 DjtQDVR5Btp0U/dSmbK6VeSKAoz7+9IysIt/eG4JXu55m4+2hfoRsVHeFcl9iiw/nhbS A+B4Y9ENYe1YLvAdQH/normlMlKJCsE9BKwkTFJ/Gq/+WxfqryDMwerohif/xencvHRR ELFw== X-Gm-Message-State: ALyK8tKIBuYEWz+N1TCc/1zyI2SP4U1RhO25WpKwN8IysKEioRJUZnnG84LMlxrwC6Ekoh7/Mas0eP05oZK8Sg== X-Received: by 10.202.226.205 with SMTP id z196mr25493298oig.13.1469092252384; Thu, 21 Jul 2016 02:10:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.73.206 with HTTP; Thu, 21 Jul 2016 02:10:51 -0700 (PDT) In-Reply-To: References: From: Krzysztof Kozlowski Date: Thu, 21 Jul 2016 11:10:51 +0200 X-Google-Sender-Auth: BkDByZw9dgNLc_SMsdyiQbSS7ME Message-ID: Subject: Re: pin stats To: Ryan Cc: linux-samsung-soc@vger.kernel.org Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jul 21, 2016 at 7:15 AM, Ryan 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 From bfd789387cc67eb34752be4c40e4e494e499bec6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski 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