Commit | Line | Data |
---|---|---|
de55d871 | 1 | What: /sys/class/extcon/.../ |
806d9dd7 | 2 | Date: February 2012 |
de55d871 MH |
3 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
4 | Description: | |
5 | Provide a place in sysfs for the extcon objects. | |
6 | This allows accessing extcon specific variables. | |
7 | The name of extcon object denoted as ... is the name given | |
8 | with extcon_dev_register. | |
9 | ||
806d9dd7 MH |
10 | One extcon device denotes a single external connector |
11 | port. An external connector may have multiple cables | |
12 | attached simultaneously. Many of docks, cradles, and | |
13 | accessory cables have such capability. For example, | |
14 | the 30-pin port of Nuri board (/arch/arm/mach-exynos) | |
15 | may have both HDMI and Charger attached, or analog audio, | |
f28d5a01 | 16 | video, and USB cables attached simultaneously. |
806d9dd7 | 17 | |
bde68e60 MH |
18 | If there are cables mutually exclusive with each other, |
19 | such binary relations may be expressed with extcon_dev's | |
20 | mutually_exclusive array. | |
21 | ||
de55d871 | 22 | What: /sys/class/extcon/.../name |
806d9dd7 | 23 | Date: February 2012 |
de55d871 MH |
24 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
25 | Description: | |
26 | The /sys/class/extcon/.../name shows the name of the extcon | |
27 | object. If the extcon object has an optional callback | |
28 | "show_name" defined, the callback will provide the name with | |
29 | this sysfs node. | |
30 | ||
31 | What: /sys/class/extcon/.../state | |
806d9dd7 MH |
32 | Date: February 2012 |
33 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | |
34 | Description: | |
35 | The /sys/class/extcon/.../state shows and stores the cable | |
36 | attach/detach information of the corresponding extcon object. | |
37 | If the extcon object has an optional callback "show_state" | |
f28d5a01 | 38 | defined, the showing function is overridden with the optional |
806d9dd7 MH |
39 | callback. |
40 | ||
41 | If the default callback for showing function is used, the | |
54a19b4d MCC |
42 | format is like this:: |
43 | ||
44 | # cat state | |
45 | USB_OTG=1 | |
46 | HDMI=0 | |
47 | TA=1 | |
48 | EAR_JACK=0 | |
49 | # | |
50 | ||
f28d5a01 | 51 | In this example, the extcon device has USB_OTG and TA |
806d9dd7 MH |
52 | cables attached and HDMI and EAR_JACK cables detached. |
53 | ||
54 | In order to update the state of an extcon device, enter a hex | |
54a19b4d MCC |
55 | state number starting with 0x:: |
56 | ||
57 | # echo 0xHEX > state | |
806d9dd7 | 58 | |
f28d5a01 | 59 | This updates the whole state of the extcon device. |
806d9dd7 | 60 | Inputs of all the methods are required to meet the |
f28d5a01 | 61 | mutually_exclusive conditions if they exist. |
806d9dd7 MH |
62 | |
63 | It is recommended to use this "global" state interface if | |
f28d5a01 | 64 | you need to set the value atomically. The later state |
806d9dd7 MH |
65 | interface associated with each cable cannot update |
66 | multiple cable states of an extcon device simultaneously. | |
67 | ||
4aa5216c | 68 | What: /sys/class/extcon/.../cable.X/name |
806d9dd7 MH |
69 | Date: February 2012 |
70 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | |
71 | Description: | |
4aa5216c MCC |
72 | The /sys/class/extcon/.../cable.X/name shows the name of cable |
73 | "X" (integer between 0 and 31) of an extcon device. | |
806d9dd7 | 74 | |
4aa5216c | 75 | What: /sys/class/extcon/.../cable.X/state |
806d9dd7 | 76 | Date: February 2012 |
de55d871 MH |
77 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
78 | Description: | |
4aa5216c MCC |
79 | The /sys/class/extcon/.../cable.X/state shows and stores the |
80 | state of cable "X" (integer between 0 and 31) of an extcon | |
806d9dd7 MH |
81 | device. The state value is either 0 (detached) or 1 |
82 | (attached). | |
bde68e60 MH |
83 | |
84 | What: /sys/class/extcon/.../mutually_exclusive/... | |
85 | Date: December 2011 | |
86 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | |
87 | Description: | |
88 | Shows the relations of mutually exclusiveness. For example, | |
f28d5a01 | 89 | if the mutually_exclusive array of extcon device is |
54a19b4d MCC |
90 | {0x3, 0x5, 0xC, 0x0}, then the output is:: |
91 | ||
92 | # ls mutually_exclusive/ | |
93 | 0x3 | |
94 | 0x5 | |
95 | 0xc | |
96 | # | |
bde68e60 MH |
97 | |
98 | Note that mutually_exclusive is a sub-directory of the extcon | |
99 | device and the file names under the mutually_exclusive | |
100 | directory show the mutually-exclusive sets, not the contents | |
101 | of the files. |