[PATCH 1/2][OF] Add of_device_is_disabled function

Josh Boyer jwboyer at linux.vnet.ibm.com
Sun Feb 24 11:59:04 EST 2008


On Sat, 23 Feb 2008 15:58:23 -0600
Josh Boyer <jwboyer at linux.vnet.ibm.com> wrote:

> IEEE 1275 defined a standard "status" property to indicate the operational
> status of a device.  The property has four possible values: okay, disabled,
> fail, fail-xxx.  The absence of this property means the operational status
> of the device is unknown or okay.
> 
> This adds a function called of_device_is_disabled that checks to see if a
> node has the status property set to "disabled".  This can be quite useful
> for devices that may be present but disabled due to pin sharing, etc.
> 
> Signed-off-by: Josh Boyer <jwboyer at linux.vnet.ibm.com>

Talking with Ben H a bit, he suggested to reverse this API.  Basically,
create an of_device_is_available that returns 1 if the status property
is completely missing, or if it's set to "okay" or "ok".  The latter is
to cope with some broken firmwares.

I can do either really.  Eventually you could embed the is_available
check in the of_platform code so that devices don't even get presented
to drivers if they aren't available.

Dave, I'm not sure how applicable this all is to sparc.  But for some
of the "newer" embedded ports that are coming into powerpc I can see it
being very useful.

Thoughts?

josh



More information about the Linuxppc-dev mailing list