Commit 26a41753 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'extcon-next-for-5.5' of...

Merge tag 'extcon-next-for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Update extcon for 5.5

Detailed description for this pull request:
1. Clean up the and fix the minor issue of extcon provider driver
- extcon-intel-cht-wc don't reset the USB data connection at probe time
  in order to prevent the removing all devices from bus.
- extcon-sm5502 reset the registers at proble time in order to
  prevent the some stuck state. And remove the redundant variable initializaiton.

* tag 'extcon-next-for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
  extcon: sm5502: remove redundant assignment to variable cable_type
  extcon: sm5502: Reset registers during initialization
  extcon-intel-cht-wc: Don't reset USB data connection at probe
parents 9c7db494 ddd1bbba
...@@ -338,6 +338,7 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) ...@@ -338,6 +338,7 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
struct cht_wc_extcon_data *ext; struct cht_wc_extcon_data *ext;
unsigned long mask = ~(CHT_WC_PWRSRC_VBUS | CHT_WC_PWRSRC_USBID_MASK); unsigned long mask = ~(CHT_WC_PWRSRC_VBUS | CHT_WC_PWRSRC_USBID_MASK);
int pwrsrc_sts, id;
int irq, ret; int irq, ret;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
...@@ -387,8 +388,19 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) ...@@ -387,8 +388,19 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
goto disable_sw_control; goto disable_sw_control;
} }
/* Route D+ and D- to PMIC for initial charger detection */ ret = regmap_read(ext->regmap, CHT_WC_PWRSRC_STS, &pwrsrc_sts);
cht_wc_extcon_set_phymux(ext, MUX_SEL_PMIC); if (ret) {
dev_err(ext->dev, "Error reading pwrsrc status: %d\n", ret);
goto disable_sw_control;
}
/*
* If no USB host or device connected, route D+ and D- to PMIC for
* initial charger detection
*/
id = cht_wc_extcon_get_id(ext, pwrsrc_sts);
if (id != INTEL_USB_ID_GND)
cht_wc_extcon_set_phymux(ext, MUX_SEL_PMIC);
/* Get initial state */ /* Get initial state */
cht_wc_extcon_pwrsrc_event(ext); cht_wc_extcon_pwrsrc_event(ext);
......
...@@ -65,6 +65,10 @@ struct sm5502_muic_info { ...@@ -65,6 +65,10 @@ struct sm5502_muic_info {
/* Default value of SM5502 register to bring up MUIC device. */ /* Default value of SM5502 register to bring up MUIC device. */
static struct reg_data sm5502_reg_data[] = { static struct reg_data sm5502_reg_data[] = {
{ {
.reg = SM5502_REG_RESET,
.val = SM5502_REG_RESET_MASK,
.invert = true,
}, {
.reg = SM5502_REG_CONTROL, .reg = SM5502_REG_CONTROL,
.val = SM5502_REG_CONTROL_MASK_INT_MASK, .val = SM5502_REG_CONTROL_MASK_INT_MASK,
.invert = false, .invert = false,
...@@ -272,7 +276,7 @@ static int sm5502_muic_set_path(struct sm5502_muic_info *info, ...@@ -272,7 +276,7 @@ static int sm5502_muic_set_path(struct sm5502_muic_info *info,
/* Return cable type of attached or detached accessories */ /* Return cable type of attached or detached accessories */
static unsigned int sm5502_muic_get_cable_type(struct sm5502_muic_info *info) static unsigned int sm5502_muic_get_cable_type(struct sm5502_muic_info *info)
{ {
unsigned int cable_type = -1, adc, dev_type1; unsigned int cable_type, adc, dev_type1;
int ret; int ret;
/* Read ADC value according to external cable or button */ /* Read ADC value according to external cable or button */
......
...@@ -237,6 +237,8 @@ enum sm5502_reg { ...@@ -237,6 +237,8 @@ enum sm5502_reg {
#define DM_DP_SWITCH_UART ((DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ #define DM_DP_SWITCH_UART ((DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \
| (DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | (DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DM_SHIFT))
#define SM5502_REG_RESET_MASK (0x1)
/* SM5502 Interrupts */ /* SM5502 Interrupts */
enum sm5502_irq { enum sm5502_irq {
/* INT1 */ /* INT1 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment