1de55d871SMyungJoo HamWhat: /sys/class/extcon/.../ 2806d9dd7SMyungJoo 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 10806d9dd7SMyungJoo Ham One extcon device denotes a single external connector 11806d9dd7SMyungJoo Ham port. An external connector may have multiple cables 12806d9dd7SMyungJoo Ham attached simultaneously. Many of docks, cradles, and 13806d9dd7SMyungJoo Ham accessory cables have such capability. For example, 14806d9dd7SMyungJoo Ham the 30-pin port of Nuri board (/arch/arm/mach-exynos) 15806d9dd7SMyungJoo Ham may have both HDMI and Charger attached, or analog audio, 16806d9dd7SMyungJoo Ham video, and USB cables attached simulteneously. 17806d9dd7SMyungJoo Ham 18de55d871SMyungJoo HamWhat: /sys/class/extcon/.../name 19806d9dd7SMyungJoo 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 28806d9dd7SMyungJoo HamDate: February 2012 29de55d871SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 30de55d871SMyungJoo HamDescription: 31806d9dd7SMyungJoo Ham The /sys/class/extcon/.../state shows and stores the cable 32806d9dd7SMyungJoo Ham attach/detach information of the corresponding extcon object. 33806d9dd7SMyungJoo Ham If the extcon object has an optional callback "show_state" 34806d9dd7SMyungJoo Ham defined, the showing function is overriden with the optional 35806d9dd7SMyungJoo Ham callback. 36806d9dd7SMyungJoo Ham 37806d9dd7SMyungJoo Ham If the default callback for showing function is used, the 38806d9dd7SMyungJoo Ham format is like this: 39806d9dd7SMyungJoo Ham # cat state 40806d9dd7SMyungJoo Ham USB_OTG=1 41806d9dd7SMyungJoo Ham HDMI=0 42806d9dd7SMyungJoo Ham TA=1 43806d9dd7SMyungJoo Ham EAR_JACK=0 44806d9dd7SMyungJoo Ham # 45806d9dd7SMyungJoo Ham In this example, the extcon device have USB_OTG and TA 46806d9dd7SMyungJoo Ham cables attached and HDMI and EAR_JACK cables detached. 47806d9dd7SMyungJoo Ham 48806d9dd7SMyungJoo Ham In order to update the state of an extcon device, enter a hex 49806d9dd7SMyungJoo Ham state number starting with 0x. 50806d9dd7SMyungJoo Ham echo 0xHEX > state 51806d9dd7SMyungJoo Ham 52806d9dd7SMyungJoo Ham This updates the whole state of the extcon dev. 53806d9dd7SMyungJoo Ham Inputs of all the methods are required to meet the 54806d9dd7SMyungJoo Ham mutually_exclusive contidions if they exist. 55806d9dd7SMyungJoo Ham 56806d9dd7SMyungJoo Ham It is recommended to use this "global" state interface if 57806d9dd7SMyungJoo Ham you need to enter the value atomically. The later state 58806d9dd7SMyungJoo Ham interface associated with each cable cannot update 59806d9dd7SMyungJoo Ham multiple cable states of an extcon device simultaneously. 60806d9dd7SMyungJoo Ham 61806d9dd7SMyungJoo HamWhat: /sys/class/extcon/.../cable.x/name 62806d9dd7SMyungJoo HamDate: February 2012 63806d9dd7SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 64806d9dd7SMyungJoo HamDescription: 65806d9dd7SMyungJoo Ham The /sys/class/extcon/.../cable.x/name shows the name of cable 66806d9dd7SMyungJoo Ham "x" (integer between 0 and 31) of an extcon device. 67806d9dd7SMyungJoo Ham 68806d9dd7SMyungJoo HamWhat: /sys/class/extcon/.../cable.x/state 69806d9dd7SMyungJoo HamDate: February 2012 70806d9dd7SMyungJoo HamContact: MyungJoo Ham <myungjoo.ham@samsung.com> 71806d9dd7SMyungJoo HamDescription: 72806d9dd7SMyungJoo Ham The /sys/class/extcon/.../cable.x/name shows and stores the 73806d9dd7SMyungJoo Ham state of cable "x" (integer between 0 and 31) of an extcon 74806d9dd7SMyungJoo Ham device. The state value is either 0 (detached) or 1 75806d9dd7SMyungJoo Ham (attached). 76