From: Bill Gatliff <bgat@billgatliff.com>
To: Linux/PPC Development <linuxppc-dev@ozlabs.org>
Subject: Trouble specifying dts gpio-leds with GPIO expander chip
Date: Mon, 21 Dec 2009 13:40:48 -0600 [thread overview]
Message-ID: <4B2FCF40.3050204@billgatliff.com> (raw)
Guys:
I'm trying to come up with the right stuff for my dts file to assign a
Linux "heartbeat" trigger to an I2C GPIO expansion device (MAX7314).
I'm running on a platform that is very similar to the lite5200b, with
linux-2.6.32. I'm a bit new to the device tree concept, having come
most recently from an ARM world, so please be gentle... :)
I have this so far:
soc5200@f0000000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,mpc5200b-immr","simple-bus";
ranges = <0 0xf0000000 0x0000c000>;
reg = <0xf0000000 0x00000100>;
bus-frequency = <0>; // from bootloader
system-frequency = <0>; // from bootloader
...
i2c@3d40 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
reg = <0x3d40 0x40>;
interrupts = <2 16 0>;
lext20: max7314@20 {
#gpio-cells = <2>;
compatible = "maxim,max7314","phillips,pca953x";
reg = <0x20>;
linux,phandle = <0x20>;
gpio-controller;
};
...
};
};
...
system {
compatible = "simple-bus";
gpio-leds {
compatible = "gpio-leds";
heartbeat {
gpios = <&lext20 3 0>;
linux,default-trigger = "heartbeat";
};
};
};
...
The MAX7314 chip is showing up under /debug/gpio:
# cat /debug/gpio
...
GPIOs 198-213, i2c/1-0020, max7314, can sleep:
And, indeed, I can twiddle the LED by hand:
# echo 201 > /sys/class/gpio/export
# while true; do for led in high low; \
do echo $led > /sys/class/gpio/gpio201/direction; \
sleep 1; done; done
(observe blinking)
But I see this at boot:
Skipping unavailable LED gpio -19 (heartbeat)
That error code is -ENODEV. I double-checked that gpio-leds is showing
up on of_platform:
# ls /sys/bus/of_platform/devices/
...
gpio-leds.2
...
I'm stumped. Could it be that the startup code is trying to register
the heartbeat device before it has registered the MAX7314, so it doesn't
know yet that the GPIO line exists?
Anyone have any suggestions?
b.g.
--
Bill Gatliff
bgat@billgatliff.com
next reply other threads:[~2009-12-21 19:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-21 19:40 Bill Gatliff [this message]
2009-12-21 21:55 ` Trouble specifying dts gpio-leds with GPIO expander chip Anton Vorontsov
2009-12-31 17:00 ` Bill Gatliff
2009-12-21 22:32 ` Grant Likely
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=4B2FCF40.3050204@billgatliff.com \
--to=bgat@billgatliff.com \
--cc=linuxppc-dev@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