public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru•mvista.com>
To: Stefan Strobl <nst@gersys•de>
Cc: ppc-dev <linuxppc-dev@ozlabs•org>
Subject: Re: MPC52xx simple GPIO support
Date: Tue, 2 Jun 2009 21:15:27 +0400	[thread overview]
Message-ID: <20090602171527.GA8745@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <4A255B21.8040002@gersys.de>

Hi Stefan,

On Tue, Jun 02, 2009 at 07:02:25PM +0200, Stefan Strobl wrote:
> Hi
> I still don't quite understand how to use the Flattened Device Tree /
> Open Firmware. I see there's a driver (mpc52xx_gpt.c) that supports to
> use the Pins on the GPT as simple GPIOs. I activated it by adding these
> lines to my dts file:
> 
> gpt2: timer@620 {
> 	compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
> 	reg = <0x620 0x10>;
> 	interrupts = <1 11 0>;
> 	gpio-controller;
> 	#gpio-cells = <2>;
> };
> 
> I can see the appropriate entries in sysfs
> (/sys/devices/f0000000.soc5200/f0000620.timer), but how can I actually
> use these GPIO's now?

For in-kernel usage example you can take a look at:
arch/powerpc/boot/dts/mpc836x_rdk.dts (upm node, notice gpios = <>)
drivers/mtd/nand/fsl_upm.c (of_get_gpio() then gpio_request()).

For userland usage you need to enable CONFIG_GPIO_SYSFS, and then
look into /sys/class/gpio/{gpiochip,export,gpioNNN}.

-- 
Anton Vorontsov
email: cbouatmailru@gmail•com
irc://irc.freenode.net/bd2

  reply	other threads:[~2009-06-02 17:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 17:02 MPC52xx simple GPIO support Stefan Strobl
2009-06-02 17:15 ` Anton Vorontsov [this message]
2009-06-03 12:42   ` Stefan Strobl
2009-06-03 13:22     ` PWM class? (was: Re: MPC52xx simple GPIO support) Anton Vorontsov
2009-06-03 15:38       ` Jon Smirl
2009-06-03 15:54         ` Trilok Soni
2009-06-11 22:00       ` Grant Likely
2009-06-12  0:37         ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090602171527.GA8745@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru$(echo .)mvista.com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=nst@gersys$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox