MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 1 | What: /sys/class/extcon/.../ |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 2 | Date: February 2012 |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 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 | |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 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, |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 16 | video, and USB cables attached simultaneously. |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 17 | |
MyungJoo Ham | bde68e6 | 2012-04-20 14:16:26 +0900 | [diff] [blame] | 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 | |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 22 | What: /sys/class/extcon/.../name |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 23 | Date: February 2012 |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 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 |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 32 | Date: February 2012 |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 33 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 34 | Description: |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 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" |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 38 | defined, the showing function is overridden with the optional |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 39 | callback. |
| 40 | |
| 41 | If the default callback for showing function is used, the |
| 42 | format is like this: |
| 43 | # cat state |
| 44 | USB_OTG=1 |
| 45 | HDMI=0 |
| 46 | TA=1 |
| 47 | EAR_JACK=0 |
| 48 | # |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 49 | In this example, the extcon device has USB_OTG and TA |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 50 | cables attached and HDMI and EAR_JACK cables detached. |
| 51 | |
| 52 | In order to update the state of an extcon device, enter a hex |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 53 | state number starting with 0x: |
| 54 | # echo 0xHEX > state |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 55 | |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 56 | This updates the whole state of the extcon device. |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 57 | Inputs of all the methods are required to meet the |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 58 | mutually_exclusive conditions if they exist. |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 59 | |
| 60 | It is recommended to use this "global" state interface if |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 61 | you need to set the value atomically. The later state |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 62 | interface associated with each cable cannot update |
| 63 | multiple cable states of an extcon device simultaneously. |
| 64 | |
| 65 | What: /sys/class/extcon/.../cable.x/name |
| 66 | Date: February 2012 |
| 67 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 68 | Description: |
| 69 | The /sys/class/extcon/.../cable.x/name shows the name of cable |
| 70 | "x" (integer between 0 and 31) of an extcon device. |
| 71 | |
| 72 | What: /sys/class/extcon/.../cable.x/state |
| 73 | Date: February 2012 |
| 74 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 75 | Description: |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 76 | The /sys/class/extcon/.../cable.x/state shows and stores the |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 77 | state of cable "x" (integer between 0 and 31) of an extcon |
| 78 | device. The state value is either 0 (detached) or 1 |
| 79 | (attached). |
MyungJoo Ham | bde68e6 | 2012-04-20 14:16:26 +0900 | [diff] [blame] | 80 | |
| 81 | What: /sys/class/extcon/.../mutually_exclusive/... |
| 82 | Date: December 2011 |
| 83 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 84 | Description: |
| 85 | Shows the relations of mutually exclusiveness. For example, |
Peter Meerwald | f28d5a0 | 2012-08-23 09:11:43 +0900 | [diff] [blame] | 86 | if the mutually_exclusive array of extcon device is |
| 87 | {0x3, 0x5, 0xC, 0x0}, then the output is: |
MyungJoo Ham | bde68e6 | 2012-04-20 14:16:26 +0900 | [diff] [blame] | 88 | # ls mutually_exclusive/ |
| 89 | 0x3 |
| 90 | 0x5 |
| 91 | 0xc |
| 92 | # |
| 93 | |
| 94 | Note that mutually_exclusive is a sub-directory of the extcon |
| 95 | device and the file names under the mutually_exclusive |
| 96 | directory show the mutually-exclusive sets, not the contents |
| 97 | of the files. |