aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-14 00:14:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-14 00:14:07 -0500
commit894025f24bd028942da3e602b87d9f7223109b14 (patch)
tree57f23d2bcdd59aaa6a3e7e26e175e678bfa9a5f4 /drivers/extcon
parentfb0255fb2941ef6f21742b2bc146d6b9aef4fedc (diff)
parentcdafb6d8b8da7fde266f79b3287ac221aa841879 (diff)
Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: usbfs: compute urb->actual_length for isochronous usb: core: message: remember to reset 'ret' to 0 when necessary USB: typec: Remove remaining redundant license text USB: typec: add SPDX identifiers to some files USB: renesas_usbhs: rcar?.h: add SPDX tags USB: chipidea: ci_hdrc_tegra.c: add SPDX line USB: host: xhci-debugfs: add SPDX lines USB: add SPDX identifiers to all remaining Makefiles usb: host: isp1362-hcd: remove a couple of redundant assignments USB: adutux: remove redundant variable minor usb: core: add a new usb_get_ptm_status() helper usb: core: add a 'type' parameter to usb_get_status() usb: core: introduce a new usb_get_std_status() helper usb: core: rename usb_get_status() 'type' argument to 'recip' usb: core: add Status Type definitions USB: gadget: Remove redundant license text USB: gadget: function: Remove redundant license text USB: gadget: udc: Remove redundant license text USB: gadget: legacy: Remove redundant license text ...
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-adc-jack.c2
-rw-r--r--drivers/extcon/extcon-arizona.c2
-rw-r--r--drivers/extcon/extcon-axp288.c2
-rw-r--r--drivers/extcon/extcon-gpio.c2
-rw-r--r--drivers/extcon/extcon-intel-cht-wc.c2
-rw-r--r--drivers/extcon/extcon-intel-int3496.c2
-rw-r--r--drivers/extcon/extcon-max14577.c4
-rw-r--r--drivers/extcon/extcon-max3355.c2
-rw-r--r--drivers/extcon/extcon-max77693.c2
-rw-r--r--drivers/extcon/extcon-max77843.c95
-rw-r--r--drivers/extcon/extcon-max8997.c2
-rw-r--r--drivers/extcon/extcon-qcom-spmi-misc.c2
-rw-r--r--drivers/extcon/extcon-rt8973a.c2
-rw-r--r--drivers/extcon/extcon-sm5502.c2
-rw-r--r--drivers/extcon/extcon-usb-gpio.c2
-rw-r--r--drivers/extcon/extcon-usbc-cros-ec.c2
-rw-r--r--drivers/extcon/extcon.c2
-rw-r--r--drivers/extcon/extcon.h2
18 files changed, 98 insertions, 33 deletions
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 6f6537ab0a79..3877d86c746a 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -26,7 +26,7 @@
26#include <linux/workqueue.h> 26#include <linux/workqueue.h>
27#include <linux/iio/consumer.h> 27#include <linux/iio/consumer.h>
28#include <linux/extcon/extcon-adc-jack.h> 28#include <linux/extcon/extcon-adc-jack.h>
29#include <linux/extcon.h> 29#include <linux/extcon-provider.h>
30 30
31/** 31/**
32 * struct adc_jack_data - internal data for adc_jack device driver 32 * struct adc_jack_data - internal data for adc_jack device driver
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index f84da4a17724..da0e9bc4262f 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -27,7 +27,7 @@
27#include <linux/pm_runtime.h> 27#include <linux/pm_runtime.h>
28#include <linux/property.h> 28#include <linux/property.h>
29#include <linux/regulator/consumer.h> 29#include <linux/regulator/consumer.h>
30#include <linux/extcon.h> 30#include <linux/extcon-provider.h>
31 31
32#include <sound/soc.h> 32#include <sound/soc.h>
33 33
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index f4fd03e58e37..981fba56bc18 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -22,7 +22,7 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/property.h> 23#include <linux/property.h>
24#include <linux/notifier.h> 24#include <linux/notifier.h>
25#include <linux/extcon.h> 25#include <linux/extcon-provider.h>
26#include <linux/regmap.h> 26#include <linux/regmap.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/gpio/consumer.h> 28#include <linux/gpio/consumer.h>
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index ebed22f22d75..ab770adcca7e 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -17,7 +17,7 @@
17 * GNU General Public License for more details. 17 * GNU General Public License for more details.
18 */ 18 */
19 19
20#include <linux/extcon.h> 20#include <linux/extcon-provider.h>
21#include <linux/extcon/extcon-gpio.h> 21#include <linux/extcon/extcon-gpio.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/gpio/consumer.h> 23#include <linux/gpio/consumer.h>
diff --git a/drivers/extcon/extcon-intel-cht-wc.c b/drivers/extcon/extcon-intel-cht-wc.c
index 91a0023074af..7c4bc8c44c3f 100644
--- a/drivers/extcon/extcon-intel-cht-wc.c
+++ b/drivers/extcon/extcon-intel-cht-wc.c
@@ -15,7 +15,7 @@
15 * more details. 15 * more details.
16 */ 16 */
17 17
18#include <linux/extcon.h> 18#include <linux/extcon-provider.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/mfd/intel_soc_pmic.h> 21#include <linux/mfd/intel_soc_pmic.h>
diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
index 1a45e745717d..c8691b5a9cb0 100644
--- a/drivers/extcon/extcon-intel-int3496.c
+++ b/drivers/extcon/extcon-intel-int3496.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21#include <linux/acpi.h> 21#include <linux/acpi.h>
22#include <linux/extcon.h> 22#include <linux/extcon-provider.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/module.h> 25#include <linux/module.h>
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index f6414b7fa5bc..b871836da8a4 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -23,7 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/mfd/max14577.h> 24#include <linux/mfd/max14577.h>
25#include <linux/mfd/max14577-private.h> 25#include <linux/mfd/max14577-private.h>
26#include <linux/extcon.h> 26#include <linux/extcon-provider.h>
27 27
28#define DELAY_MS_DEFAULT 17000 /* unit: millisecond */ 28#define DELAY_MS_DEFAULT 17000 /* unit: millisecond */
29 29
@@ -204,8 +204,8 @@ static int max14577_muic_set_debounce_time(struct max14577_muic_info *info,
204static int max14577_muic_set_path(struct max14577_muic_info *info, 204static int max14577_muic_set_path(struct max14577_muic_info *info,
205 u8 val, bool attached) 205 u8 val, bool attached)
206{ 206{
207 int ret = 0;
208 u8 ctrl1, ctrl2 = 0; 207 u8 ctrl1, ctrl2 = 0;
208 int ret;
209 209
210 /* Set open state to path before changing hw path */ 210 /* Set open state to path before changing hw path */
211 ret = max14577_update_reg(info->max14577->regmap, 211 ret = max14577_update_reg(info->max14577->regmap,
diff --git a/drivers/extcon/extcon-max3355.c b/drivers/extcon/extcon-max3355.c
index 533e16a952b8..0aa410836f4e 100644
--- a/drivers/extcon/extcon-max3355.c
+++ b/drivers/extcon/extcon-max3355.c
@@ -9,7 +9,7 @@
9 * may be copied, distributed, and modified under those terms. 9 * may be copied, distributed, and modified under those terms.
10 */ 10 */
11 11
12#include <linux/extcon.h> 12#include <linux/extcon-provider.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/gpio/consumer.h> 14#include <linux/gpio/consumer.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 7a5856809047..643411066ad9 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -26,7 +26,7 @@
26#include <linux/mfd/max77693.h> 26#include <linux/mfd/max77693.h>
27#include <linux/mfd/max77693-common.h> 27#include <linux/mfd/max77693-common.h>
28#include <linux/mfd/max77693-private.h> 28#include <linux/mfd/max77693-private.h>
29#include <linux/extcon.h> 29#include <linux/extcon-provider.h>
30#include <linux/regmap.h> 30#include <linux/regmap.h>
31#include <linux/irqdomain.h> 31#include <linux/irqdomain.h>
32 32
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index 6e722d552cf1..c9fcd6cd41cb 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -11,7 +11,7 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/extcon.h> 14#include <linux/extcon-provider.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
@@ -80,7 +80,7 @@ enum max77843_muic_accessory_type {
80 MAX77843_MUIC_ADC_REMOTE_S12_BUTTON, 80 MAX77843_MUIC_ADC_REMOTE_S12_BUTTON,
81 MAX77843_MUIC_ADC_RESERVED_ACC_1, 81 MAX77843_MUIC_ADC_RESERVED_ACC_1,
82 MAX77843_MUIC_ADC_RESERVED_ACC_2, 82 MAX77843_MUIC_ADC_RESERVED_ACC_2,
83 MAX77843_MUIC_ADC_RESERVED_ACC_3, 83 MAX77843_MUIC_ADC_RESERVED_ACC_3, /* SmartDock */
84 MAX77843_MUIC_ADC_RESERVED_ACC_4, 84 MAX77843_MUIC_ADC_RESERVED_ACC_4,
85 MAX77843_MUIC_ADC_RESERVED_ACC_5, 85 MAX77843_MUIC_ADC_RESERVED_ACC_5,
86 MAX77843_MUIC_ADC_AUDIO_DEVICE_TYPE2, 86 MAX77843_MUIC_ADC_AUDIO_DEVICE_TYPE2,
@@ -119,6 +119,7 @@ enum max77843_muic_charger_type {
119 MAX77843_MUIC_CHG_SPECIAL_BIAS, 119 MAX77843_MUIC_CHG_SPECIAL_BIAS,
120 MAX77843_MUIC_CHG_RESERVED, 120 MAX77843_MUIC_CHG_RESERVED,
121 MAX77843_MUIC_CHG_GND, 121 MAX77843_MUIC_CHG_GND,
122 MAX77843_MUIC_CHG_DOCK,
122}; 123};
123 124
124static const unsigned int max77843_extcon_cable[] = { 125static const unsigned int max77843_extcon_cable[] = {
@@ -130,6 +131,7 @@ static const unsigned int max77843_extcon_cable[] = {
130 EXTCON_CHG_USB_FAST, 131 EXTCON_CHG_USB_FAST,
131 EXTCON_CHG_USB_SLOW, 132 EXTCON_CHG_USB_SLOW,
132 EXTCON_DISP_MHL, 133 EXTCON_DISP_MHL,
134 EXTCON_DOCK,
133 EXTCON_JIG, 135 EXTCON_JIG,
134 EXTCON_NONE, 136 EXTCON_NONE,
135}; 137};
@@ -200,7 +202,7 @@ static const struct regmap_irq_chip max77843_muic_irq_chip = {
200}; 202};
201 203
202static int max77843_muic_set_path(struct max77843_muic_info *info, 204static int max77843_muic_set_path(struct max77843_muic_info *info,
203 u8 val, bool attached) 205 u8 val, bool attached, bool nobccomp)
204{ 206{
205 struct max77693_dev *max77843 = info->max77843; 207 struct max77693_dev *max77843 = info->max77843;
206 int ret = 0; 208 int ret = 0;
@@ -210,10 +212,16 @@ static int max77843_muic_set_path(struct max77843_muic_info *info,
210 ctrl1 = val; 212 ctrl1 = val;
211 else 213 else
212 ctrl1 = MAX77843_MUIC_CONTROL1_SW_OPEN; 214 ctrl1 = MAX77843_MUIC_CONTROL1_SW_OPEN;
215 if (nobccomp) {
216 /* Disable BC1.2 protocol and force manual switch control */
217 ctrl1 |= MAX77843_MUIC_CONTROL1_NOBCCOMP_MASK;
218 }
213 219
214 ret = regmap_update_bits(max77843->regmap_muic, 220 ret = regmap_update_bits(max77843->regmap_muic,
215 MAX77843_MUIC_REG_CONTROL1, 221 MAX77843_MUIC_REG_CONTROL1,
216 MAX77843_MUIC_CONTROL1_COM_SW, ctrl1); 222 MAX77843_MUIC_CONTROL1_COM_SW |
223 MAX77843_MUIC_CONTROL1_NOBCCOMP_MASK,
224 ctrl1);
217 if (ret < 0) { 225 if (ret < 0) {
218 dev_err(info->dev, "Cannot switch MUIC port\n"); 226 dev_err(info->dev, "Cannot switch MUIC port\n");
219 return ret; 227 return ret;
@@ -240,6 +248,21 @@ static int max77843_muic_set_path(struct max77843_muic_info *info,
240 return 0; 248 return 0;
241} 249}
242 250
251static void max77843_charger_set_otg_vbus(struct max77843_muic_info *info,
252 bool on)
253{
254 struct max77693_dev *max77843 = info->max77843;
255 unsigned int cnfg00;
256
257 if (on)
258 cnfg00 = MAX77843_CHG_OTG_MASK | MAX77843_CHG_BOOST_MASK;
259 else
260 cnfg00 = MAX77843_CHG_ENABLE | MAX77843_CHG_BUCK_MASK;
261
262 regmap_update_bits(max77843->regmap_chg, MAX77843_CHG_REG_CHG_CNFG_00,
263 MAX77843_CHG_MODE_MASK, cnfg00);
264}
265
243static int max77843_muic_get_cable_type(struct max77843_muic_info *info, 266static int max77843_muic_get_cable_type(struct max77843_muic_info *info,
244 enum max77843_muic_cable_group group, bool *attached) 267 enum max77843_muic_cable_group group, bool *attached)
245{ 268{
@@ -288,6 +311,19 @@ static int max77843_muic_get_cable_type(struct max77843_muic_info *info,
288 break; 311 break;
289 } 312 }
290 313
314 if (adc == MAX77843_MUIC_ADC_RESERVED_ACC_3) { /* SmartDock */
315 if (chg_type == MAX77843_MUIC_CHG_NONE) {
316 *attached = false;
317 cable_type = info->prev_chg_type;
318 info->prev_chg_type = MAX77843_MUIC_CHG_NONE;
319 } else {
320 *attached = true;
321 cable_type = MAX77843_MUIC_CHG_DOCK;
322 info->prev_chg_type = MAX77843_MUIC_CHG_DOCK;
323 }
324 break;
325 }
326
291 if (chg_type == MAX77843_MUIC_CHG_NONE) { 327 if (chg_type == MAX77843_MUIC_CHG_NONE) {
292 *attached = false; 328 *attached = false;
293 cable_type = info->prev_chg_type; 329 cable_type = info->prev_chg_type;
@@ -350,17 +386,18 @@ static int max77843_muic_adc_gnd_handler(struct max77843_muic_info *info)
350 case MAX77843_MUIC_GND_USB_HOST_VB: 386 case MAX77843_MUIC_GND_USB_HOST_VB:
351 ret = max77843_muic_set_path(info, 387 ret = max77843_muic_set_path(info,
352 MAX77843_MUIC_CONTROL1_SW_USB, 388 MAX77843_MUIC_CONTROL1_SW_USB,
353 attached); 389 attached, false);
354 if (ret < 0) 390 if (ret < 0)
355 return ret; 391 return ret;
356 392
357 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, attached); 393 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, attached);
394 max77843_charger_set_otg_vbus(info, attached);
358 break; 395 break;
359 case MAX77843_MUIC_GND_MHL_VB: 396 case MAX77843_MUIC_GND_MHL_VB:
360 case MAX77843_MUIC_GND_MHL: 397 case MAX77843_MUIC_GND_MHL:
361 ret = max77843_muic_set_path(info, 398 ret = max77843_muic_set_path(info,
362 MAX77843_MUIC_CONTROL1_SW_OPEN, 399 MAX77843_MUIC_CONTROL1_SW_OPEN,
363 attached); 400 attached, false);
364 if (ret < 0) 401 if (ret < 0)
365 return ret; 402 return ret;
366 403
@@ -396,7 +433,7 @@ static int max77843_muic_jig_handler(struct max77843_muic_info *info,
396 return -EINVAL; 433 return -EINVAL;
397 } 434 }
398 435
399 ret = max77843_muic_set_path(info, path, attached); 436 ret = max77843_muic_set_path(info, path, attached, false);
400 if (ret < 0) 437 if (ret < 0)
401 return ret; 438 return ret;
402 439
@@ -405,6 +442,26 @@ static int max77843_muic_jig_handler(struct max77843_muic_info *info,
405 return 0; 442 return 0;
406} 443}
407 444
445static int max77843_muic_dock_handler(struct max77843_muic_info *info,
446 bool attached)
447{
448 int ret;
449
450 dev_dbg(info->dev, "external connector is %s (adc: 0x10)\n",
451 attached ? "attached" : "detached");
452
453 ret = max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_USB,
454 attached, attached);
455 if (ret < 0)
456 return ret;
457
458 extcon_set_state_sync(info->edev, EXTCON_DISP_MHL, attached);
459 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, attached);
460 extcon_set_state_sync(info->edev, EXTCON_DOCK, attached);
461
462 return 0;
463}
464
408static int max77843_muic_adc_handler(struct max77843_muic_info *info) 465static int max77843_muic_adc_handler(struct max77843_muic_info *info)
409{ 466{
410 int ret, cable_type; 467 int ret, cable_type;
@@ -419,6 +476,11 @@ static int max77843_muic_adc_handler(struct max77843_muic_info *info)
419 info->prev_cable_type); 476 info->prev_cable_type);
420 477
421 switch (cable_type) { 478 switch (cable_type) {
479 case MAX77843_MUIC_ADC_RESERVED_ACC_3: /* SmartDock */
480 ret = max77843_muic_dock_handler(info, attached);
481 if (ret < 0)
482 return ret;
483 break;
422 case MAX77843_MUIC_ADC_GROUND: 484 case MAX77843_MUIC_ADC_GROUND:
423 ret = max77843_muic_adc_gnd_handler(info); 485 ret = max77843_muic_adc_gnd_handler(info);
424 if (ret < 0) 486 if (ret < 0)
@@ -446,7 +508,6 @@ static int max77843_muic_adc_handler(struct max77843_muic_info *info)
446 case MAX77843_MUIC_ADC_REMOTE_S12_BUTTON: 508 case MAX77843_MUIC_ADC_REMOTE_S12_BUTTON:
447 case MAX77843_MUIC_ADC_RESERVED_ACC_1: 509 case MAX77843_MUIC_ADC_RESERVED_ACC_1:
448 case MAX77843_MUIC_ADC_RESERVED_ACC_2: 510 case MAX77843_MUIC_ADC_RESERVED_ACC_2:
449 case MAX77843_MUIC_ADC_RESERVED_ACC_3:
450 case MAX77843_MUIC_ADC_RESERVED_ACC_4: 511 case MAX77843_MUIC_ADC_RESERVED_ACC_4:
451 case MAX77843_MUIC_ADC_RESERVED_ACC_5: 512 case MAX77843_MUIC_ADC_RESERVED_ACC_5:
452 case MAX77843_MUIC_ADC_AUDIO_DEVICE_TYPE2: 513 case MAX77843_MUIC_ADC_AUDIO_DEVICE_TYPE2:
@@ -490,7 +551,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
490 case MAX77843_MUIC_CHG_USB: 551 case MAX77843_MUIC_CHG_USB:
491 ret = max77843_muic_set_path(info, 552 ret = max77843_muic_set_path(info,
492 MAX77843_MUIC_CONTROL1_SW_USB, 553 MAX77843_MUIC_CONTROL1_SW_USB,
493 attached); 554 attached, false);
494 if (ret < 0) 555 if (ret < 0)
495 return ret; 556 return ret;
496 557
@@ -501,7 +562,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
501 case MAX77843_MUIC_CHG_DOWNSTREAM: 562 case MAX77843_MUIC_CHG_DOWNSTREAM:
502 ret = max77843_muic_set_path(info, 563 ret = max77843_muic_set_path(info,
503 MAX77843_MUIC_CONTROL1_SW_OPEN, 564 MAX77843_MUIC_CONTROL1_SW_OPEN,
504 attached); 565 attached, false);
505 if (ret < 0) 566 if (ret < 0)
506 return ret; 567 return ret;
507 568
@@ -511,7 +572,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
511 case MAX77843_MUIC_CHG_DEDICATED: 572 case MAX77843_MUIC_CHG_DEDICATED:
512 ret = max77843_muic_set_path(info, 573 ret = max77843_muic_set_path(info,
513 MAX77843_MUIC_CONTROL1_SW_OPEN, 574 MAX77843_MUIC_CONTROL1_SW_OPEN,
514 attached); 575 attached, false);
515 if (ret < 0) 576 if (ret < 0)
516 return ret; 577 return ret;
517 578
@@ -521,7 +582,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
521 case MAX77843_MUIC_CHG_SPECIAL_500MA: 582 case MAX77843_MUIC_CHG_SPECIAL_500MA:
522 ret = max77843_muic_set_path(info, 583 ret = max77843_muic_set_path(info,
523 MAX77843_MUIC_CONTROL1_SW_OPEN, 584 MAX77843_MUIC_CONTROL1_SW_OPEN,
524 attached); 585 attached, false);
525 if (ret < 0) 586 if (ret < 0)
526 return ret; 587 return ret;
527 588
@@ -531,7 +592,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
531 case MAX77843_MUIC_CHG_SPECIAL_1A: 592 case MAX77843_MUIC_CHG_SPECIAL_1A:
532 ret = max77843_muic_set_path(info, 593 ret = max77843_muic_set_path(info,
533 MAX77843_MUIC_CONTROL1_SW_OPEN, 594 MAX77843_MUIC_CONTROL1_SW_OPEN,
534 attached); 595 attached, false);
535 if (ret < 0) 596 if (ret < 0)
536 return ret; 597 return ret;
537 598
@@ -550,6 +611,9 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
550 extcon_set_state_sync(info->edev, EXTCON_CHG_USB_DCP, 611 extcon_set_state_sync(info->edev, EXTCON_CHG_USB_DCP,
551 false); 612 false);
552 break; 613 break;
614 case MAX77843_MUIC_CHG_DOCK:
615 extcon_set_state_sync(info->edev, EXTCON_CHG_USB_DCP, attached);
616 break;
553 case MAX77843_MUIC_CHG_NONE: 617 case MAX77843_MUIC_CHG_NONE:
554 break; 618 break;
555 default: 619 default:
@@ -558,7 +622,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
558 attached ? "attached" : "detached", chg_type); 622 attached ? "attached" : "detached", chg_type);
559 623
560 max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_OPEN, 624 max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_OPEN,
561 attached); 625 attached, false);
562 return -EINVAL; 626 return -EINVAL;
563 } 627 }
564 628
@@ -798,7 +862,8 @@ static int max77843_muic_probe(struct platform_device *pdev)
798 max77843_muic_set_debounce_time(info, MAX77843_DEBOUNCE_TIME_25MS); 862 max77843_muic_set_debounce_time(info, MAX77843_DEBOUNCE_TIME_25MS);
799 863
800 /* Set initial path for UART */ 864 /* Set initial path for UART */
801 max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_UART, true); 865 max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_UART, true,
866 false);
802 867
803 /* Check revision number of MUIC device */ 868 /* Check revision number of MUIC device */
804 ret = regmap_read(max77843->regmap_muic, MAX77843_MUIC_REG_ID, &id); 869 ret = regmap_read(max77843->regmap_muic, MAX77843_MUIC_REG_ID, &id);
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 4a0612fb9c07..8152790d72e1 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -25,7 +25,7 @@
25#include <linux/kobject.h> 25#include <linux/kobject.h>
26#include <linux/mfd/max8997.h> 26#include <linux/mfd/max8997.h>
27#include <linux/mfd/max8997-private.h> 27#include <linux/mfd/max8997-private.h>
28#include <linux/extcon.h> 28#include <linux/extcon-provider.h>
29#include <linux/irqdomain.h> 29#include <linux/irqdomain.h>
30 30
31#define DEV_NAME "max8997-muic" 31#define DEV_NAME "max8997-muic"
diff --git a/drivers/extcon/extcon-qcom-spmi-misc.c b/drivers/extcon/extcon-qcom-spmi-misc.c
index b8cde096a808..660bbf163bf5 100644
--- a/drivers/extcon/extcon-qcom-spmi-misc.c
+++ b/drivers/extcon/extcon-qcom-spmi-misc.c
@@ -15,7 +15,7 @@
15 * GNU General Public License for more details. 15 * GNU General Public License for more details.
16 */ 16 */
17 17
18#include <linux/extcon.h> 18#include <linux/extcon-provider.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
diff --git a/drivers/extcon/extcon-rt8973a.c b/drivers/extcon/extcon-rt8973a.c
index eaa355e7d9e4..e059bd5f2041 100644
--- a/drivers/extcon/extcon-rt8973a.c
+++ b/drivers/extcon/extcon-rt8973a.c
@@ -20,7 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/regmap.h> 21#include <linux/regmap.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/extcon.h> 23#include <linux/extcon-provider.h>
24 24
25#include "extcon-rt8973a.h" 25#include "extcon-rt8973a.h"
26 26
diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
index 106ef0297b53..0cfb5a3efdf6 100644
--- a/drivers/extcon/extcon-sm5502.c
+++ b/drivers/extcon/extcon-sm5502.c
@@ -19,7 +19,7 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/regmap.h> 20#include <linux/regmap.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/extcon.h> 22#include <linux/extcon-provider.h>
23 23
24#include "extcon-sm5502.h" 24#include "extcon-sm5502.h"
25 25
diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index 9c925b05b7aa..53762864a9f7 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -14,7 +14,7 @@
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 */ 15 */
16 16
17#include <linux/extcon.h> 17#include <linux/extcon-provider.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/gpio/consumer.h> 19#include <linux/gpio/consumer.h>
20#include <linux/init.h> 20#include <linux/init.h>
diff --git a/drivers/extcon/extcon-usbc-cros-ec.c b/drivers/extcon/extcon-usbc-cros-ec.c
index 598956f1dcae..6187f731b29d 100644
--- a/drivers/extcon/extcon-usbc-cros-ec.c
+++ b/drivers/extcon/extcon-usbc-cros-ec.c
@@ -14,7 +14,7 @@
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 */ 15 */
16 16
17#include <linux/extcon.h> 17#include <linux/extcon-provider.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/mfd/cros_ec.h> 19#include <linux/mfd/cros_ec.h>
20#include <linux/module.h> 20#include <linux/module.h>
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 35e9fb885486..cb38c2747684 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -36,7 +36,7 @@
36 36
37#define SUPPORTED_CABLE_MAX 32 37#define SUPPORTED_CABLE_MAX 32
38 38
39struct __extcon_info { 39static const struct __extcon_info {
40 unsigned int type; 40 unsigned int type;
41 unsigned int id; 41 unsigned int id;
42 const char *name; 42 const char *name;
diff --git a/drivers/extcon/extcon.h b/drivers/extcon/extcon.h
index 61358479bfcc..93b5e0306966 100644
--- a/drivers/extcon/extcon.h
+++ b/drivers/extcon/extcon.h
@@ -2,7 +2,7 @@
2#ifndef __LINUX_EXTCON_INTERNAL_H__ 2#ifndef __LINUX_EXTCON_INTERNAL_H__
3#define __LINUX_EXTCON_INTERNAL_H__ 3#define __LINUX_EXTCON_INTERNAL_H__
4 4
5#include <linux/extcon.h> 5#include <linux/extcon-provider.h>
6 6
7/** 7/**
8 * struct extcon_dev - An extcon device represents one external connector. 8 * struct extcon_dev - An extcon device represents one external connector.