aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2015-06-11 22:10:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-12 20:01:42 -0400
commit73b6ecdb93e8e77752cae9077c424fcdc6f23c39 (patch)
treeb5835ea1ec76678325e73280209384361f82b695
parent03cb0503014f49e41a937d81238ab059fd69ad78 (diff)
extcon: Redefine the unique id of supported external connectors without 'enum extcon' type
This patch just redefine the unique id of supported external connectors without 'enum extcon' type. Because unique id would be used on devictree file(*.dts) to indicate the specific external connectors like key number of input framework. So, I have the plan to move this definitions to following header file which includes the unique id of supported external connectors. - include/dt-bindings/extcon/extcon.h Fixes: 2a9de9c0f08d ("extcon: Use the unique id for external connector instead of string") Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/extcon/extcon-adc-jack.c2
-rw-r--r--drivers/extcon/extcon-arizona.c4
-rw-r--r--drivers/extcon/extcon-axp288.c4
-rw-r--r--drivers/extcon/extcon-max14577.c2
-rw-r--r--drivers/extcon/extcon-max77693.c4
-rw-r--r--drivers/extcon/extcon-max77843.c2
-rw-r--r--drivers/extcon/extcon-max8997.c2
-rw-r--r--drivers/extcon/extcon-palmas.c2
-rw-r--r--drivers/extcon/extcon-rt8973a.c4
-rw-r--r--drivers/extcon/extcon-sm5502.c4
-rw-r--r--drivers/extcon/extcon-usb-gpio.c2
-rw-r--r--drivers/extcon/extcon.c24
-rw-r--r--drivers/usb/phy/phy-tahvo.c2
-rw-r--r--include/linux/extcon.h90
14 files changed, 71 insertions, 77 deletions
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 5bf08ec1cacf..7fc0ae1912f8 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -40,7 +40,7 @@
40struct adc_jack_data { 40struct adc_jack_data {
41 struct extcon_dev *edev; 41 struct extcon_dev *edev;
42 42
43 const char **cable_names; 43 const unsigned int **cable_names;
44 struct adc_jack_cond *adc_conditions; 44 struct adc_jack_cond *adc_conditions;
45 int num_conditions; 45 int num_conditions;
46 46
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 9262b45a4484..ad87f263056f 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -118,7 +118,7 @@ static const int arizona_micd_levels[] = {
118 1257, 118 1257,
119}; 119};
120 120
121static const enum extcon arizona_cable[] = { 121static const unsigned int arizona_cable[] = {
122 EXTCON_MECHANICAL, 122 EXTCON_MECHANICAL,
123 EXTCON_MICROPHONE, 123 EXTCON_MICROPHONE,
124 EXTCON_HEADPHONE, 124 EXTCON_HEADPHONE,
@@ -552,7 +552,7 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
552 struct arizona_extcon_info *info = data; 552 struct arizona_extcon_info *info = data;
553 struct arizona *arizona = info->arizona; 553 struct arizona *arizona = info->arizona;
554 int id_gpio = arizona->pdata.hpdet_id_gpio; 554 int id_gpio = arizona->pdata.hpdet_id_gpio;
555 enum extcon report = EXTCON_HEADPHONE; 555 unsigned int report = EXTCON_HEADPHONE;
556 int ret, reading; 556 int ret, reading;
557 bool mic = false; 557 bool mic = false;
558 558
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 3605aa96c25a..ea962bc547b8 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -101,7 +101,7 @@ enum axp288_extcon_irq {
101 EXTCON_IRQ_END, 101 EXTCON_IRQ_END,
102}; 102};
103 103
104static const enum extcon axp288_extcon_cables[] = { 104static const unsigned int axp288_extcon_cables[] = {
105 EXTCON_SLOW_CHARGER, 105 EXTCON_SLOW_CHARGER,
106 EXTCON_CHARGE_DOWNSTREAM, 106 EXTCON_CHARGE_DOWNSTREAM,
107 EXTCON_FAST_CHARGER, 107 EXTCON_FAST_CHARGER,
@@ -157,7 +157,7 @@ static void axp288_extcon_log_rsi(struct axp288_extcon_info *info)
157static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) 157static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
158{ 158{
159 static bool notify_otg, notify_charger; 159 static bool notify_otg, notify_charger;
160 static enum extcon cable; 160 static unsigned int cable;
161 int ret, stat, cfg, pwr_stat; 161 int ret, stat, cfg, pwr_stat;
162 u8 chrg_type; 162 u8 chrg_type;
163 bool vbus_attach = false; 163 bool vbus_attach = false;
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index e7c3edb5bd4b..df0659d98e5a 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -148,7 +148,7 @@ enum max14577_muic_acc_type {
148 MAX14577_MUIC_ADC_OPEN, 148 MAX14577_MUIC_ADC_OPEN,
149}; 149};
150 150
151static const enum extcon max14577_extcon_cable[] = { 151static const unsigned int max14577_extcon_cable[] = {
152 EXTCON_USB, 152 EXTCON_USB,
153 EXTCON_TA, 153 EXTCON_TA,
154 EXTCON_FAST_CHARGER, 154 EXTCON_FAST_CHARGER,
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 20e796e10e57..f4f3b3d53928 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -200,7 +200,7 @@ enum max77693_muic_acc_type {
200/* 200/*
201 * MAX77693 MUIC device support below list of accessories(external connector) 201 * MAX77693 MUIC device support below list of accessories(external connector)
202 */ 202 */
203static const enum extcon max77693_extcon_cable[] = { 203static const unsigned int max77693_extcon_cable[] = {
204 EXTCON_USB, 204 EXTCON_USB,
205 EXTCON_USB_HOST, 205 EXTCON_USB_HOST,
206 EXTCON_TA, 206 EXTCON_TA,
@@ -457,7 +457,7 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
457 int ret = 0; 457 int ret = 0;
458 int vbvolt; 458 int vbvolt;
459 bool cable_attached; 459 bool cable_attached;
460 enum extcon dock_id; 460 unsigned int dock_id;
461 461
462 dev_info(info->dev, 462 dev_info(info->dev,
463 "external connector is %s (adc:0x%02x)\n", 463 "external connector is %s (adc:0x%02x)\n",
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index d78a64d7fc20..fac2f1417a79 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -118,7 +118,7 @@ enum max77843_muic_charger_type {
118 MAX77843_MUIC_CHG_GND, 118 MAX77843_MUIC_CHG_GND,
119}; 119};
120 120
121static const enum extcon max77843_extcon_cable[] = { 121static const unsigned int max77843_extcon_cable[] = {
122 EXTCON_USB, 122 EXTCON_USB,
123 EXTCON_USB_HOST, 123 EXTCON_USB_HOST,
124 EXTCON_TA, 124 EXTCON_TA,
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 4d10949c6eb2..7b1ef200b121 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -145,7 +145,7 @@ struct max8997_muic_info {
145 int path_uart; 145 int path_uart;
146}; 146};
147 147
148static const enum extcon max8997_extcon_cable[] = { 148static const unsigned int max8997_extcon_cable[] = {
149 EXTCON_USB, 149 EXTCON_USB,
150 EXTCON_USB_HOST, 150 EXTCON_USB_HOST,
151 EXTCON_TA, 151 EXTCON_TA,
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
index d68954045a33..080d5cc27055 100644
--- a/drivers/extcon/extcon-palmas.c
+++ b/drivers/extcon/extcon-palmas.c
@@ -29,7 +29,7 @@
29#include <linux/of.h> 29#include <linux/of.h>
30#include <linux/of_platform.h> 30#include <linux/of_platform.h>
31 31
32static const enum extcon palmas_extcon_cable[] = { 32static const unsigned int palmas_extcon_cable[] = {
33 EXTCON_USB, 33 EXTCON_USB,
34 EXTCON_USB_HOST, 34 EXTCON_USB_HOST,
35 EXTCON_NONE, 35 EXTCON_NONE,
diff --git a/drivers/extcon/extcon-rt8973a.c b/drivers/extcon/extcon-rt8973a.c
index f2a8672cbf82..92c939221a41 100644
--- a/drivers/extcon/extcon-rt8973a.c
+++ b/drivers/extcon/extcon-rt8973a.c
@@ -90,7 +90,7 @@ static struct reg_data rt8973a_reg_data[] = {
90}; 90};
91 91
92/* List of detectable cables */ 92/* List of detectable cables */
93static const enum extcon rt8973a_extcon_cable[] = { 93static const unsigned int rt8973a_extcon_cable[] = {
94 EXTCON_USB, 94 EXTCON_USB,
95 EXTCON_USB_HOST, 95 EXTCON_USB_HOST,
96 EXTCON_TA, 96 EXTCON_TA,
@@ -300,7 +300,7 @@ static int rt8973a_muic_cable_handler(struct rt8973a_muic_info *info,
300 static unsigned int prev_cable_type; 300 static unsigned int prev_cable_type;
301 unsigned int con_sw = DM_DP_SWITCH_UART; 301 unsigned int con_sw = DM_DP_SWITCH_UART;
302 int ret, cable_type; 302 int ret, cable_type;
303 enum extcon id; 303 unsigned int id;
304 bool attached = false; 304 bool attached = false;
305 305
306 switch (event) { 306 switch (event) {
diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
index 520693d6fa8a..817dece23b4c 100644
--- a/drivers/extcon/extcon-sm5502.c
+++ b/drivers/extcon/extcon-sm5502.c
@@ -92,7 +92,7 @@ static struct reg_data sm5502_reg_data[] = {
92}; 92};
93 93
94/* List of detectable cables */ 94/* List of detectable cables */
95static const enum extcon sm5502_extcon_cable[] = { 95static const unsigned int sm5502_extcon_cable[] = {
96 EXTCON_USB, 96 EXTCON_USB,
97 EXTCON_USB_HOST, 97 EXTCON_USB_HOST,
98 EXTCON_TA, 98 EXTCON_TA,
@@ -372,7 +372,7 @@ static int sm5502_muic_cable_handler(struct sm5502_muic_info *info,
372 unsigned int cable_type = SM5502_MUIC_ADC_GROUND; 372 unsigned int cable_type = SM5502_MUIC_ADC_GROUND;
373 unsigned int con_sw = DM_DP_SWITCH_OPEN; 373 unsigned int con_sw = DM_DP_SWITCH_OPEN;
374 unsigned int vbus_sw = VBUSIN_SWITCH_OPEN; 374 unsigned int vbus_sw = VBUSIN_SWITCH_OPEN;
375 enum extcon id; 375 unsigned int id;
376 int ret; 376 int ret;
377 377
378 /* Get the type of attached or detached cable */ 378 /* Get the type of attached or detached cable */
diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index 14da94cb57fa..a2a44536a608 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -39,7 +39,7 @@ struct usb_extcon_info {
39 struct delayed_work wq_detcable; 39 struct delayed_work wq_detcable;
40}; 40};
41 41
42static const enum extcon usb_extcon_cable[] = { 42static const unsigned int usb_extcon_cable[] = {
43 EXTCON_USB, 43 EXTCON_USB,
44 EXTCON_USB_HOST, 44 EXTCON_USB_HOST,
45 EXTCON_NONE, 45 EXTCON_NONE,
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index fafd428cae7f..76157ab9faf3 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -39,6 +39,8 @@
39#define CABLE_NAME_MAX 30 39#define CABLE_NAME_MAX 30
40 40
41static const char *extcon_name[] = { 41static const char *extcon_name[] = {
42 [EXTCON_NONE] = "NONE",
43
42 /* USB external connector */ 44 /* USB external connector */
43 [EXTCON_USB] = "USB", 45 [EXTCON_USB] = "USB",
44 [EXTCON_USB_HOST] = "USB-HOST", 46 [EXTCON_USB_HOST] = "USB-HOST",
@@ -109,7 +111,7 @@ static int check_mutually_exclusive(struct extcon_dev *edev, u32 new_state)
109 return 0; 111 return 0;
110} 112}
111 113
112static int find_cable_index_by_id(struct extcon_dev *edev, const enum extcon id) 114static int find_cable_index_by_id(struct extcon_dev *edev, const unsigned int id)
113{ 115{
114 int i; 116 int i;
115 117
@@ -124,16 +126,14 @@ static int find_cable_index_by_id(struct extcon_dev *edev, const enum extcon id)
124 126
125static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) 127static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
126{ 128{
127 enum extcon id = EXTCON_NONE; 129 unsigned int id = EXTCON_NONE;
128 int i; 130 int i = 0;
129 131
130 if (edev->max_supported == 0) 132 if (edev->max_supported == 0)
131 return -EINVAL; 133 return -EINVAL;
132 134
133 /* Find the the number of extcon cable */ 135 /* Find the the number of extcon cable */
134 for (i = 0; i < EXTCON_END; i++) { 136 while (extcon_name[i]) {
135 if (!extcon_name[i])
136 continue;
137 if (!strncmp(extcon_name[i], name, CABLE_NAME_MAX)) { 137 if (!strncmp(extcon_name[i], name, CABLE_NAME_MAX)) {
138 id = i; 138 id = i;
139 break; 139 break;
@@ -337,7 +337,7 @@ EXPORT_SYMBOL_GPL(extcon_set_state);
337 * @edev: the extcon device that has the cable. 337 * @edev: the extcon device that has the cable.
338 * @id: the unique id of each external connector in extcon enumeration. 338 * @id: the unique id of each external connector in extcon enumeration.
339 */ 339 */
340int extcon_get_cable_state_(struct extcon_dev *edev, const enum extcon id) 340int extcon_get_cable_state_(struct extcon_dev *edev, const unsigned int id)
341{ 341{
342 int index; 342 int index;
343 343
@@ -374,7 +374,7 @@ EXPORT_SYMBOL_GPL(extcon_get_cable_state);
374 * @state: the new cable status. The default semantics is 374 * @state: the new cable status. The default semantics is
375 * true: attached / false: detached. 375 * true: attached / false: detached.
376 */ 376 */
377int extcon_set_cable_state_(struct extcon_dev *edev, enum extcon id, 377int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id,
378 bool cable_state) 378 bool cable_state)
379{ 379{
380 u32 state; 380 u32 state;
@@ -539,7 +539,7 @@ EXPORT_SYMBOL_GPL(extcon_unregister_interest);
539 * "old_state", not the current state. The current state can be retrieved 539 * "old_state", not the current state. The current state can be retrieved
540 * by looking at the third pameter (edev pointer)'s state value. 540 * by looking at the third pameter (edev pointer)'s state value.
541 */ 541 */
542int extcon_register_notifier(struct extcon_dev *edev, enum extcon id, 542int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
543 struct notifier_block *nb) 543 struct notifier_block *nb)
544{ 544{
545 unsigned long flags; 545 unsigned long flags;
@@ -561,7 +561,7 @@ EXPORT_SYMBOL_GPL(extcon_register_notifier);
561 * @id: the unique id of each external connector in extcon enumeration. 561 * @id: the unique id of each external connector in extcon enumeration.
562 * @nb: a notifier block to be registered. 562 * @nb: a notifier block to be registered.
563 */ 563 */
564int extcon_unregister_notifier(struct extcon_dev *edev, enum extcon id, 564int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
565 struct notifier_block *nb) 565 struct notifier_block *nb)
566{ 566{
567 unsigned long flags; 567 unsigned long flags;
@@ -623,7 +623,7 @@ static void dummy_sysfs_dev_release(struct device *dev)
623 * 623 *
624 * Return the pointer of extcon device if success or ERR_PTR(err) if fail 624 * Return the pointer of extcon device if success or ERR_PTR(err) if fail
625 */ 625 */
626struct extcon_dev *extcon_dev_allocate(const enum extcon *supported_cable) 626struct extcon_dev *extcon_dev_allocate(const unsigned int *supported_cable)
627{ 627{
628 struct extcon_dev *edev; 628 struct extcon_dev *edev;
629 629
@@ -677,7 +677,7 @@ static void devm_extcon_dev_release(struct device *dev, void *res)
677 * or ERR_PTR(err) if fail 677 * or ERR_PTR(err) if fail
678 */ 678 */
679struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, 679struct extcon_dev *devm_extcon_dev_allocate(struct device *dev,
680 const enum extcon *supported_cable) 680 const unsigned int *supported_cable)
681{ 681{
682 struct extcon_dev **ptr, *edev; 682 struct extcon_dev **ptr, *edev;
683 683
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index 1d1bb9ad8ccf..2f777d22184d 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -60,7 +60,7 @@ struct tahvo_usb {
60 struct extcon_dev extcon; 60 struct extcon_dev extcon;
61}; 61};
62 62
63static const enum extcon tahvo_cable[] = { 63static const unsigned int tahvo_cable[] = {
64 EXTCON_USB, 64 EXTCON_USB,
65 EXTCON_USB_HOST, 65 EXTCON_USB_HOST,
66 66
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index a7b224b20ecc..b16d929fa75f 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -30,41 +30,35 @@
30#include <linux/notifier.h> 30#include <linux/notifier.h>
31#include <linux/sysfs.h> 31#include <linux/sysfs.h>
32 32
33enum extcon { 33/*
34 EXTCON_NONE = 0x0, 34 * Define the unique id of supported external connectors
35 35 */
36 /* USB external connector */ 36#define EXTCON_NONE 0
37 EXTCON_USB = 0x1, 37
38 EXTCON_USB_HOST = 0x2, 38#define EXTCON_USB 1 /* USB connector */
39 39#define EXTCON_USB_HOST 2
40 /* Charger external connector */ 40
41 EXTCON_TA = 0x10, 41#define EXTCON_TA 3 /* Charger connector */
42 EXTCON_FAST_CHARGER = 0x11, 42#define EXTCON_FAST_CHARGER 4
43 EXTCON_SLOW_CHARGER = 0x12, 43#define EXTCON_SLOW_CHARGER 5
44 EXTCON_CHARGE_DOWNSTREAM = 0x13, 44#define EXTCON_CHARGE_DOWNSTREAM 6
45 45
46 /* Audio/Video external connector */ 46#define EXTCON_LINE_IN 7 /* Audio/Video connector */
47 EXTCON_LINE_IN = 0x20, 47#define EXTCON_LINE_OUT 8
48 EXTCON_LINE_OUT = 0x21, 48#define EXTCON_MICROPHONE 9
49 EXTCON_MICROPHONE = 0x22, 49#define EXTCON_HEADPHONE 10
50 EXTCON_HEADPHONE = 0x23, 50#define EXTCON_HDMI 11
51 51#define EXTCON_MHL 12
52 EXTCON_HDMI = 0x30, 52#define EXTCON_DVI 13
53 EXTCON_MHL = 0x31, 53#define EXTCON_VGA 14
54 EXTCON_DVI = 0x32, 54#define EXTCON_SPDIF_IN 15
55 EXTCON_VGA = 0x33, 55#define EXTCON_SPDIF_OUT 16
56 EXTCON_SPDIF_IN = 0x34, 56#define EXTCON_VIDEO_IN 17
57 EXTCON_SPDIF_OUT = 0x35, 57#define EXTCON_VIDEO_OUT 18
58 EXTCON_VIDEO_IN = 0x36, 58
59 EXTCON_VIDEO_OUT = 0x37, 59#define EXTCON_DOCK 19 /* Misc connector */
60 60#define EXTCON_JIG 20
61 /* Etc external connector */ 61#define EXTCON_MECHANICAL 21
62 EXTCON_DOCK = 0x50,
63 EXTCON_JIG = 0x51,
64 EXTCON_MECHANICAL = 0x52,
65
66 EXTCON_END,
67};
68 62
69struct extcon_cable; 63struct extcon_cable;
70 64
@@ -105,7 +99,7 @@ struct extcon_cable;
105struct extcon_dev { 99struct extcon_dev {
106 /* Optional user initializing data */ 100 /* Optional user initializing data */
107 const char *name; 101 const char *name;
108 const enum extcon *supported_cable; 102 const unsigned int *supported_cable;
109 const u32 *mutually_exclusive; 103 const u32 *mutually_exclusive;
110 104
111 /* Optional callbacks to override class functions */ 105 /* Optional callbacks to override class functions */
@@ -182,10 +176,10 @@ extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name);
182/* 176/*
183 * Following APIs control the memory of extcon device. 177 * Following APIs control the memory of extcon device.
184 */ 178 */
185extern struct extcon_dev *extcon_dev_allocate(const enum extcon *cable); 179extern struct extcon_dev *extcon_dev_allocate(const unsigned int *cable);
186extern void extcon_dev_free(struct extcon_dev *edev); 180extern void extcon_dev_free(struct extcon_dev *edev);
187extern struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, 181extern struct extcon_dev *devm_extcon_dev_allocate(struct device *dev,
188 const enum extcon *cable); 182 const unsigned int *cable);
189extern void devm_extcon_dev_free(struct device *dev, struct extcon_dev *edev); 183extern void devm_extcon_dev_free(struct device *dev, struct extcon_dev *edev);
190 184
191/* 185/*
@@ -206,8 +200,8 @@ extern int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state);
206 * get/set_cable_state access each bit of the 32b encoded state value. 200 * get/set_cable_state access each bit of the 32b encoded state value.
207 * They are used to access the status of each cable based on the cable_name. 201 * They are used to access the status of each cable based on the cable_name.
208 */ 202 */
209extern int extcon_get_cable_state_(struct extcon_dev *edev, enum extcon id); 203extern int extcon_get_cable_state_(struct extcon_dev *edev, unsigned int id);
210extern int extcon_set_cable_state_(struct extcon_dev *edev, enum extcon id, 204extern int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id,
211 bool cable_state); 205 bool cable_state);
212 206
213extern int extcon_get_cable_state(struct extcon_dev *edev, 207extern int extcon_get_cable_state(struct extcon_dev *edev,
@@ -234,9 +228,9 @@ extern int extcon_unregister_interest(struct extcon_specific_cable_nb *nb);
234 * we do not recommend to use this for normal 'notifiee' device drivers who 228 * we do not recommend to use this for normal 'notifiee' device drivers who
235 * want to be notified by a specific external port of the notifier. 229 * want to be notified by a specific external port of the notifier.
236 */ 230 */
237extern int extcon_register_notifier(struct extcon_dev *edev, enum extcon id, 231extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
238 struct notifier_block *nb); 232 struct notifier_block *nb);
239extern int extcon_unregister_notifier(struct extcon_dev *edev, enum extcon id, 233extern int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
240 struct notifier_block *nb); 234 struct notifier_block *nb);
241 235
242/* 236/*
@@ -266,7 +260,7 @@ static inline int devm_extcon_dev_register(struct device *dev,
266static inline void devm_extcon_dev_unregister(struct device *dev, 260static inline void devm_extcon_dev_unregister(struct device *dev,
267 struct extcon_dev *edev) { } 261 struct extcon_dev *edev) { }
268 262
269static inline struct extcon_dev *extcon_dev_allocate(const enum extcon *cable) 263static inline struct extcon_dev *extcon_dev_allocate(const unsigned int *cable)
270{ 264{
271 return ERR_PTR(-ENOSYS); 265 return ERR_PTR(-ENOSYS);
272} 266}
@@ -274,7 +268,7 @@ static inline struct extcon_dev *extcon_dev_allocate(const enum extcon *cable)
274static inline void extcon_dev_free(struct extcon_dev *edev) { } 268static inline void extcon_dev_free(struct extcon_dev *edev) { }
275 269
276static inline struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, 270static inline struct extcon_dev *devm_extcon_dev_allocate(struct device *dev,
277 const enum extcon *cable) 271 const unsigned int *cable)
278{ 272{
279 return ERR_PTR(-ENOSYS); 273 return ERR_PTR(-ENOSYS);
280} 274}
@@ -298,13 +292,13 @@ static inline int extcon_update_state(struct extcon_dev *edev, u32 mask,
298} 292}
299 293
300static inline int extcon_get_cable_state_(struct extcon_dev *edev, 294static inline int extcon_get_cable_state_(struct extcon_dev *edev,
301 enum extcon id) 295 unsigned int id)
302{ 296{
303 return 0; 297 return 0;
304} 298}
305 299
306static inline int extcon_set_cable_state_(struct extcon_dev *edev, 300static inline int extcon_set_cable_state_(struct extcon_dev *edev,
307 enum extcon id, bool cable_state) 301 unsigned int id, bool cable_state)
308{ 302{
309 return 0; 303 return 0;
310} 304}
@@ -327,14 +321,14 @@ static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
327} 321}
328 322
329static inline int extcon_register_notifier(struct extcon_dev *edev, 323static inline int extcon_register_notifier(struct extcon_dev *edev,
330 enum extcon id, 324 unsigned int id,
331 struct notifier_block *nb) 325 struct notifier_block *nb)
332{ 326{
333 return 0; 327 return 0;
334} 328}
335 329
336static inline int extcon_unregister_notifier(struct extcon_dev *edev, 330static inline int extcon_unregister_notifier(struct extcon_dev *edev,
337 enum extcon id, 331 unsigned int id,
338 struct notifier_block *nb) 332 struct notifier_block *nb)
339{ 333{
340 return 0; 334 return 0;