sysfs-class-extcon 3.3 KB

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