Re: GPIO driver for MPC8313.

2009-09-23 Thread Peter Korsgaard
 Johnny == Johnny Hung johnny.hack...@gmail.com writes:

 Johnny Hi All:
 Johnny    Is 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 gpio
 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.

-- 
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: GPIO driver for MPC8313.

2009-09-23 Thread Johnny Hung
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 jac...@sunsite.dk:
 Johnny == Johnny Hung johnny.hack...@gmail.com writes:

  Johnny Hi All:
  Johnny    Is 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 gpio
  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.

 --
 Bye, Peter Korsgaard

--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: GPIO driver for MPC8313.

2009-09-23 Thread Peter Korsgaard
 Johnny == Johnny Hung johnny.hack...@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
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: GPIO driver for MPC8313.

2009-09-23 Thread Johnny Hung
Many thanks for your help. I will try it.

2009/9/23 Peter Korsgaard jac...@sunsite.dk:
 Johnny == Johnny Hung johnny.hack...@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

--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html