162306a36Sopenharmony_ciWhat: /sys/class/extcon/.../ 262306a36Sopenharmony_ciDate: February 2012 362306a36Sopenharmony_ciContact: MyungJoo Ham <myungjoo.ham@samsung.com> 462306a36Sopenharmony_ciDescription: 562306a36Sopenharmony_ci Provide a place in sysfs for the extcon objects. 662306a36Sopenharmony_ci This allows accessing extcon specific variables. 762306a36Sopenharmony_ci The name of extcon object denoted as ... is the name given 862306a36Sopenharmony_ci with extcon_dev_register. 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci One extcon device denotes a single external connector 1162306a36Sopenharmony_ci port. An external connector may have multiple cables 1262306a36Sopenharmony_ci attached simultaneously. Many of docks, cradles, and 1362306a36Sopenharmony_ci accessory cables have such capability. For example, 1462306a36Sopenharmony_ci the 30-pin port of Nuri board (/arch/arm/mach-exynos) 1562306a36Sopenharmony_ci may have both HDMI and Charger attached, or analog audio, 1662306a36Sopenharmony_ci video, and USB cables attached simultaneously. 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci If there are cables mutually exclusive with each other, 1962306a36Sopenharmony_ci such binary relations may be expressed with extcon_dev's 2062306a36Sopenharmony_ci mutually_exclusive array. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ciWhat: /sys/class/extcon/.../name 2362306a36Sopenharmony_ciDate: February 2012 2462306a36Sopenharmony_ciContact: MyungJoo Ham <myungjoo.ham@samsung.com> 2562306a36Sopenharmony_ciDescription: 2662306a36Sopenharmony_ci The /sys/class/extcon/.../name shows the name of the extcon 2762306a36Sopenharmony_ci object. If the extcon object has an optional callback 2862306a36Sopenharmony_ci "show_name" defined, the callback will provide the name with 2962306a36Sopenharmony_ci this sysfs node. 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ciWhat: /sys/class/extcon/.../state 3262306a36Sopenharmony_ciDate: February 2012 3362306a36Sopenharmony_ciContact: MyungJoo Ham <myungjoo.ham@samsung.com> 3462306a36Sopenharmony_ciDescription: 3562306a36Sopenharmony_ci The /sys/class/extcon/.../state shows and stores the cable 3662306a36Sopenharmony_ci attach/detach information of the corresponding extcon object. 3762306a36Sopenharmony_ci If the extcon object has an optional callback "show_state" 3862306a36Sopenharmony_ci defined, the showing function is overridden with the optional 3962306a36Sopenharmony_ci callback. 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci If the default callback for showing function is used, the 4262306a36Sopenharmony_ci format is like this:: 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci # cat state 4562306a36Sopenharmony_ci USB_OTG=1 4662306a36Sopenharmony_ci HDMI=0 4762306a36Sopenharmony_ci TA=1 4862306a36Sopenharmony_ci EAR_JACK=0 4962306a36Sopenharmony_ci # 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci In this example, the extcon device has USB_OTG and TA 5262306a36Sopenharmony_ci cables attached and HDMI and EAR_JACK cables detached. 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci In order to update the state of an extcon device, enter a hex 5562306a36Sopenharmony_ci state number starting with 0x:: 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci # echo 0xHEX > state 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci This updates the whole state of the extcon device. 6062306a36Sopenharmony_ci Inputs of all the methods are required to meet the 6162306a36Sopenharmony_ci mutually_exclusive conditions if they exist. 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci It is recommended to use this "global" state interface if 6462306a36Sopenharmony_ci you need to set the value atomically. The later state 6562306a36Sopenharmony_ci interface associated with each cable cannot update 6662306a36Sopenharmony_ci multiple cable states of an extcon device simultaneously. 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciWhat: /sys/class/extcon/.../cable.X/name 6962306a36Sopenharmony_ciDate: February 2012 7062306a36Sopenharmony_ciContact: MyungJoo Ham <myungjoo.ham@samsung.com> 7162306a36Sopenharmony_ciDescription: 7262306a36Sopenharmony_ci The /sys/class/extcon/.../cable.X/name shows the name of cable 7362306a36Sopenharmony_ci "X" (integer between 0 and 31) of an extcon device. 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ciWhat: /sys/class/extcon/.../cable.X/state 7662306a36Sopenharmony_ciDate: February 2012 7762306a36Sopenharmony_ciContact: MyungJoo Ham <myungjoo.ham@samsung.com> 7862306a36Sopenharmony_ciDescription: 7962306a36Sopenharmony_ci The /sys/class/extcon/.../cable.X/state shows and stores the 8062306a36Sopenharmony_ci state of cable "X" (integer between 0 and 31) of an extcon 8162306a36Sopenharmony_ci device. The state value is either 0 (detached) or 1 8262306a36Sopenharmony_ci (attached). 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ciWhat: /sys/class/extcon/.../mutually_exclusive/... 8562306a36Sopenharmony_ciDate: December 2011 8662306a36Sopenharmony_ciContact: MyungJoo Ham <myungjoo.ham@samsung.com> 8762306a36Sopenharmony_ciDescription: 8862306a36Sopenharmony_ci Shows the relations of mutually exclusiveness. For example, 8962306a36Sopenharmony_ci if the mutually_exclusive array of extcon device is 9062306a36Sopenharmony_ci {0x3, 0x5, 0xC, 0x0}, then the output is:: 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ci # ls mutually_exclusive/ 9362306a36Sopenharmony_ci 0x3 9462306a36Sopenharmony_ci 0x5 9562306a36Sopenharmony_ci 0xc 9662306a36Sopenharmony_ci # 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci Note that mutually_exclusive is a sub-directory of the extcon 9962306a36Sopenharmony_ci device and the file names under the mutually_exclusive 10062306a36Sopenharmony_ci directory show the mutually-exclusive sets, not the contents 10162306a36Sopenharmony_ci of the files. 102