* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
@ 2009-11-17 11:21 Rodolfo Giometti
2009-11-17 11:44 ` Daniel Mack
0 siblings, 1 reply; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 11:21 UTC (permalink / raw)
To: linux-arm-kernel
PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
outputs (see for example figure 24-1 into PXA27x Processor Family
Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
correct.
Programmers should set up GPIOs direction according to their usage and
the function pxa_gpio_irq_type() should simply enable the IRQ
detection.
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Cc: raffaele.recalcati at bticino.it
---
arch/arm/plat-pxa/gpio.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
index 98548c6..3f17221 100644
--- a/arch/arm/plat-pxa/gpio.c
+++ b/arch/arm/plat-pxa/gpio.c
@@ -176,13 +176,6 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
}
- gpdr = __raw_readl(c->regbase + GPDR_OFFSET);
-
- if (__gpio_is_inverted(gpio))
- __raw_writel(gpdr | mask, c->regbase + GPDR_OFFSET);
- else
- __raw_writel(gpdr & ~mask, c->regbase + GPDR_OFFSET);
-
if (type & IRQ_TYPE_EDGE_RISING)
c->irq_edge_rise |= mask;
else
--
1.6.3.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 11:21 [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs Rodolfo Giometti
@ 2009-11-17 11:44 ` Daniel Mack
2009-11-17 12:05 ` Rodolfo Giometti
2009-11-17 17:00 ` H Hartley Sweeten
0 siblings, 2 replies; 15+ messages in thread
From: Daniel Mack @ 2009-11-17 11:44 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
> PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
> outputs (see for example figure 24-1 into PXA27x Processor Family
> Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
> correct.
>
> Programmers should set up GPIOs direction according to their usage and
> the function pxa_gpio_irq_type() should simply enable the IRQ
> detection.
Interesting. Is this an academic issue or do you actually use that?
That would mean you externally drive the IO pin level to something else
than the output driver provides, which isn't healthy at all.
Daniel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 11:44 ` Daniel Mack
@ 2009-11-17 12:05 ` Rodolfo Giometti
2009-11-17 12:12 ` Eric Miao
2009-11-17 12:34 ` Daniel Mack
2009-11-17 17:00 ` H Hartley Sweeten
1 sibling, 2 replies; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 12:05 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 12:44:29PM +0100, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
> > PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
> > outputs (see for example figure 24-1 into PXA27x Processor Family
> > Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
> > correct.
> >
> > Programmers should set up GPIOs direction according to their usage and
> > the function pxa_gpio_irq_type() should simply enable the IRQ
> > detection.
>
> Interesting. Is this an academic issue or do you actually use that?
> That would mean you externally drive the IO pin level to something else
> than the output driver provides, which isn't healthy at all.
It's a real configuration with no electrical drawbacks at all! Of
course the driver's output must be passive (I use it to detect a CARD
insert) but it's functional.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 12:05 ` Rodolfo Giometti
@ 2009-11-17 12:12 ` Eric Miao
2009-11-17 12:34 ` Daniel Mack
1 sibling, 0 replies; 15+ messages in thread
From: Eric Miao @ 2009-11-17 12:12 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 6:05 AM, Rodolfo Giometti <giometti@enneenne.com> wrote:
> On Tue, Nov 17, 2009 at 12:44:29PM +0100, Daniel Mack wrote:
>> On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
>> > PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
>> > outputs (see for example figure 24-1 into PXA27x Processor Family
>> > Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
>> > correct.
>> >
>> > Programmers should set up GPIOs direction according to their usage and
>> > the function pxa_gpio_irq_type() should simply enable the IRQ
>> > detection.
>>
>> Interesting. Is this an academic issue or do you actually use that?
>> That would mean you externally drive the IO pin level to something else
>> than the output driver provides, which isn't healthy at all.
>
> It's a real configuration with no electrical drawbacks at all! Of
> course the driver's output must be passive (I use it to detect a CARD
> insert) but it's functional.
Well, that might be possible configuration but as long as there is no
real issue with this, I'd prefer the safe guard here remain intact atm.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 12:05 ` Rodolfo Giometti
2009-11-17 12:12 ` Eric Miao
@ 2009-11-17 12:34 ` Daniel Mack
2009-11-17 12:37 ` Rodolfo Giometti
1 sibling, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2009-11-17 12:34 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 01:05:01PM +0100, Rodolfo Giometti wrote:
> On Tue, Nov 17, 2009 at 12:44:29PM +0100, Daniel Mack wrote:
> > On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
> > > PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
> > > outputs (see for example figure 24-1 into PXA27x Processor Family
> > > Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
> > > correct.
> > >
> > > Programmers should set up GPIOs direction according to their usage and
> > > the function pxa_gpio_irq_type() should simply enable the IRQ
> > > detection.
> >
> > Interesting. Is this an academic issue or do you actually use that?
> > That would mean you externally drive the IO pin level to something else
> > than the output driver provides, which isn't healthy at all.
>
> It's a real configuration with no electrical drawbacks at all! Of
> course the driver's output must be passive (I use it to detect a CARD
> insert) but it's functional.
For such situations, the pullup/pulldown functions are normally used.
Have you tried that?
Daniel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 12:34 ` Daniel Mack
@ 2009-11-17 12:37 ` Rodolfo Giometti
2009-11-17 12:43 ` Daniel Mack
0 siblings, 1 reply; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 12:37 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 01:34:22PM +0100, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 01:05:01PM +0100, Rodolfo Giometti wrote:
> > On Tue, Nov 17, 2009 at 12:44:29PM +0100, Daniel Mack wrote:
> > > On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
> > > > PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
> > > > outputs (see for example figure 24-1 into PXA27x Processor Family
> > > > Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
> > > > correct.
> > > >
> > > > Programmers should set up GPIOs direction according to their usage and
> > > > the function pxa_gpio_irq_type() should simply enable the IRQ
> > > > detection.
> > >
> > > Interesting. Is this an academic issue or do you actually use that?
> > > That would mean you externally drive the IO pin level to something else
> > > than the output driver provides, which isn't healthy at all.
> >
> > It's a real configuration with no electrical drawbacks at all! Of
> > course the driver's output must be passive (I use it to detect a CARD
> > insert) but it's functional.
>
> For such situations, the pullup/pulldown functions are normally used.
> Have you tried that?
Yes, the code has been tested on my board and it works perfectly.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 12:37 ` Rodolfo Giometti
@ 2009-11-17 12:43 ` Daniel Mack
2009-11-17 12:59 ` Rodolfo Giometti
0 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2009-11-17 12:43 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 01:37:21PM +0100, Rodolfo Giometti wrote:
> On Tue, Nov 17, 2009 at 01:34:22PM +0100, Daniel Mack wrote:
> > On Tue, Nov 17, 2009 at 01:05:01PM +0100, Rodolfo Giometti wrote:
> > > On Tue, Nov 17, 2009 at 12:44:29PM +0100, Daniel Mack wrote:
> > > > On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
> > > > > PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
> > > > > outputs (see for example figure 24-1 into PXA27x Processor Family
> > > > > Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
> > > > > correct.
> > > > >
> > > > > Programmers should set up GPIOs direction according to their usage and
> > > > > the function pxa_gpio_irq_type() should simply enable the IRQ
> > > > > detection.
> > > >
> > > > Interesting. Is this an academic issue or do you actually use that?
> > > > That would mean you externally drive the IO pin level to something else
> > > > than the output driver provides, which isn't healthy at all.
> > >
> > > It's a real configuration with no electrical drawbacks at all! Of
> > > course the driver's output must be passive (I use it to detect a CARD
> > > insert) but it's functional.
> >
> > For such situations, the pullup/pulldown functions are normally used.
> > Have you tried that?
>
> Yes, the code has been tested on my board and it works perfectly.
What I mean is a mfp_cfg_t configuration as input pin with pull flags
MFP_PULL_{HIGH,LOW} set.
Daniel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 12:43 ` Daniel Mack
@ 2009-11-17 12:59 ` Rodolfo Giometti
2009-11-17 13:06 ` Daniel Mack
0 siblings, 1 reply; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 12:59 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 01:43:34PM +0100, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 01:37:21PM +0100, Rodolfo Giometti wrote:
> > On Tue, Nov 17, 2009 at 01:34:22PM +0100, Daniel Mack wrote:
> > > On Tue, Nov 17, 2009 at 01:05:01PM +0100, Rodolfo Giometti wrote:
> > > > On Tue, Nov 17, 2009 at 12:44:29PM +0100, Daniel Mack wrote:
> > > > > On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
> > > > > > PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
> > > > > > outputs (see for example figure 24-1 into PXA27x Processor Family
> > > > > > Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
> > > > > > correct.
> > > > > >
> > > > > > Programmers should set up GPIOs direction according to their usage and
> > > > > > the function pxa_gpio_irq_type() should simply enable the IRQ
> > > > > > detection.
> > > > >
> > > > > Interesting. Is this an academic issue or do you actually use that?
> > > > > That would mean you externally drive the IO pin level to something else
> > > > > than the output driver provides, which isn't healthy at all.
> > > >
> > > > It's a real configuration with no electrical drawbacks at all! Of
> > > > course the driver's output must be passive (I use it to detect a CARD
> > > > insert) but it's functional.
> > >
> > > For such situations, the pullup/pulldown functions are normally used.
> > > Have you tried that?
> >
> > Yes, the code has been tested on my board and it works perfectly.
>
> What I mean is a mfp_cfg_t configuration as input pin with pull flags
> MFP_PULL_{HIGH,LOW} set.
I see... no I didn't noticed such possibility.
however I suppose that even using such flags my patch is needed in
order to avoid pxa_gpio_irq_type() forcing the input direction...
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 12:59 ` Rodolfo Giometti
@ 2009-11-17 13:06 ` Daniel Mack
2009-11-17 13:16 ` Rodolfo Giometti
2009-11-17 14:38 ` Rodolfo Giometti
0 siblings, 2 replies; 15+ messages in thread
From: Daniel Mack @ 2009-11-17 13:06 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 01:59:53PM +0100, Rodolfo Giometti wrote:
> On Tue, Nov 17, 2009 at 01:43:34PM +0100, Daniel Mack wrote:
> > On Tue, Nov 17, 2009 at 01:37:21PM +0100, Rodolfo Giometti wrote:
> > > On Tue, Nov 17, 2009 at 01:34:22PM +0100, Daniel Mack wrote:
> > > > For such situations, the pullup/pulldown functions are normally used.
> > > > Have you tried that?
> > >
> > > Yes, the code has been tested on my board and it works perfectly.
> >
> > What I mean is a mfp_cfg_t configuration as input pin with pull flags
> > MFP_PULL_{HIGH,LOW} set.
>
> I see... no I didn't noticed such possibility.
>
> however I suppose that even using such flags my patch is needed in
> order to avoid pxa_gpio_irq_type() forcing the input direction...
No, that's exactly my point. You don't need to set the pin to output
direction to make use of those pull features. More than that, when
confiugured as output, the pull flags actually don't make sense.
As an IRQ is always inbound, I agree with Eric that the code should
stay in there for safety and sanity.
Daniel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 13:06 ` Daniel Mack
@ 2009-11-17 13:16 ` Rodolfo Giometti
2009-11-17 14:38 ` Rodolfo Giometti
1 sibling, 0 replies; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 13:16 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 02:06:53PM +0100, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 01:59:53PM +0100, Rodolfo Giometti wrote:
> > On Tue, Nov 17, 2009 at 01:43:34PM +0100, Daniel Mack wrote:
> > > On Tue, Nov 17, 2009 at 01:37:21PM +0100, Rodolfo Giometti wrote:
> > > > On Tue, Nov 17, 2009 at 01:34:22PM +0100, Daniel Mack wrote:
> > > > > For such situations, the pullup/pulldown functions are normally used.
> > > > > Have you tried that?
> > > >
> > > > Yes, the code has been tested on my board and it works perfectly.
> > >
> > > What I mean is a mfp_cfg_t configuration as input pin with pull flags
> > > MFP_PULL_{HIGH,LOW} set.
> >
> > I see... no I didn't noticed such possibility.
> >
> > however I suppose that even using such flags my patch is needed in
> > order to avoid pxa_gpio_irq_type() forcing the input direction...
>
> No, that's exactly my point. You don't need to set the pin to output
> direction to make use of those pull features. More than that, when
> confiugured as output, the pull flags actually don't make sense.
>
> As an IRQ is always inbound, I agree with Eric that the code should
> stay in there for safety and sanity.
I see what you mean... I'll test those flags and report results ASAP.
Thanks,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 13:06 ` Daniel Mack
2009-11-17 13:16 ` Rodolfo Giometti
@ 2009-11-17 14:38 ` Rodolfo Giometti
2009-11-17 17:11 ` Daniel Mack
1 sibling, 1 reply; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 14:38 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 02:06:53PM +0100, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 01:59:53PM +0100, Rodolfo Giometti wrote:
> > On Tue, Nov 17, 2009 at 01:43:34PM +0100, Daniel Mack wrote:
> > > On Tue, Nov 17, 2009 at 01:37:21PM +0100, Rodolfo Giometti wrote:
> > > > On Tue, Nov 17, 2009 at 01:34:22PM +0100, Daniel Mack wrote:
> > > > > For such situations, the pullup/pulldown functions are normally used.
> > > > > Have you tried that?
> > > >
> > > > Yes, the code has been tested on my board and it works perfectly.
> > >
> > > What I mean is a mfp_cfg_t configuration as input pin with pull flags
> > > MFP_PULL_{HIGH,LOW} set.
> >
> > I see... no I didn't noticed such possibility.
> >
> > however I suppose that even using such flags my patch is needed in
> > order to avoid pxa_gpio_irq_type() forcing the input direction...
>
> No, that's exactly my point. You don't need to set the pin to output
> direction to make use of those pull features. More than that, when
> confiugured as output, the pull flags actually don't make sense.
I just looking at pxa27x user manual but I don't see such pull-up
functionality... are you sure these settings aren't pxa3xx specific?
=:-o
Thanks,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 11:44 ` Daniel Mack
2009-11-17 12:05 ` Rodolfo Giometti
@ 2009-11-17 17:00 ` H Hartley Sweeten
1 sibling, 0 replies; 15+ messages in thread
From: H Hartley Sweeten @ 2009-11-17 17:00 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday, November 17, 2009 4:44 AM, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 12:21:46PM +0100, Rodolfo Giometti wrote:
>> PXA CPUs may use their GPIOs as IRQ lines even if they are selected as
>> outputs (see for example figure 24-1 into PXA27x Processor Family
>> Developer's Manual). So forcing GPIOs IRQ lines as inputs is not
>> correct.
>>
>> Programmers should set up GPIOs direction according to their usage and
>> the function pxa_gpio_irq_type() should simply enable the IRQ
>> detection.
>
> Interesting. Is this an academic issue or do you actually use that?
> That would mean you externally drive the IO pin level to something else
> than the output driver provides, which isn't healthy at all.
Actually, it appears this is a way of generating a software interrupt.
If the GPIO IRQ line is set as an output you could drive the pin to the
appropriate level to generate an interrupt.
Regards,
Hartley
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 14:38 ` Rodolfo Giometti
@ 2009-11-17 17:11 ` Daniel Mack
2009-11-17 18:02 ` Rodolfo Giometti
0 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2009-11-17 17:11 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 03:38:47PM +0100, Rodolfo Giometti wrote:
> On Tue, Nov 17, 2009 at 02:06:53PM +0100, Daniel Mack wrote:
> > On Tue, Nov 17, 2009 at 01:59:53PM +0100, Rodolfo Giometti wrote:
> > > On Tue, Nov 17, 2009 at 01:43:34PM +0100, Daniel Mack wrote:
> >
> > No, that's exactly my point. You don't need to set the pin to output
> > direction to make use of those pull features. More than that, when
> > confiugured as output, the pull flags actually don't make sense.
>
> I just looking at pxa27x user manual but I don't see such pull-up
> functionality... are you sure these settings aren't pxa3xx specific?
> =:-o
I haven't checked the datasheet but the header files that defines this
macro only. And it didn't appear to be PXA3x specific.
Anyway, if this is unavailable on your hardware, the proper way would be
to place an external resistor on the board (given that you can modify
the schematics).
I'm still not convinced that driving the pad as output GPIO and then
applying a different level externally to generate an IRQ is intended.
Daniel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 17:11 ` Daniel Mack
@ 2009-11-17 18:02 ` Rodolfo Giometti
2009-11-17 19:28 ` Russell King - ARM Linux
0 siblings, 1 reply; 15+ messages in thread
From: Rodolfo Giometti @ 2009-11-17 18:02 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 06:11:16PM +0100, Daniel Mack wrote:
> On Tue, Nov 17, 2009 at 03:38:47PM +0100, Rodolfo Giometti wrote:
> > On Tue, Nov 17, 2009 at 02:06:53PM +0100, Daniel Mack wrote:
> > > On Tue, Nov 17, 2009 at 01:59:53PM +0100, Rodolfo Giometti wrote:
> > > > On Tue, Nov 17, 2009 at 01:43:34PM +0100, Daniel Mack wrote:
> > >
> > > No, that's exactly my point. You don't need to set the pin to output
> > > direction to make use of those pull features. More than that, when
> > > confiugured as output, the pull flags actually don't make sense.
> >
> > I just looking at pxa27x user manual but I don't see such pull-up
> > functionality... are you sure these settings aren't pxa3xx specific?
> > =:-o
>
> I haven't checked the datasheet but the header files that defines this
> macro only. And it didn't appear to be PXA3x specific.
I cannot find such register nor pull-up/down management into whole
PXA27x user manual.
> Anyway, if this is unavailable on your hardware, the proper way would be
> to place an external resistor on the board (given that you can modify
> the schematics).
Why should I do as you suggest when the CPU can support such
electrical configuration?
> I'm still not convinced that driving the pad as output GPIO and then
> applying a different level externally to generate an IRQ is intended.
No external different level applyed! Just a pull-down enabled by a
machanical switch: if no cards are inserted I read 1 but if I insert a
card I got 0 due the pull-down enabling.
I tested the code on my hardware who works perfectly.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs
2009-11-17 18:02 ` Rodolfo Giometti
@ 2009-11-17 19:28 ` Russell King - ARM Linux
0 siblings, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2009-11-17 19:28 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 17, 2009 at 07:02:00PM +0100, Rodolfo Giometti wrote:
> On Tue, Nov 17, 2009 at 06:11:16PM +0100, Daniel Mack wrote:
> > I'm still not convinced that driving the pad as output GPIO and then
> > applying a different level externally to generate an IRQ is intended.
>
> No external different level applyed! Just a pull-down enabled by a
> machanical switch: if no cards are inserted I read 1 but if I insert a
> card I got 0 due the pull-down enabling.
I'm sorry, but I really can't believe you mean what you just said. The
two sentences are definitely contradictory.
In the first, you say that you're not applying a different level.
In the second, you say that you're applying zero volts to the output.
That _is_ a different level, no two ways about it.
By doing so, you are brute-force fighting the FET in the SoC which is
trying to pull the output up to logic '1'. God knows how much current
you're causing the FET to pass - and therefore how much power it is
dissapating - but according to the PXA270 spec, it'll be in excess of
3mA. (At 3mA, the output voltage on a GPIO pin is guaranteed to be,
for logic 1, at least 0.8 * VCC_IO).
This is in no way good electronic practice.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2009-11-17 19:28 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17 11:21 [PATCH] arm pxa: remove "direction input" forcing for IRQ GPIOs Rodolfo Giometti
2009-11-17 11:44 ` Daniel Mack
2009-11-17 12:05 ` Rodolfo Giometti
2009-11-17 12:12 ` Eric Miao
2009-11-17 12:34 ` Daniel Mack
2009-11-17 12:37 ` Rodolfo Giometti
2009-11-17 12:43 ` Daniel Mack
2009-11-17 12:59 ` Rodolfo Giometti
2009-11-17 13:06 ` Daniel Mack
2009-11-17 13:16 ` Rodolfo Giometti
2009-11-17 14:38 ` Rodolfo Giometti
2009-11-17 17:11 ` Daniel Mack
2009-11-17 18:02 ` Rodolfo Giometti
2009-11-17 19:28 ` Russell King - ARM Linux
2009-11-17 17:00 ` H Hartley Sweeten
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).