All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@linux.it>
To: linux-mips@linux-mips.org
Subject: au1x00 GPIO2 power management
Date: Tue, 27 Jun 2006 17:56:02 +0200	[thread overview]
Message-ID: <20060627155602.GB10595@enneenne.com> (raw)

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

Hello,

attached patch adds support for power management for the secondary
general purpose I/O.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

[-- Attachment #2: patch-gpio2-pm-support --]
[-- Type: text/plain, Size: 1479 bytes --]

diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c
index 9b47082..482de93 100644
--- a/arch/mips/au1000/common/power.c
+++ b/arch/mips/au1000/common/power.c
@@ -88,7 +88,10 @@ static DEFINE_SPINLOCK(pm_lock);
 static uint	sleep_aux_pll_cntrl;
 static uint	sleep_cpu_pll_cntrl;
 static uint	sleep_pin_function;
+static uint	sleep_gpio2_dir;
+static uint	sleep_gpio2_output;
 static uint	sleep_gpio2_enable;
+static uint	sleep_gpio2_inten;
 static uint	sleep_uart0_inten;
 static uint	sleep_uart0_fifoctl;
 static uint	sleep_uart0_linectl;
@@ -182,6 +185,10 @@ save_core_regs(void)
 	sleep_cpu_pll_cntrl = au_readl(SYS_CPUPLL);
 
 	sleep_pin_function = au_readl(SYS_PINFUNC);
+
+	sleep_gpio2_dir = au_readl(GPIO2_DIR);
+	sleep_gpio2_output = au_readl(GPIO2_OUTPUT);
+	sleep_gpio2_inten = au_readl(GPIO2_INTENABLE);
 	sleep_gpio2_enable = au_readl(GPIO2_ENABLE);
 
 	/* Save the static memory controller configuration.
@@ -209,7 +216,11 @@ restore_core_regs(void)
 	au_writel(sleep_aux_pll_cntrl, SYS_AUXPLL); au_sync();
 	au_writel(sleep_cpu_pll_cntrl, SYS_CPUPLL); au_sync();
 	au_writel(sleep_pin_function, SYS_PINFUNC); au_sync();
+
 	au_writel(sleep_gpio2_enable, GPIO2_ENABLE); au_sync();
+	au_writel(sleep_gpio2_dir, GPIO2_DIR); au_sync();
+	au_writel((sleep_gpio2_output<<16)|sleep_gpio2_output, GPIO2_OUTPUT); au_sync();
+	au_writel(sleep_gpio2_inten, GPIO2_INTENABLE); au_sync();
 
 	/* Restore the static memory controller configuration.
 	*/

                 reply	other threads:[~2006-06-27 15:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060627155602.GB10595@enneenne.com \
    --to=giometti@linux.it \
    --cc=linux-mips@linux-mips.org \
    /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.