linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@ge.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: GPIO MPC8315 board
Date: Wed, 22 Jun 2011 10:37:23 +0100	[thread overview]
Message-ID: <4E01B7D3.1010700@ge.com> (raw)
In-Reply-To: <31901492.post@talk.nabble.com>

On 22/06/11 09:56, Vasanth Ragavendran wrote:
> 
> Hi
>  
> I am using a MPC8315ERDB board. For this i've an external button which is
> connected to GPIO pin 7 of the board. And if this button is pressed then
> certain files have to be deleted. Browsing through the internet i found that
> GPIO drivers have to be included into the kernel and hence i set a 'y' to
> CONFIG_MPC8xxx_GPIO, CONFIG_GPIO_SYSFS and CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB
> etc. And the dts file has be modified to include the following lines 
>  
> gpio1: gpio-controller@c00 {                
> #gpio-cells = <2>;                
> compatible = "fsl,mpc8315-gpio", "fsl,mpc8349-gpio";                
> reg = <0xc00 0x100>;                
> interrupts = <74 0x8>;                
> interrupt-parent = <&ipic>;                
> gpio-controller;         };          
>  
> this is included under immr@e0000000.
>  
> further i included
>  
> erase-button@0 {
> compatible = "erase-button";
> interrupts = <7 2>;
> interrupt-parent = <&gpio1>;
> };
>  
> am i right in including this? coz after compiling the kernel i get a folder
> under /sys/class/gpio. I did an export using
>  
> echo 224 > /sys/class/gpio/export.
>  
> 224 was the number appearing in gpiochip224/base.
>  
> It created another folder gpio224.
>  
> However i'm not able to set the value in them nor the direction.
>  
> echo 1 > /sys/class/gpio/gpio224/value
> cat /sys/class/gpio/gpio224/value
> returns a value of 0 only.
>  
> however the direction is "in"
> cat /sys/class/gpio/gpio224/direction
> in
> 

echo "out" > /sys/class/gpio/gpio224/direction

Martyn

> Am i doing it correctly? How to check it programatically if the button is
> pressed and take the corresponding action! Plz help!
>  
> My kernel version is 2.6.35.9.
>  
> Thanking you in advance.


-- 
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms                   | Wales (3828642) at 100
T +44(0)127322748                          | Barbirolli Square, Manchester,
E martyn.welch@ge.com                      | M2 3AB  VAT:GB 927559189

      reply	other threads:[~2011-06-22  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  8:56 GPIO MPC8315 board Vasanth Ragavendran
2011-06-22  9:37 ` Martyn Welch [this message]

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=4E01B7D3.1010700@ge.com \
    --to=martyn.welch@ge.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).