diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2013-08-31 00:16:49 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2013-09-26 20:37:00 -0400 |
commit | a75e1c73a46eed0332d036e371f714e76d167c07 (patch) | |
tree | e910c19802ead91ec7dc26f1e8d6f63bb7e20faf /include/linux | |
parent | a33411b26e43d67d361298a822ecfd76a177183f (diff) |
extcon: Fix indentation coding style to improve readability
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/extcon.h | 67 | ||||
-rw-r--r-- | include/linux/extcon/extcon-adc-jack.h | 42 | ||||
-rw-r--r-- | include/linux/extcon/extcon-gpio.h | 16 |
3 files changed, 64 insertions, 61 deletions
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index fcb51c88319f..c2b652dde72c 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
@@ -51,10 +51,10 @@ | |||
51 | enum extcon_cable_name { | 51 | enum extcon_cable_name { |
52 | EXTCON_USB = 0, | 52 | EXTCON_USB = 0, |
53 | EXTCON_USB_HOST, | 53 | EXTCON_USB_HOST, |
54 | EXTCON_TA, /* Travel Adaptor */ | 54 | EXTCON_TA, /* Travel Adaptor */ |
55 | EXTCON_FAST_CHARGER, | 55 | EXTCON_FAST_CHARGER, |
56 | EXTCON_SLOW_CHARGER, | 56 | EXTCON_SLOW_CHARGER, |
57 | EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ | 57 | EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ |
58 | EXTCON_HDMI, | 58 | EXTCON_HDMI, |
59 | EXTCON_MHL, | 59 | EXTCON_MHL, |
60 | EXTCON_DVI, | 60 | EXTCON_DVI, |
@@ -76,8 +76,8 @@ struct extcon_cable; | |||
76 | 76 | ||
77 | /** | 77 | /** |
78 | * struct extcon_dev - An extcon device represents one external connector. | 78 | * struct extcon_dev - An extcon device represents one external connector. |
79 | * @name: The name of this extcon device. Parent device name is used | 79 | * @name: The name of this extcon device. Parent device name is |
80 | * if NULL. | 80 | * used if NULL. |
81 | * @supported_cable: Array of supported cable names ending with NULL. | 81 | * @supported_cable: Array of supported cable names ending with NULL. |
82 | * If supported_cable is NULL, cable name related APIs | 82 | * If supported_cable is NULL, cable name related APIs |
83 | * are disabled. | 83 | * are disabled. |
@@ -89,21 +89,21 @@ struct extcon_cable; | |||
89 | * be attached simulataneously. {0x7, 0} is equivalent to | 89 | * be attached simulataneously. {0x7, 0} is equivalent to |
90 | * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there | 90 | * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there |
91 | * can be no simultaneous connections. | 91 | * can be no simultaneous connections. |
92 | * @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 |
93 | * name of the extcon device. | 93 | * name of the extcon device. |
94 | * @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 |
95 | * status of the extcon device. | 95 | * status of the extcon device. |
96 | * @dev: Device of this extcon. Do not provide at register-time. | 96 | * @dev: Device of this extcon. Do not provide at register-time. |
97 | * @state: Attach/detach state of this extcon. Do not provide at | 97 | * @state: Attach/detach state of this extcon. Do not provide at |
98 | * register-time | 98 | * register-time. |
99 | * @nh: Notifier for the state change events from this extcon | 99 | * @nh: Notifier for the state change events from this extcon |
100 | * @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 |
101 | * for extcon devices based on the extcon name. | 101 | * for extcon devices based on the extcon name. |
102 | * @lock: | 102 | * @lock: |
103 | * @max_supported: Internal value to store the number of cables. | 103 | * @max_supported: Internal value to store the number of cables. |
104 | * @extcon_dev_type: Device_type struct to provide attribute_groups | 104 | * @extcon_dev_type: Device_type struct to provide attribute_groups |
105 | * customized for each extcon device. | 105 | * customized for each extcon device. |
106 | * @cables: Sysfs subdirectories. Each represents one cable. | 106 | * @cables: Sysfs subdirectories. Each represents one cable. |
107 | * | 107 | * |
108 | * 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 |
109 | * this struct when registering an extcon. In some exceptional cases, | 109 | * this struct when registering an extcon. In some exceptional cases, |
@@ -111,26 +111,27 @@ struct extcon_cable; | |||
111 | * are overwritten by register function. | 111 | * are overwritten by register function. |
112 | */ | 112 | */ |
113 | struct extcon_dev { | 113 | struct extcon_dev { |
114 | /* --- Optional user initializing data --- */ | 114 | /* Optional user initializing data */ |
115 | const char *name; | 115 | const char *name; |
116 | const char **supported_cable; | 116 | const char **supported_cable; |
117 | const u32 *mutually_exclusive; | 117 | const u32 *mutually_exclusive; |
118 | 118 | ||
119 | /* --- Optional callbacks to override class functions --- */ | 119 | /* Optional callbacks to override class functions */ |
120 | ssize_t (*print_name)(struct extcon_dev *edev, char *buf); | 120 | ssize_t (*print_name)(struct extcon_dev *edev, char *buf); |
121 | ssize_t (*print_state)(struct extcon_dev *edev, char *buf); | 121 | ssize_t (*print_state)(struct extcon_dev *edev, char *buf); |
122 | 122 | ||
123 | /* --- Internal data. Please do not set. --- */ | 123 | /* Internal data. Please do not set. */ |
124 | struct device *dev; | 124 | struct device *dev; |
125 | u32 state; | ||
126 | struct raw_notifier_head nh; | 125 | struct raw_notifier_head nh; |
127 | struct list_head entry; | 126 | struct list_head entry; |
128 | spinlock_t lock; /* could be called by irq handler */ | ||
129 | int max_supported; | 127 | int max_supported; |
128 | spinlock_t lock; /* could be called by irq handler */ | ||
129 | u32 state; | ||
130 | 130 | ||
131 | /* /sys/class/extcon/.../cable.n/... */ | 131 | /* /sys/class/extcon/.../cable.n/... */ |
132 | struct device_type extcon_dev_type; | 132 | struct device_type extcon_dev_type; |
133 | struct extcon_cable *cables; | 133 | struct extcon_cable *cables; |
134 | |||
134 | /* /sys/class/extcon/.../mutually_exclusive/... */ | 135 | /* /sys/class/extcon/.../mutually_exclusive/... */ |
135 | struct attribute_group attr_g_muex; | 136 | struct attribute_group attr_g_muex; |
136 | struct attribute **attrs_muex; | 137 | struct attribute **attrs_muex; |
@@ -138,13 +139,13 @@ struct extcon_dev { | |||
138 | }; | 139 | }; |
139 | 140 | ||
140 | /** | 141 | /** |
141 | * struct extcon_cable - An internal data for each cable of extcon device. | 142 | * struct extcon_cable - An internal data for each cable of extcon device. |
142 | * @edev: The extcon device | 143 | * @edev: The extcon device |
143 | * @cable_index: Index of this cable in the edev | 144 | * @cable_index: Index of this cable in the edev |
144 | * @attr_g: Attribute group for the cable | 145 | * @attr_g: Attribute group for the cable |
145 | * @attr_name: "name" sysfs entry | 146 | * @attr_name: "name" sysfs entry |
146 | * @attr_state: "state" sysfs entry | 147 | * @attr_state: "state" sysfs entry |
147 | * @attrs: Array pointing to attr_name and attr_state for attr_g | 148 | * @attrs: Array pointing to attr_name and attr_state for attr_g |
148 | */ | 149 | */ |
149 | struct extcon_cable { | 150 | struct extcon_cable { |
150 | struct extcon_dev *edev; | 151 | struct extcon_dev *edev; |
@@ -159,11 +160,13 @@ struct extcon_cable { | |||
159 | 160 | ||
160 | /** | 161 | /** |
161 | * struct extcon_specific_cable_nb - An internal data for | 162 | * struct extcon_specific_cable_nb - An internal data for |
162 | * extcon_register_interest(). | 163 | * extcon_register_interest(). |
163 | * @internal_nb: a notifier block bridging extcon notifier and cable notifier. | 164 | * @internal_nb: A notifier block bridging extcon notifier |
164 | * @user_nb: user provided notifier block for events from a specific cable. | 165 | * and cable notifier. |
166 | * @user_nb: user provided notifier block for events from | ||
167 | * a specific cable. | ||
165 | * @cable_index: the target cable. | 168 | * @cable_index: the target cable. |
166 | * @edev: the target extcon device. | 169 | * @edev: the target extcon device. |
167 | * @previous_value: the saved previous event value. | 170 | * @previous_value: the saved previous event value. |
168 | */ | 171 | */ |
169 | struct extcon_specific_cable_nb { | 172 | struct extcon_specific_cable_nb { |
diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h index 20e9eef25d4c..9ca958c4e94c 100644 --- a/include/linux/extcon/extcon-adc-jack.h +++ b/include/linux/extcon/extcon-adc-jack.h | |||
@@ -20,10 +20,10 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * struct adc_jack_cond - condition to use an extcon state | 22 | * struct adc_jack_cond - condition to use an extcon state |
23 | * @state - the corresponding extcon state (if 0, this struct denotes | 23 | * @state: the corresponding extcon state (if 0, this struct |
24 | * the last adc_jack_cond element among the array) | 24 | * denotes the last adc_jack_cond element among the array) |
25 | * @min_adc - min adc value for this condition | 25 | * @min_adc: min adc value for this condition |
26 | * @max_adc - max adc value for this condition | 26 | * @max_adc: max adc value for this condition |
27 | * | 27 | * |
28 | * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means | 28 | * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means |
29 | * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and | 29 | * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and |
@@ -33,34 +33,34 @@ | |||
33 | * because when no adc_jack_cond is met, state = 0 is automatically chosen. | 33 | * because when no adc_jack_cond is met, state = 0 is automatically chosen. |
34 | */ | 34 | */ |
35 | struct adc_jack_cond { | 35 | struct adc_jack_cond { |
36 | u32 state; /* extcon state value. 0 if invalid */ | 36 | u32 state; /* extcon state value. 0 if invalid */ |
37 | u32 min_adc; | 37 | u32 min_adc; |
38 | u32 max_adc; | 38 | u32 max_adc; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * struct adc_jack_pdata - platform data for adc jack device. | 42 | * struct adc_jack_pdata - platform data for adc jack device. |
43 | * @name - name of the extcon device. If null, "adc-jack" is used. | 43 | * @name: name of the extcon device. If null, "adc-jack" is used. |
44 | * @consumer_channel - Unique name to identify the channel on the consumer | 44 | * @consumer_channel: Unique name to identify the channel on the consumer |
45 | * side. This typically describes the channels used within | 45 | * side. This typically describes the channels used within |
46 | * the consumer. E.g. 'battery_voltage' | 46 | * the consumer. E.g. 'battery_voltage' |
47 | * @cable_names - array of cable names ending with null. | 47 | * @cable_names: array of cable names ending with null. |
48 | * @adc_contitions - array of struct adc_jack_cond conditions ending | 48 | * @adc_contitions: array of struct adc_jack_cond conditions ending |
49 | * with .state = 0 entry. This describes how to decode | 49 | * with .state = 0 entry. This describes how to decode |
50 | * adc values into extcon state. | 50 | * adc values into extcon state. |
51 | * @irq_flags - irq flags used for the @irq | 51 | * @irq_flags: irq flags used for the @irq |
52 | * @handling_delay_ms - in some devices, we need to read ADC value some | 52 | * @handling_delay_ms: in some devices, we need to read ADC value some |
53 | * milli-seconds after the interrupt occurs. You may | 53 | * milli-seconds after the interrupt occurs. You may |
54 | * describe such delays with @handling_delay_ms, which | 54 | * describe such delays with @handling_delay_ms, which |
55 | * is rounded-off by jiffies. | 55 | * is rounded-off by jiffies. |
56 | */ | 56 | */ |
57 | struct adc_jack_pdata { | 57 | struct adc_jack_pdata { |
58 | const char *name; | 58 | const char *name; |
59 | const char *consumer_channel; | 59 | const char *consumer_channel; |
60 | /* | 60 | |
61 | * The last entry should be NULL | 61 | /* The last entry should be NULL */ |
62 | */ | ||
63 | const char **cable_names; | 62 | const char **cable_names; |
63 | |||
64 | /* The last entry's state should be 0 */ | 64 | /* The last entry's state should be 0 */ |
65 | struct adc_jack_cond *adc_conditions; | 65 | struct adc_jack_cond *adc_conditions; |
66 | 66 | ||
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h index 2d8307f7d67d..4ce1aa7d29bd 100644 --- a/include/linux/extcon/extcon-gpio.h +++ b/include/linux/extcon/extcon-gpio.h | |||
@@ -25,14 +25,14 @@ | |||
25 | 25 | ||
26 | /** | 26 | /** |
27 | * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device. | 27 | * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device. |
28 | * @name The name of this GPIO extcon device. | 28 | * @name: The name of this GPIO extcon device. |
29 | * @gpio Corresponding GPIO. | 29 | * @gpio: Corresponding GPIO. |
30 | * @debounce Debounce time for GPIO IRQ in ms. | 30 | * @debounce: Debounce time for GPIO IRQ in ms. |
31 | * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW). | 31 | * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW). |
32 | * @state_on print_state is overriden with state_on if attached. If Null, | 32 | * @state_on: print_state is overriden with state_on if attached. |
33 | * default method of extcon class is used. | 33 | * If NULL, default method of extcon class is used. |
34 | * @state_off print_state is overriden with state_on if detached. If Null, | 34 | * @state_off: print_state is overriden with state_on if detached. |
35 | * default method of extcon class is used. | 35 | * If NUll, default method of extcon class is used. |
36 | * | 36 | * |
37 | * Note that in order for state_on or state_off to be valid, both state_on | 37 | * Note that in order for state_on or state_off to be valid, both state_on |
38 | * and state_off should be not NULL. If at least one of them is NULL, | 38 | * and state_off should be not NULL. If at least one of them is NULL, |