From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: Same parts of DT being probed twice Date: Thu, 21 Jul 2011 15:15:08 -0500 Message-ID: <4E2888CC.5050302@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Daniel Drake Cc: devicetree-discuss , Andres Salomon List-Id: devicetree@vger.kernel.org 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