* [PATCH] pch_gpio: set value before enabling output direction
@ 2014-03-25 9:32 Alexander Stein
2014-03-27 9:22 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Stein @ 2014-03-25 9:32 UTC (permalink / raw)
To: Linus Walleij, Alexandre Courbot
Cc: linux-gpio, Daniel Krueger, Alexander Stein
From: Daniel Krueger <daniel.krueger@systec-electronic.com>
This ensures that the output signal does not toggle if set to high.
Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
drivers/gpio/gpio-pch.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
index 9656c19..83a1563 100644
--- a/drivers/gpio/gpio-pch.c
+++ b/drivers/gpio/gpio-pch.c
@@ -138,9 +138,6 @@ static int pch_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
unsigned long flags;
spin_lock_irqsave(&chip->spinlock, flags);
- pm = ioread32(&chip->reg->pm) & ((1 << gpio_pins[chip->ioh]) - 1);
- pm |= (1 << nr);
- iowrite32(pm, &chip->reg->pm);
reg_val = ioread32(&chip->reg->po);
if (val)
@@ -148,6 +145,11 @@ static int pch_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
else
reg_val &= ~(1 << nr);
iowrite32(reg_val, &chip->reg->po);
+
+ pm = ioread32(&chip->reg->pm) & ((1 << gpio_pins[chip->ioh]) - 1);
+ pm |= (1 << nr);
+ iowrite32(pm, &chip->reg->pm);
+
spin_unlock_irqrestore(&chip->spinlock, flags);
return 0;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pch_gpio: set value before enabling output direction
2014-03-25 9:32 [PATCH] pch_gpio: set value before enabling output direction Alexander Stein
@ 2014-03-27 9:22 ` Linus Walleij
2014-04-07 10:16 ` Alexander Stein
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2014-03-27 9:22 UTC (permalink / raw)
To: Alexander Stein
Cc: Alexandre Courbot, linux-gpio@vger.kernel.org, Daniel Krueger
On Tue, Mar 25, 2014 at 10:32 AM, Alexander Stein
<alexander.stein@systec-electronic.com> wrote:
> From: Daniel Krueger <daniel.krueger@systec-electronic.com>
>
> This ensures that the output signal does not toggle if set to high.
>
> Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Patch applied,
Alexander, would you consider doing a patch adding yourself
as maintainer of this driver in the MAINTAINERS file?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pch_gpio: set value before enabling output direction
2014-03-27 9:22 ` Linus Walleij
@ 2014-04-07 10:16 ` Alexander Stein
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Stein @ 2014-04-07 10:16 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexandre Courbot, linux-gpio@vger.kernel.org, Daniel Krueger
Hello Linus,
On Thursday 27 March 2014 10:22:40, Linus Walleij wrote:
> On Tue, Mar 25, 2014 at 10:32 AM, Alexander Stein
> <alexander.stein@systec-electronic.com> wrote:
>
> > From: Daniel Krueger <daniel.krueger@systec-electronic.com>
> >
> > This ensures that the output signal does not toggle if set to high.
> >
> > Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
> > Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
>
> Patch applied,
>
> Alexander, would you consider doing a patch adding yourself
> as maintainer of this driver in the MAINTAINERS file?
Thanks for offering this. I'm inclined to this, but the problem ist I won't have
good or even permanent access to this hardware :( So I have to decline.
Best regards,
Alexander
--
Dipl.-Inf. Alexander Stein
SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Tel.: 03765 38600-1156
Fax: 03765 38600-4100
Email: alexander.stein@systec-electronic.com
Website: www.systec-electronic.com
Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Chemnitz, HRB 28082
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-07 10:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25 9:32 [PATCH] pch_gpio: set value before enabling output direction Alexander Stein
2014-03-27 9:22 ` Linus Walleij
2014-04-07 10:16 ` Alexander Stein
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).