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

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
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -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 cht_wc_extcon_data *ext;
	unsigned long mask = ~(CHT_WC_PWRSRC_VBUS | CHT_WC_PWRSRC_USBID_MASK);
	int pwrsrc_sts, id;
	int irq, ret;

	irq = platform_get_irq(pdev, 0);
@@ -387,7 +388,18 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
		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);
	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 */
+5 −1
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ struct sm5502_muic_info {
/* Default value of SM5502 register to bring up MUIC device. */
static struct reg_data sm5502_reg_data[] = {
	{
		.reg = SM5502_REG_RESET,
		.val = SM5502_REG_RESET_MASK,
		.invert = true,
	}, {
		.reg = SM5502_REG_CONTROL,
		.val = SM5502_REG_CONTROL_MASK_INT_MASK,
		.invert = false,
@@ -272,7 +276,7 @@ static int sm5502_muic_set_path(struct sm5502_muic_info *info,
/* Return cable type of attached or detached accessories */
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;

	/* Read ADC value according to external cable or button */
+2 −0
Original line number Diff line number Diff line
@@ -237,6 +237,8 @@ enum sm5502_reg {
#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))

#define SM5502_REG_RESET_MASK			(0x1)

/* SM5502 Interrupts */
enum sm5502_irq {
	/* INT1 */