[RFC PATCHv1 1/2] Export SoC info through sysfs

Arnd Bergmann arnd at arndb.de
Fri Mar 11 11:14:12 EST 2011


On Thursday 10 March 2011, Linus Walleij wrote:
> What I'm trying to get at is that the user of this
> info isn't really interested in any device tree structure,
> it just becomes an obstacle s/he has to overcome
> to get this info out.
> 
> But there may be a compromise: if we create the
> socinfo in one place in the device tree (possibly the
> top node, or a dedicated device) then class it?
> 
> /sys/class/soc/soc0 -> ../../devices/platform/top-node
> 
> Then you find your entries easily by opening
> /sys/class/soc/soc0/* ?

That would be one way of finding all soc nodes, in
case we want to have multiple ones. Similarly,
it could be done based on

1. the name under /sys/devices/platform:

/sys/devices/platform/soc0
/sys/devices/platform/soc1
/sys/devices/platform/soc2

2. a new bus_type for soc devices, with bus_attributes:

/sys/bus/soc/devices/foo0 -> ../../../devices/platform/foo0
/sys/bus/soc/devices/bar0 -> ../../../devices/platform/bar0
/sys/bus/soc/devices/bar1 -> ../../../devices/platform/bar1

3. A new top-level device besides /sys/devices/platform (like PCI):

/sys/devices/soc0
/sys/devices/soc1
/sys/devices/soc2

> If the socinfo interface is singleton (and why should
> it not be) then:
> 
> /sys/class/soc -> ../devices/platfom/top-node
> 
> Or is this thing too trivial to have it's own class?

In case of a singleton, I'd just use a fixed device as
the parent:

/sys/devices/platform/soc/

or

/sys/devices/soc/

And pass that as the parent for all devices under it.

	Arnd



More information about the linux-arm-kernel mailing list