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

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

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

Chanwoo writes:

Update extcon next for v5.16

Detailed description for this pull request:
1. Add support for TUSB320L and update tusb320 extcon driver
- The existing extcon-usbc-tusb320 driver is updated
for supporting the mode setting and reset operation.
Also, this driver supports the simliar TUSB320L device
at the same extcon-usbc-tusb320 extcon provider driver.

2. Use p-unit semaphone lock for register access for extcon-axp288
driver

3. Update the minor clean-up for extcon-max3355 and extcon-usb-gpio
driver.

* tag 'extcon-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
  dt-bindings: extcon: usbc-tusb320: Add TUSB320L compatible string
  extcon: usbc-tusb320: Add support for TUSB320L
  extcon: usbc-tusb320: Add support for mode setting and reset
  extcon: extcon-axp288: Use P-Unit semaphore lock for register accesses
  extcon: max3355: Drop unused include
  extcon: usb-gpio: Use the right includes
parents 08e438e6 9e6ef3a2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -11,7 +11,9 @@ maintainers:

properties:
  compatible:
    const: ti,tusb320
    enum:
      - ti,tusb320
      - ti,tusb320l

  reg:
    maxItems: 1
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ config EXTCON_ADC_JACK

config EXTCON_AXP288
	tristate "X-Power AXP288 EXTCON support"
	depends on MFD_AXP20X && USB_SUPPORT && X86 && ACPI
	depends on MFD_AXP20X && USB_SUPPORT && X86 && ACPI && IOSF_MBI
	select USB_ROLE_SWITCH
	help
	  Say Y here to enable support for USB peripheral detection
+29 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/iosf_mbi.h>

/* Power source status register */
#define PS_STAT_VBUS_TRIGGER		BIT(0)
@@ -215,6 +216,10 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
	unsigned int cable = info->previous_cable;
	bool vbus_attach = false;

	ret = iosf_mbi_block_punit_i2c_access();
	if (ret < 0)
		return ret;

	vbus_attach = axp288_get_vbus_attach(info);
	if (!vbus_attach)
		goto no_vbus;
@@ -253,6 +258,8 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
	}

no_vbus:
	iosf_mbi_unblock_punit_i2c_access();

	extcon_set_state_sync(info->edev, info->previous_cable, false);
	if (info->previous_cable == EXTCON_CHG_USB_SDP)
		extcon_set_state_sync(info->edev, EXTCON_USB, false);
@@ -275,6 +282,8 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
	return 0;

dev_det_ret:
	iosf_mbi_unblock_punit_i2c_access();

	if (ret < 0)
		dev_err(info->dev, "failed to detect BC Mod\n");

@@ -305,13 +314,23 @@ static irqreturn_t axp288_extcon_isr(int irq, void *data)
	return IRQ_HANDLED;
}

static void axp288_extcon_enable(struct axp288_extcon_info *info)
static int axp288_extcon_enable(struct axp288_extcon_info *info)
{
	int ret = 0;

	ret = iosf_mbi_block_punit_i2c_access();
	if (ret < 0)
		return ret;

	regmap_update_bits(info->regmap, AXP288_BC_GLOBAL_REG,
						BC_GLOBAL_RUN, 0);
	/* Enable the charger detection logic */
	regmap_update_bits(info->regmap, AXP288_BC_GLOBAL_REG,
					BC_GLOBAL_RUN, BC_GLOBAL_RUN);

	iosf_mbi_unblock_punit_i2c_access();

	return ret;
}

static void axp288_put_role_sw(void *data)
@@ -384,10 +403,16 @@ static int axp288_extcon_probe(struct platform_device *pdev)
		}
	}

	ret = iosf_mbi_block_punit_i2c_access();
	if (ret < 0)
		return ret;

	info->vbus_attach = axp288_get_vbus_attach(info);

	axp288_extcon_log_rsi(info);

	iosf_mbi_unblock_punit_i2c_access();

	/* Initialize extcon device */
	info->edev = devm_extcon_dev_allocate(&pdev->dev,
					      axp288_extcon_cables);
@@ -441,7 +466,9 @@ static int axp288_extcon_probe(struct platform_device *pdev)
	}

	/* Start charger cable type detection */
	axp288_extcon_enable(info);
	ret = axp288_extcon_enable(info);
	if (ret < 0)
		return ret;

	device_init_wakeup(dev, true);
	platform_set_drvdata(pdev, info);
+0 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
 */

#include <linux/extcon-provider.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+1 −2
Original line number Diff line number Diff line
@@ -7,18 +7,17 @@
 */

#include <linux/extcon-provider.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/pinctrl/consumer.h>
#include <linux/mod_devicetable.h>

#define USB_GPIO_DEBOUNCE_MS	20	/* ms */

Loading