1de55d871SMyungJoo HamWhat: /sys/class/extcon/.../ 2*806d9dd7SMyungJoo HamDate: February 2012 3de55d871SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 4de55d871SMyungJoo HamDescription: 5de55d871SMyungJoo Ham Provide a place in sysfs for the extcon objects. 6de55d871SMyungJoo Ham This allows accessing extcon specific variables. 7de55d871SMyungJoo Ham The name of extcon object denoted as ... is the name given 8de55d871SMyungJoo Ham with extcon_dev_register. 9de55d871SMyungJoo Ham 10*806d9dd7SMyungJoo Ham One extcon device denotes a single external connector 11*806d9dd7SMyungJoo Ham port. An external connector may have multiple cables 12*806d9dd7SMyungJoo Ham attached simultaneously. Many of docks, cradles, and 13*806d9dd7SMyungJoo Ham accessory cables have such capability. For example, 14*806d9dd7SMyungJoo Ham the 30-pin port of Nuri board (/arch/arm/mach-exynos) 15*806d9dd7SMyungJoo Ham may have both HDMI and Charger attached, or analog audio, 16*806d9dd7SMyungJoo Ham video, and USB cables attached simulteneously. 17*806d9dd7SMyungJoo Ham 18de55d871SMyungJoo HamWhat: /sys/class/extcon/.../name 19*806d9dd7SMyungJoo HamDate: February 2012 20de55d871SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 21de55d871SMyungJoo HamDescription: 22de55d871SMyungJoo Ham The /sys/class/extcon/.../name shows the name of the extcon 23de55d871SMyungJoo Ham object. If the extcon object has an optional callback 24de55d871SMyungJoo Ham "show_name" defined, the callback will provide the name with 25de55d871SMyungJoo Ham this sysfs node. 26de55d871SMyungJoo Ham 27de55d871SMyungJoo HamWhat: /sys/class/extcon/.../state 28*806d9dd7SMyungJoo HamDate: February 2012 29de55d871SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 30de55d871SMyungJoo HamDescription: 31*806d9dd7SMyungJoo Ham The /sys/class/extcon/.../state shows and stores the cable 32*806d9dd7SMyungJoo Ham attach/detach information of the corresponding extcon object. 33*806d9dd7SMyungJoo Ham If the extcon object has an optional callback "show_state" 34*806d9dd7SMyungJoo Ham defined, the showing function is overriden with the optional 35*806d9dd7SMyungJoo Ham callback. 36*806d9dd7SMyungJoo Ham 37*806d9dd7SMyungJoo Ham If the default callback for showing function is used, the 38*806d9dd7SMyungJoo Ham format is like this: 39*806d9dd7SMyungJoo Ham # cat state 40*806d9dd7SMyungJoo Ham USB_OTG=1 41*806d9dd7SMyungJoo Ham HDMI=0 42*806d9dd7SMyungJoo Ham TA=1 43*806d9dd7SMyungJoo Ham EAR_JACK=0 44*806d9dd7SMyungJoo Ham # 45*806d9dd7SMyungJoo Ham In this example, the extcon device have USB_OTG and TA 46*806d9dd7SMyungJoo Ham cables attached and HDMI and EAR_JACK cables detached. 47*806d9dd7SMyungJoo Ham 48*806d9dd7SMyungJoo Ham In order to update the state of an extcon device, enter a hex 49*806d9dd7SMyungJoo Ham state number starting with 0x. 50*806d9dd7SMyungJoo Ham echo 0xHEX > state 51*806d9dd7SMyungJoo Ham 52*806d9dd7SMyungJoo Ham This updates the whole state of the extcon dev. 53*806d9dd7SMyungJoo Ham Inputs of all the methods are required to meet the 54*806d9dd7SMyungJoo Ham mutually_exclusive contidions if they exist. 55*806d9dd7SMyungJoo Ham 56*806d9dd7SMyungJoo Ham It is recommended to use this "global" state interface if 57*806d9dd7SMyungJoo Ham you need to enter the value atomically. The later state 58*806d9dd7SMyungJoo Ham interface associated with each cable cannot update 59*806d9dd7SMyungJoo Ham multiple cable states of an extcon device simultaneously. 60*806d9dd7SMyungJoo Ham 61*806d9dd7SMyungJoo HamWhat: /sys/class/extcon/.../cable.x/name 62*806d9dd7SMyungJoo HamDate: February 2012 63*806d9dd7SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 64*806d9dd7SMyungJoo HamDescription: 65*806d9dd7SMyungJoo Ham The /sys/class/extcon/.../cable.x/name shows the name of cable 66*806d9dd7SMyungJoo Ham "x" (integer between 0 and 31) of an extcon device. 67*806d9dd7SMyungJoo Ham 68*806d9dd7SMyungJoo HamWhat: /sys/class/extcon/.../cable.x/state 69*806d9dd7SMyungJoo HamDate: February 2012 70*806d9dd7SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 71*806d9dd7SMyungJoo HamDescription: 72*806d9dd7SMyungJoo Ham The /sys/class/extcon/.../cable.x/name shows and stores the 73*806d9dd7SMyungJoo Ham state of cable "x" (integer between 0 and 31) of an extcon 74*806d9dd7SMyungJoo Ham device. The state value is either 0 (detached) or 1 75*806d9dd7SMyungJoo Ham (attached). 76