linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: Russell King <linux@arm.linux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Andrea Adami <andrea.adami@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] ARM: sa1100: add platform functions to handle PWER settings
Date: Thu, 15 Jan 2015 13:09:30 +0300	[thread overview]
Message-ID: <1421316574-10022-1-git-send-email-dbaryshkov@gmail.com> (raw)

PWER settings logically belongs neither to GPIO nor to system IRQ code.
Add special functions to handle PWER (for GPIO and for system IRQs)
from platform code.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-sa1100/generic.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 40e0d86..022e451 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -416,3 +416,24 @@ void sa1110_mb_enable(void)
 	local_irq_restore(flags);
 }
 
+int sa11x0_gpio_set_wake(unsigned int gpio, unsigned int on)
+{
+	if (on)
+		PWER |= BIT(gpio);
+	else
+		PWER &= ~BIT(gpio);
+
+	return 0;
+}
+
+int sa11x0_sc_set_wake(unsigned int irq, unsigned int on)
+{
+	if (BIT(irq) != IC_RTCAlrm)
+		return -EINVAL;
+
+	if (on)
+		PWER |= PWER_RTC;
+	else
+		PWER &= ~PWER_RTC;
+	return 0;
+}
-- 
2.1.4


             reply	other threads:[~2015-01-15 10:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 10:09 Dmitry Eremin-Solenikov [this message]
2015-01-15 10:09 ` [PATCH 2/5] ARM: sa1100: use sa11x0_sc_set_wake() in irq driver Dmitry Eremin-Solenikov
2015-01-15 10:09 ` [PATCH 3/5] ARM: sa1100: use ioremapped memory to access SC registers Dmitry Eremin-Solenikov
2015-01-24 17:48   ` Thomas Gleixner
2015-01-24 17:50     ` Dmitry Eremin-Solenikov
2015-01-24 19:24       ` Thomas Gleixner
2015-01-24 19:25         ` Dmitry Eremin-Solenikov
2015-01-15 10:09 ` [PATCH 4/5] irqchip: add sa1100 driver Dmitry Eremin-Solenikov
2015-01-15 10:09 ` [PATCH 5/5] ARM: sa1100: drop irq driver Dmitry Eremin-Solenikov
2015-01-21 10:05 ` [PATCH 1/5] ARM: sa1100: add platform functions to handle PWER settings Linus Walleij
2015-01-21 13:37   ` Dmitry Eremin-Solenikov

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=1421316574-10022-1-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=andrea.adami@gmail.com \
    --cc=jason@lakedaemon.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).