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