diff options
Diffstat (limited to 'include/linux/extcon.h')
-rw-r--r-- | include/linux/extcon.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 2c26c14cd71..fcb51c88319 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
@@ -23,7 +23,9 @@ | |||
23 | #ifndef __LINUX_EXTCON_H__ | 23 | #ifndef __LINUX_EXTCON_H__ |
24 | #define __LINUX_EXTCON_H__ | 24 | #define __LINUX_EXTCON_H__ |
25 | 25 | ||
26 | #include <linux/device.h> | ||
26 | #include <linux/notifier.h> | 27 | #include <linux/notifier.h> |
28 | #include <linux/sysfs.h> | ||
27 | 29 | ||
28 | #define SUPPORTED_CABLE_MAX 32 | 30 | #define SUPPORTED_CABLE_MAX 32 |
29 | #define CABLE_NAME_MAX 30 | 31 | #define CABLE_NAME_MAX 30 |
@@ -74,12 +76,12 @@ struct extcon_cable; | |||
74 | 76 | ||
75 | /** | 77 | /** |
76 | * struct extcon_dev - An extcon device represents one external connector. | 78 | * struct extcon_dev - An extcon device represents one external connector. |
77 | * @name The name of this extcon device. Parent device name is used | 79 | * @name: The name of this extcon device. Parent device name is used |
78 | * if NULL. | 80 | * if NULL. |
79 | * @supported_cable Array of supported cable names ending with NULL. | 81 | * @supported_cable: Array of supported cable names ending with NULL. |
80 | * If supported_cable is NULL, cable name related APIs | 82 | * If supported_cable is NULL, cable name related APIs |
81 | * are disabled. | 83 | * are disabled. |
82 | * @mutually_exclusive Array of mutually exclusive set of cables that cannot | 84 | * @mutually_exclusive: Array of mutually exclusive set of cables that cannot |
83 | * be attached simultaneously. The array should be | 85 | * be attached simultaneously. The array should be |
84 | * ending with NULL or be NULL (no mutually exclusive | 86 | * ending with NULL or be NULL (no mutually exclusive |
85 | * cables). For example, if it is { 0x7, 0x30, 0}, then, | 87 | * cables). For example, if it is { 0x7, 0x30, 0}, then, |
@@ -87,21 +89,21 @@ struct extcon_cable; | |||
87 | * be attached simulataneously. {0x7, 0} is equivalent to | 89 | * be attached simulataneously. {0x7, 0} is equivalent to |
88 | * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there | 90 | * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there |
89 | * can be no simultaneous connections. | 91 | * can be no simultaneous connections. |
90 | * @print_name An optional callback to override the method to print the | 92 | * @print_name: An optional callback to override the method to print the |
91 | * name of the extcon device. | 93 | * name of the extcon device. |
92 | * @print_state An optional callback to override the method to print the | 94 | * @print_state: An optional callback to override the method to print the |
93 | * status of the extcon device. | 95 | * status of the extcon device. |
94 | * @dev Device of this extcon. Do not provide at register-time. | 96 | * @dev: Device of this extcon. Do not provide at register-time. |
95 | * @state Attach/detach state of this extcon. Do not provide at | 97 | * @state: Attach/detach state of this extcon. Do not provide at |
96 | * register-time | 98 | * register-time |
97 | * @nh Notifier for the state change events from this extcon | 99 | * @nh: Notifier for the state change events from this extcon |
98 | * @entry To support list of extcon devices so that users can search | 100 | * @entry: To support list of extcon devices so that users can search |
99 | * for extcon devices based on the extcon name. | 101 | * for extcon devices based on the extcon name. |
100 | * @lock | 102 | * @lock: |
101 | * @max_supported Internal value to store the number of cables. | 103 | * @max_supported: Internal value to store the number of cables. |
102 | * @extcon_dev_type Device_type struct to provide attribute_groups | 104 | * @extcon_dev_type: Device_type struct to provide attribute_groups |
103 | * customized for each extcon device. | 105 | * customized for each extcon device. |
104 | * @cables Sysfs subdirectories. Each represents one cable. | 106 | * @cables: Sysfs subdirectories. Each represents one cable. |
105 | * | 107 | * |
106 | * In most cases, users only need to provide "User initializing data" of | 108 | * In most cases, users only need to provide "User initializing data" of |
107 | * this struct when registering an extcon. In some exceptional cases, | 109 | * this struct when registering an extcon. In some exceptional cases, |
@@ -137,12 +139,12 @@ struct extcon_dev { | |||
137 | 139 | ||
138 | /** | 140 | /** |
139 | * struct extcon_cable - An internal data for each cable of extcon device. | 141 | * struct extcon_cable - An internal data for each cable of extcon device. |
140 | * @edev The extcon device | 142 | * @edev: The extcon device |
141 | * @cable_index Index of this cable in the edev | 143 | * @cable_index: Index of this cable in the edev |
142 | * @attr_g Attribute group for the cable | 144 | * @attr_g: Attribute group for the cable |
143 | * @attr_name "name" sysfs entry | 145 | * @attr_name: "name" sysfs entry |
144 | * @attr_state "state" sysfs entry | 146 | * @attr_state: "state" sysfs entry |
145 | * @attrs Array pointing to attr_name and attr_state for attr_g | 147 | * @attrs: Array pointing to attr_name and attr_state for attr_g |
146 | */ | 148 | */ |
147 | struct extcon_cable { | 149 | struct extcon_cable { |
148 | struct extcon_dev *edev; | 150 | struct extcon_dev *edev; |
@@ -158,11 +160,11 @@ struct extcon_cable { | |||
158 | /** | 160 | /** |
159 | * struct extcon_specific_cable_nb - An internal data for | 161 | * struct extcon_specific_cable_nb - An internal data for |
160 | * extcon_register_interest(). | 162 | * extcon_register_interest(). |
161 | * @internal_nb a notifier block bridging extcon notifier and cable notifier. | 163 | * @internal_nb: a notifier block bridging extcon notifier and cable notifier. |
162 | * @user_nb user provided notifier block for events from a specific cable. | 164 | * @user_nb: user provided notifier block for events from a specific cable. |
163 | * @cable_index the target cable. | 165 | * @cable_index: the target cable. |
164 | * @edev the target extcon device. | 166 | * @edev: the target extcon device. |
165 | * @previous_value the saved previous event value. | 167 | * @previous_value: the saved previous event value. |
166 | */ | 168 | */ |
167 | struct extcon_specific_cable_nb { | 169 | struct extcon_specific_cable_nb { |
168 | struct notifier_block internal_nb; | 170 | struct notifier_block internal_nb; |