From: Sascha Hauer <s.hauer@pengutronix.de>
To: Patrick <kpa_info@yahoo.fr>
Cc: barebox@lists.infradead.org
Subject: Re: GPIO commands on OMAP4
Date: Thu, 5 Apr 2012 15:49:57 +0200 [thread overview]
Message-ID: <20120405134957.GE3852@pengutronix.de> (raw)
In-Reply-To: <4F7D68A1.9000800@yahoo.fr>
On Thu, Apr 05, 2012 at 11:40:49AM +0200, Patrick wrote:
> Dear mailing-list,
>
> I am using a pcm049 phyCORE omap4430 module from Phytec with BareBox
> 2011.09.0 patched with BSP from Phytec.
>
> I would like to use the GPIO command to read a switch at startup.
> This chip is connected on ABE_MCBSP1_DX (gpio_116). I have edited
> the boards/pcm049/mux.c files to change the configuration of this
> GPIO as follow: {ABE_MCBSP1_DX, (DIS | IEN | M3)} instead of
> {ABE_MCBSP1_DX, (SAFE_MODE)}.
>
> I then use the "gpio_get_value 116" command followed by "echo $?" to
> read the value. I always read a 0. On Linux I could read the right
> value depending of the position of the switch, so it's not an
> hardware problems.
>
> I have tried with one of the two LEDs on the module (gpio_152) and I
> could change the LED state and read it back with gpio_get_value.
>
> I do not understand what I am doing wrong. Any help will be appreciated.
What you tried should work. The only thing I can imagine is that you
need a gpio_direction_input before reading the value.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-04-05 13:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 9:40 Patrick
2012-04-05 12:45 ` Patrick
2012-04-05 13:49 ` Sascha Hauer [this message]
2012-04-05 14:38 ` Patrick
2012-04-05 14:58 ` Patrick
2012-04-05 16:19 ` Sascha Hauer
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=20120405134957.GE3852@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=kpa_info@yahoo.fr \
/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