[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1383280054.28909.30.camel@pasglop>
Date: Fri, 01 Nov 2013 15:27:34 +1100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: NeilBrown <neilb@...e.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Grant Likely <grant.likely@...aro.org>,
Rob Herring <rob.herring@...xeda.com>,
devicetree@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>
Subject: Re: Strange location and name for platform devices when
device-tree is used.
On Fri, 2013-11-01 at 15:22 +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2013-11-01 at 14:59 +1100, NeilBrown wrote:
> > and I wonder how relevant it still is in this context. As platform devices
> > are all in the root of the device-tree and hence are siblings, they must have
> > unique names in the device-tree and so the platform devices created from
> > them will also have unique names -- won't they?
>
> I agree about /sys/devices -> /sys/devices/platform, that makes more
> sense
>
> The problem with names is that we don't *know* that your devices are
> at the root and unique. They don't have to be. I have platforms that
> have several "chips" each containing all the same devices. They need to
> be de-duped.
>
> Maybe the right approach is to build the de-duplication in sysfs
> itself ?
BTW. How come you have devices at the root of the tree without "reg" ?
It's fairly fishy ...
The root of the tree is supposed to represent the processor address
space, and has #address-cells/#size-cells set appropriately. Any MMIO
mapped device shall thus have a "reg" property and a unit address.
Only "container" nodes (such as /cpus or /chosen) or virtual devices
(such as a node used to representing the collection of bits & pieces
that makes the audio infrastructure) and are thus not per-se MMIO mapped
entities can ommit the "reg" properties.
In the case of pwm, it looks like there's another device providing a pwm
capability, in which case your backlight would indeed be a "virtual
device" (basically non-mmio device not hanging off any bus). Or it could
have been represented as a child of pwm if that had been defined that
way, I am not familiar with the pwm bindings.
Cheers,
Ben.
> Cheers,
> Ben.
>
> > Any help understanding and/or fixing this discrepancy greatly appreciated.
> >
> > The change of name is particularly annoying to me because one of my platform
> > devices is a pwm_bl.c backlight. With a boardfile I
> > get /sys/class/pwm_backlight. With devicetree the best I can get
> > is /sys/class/pwm_backlight.23 (or similar). It would be really nice to have
> > a more stable and sensible name here.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists