* [PATCH] gpio: ich: add GPO_BLINK support
@ 2013-06-14 14:09 Vincent Donnefort
2013-06-17 9:27 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Donnefort @ 2013-06-14 14:09 UTC (permalink / raw)
To: Grant Likely, Linus Walleij, Peter Tyser
Cc: linux-kernel, Simon Guinot, Vincent Donnefort
This patch makes sure blink hardware is disabled for selected GPIO. Blink
hardware is controled by GPO_BLINK register and is available for GPIOs from 0
to 31.
Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index de3c317..181828f 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -41,12 +41,14 @@ enum GPIO_REG {
GPIO_USE_SEL = 0,
GPIO_IO_SEL,
GPIO_LVL,
+ GPO_BLINK
};
-static const u8 ichx_regs[3][3] = {
+static const u8 ichx_regs[4][3] = {
{0x00, 0x30, 0x40}, /* USE_SEL[1-3] offsets */
{0x04, 0x34, 0x44}, /* IO_SEL[1-3] offsets */
{0x0c, 0x38, 0x48}, /* LVL[1-3] offsets */
+ {0x18, 0x18, 0x18}, /* BLINK offset */
};
static const u8 ichx_reglen[3] = {
@@ -154,6 +156,10 @@ static int ichx_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
if (!ichx_gpio_check_available(gpio, nr))
return -ENXIO;
+ /* Disable blink hardware which is available for GPIOs from 0 to 31. */
+ if (nr < 32)
+ ichx_write_bit(GPO_BLINK, nr, 0, 0);
+
/* Set GPIO output value. */
ichx_write_bit(GPIO_LVL, nr, val, 0);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: ich: add GPO_BLINK support
2013-06-14 14:09 [PATCH] gpio: ich: add GPO_BLINK support Vincent Donnefort
@ 2013-06-17 9:27 ` Linus Walleij
2013-06-17 12:03 ` [PATCH v2] " Vincent Donnefort
0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2013-06-17 9:27 UTC (permalink / raw)
To: Vincent Donnefort; +Cc: Grant Likely, Peter Tyser, linux-kernel, Simon Guinot
On Fri, Jun 14, 2013 at 4:09 PM, Vincent Donnefort <vdonnefort@gmail.com> wrote:
> This patch makes sure blink hardware is disabled for selected GPIO. Blink
> hardware is controled by GPO_BLINK register and is available for GPIOs from 0
> to 31.
>
> Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
Patch looks OK but does not apply on my current GPIO
tree, i.e. this:
https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=next
Care to rebase it?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] gpio: ich: add GPO_BLINK support
2013-06-17 9:27 ` Linus Walleij
@ 2013-06-17 12:03 ` Vincent Donnefort
2013-06-19 19:14 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Donnefort @ 2013-06-17 12:03 UTC (permalink / raw)
To: Grant Likely, Linus Walleij, Peter Tyser
Cc: linux-kernel, Simon Guinot, Vincent Donnefort
This patch makes sure blink hardware is disabled for selected GPIO. Blink
hardware is controled by GPO_BLINK register and is available for GPIOs from 0
to 31.
Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
---
Changes for v2:
- Rebased on for-next branch of linux-gpio git tree
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
drivers/gpio/gpio-ich.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index e16d932..2729e3d 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -41,12 +41,14 @@ enum GPIO_REG {
GPIO_USE_SEL = 0,
GPIO_IO_SEL,
GPIO_LVL,
+ GPO_BLINK
};
-static const u8 ichx_regs[3][3] = {
+static const u8 ichx_regs[4][3] = {
{0x00, 0x30, 0x40}, /* USE_SEL[1-3] offsets */
{0x04, 0x34, 0x44}, /* IO_SEL[1-3] offsets */
{0x0c, 0x38, 0x48}, /* LVL[1-3] offsets */
+ {0x18, 0x18, 0x18}, /* BLINK offset */
};
static const u8 ichx_reglen[3] = {
@@ -148,6 +150,10 @@ static int ichx_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
static int ichx_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
int val)
{
+ /* Disable blink hardware which is available for GPIOs from 0 to 31. */
+ if (nr < 32)
+ ichx_write_bit(GPO_BLINK, nr, 0, 0);
+
/* Set GPIO output value. */
ichx_write_bit(GPIO_LVL, nr, val, 0);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gpio: ich: add GPO_BLINK support
2013-06-17 12:03 ` [PATCH v2] " Vincent Donnefort
@ 2013-06-19 19:14 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-06-19 19:14 UTC (permalink / raw)
To: Vincent Donnefort; +Cc: Grant Likely, Peter Tyser, linux-kernel, Simon Guinot
On Mon, Jun 17, 2013 at 2:03 PM, Vincent Donnefort <vdonnefort@gmail.com> wrote:
> This patch makes sure blink hardware is disabled for selected GPIO. Blink
> hardware is controled by GPO_BLINK register and is available for GPIOs from 0
> to 31.
>
> Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
> ---
> Changes for v2:
> - Rebased on for-next branch of linux-gpio git tree
> git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
Thanks!
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-19 19:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-14 14:09 [PATCH] gpio: ich: add GPO_BLINK support Vincent Donnefort
2013-06-17 9:27 ` Linus Walleij
2013-06-17 12:03 ` [PATCH v2] " Vincent Donnefort
2013-06-19 19:14 ` Linus Walleij
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.