Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6fb9ec0 authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman
Browse files

usb: roles: Add Intel xHCI USB role switch driver



Various Intel SoCs (Cherry Trail, Broxton and others) have an internal USB
role switch for swiching the OTG USB data lines between the xHCI host
controller and the dwc3 gadget controller.

Note on some Cherry Trail systems there is ACPI/AML code listening to
edge interrupts on the id-pin (through an _AIE ACPI method) and switching
the role between ROLE_HOST and ROLE_NONE based on the id-pin. Note it does
not set the role to ROLE_DEVICE, because device-mode is usually not used
under Windows.

The presence of AML code which modifies the cfg0 reg (on some systems)
means that our read/write/modify of cfg0 may race with the AML code
doing the same to avoid this we take the global ACPI lock while doing
the read/write/modify.

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fa31b3cb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -14408,6 +14408,12 @@ S: Maintained
F:	Documentation/hid/hiddev.txt
F:	drivers/hid/usbhid/

USB INTEL XHCI ROLE MUX DRIVER
M:	Hans de Goede <hdegoede@redhat.com>
L:	linux-usb@vger.kernel.org
S:	Maintained
F:	drivers/usb/roles/intel-xhci-usb-role-switch.c

USB ISP116X DRIVER
M:	Olav Kongas <ok@artecdesign.ee>
L:	linux-usb@vger.kernel.org
+2 −0
Original line number Diff line number Diff line
@@ -171,6 +171,8 @@ source "drivers/usb/gadget/Kconfig"

source "drivers/usb/typec/Kconfig"

source "drivers/usb/roles/Kconfig"

config USB_LED_TRIG
	bool "USB LED Triggers"
	depends on LEDS_CLASS && LEDS_TRIGGERS
+2 −0
Original line number Diff line number Diff line
@@ -65,3 +65,5 @@ obj-$(CONFIG_USB_COMMON) += common/
obj-$(CONFIG_USBIP_CORE)	+= usbip/

obj-$(CONFIG_TYPEC)		+= typec/

obj-$(CONFIG_USB_ROLE_SWITCH)	+= roles/
+14 −0
Original line number Diff line number Diff line
if USB_ROLE_SWITCH

config USB_ROLES_INTEL_XHCI
	tristate "Intel XHCI USB Role Switch"
	depends on ACPI && X86
	help
	  Driver for the internal USB role switch for switching the USB data
	  lines between the xHCI host controller and the dwc3 gadget controller
	  found on various Intel SoCs.

	  To compile the driver as a module, choose M here: the module will
	  be called intel-xhci-usb-role-switch.

endif # USB_ROLE_SWITCH
+1 −0
Original line number Diff line number Diff line
obj-$(CONFIG_USB_ROLES_INTEL_XHCI) += intel-xhci-usb-role-switch.o
Loading