linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* GPIO driver for MPC8313.
@ 2009-09-23  3:55 Johnny Hung
  2009-09-23  6:57 ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Johnny Hung @ 2009-09-23  3:55 UTC (permalink / raw)
  To: linuxppc-dev, linux-embedded

Hi All:
=A0 =A0Is there a alreday written GPIO dirver or example for
MPC8313/similar ppc platform. It looks like many people need GPIO
dirver to control LED, etc... I think is it possible to write a
general gpio driver for all ppc platform and only need to modify gpio
iomap information of dtb file. Please give me a advice. Thanks in
advanced.

BRs, H. Johnny

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GPIO driver for MPC8313.
  2009-09-23  3:55 GPIO driver for MPC8313 Johnny Hung
@ 2009-09-23  6:57 ` Peter Korsgaard
  2009-09-23 10:52   ` Johnny Hung
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2009-09-23  6:57 UTC (permalink / raw)
  To: Johnny Hung; +Cc: linuxppc-dev, linux-embedded

>>>>> "Johnny" =3D=3D Johnny Hung <johnny.hacking@gmail.com> writes:

 Johnny> Hi All:
 Johnny> =C2=A0 =C2=A0Is there a alreday written GPIO dirver or example for
 Johnny> MPC8313/similar ppc platform. It looks like many people need GPIO
 Johnny> dirver to control LED, etc... I think is it possible to write a
 Johnny> general gpio driver for all ppc platform and only need to modify g=
pio
 Johnny> iomap information of dtb file. Please give me a advice. Thanks in
 Johnny> advanced.

Sure, it's arch/powerpc/sysdev/mpc8xxx_gpio.c, included since 2.6.28. To
use it, simply enable CONFIG_MPC8xxx_GPIO and add a gpio-controller node
to your dts, similar to how it's done in
arch/powerpc/boot/dts/mpc837*_rdb.dts.

See Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt for details of
the dts bindings.

--=20
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GPIO driver for MPC8313.
  2009-09-23  6:57 ` Peter Korsgaard
@ 2009-09-23 10:52   ` Johnny Hung
  2009-09-23 11:04     ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Johnny Hung @ 2009-09-23 10:52 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev, linux-embedded

Thanks, got it. BTW, how to trigger GPIO level in user space
application? I also found arch/powerpc/platforms/52xx/mpc52xx_gpio.c
is a good example. Any reply is appreciate.

BRs, H. Johnny

2009/9/23 Peter Korsgaard <jacmet@sunsite.dk>:
>>>>>> "Johnny" =3D=3D Johnny Hung <johnny.hacking@gmail.com> writes:
>
> =A0Johnny> Hi All:
> =A0Johnny> =A0 =A0Is there a alreday written GPIO dirver or example for
> =A0Johnny> MPC8313/similar ppc platform. It looks like many people need G=
PIO
> =A0Johnny> dirver to control LED, etc... I think is it possible to write =
a
> =A0Johnny> general gpio driver for all ppc platform and only need to modi=
fy gpio
> =A0Johnny> iomap information of dtb file. Please give me a advice. Thanks=
 in
> =A0Johnny> advanced.
>
> Sure, it's arch/powerpc/sysdev/mpc8xxx_gpio.c, included since 2.6.28. To
> use it, simply enable CONFIG_MPC8xxx_GPIO and add a gpio-controller node
> to your dts, similar to how it's done in
> arch/powerpc/boot/dts/mpc837*_rdb.dts.
>
> See Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt for details of
> the dts bindings.
>
> --
> Bye, Peter Korsgaard
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GPIO driver for MPC8313.
  2009-09-23 10:52   ` Johnny Hung
@ 2009-09-23 11:04     ` Peter Korsgaard
  2009-09-23 15:20       ` Johnny Hung
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2009-09-23 11:04 UTC (permalink / raw)
  To: Johnny Hung; +Cc: linuxppc-dev, linux-embedded

>>>>> "Johnny" == Johnny Hung <johnny.hacking@gmail.com> writes:

 Johnny> Thanks, got it. BTW, how to trigger GPIO level in user space
 Johnny> application? I also found
 Johnny> arch/powerpc/platforms/52xx/mpc52xx_gpio.c is a good
 Johnny> example. Any reply is appreciate.

Through sysfs. See 'Sysfs Interface for Userspace' section of
Documentation/gpio.txt

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GPIO driver for MPC8313.
  2009-09-23 11:04     ` Peter Korsgaard
@ 2009-09-23 15:20       ` Johnny Hung
  2009-09-28  2:43         ` Johnny Hung
  0 siblings, 1 reply; 7+ messages in thread
From: Johnny Hung @ 2009-09-23 15:20 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev, linux-embedded

Many thanks for your help. I will try it.

2009/9/23 Peter Korsgaard <jacmet@sunsite.dk>:
>>>>>> "Johnny" =3D=3D Johnny Hung <johnny.hacking@gmail.com> writes:
>
> =A0Johnny> Thanks, got it. BTW, how to trigger GPIO level in user space
> =A0Johnny> application? I also found
> =A0Johnny> arch/powerpc/platforms/52xx/mpc52xx_gpio.c is a good
> =A0Johnny> example. Any reply is appreciate.
>
> Through sysfs. See 'Sysfs Interface for Userspace' section of
> Documentation/gpio.txt
>
> --
> Bye, Peter Korsgaard
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GPIO driver for MPC8313.
  2009-09-23 15:20       ` Johnny Hung
@ 2009-09-28  2:43         ` Johnny Hung
  2009-09-28  5:16           ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Johnny Hung @ 2009-09-28  2:43 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev, linux-embedded

The kerne source I used now is 2.6.23 with MPC8313-erdb pached. I
think I should port 2.6.28 gpio function back to 2.6.23. Is it a
common way to implement it in the kernel I used or I should port
MPC8313-erdb pached to 2.6.28 opposite?

BRs, H. Johnny

2009/9/23 Johnny Hung <johnny.hacking@gmail.com>:
> Many thanks for your help. I will try it.
>
> 2009/9/23 Peter Korsgaard <jacmet@sunsite.dk>:
>>>>>>> "Johnny" =3D=3D Johnny Hung <johnny.hacking@gmail.com> writes:
>>
>> =A0Johnny> Thanks, got it. BTW, how to trigger GPIO level in user space
>> =A0Johnny> application? I also found
>> =A0Johnny> arch/powerpc/platforms/52xx/mpc52xx_gpio.c is a good
>> =A0Johnny> example. Any reply is appreciate.
>>
>> Through sysfs. See 'Sysfs Interface for Userspace' section of
>> Documentation/gpio.txt
>>
>> --
>> Bye, Peter Korsgaard
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GPIO driver for MPC8313.
  2009-09-28  2:43         ` Johnny Hung
@ 2009-09-28  5:16           ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2009-09-28  5:16 UTC (permalink / raw)
  To: Johnny Hung; +Cc: linuxppc-dev, linux-embedded

>>>>> "Johnny" == Johnny Hung <johnny.hacking@gmail.com> writes:

 Johnny> The kerne source I used now is 2.6.23 with MPC8313-erdb
 Johnny> pached. I think I should port 2.6.28 gpio function back to
 Johnny> 2.6.23. Is it a common way to implement it in the kernel I used
 Johnny> or I should port MPC8313-erdb pached to 2.6.28 opposite?

It shouldn't be that hard to back port, but I would certainly go for
2.6.28 (or rather 2.6.31) unless something keeps you at 2.6.23.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-28  5:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-23  3:55 GPIO driver for MPC8313 Johnny Hung
2009-09-23  6:57 ` Peter Korsgaard
2009-09-23 10:52   ` Johnny Hung
2009-09-23 11:04     ` Peter Korsgaard
2009-09-23 15:20       ` Johnny Hung
2009-09-28  2:43         ` Johnny Hung
2009-09-28  5:16           ` Peter Korsgaard

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).