* i.MX27 GPIOs -- how to define the default output?
@ 2010-05-22 1:02 Stuart Longland
2010-05-24 10:23 ` Robert Schwebel
2010-05-25 7:59 ` Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Stuart Longland @ 2010-05-22 1:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
I'm in the process of porting Ka-Ro's TX27 kernel patch over from kernel
2.6.28 to current git HEAD[1]. In the process of doing this, I note that
the old definitions GPIO_DFLT_HIGH and GPIO_DFLT_LOW have disappeared.
I can't seem to find their replacements anywhere.
The code I'm porting defines a heap of GPIO pins for use with the LCD
controller:
static unsigned int mx27_lcdc_gpios[] = {
MXC_PIN(F, 12, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* LCD reset
(active LOW) */
MXC_PIN(E, 5, GPIO, GPIO_OUT | GPIO_DFLT_HIGH), /* LCD
backlight (PWM: 0: off 1: max brightness */
MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */
MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */
MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */
MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */
MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */
PA5_PF_LSCLK,
PA6_PF_LD0,
PA7_PF_LD1,
... etc
then later; calls mxc_gpio_setup_multiple_pins on it:
ret = mxc_gpio_setup_multiple_pins(mx27_lcdc_gpios,
ARRAY_SIZE(mx27_lcdc_gpios),
"LCD");
While a glitch probably will do little more than cause the LCD backlight
to flicker momentarily, and maybe reset the LCD itself, I'd still like
to have the signals driven the right way from the outset. Does anyone
have any pointers as to where I could look for where this default is
set?
On a related note; we have a small audio amplifier on our board. Its
mute signal is wired up to one of the keypad column outputs on the
i.MX27 keypad controller, which can be driven as a GPIO. Is there a
means of accessing this cleanly within the GPIO framework of the kernel?
--
Stuart Longland (aka Redhatter, VK4MSL) .'''.
Gentoo Linux/MIPS Cobalt and Docs Developer '.'` :
. . . . . . . . . . . . . . . . . . . . . . .'.'
http://dev.gentoo.org/~redhatter :.'
I haven't lost my mind...
...it's backed up on a tape somewhere.
1. This hasn't been an easy task; reasoning is so that we can leverage
the i.MX27 I?S SSI code in the current Linux-ASoC tree, not present in
kernel 2.6.28. Backporting this proved to be a huge mess.
^ permalink raw reply [flat|nested] 3+ messages in thread
* i.MX27 GPIOs -- how to define the default output?
2010-05-22 1:02 i.MX27 GPIOs -- how to define the default output? Stuart Longland
@ 2010-05-24 10:23 ` Robert Schwebel
2010-05-25 7:59 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Robert Schwebel @ 2010-05-24 10:23 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, May 22, 2010 at 11:02:17AM +1000, Stuart Longland wrote:
> I'm in the process of porting Ka-Ro's TX27 kernel patch over from
> kernel 2.6.28 to current git HEAD[1]. In the process of doing this, I
> note that the old definitions GPIO_DFLT_HIGH and GPIO_DFLT_LOW have
> disappeared.
>
> I can't seem to find their replacements anywhere.
Check for example mach-pcm038.c, it shows how to do the pin setup.
rsc
--
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 |
^ permalink raw reply [flat|nested] 3+ messages in thread
* i.MX27 GPIOs -- how to define the default output?
2010-05-22 1:02 i.MX27 GPIOs -- how to define the default output? Stuart Longland
2010-05-24 10:23 ` Robert Schwebel
@ 2010-05-25 7:59 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2010-05-25 7:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi Stuart,
On Sat, May 22, 2010 at 11:02:17AM +1000, Stuart Longland wrote:
> Hi all,
>
> I'm in the process of porting Ka-Ro's TX27 kernel patch over from kernel
> 2.6.28 to current git HEAD[1]. In the process of doing this, I note that
> the old definitions GPIO_DFLT_HIGH and GPIO_DFLT_LOW have disappeared.
These have never been in the mainline kernel. It must be something Ka-Ro
introduced in their kernel.
>
> I can't seem to find their replacements anywhere.
>
> The code I'm porting defines a heap of GPIO pins for use with the LCD
> controller:
>
> static unsigned int mx27_lcdc_gpios[] = {
> MXC_PIN(F, 12, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* LCD reset
> (active LOW) */
> MXC_PIN(E, 5, GPIO, GPIO_OUT | GPIO_DFLT_HIGH), /* LCD
> backlight (PWM: 0: off 1: max brightness */
> MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */
> MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */
> MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */
> MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */
> MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */
> PA5_PF_LSCLK,
> PA6_PF_LD0,
> PA7_PF_LD1,
> ... etc
>
> then later; calls mxc_gpio_setup_multiple_pins on it:
>
> ret = mxc_gpio_setup_multiple_pins(mx27_lcdc_gpios,
> ARRAY_SIZE(mx27_lcdc_gpios),
> "LCD");
>
> While a glitch probably will do little more than cause the LCD backlight
> to flicker momentarily, and maybe reset the LCD itself, I'd still like
> to have the signals driven the right way from the outset. Does anyone
> have any pointers as to where I could look for where this default is
> set?
The actual value of a gpio is not written in
mxc_gpio_setup_multiple_pins(). So if your bootloader has left the gpios
correctly everything will work. You could also pass the GPIO_IN flag in
which case the gpios will be configured as an input and a
pullup/pulldown should pull them into the right direction. As a third
possibility you could do a gpio_request/gpio_direction_output before
changing the muxer.
>
> On a related note; we have a small audio amplifier on our board. Its
> mute signal is wired up to one of the keypad column outputs on the
> i.MX27 keypad controller, which can be driven as a GPIO. Is there a
> means of accessing this cleanly within the GPIO framework of the kernel?
When the muxer is configured the gpios work with the standard gpio api.
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 |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-25 7:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 1:02 i.MX27 GPIOs -- how to define the default output? Stuart Longland
2010-05-24 10:23 ` Robert Schwebel
2010-05-25 7:59 ` Sascha Hauer
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).