From: Vincent Donnefort <vdonnefort@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: linus.walleij@linaro.org, sameo@linux.intel.com,
asierra@xes-inc.com, lee.jones@linaro.org,
Vincent Donnefort <vdonnefort@gmail.com>
Subject: [RESEND 6/6] gpio: ich: Add support for Intel Avoton
Date: Fri, 14 Feb 2014 15:01:58 +0100 [thread overview]
Message-ID: <1392386518-11025-7-git-send-email-vdonnefort@gmail.com> (raw)
In-Reply-To: <1392386518-11025-1-git-send-email-vdonnefort@gmail.com>
This patch adds support for Atom C2000 series (Avoton and Rangeley). And has
the following options:
- New addresses register.
- Caching output levels (see Intel external design spec, table 48-29)
- No hardware blink.
Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
---
drivers/gpio/gpio-ich.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index bfef20f..e73c675 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -1,5 +1,5 @@
/*
- * Intel ICH6-10, Series 5 and 6 GPIO driver
+ * Intel ICH6-10, Series 5 and 6, Atom C2000 (Avoton/Rangeley) GPIO driver
*
* Copyright (C) 2010 Extreme Engineering Solutions.
*
@@ -55,6 +55,16 @@ static const u8 ichx_reglen[3] = {
0x30, 0x10, 0x10,
};
+static const u8 avoton_regs[4][3] = {
+ {0x00, 0x80, 0x00},
+ {0x04, 0x84, 0x00},
+ {0x08, 0x88, 0x00},
+};
+
+static const u8 avoton_reglen[3] = {
+ 0x10, 0x10, 0x00,
+};
+
#define ICHX_WRITE(val, reg, base_res) outl(val, (reg) + (base_res)->start)
#define ICHX_READ(reg, base_res) inl((reg) + (base_res)->start)
@@ -353,6 +363,17 @@ static struct ichx_desc intel5_desc = {
.reglen = ichx_reglen,
};
+/* Avoton */
+static struct ichx_desc avoton_desc = {
+ /* Avoton has only 59 GPIOs, but we assume the first set of register
+ * (Core) has 32 instead of 31 to keep gpio-ich compliance
+ */
+ .ngpio = 60,
+ .regs = avoton_regs,
+ .reglen = avoton_reglen,
+ .use_outlvl_cache = true,
+};
+
static int ichx_gpio_request_regions(struct resource *res_base,
const char *name, u8 use_gpio)
{
@@ -427,6 +448,9 @@ static int ichx_gpio_probe(struct platform_device *pdev)
case ICH_V10CONS_GPIO:
ichx_priv.desc = &ich10_cons_desc;
break;
+ case AVOTON_GPIO:
+ ichx_priv.desc = &avoton_desc;
+ break;
default:
return -ENODEV;
}
--
1.8.3.2
next prev parent reply other threads:[~2014-02-14 14:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-14 14:01 [RESEND 0/6] Intel Atom C2000 series GPIO support Vincent Donnefort
2014-02-14 14:01 ` [RESEND 1/6] mfd: lpc_ich: Convert ICH GPIOs IDs to enum Vincent Donnefort
2014-02-24 13:37 ` Linus Walleij
2014-02-24 15:40 ` Lee Jones
2014-02-25 9:35 ` Linus Walleij
2014-02-14 14:01 ` [RESEND 2/6] mfd: lpc_ich: Add support for Intel Avoton GPIOs Vincent Donnefort
2014-02-14 14:01 ` [RESEND 3/6] gpio: ich: Add blink capability option Vincent Donnefort
2014-02-14 14:01 ` [RESEND 4/6] gpio: ich: Add support for multiple register addresses Vincent Donnefort
2014-02-14 14:01 ` [RESEND 5/6] gpio: ich: Add output levels cache support Vincent Donnefort
2014-02-14 14:01 ` Vincent Donnefort [this message]
2014-02-14 14:27 ` [RESEND 0/6] Intel Atom C2000 series GPIO support Lee Jones
2014-02-24 13:39 ` Linus Walleij
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=1392386518-11025-7-git-send-email-vdonnefort@gmail.com \
--to=vdonnefort@gmail.com \
--cc=asierra@xes-inc.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sameo@linux.intel.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 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).