Same parts of DT being probed twice

Rob Herring robherring2 at gmail.com
Fri Jul 22 06:15:08 EST 2011


Daniel,

On 07/21/2011 09:46 AM, Daniel Drake wrote:
> Hi,
> 
> We're working on enabling the HDD LED on the XO-1.5 laptop using
> gpio-leds and its automatic interaction with the device tree. I have
> it working locally, but there is something not quite right.
> 
> We have modified the device tree to add /pci/isa/gpios
> 
> gpios then has a child "gpio-leds" which has a child "hdd" as
> described in Documentation/devicetree/bindings/gpio/gpio-leds.txt
> 
> This means that we must extend the "matches" list passed to
> of_platform_bus_probe() in arch/x86/platform/olpc/olpc_dt.c so that
> the search goes deep enough into the tree to find the gpio-leds
> element and create a device for it. Specifically we must add:
> 
> 	{ .compatible = "pci" },
> 	{ .compatible = "isa" },
> 	{ .compatible = "via,vx855-gpio" },
> 	{ .compatible = "gpio-leds" },
> 
> This works, but it causes huge duplication of the whole pci and isa
> trees in /sys/devices. These devices were already created because
> arch/x86/kernel/devicetree.c unconditionally calls
> of_platform_bus_probe() for pci and isa devices (see add_bus_probe()
> and ce4100_ids), but not for vx855-gpio and gpio-leds.
> 
> Whats the best way to solve this?
> 
I think you want to move up the gpio-leds to top level of the dts. The
leds are part of your board not part of the gpio controller, so they
should be separate. On the other hand, i2c slaves are typically under
the controller node, so perhaps gpio controller drivers need to scan for
sub devices like leds.

Rob


More information about the devicetree-discuss mailing list