lkml.org 
[lkml]   [2012]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 3/5] Extcon: support multiple states at a device.
Date
On Friday 10 February 2012, MyungJoo Ham wrote:
> Date: December 2011
> Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
> Description:
> - The /sys/class/extcon/.../state shows the cable attach/detach
> - information of the corresponding extcon object. If the extcon
> - objecct has an optional callback "show_state" defined, the
> - callback will provide the name with this sysfs node.
> + The /sys/class/extcon/.../state shows and stores the cable
> + attach/detach information of the corresponding extcon object.
> + If the extcon objecct has an optional callback "show_state"
> + defined, the showing function is overriden with the optional
> + callback.
> +
> + If the default callback for showing function is used, the
> + format is like this:
> + # cat state
> + USB_OTG=1
> + HDMI=0
> + TA=1
> + EAR_JACK=0
> + #
> + In this example, the extcon device have USB_OTG and TA
> + cables attached and HDMI and EAR_JACK cables detached.
> +
> + There are two methods to update state of extcon.
> + Method 1.
> + echo CABLE_NAME [0|1] > state
> + Method 2.
> + echo 0xHEX > state
> +
> + Method 1 updates the state (0 or 1) of the
> + corresponding cable (either the name or index of the cable).
> + Method 2 updates the whole state of the extcon dev.

I think having two ways to do the same thing is rather confusing, it would
be nice to provide only one way and make sure that it works for everyone.

Maybe the entire thing can be turned around into one attribute group
per cable and unified with the mutually-exclusive part, like

extcon/.../usb-otg/state # 0 or 1 for disable or enable
/mutually-exclusive # list of exclusive ports
/hdmi/...
/ta/...

Arnd


\
 
 \ /
  Last update: 2012-02-22 11:09    [from the cache]
©2003-2011 Jasper Spaans