/Linux-v5.10/drivers/usb/roles/ |
D | class.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * USB Role Switch Support 10 #include <linux/usb/role.h> 22 enum usb_role role; member 36 * usb_role_switch_set_role - Set USB role for a switch 37 * @sw: USB role switch 38 * @role: USB role to be switched to 40 * Set USB role @role for @sw. 42 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument 49 mutex_lock(&sw->lock); in usb_role_switch_set_role() [all …]
|
D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0 4 tristate "USB Role Switch Support" 6 USB Role Switch is a device that can select the USB role - host or 7 device - for a USB port (connector). In most cases dual-role capable 8 USB controller will also represent the switch, but on some platforms 9 multiplexer/demultiplexer switch is used to route the data lines on 10 the USB connector between separate USB host and device controllers. 12 Say Y here if your USB connectors support both device and host roles. 19 tristate "Intel XHCI USB Role Switch" 22 Driver for the internal USB role switch for switching the USB data [all …]
|
D | intel-xhci-usb-role-switch.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Intel XHCI (Cherry Trail, Broxton and others) USB OTG role switch driver 5 * Copyright (c) 2016-2017 Hans de Goede <hdegoede@redhat.com> 23 #include <linux/usb/role.h> 52 "intel-xhci-usb-sw", 56 enum usb_role role) in intel_xhci_usb_set_role() argument 71 dev_err(data->dev, "Error could not acquire lock\n"); in intel_xhci_usb_set_role() 72 return -EIO; in intel_xhci_usb_set_role() 75 pm_runtime_get_sync(data->dev); in intel_xhci_usb_set_role() 80 * SW_SWITCH_EN bits to be zero for role switch, in intel_xhci_usb_set_role() [all …]
|
/Linux-v5.10/Documentation/devicetree/bindings/usb/ |
D | mediatek,mtu3.txt | 4 - compatible : should be "mediatek,<soc-model>-mtu3", "mediatek,mtu3", 5 soc-model is the name of SoC, such as mt8173, mt2712 etc, 8 - "mediatek,mt8173-mtu3" 9 - reg : specifies physical base address and size of the registers 10 - reg-names: should be "mac" for device IP and "ippc" for IP port control 11 - interrupts : interrupt used by the device IP 12 - power-domains : a phandle to USB power domain node to control USB's 14 - vusb33-supply : regulator of USB avdd3.3v 15 - clocks : a list of phandle + clock-specifier pairs, one for each 16 entry in clock-names [all …]
|
D | mediatek,musb.txt | 2 ------------------------------------------- 5 - compatible : should be one of: 6 "mediatek,mt2701-musb" 8 followed by "mediatek,mtk-musb" 9 - reg : specifies physical base address and size of 11 - interrupts : interrupt used by musb controller 12 - interrupt-names : must be "mc" 13 - phys : PHY specifier for the OTG phy 14 - dr_mode : should be one of "host", "peripheral" or "otg", 15 refer to usb/generic.txt [all …]
|
D | generic.txt | 1 Generic USB Properties 4 - maximum-speed: tells USB controllers we want to work up to a certain 5 speed. Valid arguments are "super-speed-plus", 6 "super-speed", "high-speed", "full-speed" and 7 "low-speed". In case this isn't passed via DT, USB 10 - dr_mode: tells Dual-Role USB controllers that we want to work on a 13 passed via DT, USB DRD controllers should default to 15 - phy_type: tells USB controllers that we want to configure the core to support 16 a UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is 18 In case this isn't passed via DT, USB controllers should [all …]
|
D | renesas,usb3-peri.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 4 $id: http://devicetree.org/schemas/usb/renesas,usb3-peri.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Renesas USB 3.0 Peripheral controller 10 - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> 15 - enum: 16 - renesas,r8a774a1-usb3-peri # RZ/G2M 17 - renesas,r8a774b1-usb3-peri # RZ/G2N 18 - renesas,r8a774c0-usb3-peri # RZ/G2E [all …]
|
D | mediatek,mt6360-tcpc.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: "http://devicetree.org/schemas/usb/mediatek,mt6360-tcpc.yaml#" 5 $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 title: Mediatek MT6360 Type-C Port Switch and Power Delivery controller DT bindings 10 - ChiYuan Huang <cy_huang@richtek.com> 13 Mediatek MT6360 is a multi-functional device. It integrates charger, ADC, flash, RGB indicators, 14 regulators (BUCKs/LDOs), and TypeC Port Switch with Power Delivery controller. 15 This document only describes MT6360 Type-C Port Switch and Power Delivery controller. 20 - mediatek,mt6360-tcpc [all …]
|
/Linux-v5.10/Documentation/ABI/testing/ |
D | sysfs-class-usb_role | 5 Place in sysfs for USB Role Switches. USB Role Switch is a 6 device that can select the data role (host or device) for USB 9 What: /sys/class/usb_role/<switch>/role 13 The current role of the switch. This attribute can be used for 14 requesting role swapping with non-USB Type-C ports. With USB 15 Type-C ports, the ABI defined for USB Type-C connector class 19 - none 20 - host 21 - device
|
/Linux-v5.10/include/linux/usb/ |
D | role.h | 1 // SPDX-License-Identifier: GPL-2.0 17 enum usb_role role); 21 * struct usb_role_switch_desc - USB Role Switch Descriptor 22 * @fwnode: The device node to be associated with the role switch 26 * @set: Callback for setting the role 27 * @get: Callback for getting the role (optional) 28 * @allow_userspace_control: If true userspace may change the role through sysfs 30 * @name: Name for the switch (optional) 32 * @usb2_port and @usb3_port will point to the USB host port and @udc to the USB 33 * device controller behind the USB connector with the role switch. If [all …]
|
/Linux-v5.10/Documentation/usb/ |
D | chipidea.rst | 2 ChipIdea Highspeed Dual Role Controller Driver 6 ----------------------------------- 12 ------------------------- 29 otg-rev = <0x0200>; 30 adp-disable; 33 ------------------- 38 2) Connect 2 boards with usb cable with one end is micro A plug, the other end 41 The A-device(with micro A plug inserted) should enumerate B-device. 43 3) Role switch 45 On B-device:: [all …]
|
/Linux-v5.10/drivers/extcon/ |
D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 11 host USB ports. Many of 30-pin connectors including PDMI are 33 tristate "X-Power AXP288 EXTCON support" 37 Say Y here to enable support for USB peripheral detection 38 and USB MUX switching by X-Power AXP288 PMIC. 47 FSA9480 microUSB switch and accessory detector chip. The FSA9480 is a USB 48 port accessory detector and switch. The FSA9480 is fully controlled using 49 I2C and enables USB data, stereo and mono audio, video, microphone 63 Say Y here to enable extcon support for USB OTG ports controlled by 90 Maxim MAX14577/77836. The MAX14577/77836 MUIC is a USB port accessory [all …]
|
D | extcon-axp288.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * extcon-axp288.c - X-Power AXP288 PMIC extcon cable detection driver 5 * Copyright (c) 2017-2018 Hans de Goede <hdegoede@redhat.com> 19 #include <linux/extcon-provider.h> 22 #include <linux/usb/role.h> 26 #include <asm/intel-family.h> 52 /* BC USB status register */ 136 ret = regmap_read(info->regmap, AXP288_PS_BOOT_REASON_REG, &val); in axp288_extcon_log_rsi() 138 dev_err(info->dev, "failed to read reset source indicator\n"); in axp288_extcon_log_rsi() 142 bits = val & GENMASK(ARRAY_SIZE(axp288_pwr_up_down_info) - 1, 0); in axp288_extcon_log_rsi() [all …]
|
D | extcon-usbc-cros-ec.c | 1 // SPDX-License-Identifier: GPL-2.0 7 #include <linux/extcon-provider.h> 28 unsigned int dr; /* data role */ 29 bool pr; /* power role (true if VBUS enabled) */ 49 * cros_ec_pd_command() - Send a command to the EC. 73 return -ENOMEM; in cros_ec_pd_command() 75 msg->version = version; in cros_ec_pd_command() 76 msg->command = command; in cros_ec_pd_command() 77 msg->outsize = outsize; in cros_ec_pd_command() 78 msg->insize = insize; in cros_ec_pd_command() [all …]
|
/Linux-v5.10/drivers/usb/common/ |
D | usb-conn-gpio.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * USB GPIO Based Connection Detection Driver 9 * Some code borrowed from drivers/extcon/extcon-usb-gpio.c 22 #include <linux/usb/role.h> 53 * Role | ID | VBUS 54 * ------------------------------------ 61 * - VBUS only - we want to distinguish between [1] and [2], so ID is always 1 62 * - ID only - we want to distinguish between [1] and [4], so VBUS = ID 67 enum usb_role role; in usb_conn_detect_cable() local 74 id = info->id_gpiod ? in usb_conn_detect_cable() [all …]
|
/Linux-v5.10/Documentation/driver-api/usb/ |
D | typec.rst | 3 USB Type-C connector class 7 ------------ 9 The typec class is meant for describing the USB Type-C ports in a system to the 14 The platforms are expected to register every USB Type-C port they have with the 15 class. In a normal case the registration will be done by a USB Type-C or PD PHY 17 USB PD controller or even driver for Thunderbolt3 controller. This document 18 considers the component registering the USB Type-C ports with the class as "port 26 attributes are described in Documentation/ABI/testing/sysfs-class-typec. 29 -------------------- 36 "port0-partner". Full path to the device would be [all …]
|
/Linux-v5.10/drivers/usb/cdns3/ |
D | core.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 5 * Copyright (C) 2017-2018 NXP 6 * Copyright (C) 2018-2019 Cadence. 11 #include <linux/usb/otg.h> 12 #include <linux/usb/role.h> 20 * struct cdns3_role_driver - host/gadget role driver 21 * @start: start this role 22 * @stop: stop this role 23 * @suspend: suspend callback for this role 24 * @resume: resume callback for this role [all …]
|
D | core.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2018-2019 Cadence. 6 * Copyright (C) 2017-2018 NXP 14 #include <linux/dma-mapping.h> 24 #include "host-export.h" 25 #include "gadget-export.h" 30 static int cdns3_role_start(struct cdns3 *cdns, enum usb_role role) in cdns3_role_start() argument 34 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns3_role_start() 37 mutex_lock(&cdns->mutex); in cdns3_role_start() 38 cdns->role = role; in cdns3_role_start() [all …]
|
/Linux-v5.10/drivers/usb/chipidea/ |
D | otg.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * otg.c - ChipIdea USB IP core OTG driver 15 #include <linux/usb/otg.h> 16 #include <linux/usb/gadget.h> 17 #include <linux/usb/chipidea.h> 38 cable = &ci->platdata->vbus_extcon; in hw_read_otgsc() 39 if (!IS_ERR(cable->edev) || ci->role_switch) { in hw_read_otgsc() 40 if (cable->changed) in hw_read_otgsc() 45 if (cable->connected) in hw_read_otgsc() 50 if (cable->enabled) in hw_read_otgsc() [all …]
|
/Linux-v5.10/drivers/misc/ |
D | hisi_hikey_usb.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Support for usb functionality of Hikey series boards 6 * Copyright (C) 2017-2018 Hilisicon Electronics Co., Ltd. 22 #include <linux/usb/role.h> 45 enum usb_role role; member 57 if (hisi_hikey_usb->hub_vbus) in hub_power_ctrl() 58 gpiod_set_value_cansleep(hisi_hikey_usb->hub_vbus, value); in hub_power_ctrl() 60 if (!hisi_hikey_usb->regulator) in hub_power_ctrl() 63 status = regulator_is_enabled(hisi_hikey_usb->regulator); in hub_power_ctrl() 68 ret = regulator_enable(hisi_hikey_usb->regulator); in hub_power_ctrl() [all …]
|
/Linux-v5.10/drivers/usb/typec/ |
D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0 4 tristate "USB Type-C Support" 6 USB Type-C Specification defines a cable and connector for USB where 8 be Type-A plug on one end of the cable and Type-B plug on the other. 9 Determination of the host-to-device relationship happens through a 10 specific Configuration Channel (CC) which goes through the USB Type-C 12 Accessory Modes - Analog Audio and Debug - and if USB Power Delivery 14 something else then USB communication. 16 USB Power Delivery Specification defines a protocol that can be used 18 partners. USB Power Delivery allows higher voltages then the normal [all …]
|
D | qcom-pmic-typec.c | 1 // SPDX-License-Identifier: GPL-2.0 15 #include <linux/usb/role.h> 16 #include <linux/usb/typec_mux.h> 51 if (enable == qcom_usb->vbus_enabled) in qcom_pmic_typec_enable_vbus_regulator() 55 ret = regulator_enable(qcom_usb->vbus_reg); in qcom_pmic_typec_enable_vbus_regulator() 59 ret = regulator_disable(qcom_usb->vbus_reg); in qcom_pmic_typec_enable_vbus_regulator() 63 qcom_usb->vbus_enabled = enable; in qcom_pmic_typec_enable_vbus_regulator() 69 enum usb_role role; in qcom_pmic_typec_check_connection() local 73 regmap_read(qcom_usb->regmap, qcom_usb->base + TYPEC_MISC_STATUS, in qcom_pmic_typec_check_connection() 80 typec_set_orientation(qcom_usb->port, orientation); in qcom_pmic_typec_check_connection() [all …]
|
/Linux-v5.10/drivers/usb/typec/mux/ |
D | intel_pmc_mux.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Driver for Intel PMC USB mux control 13 #include <linux/usb/pd.h> 14 #include <linux/usb/role.h> 15 #include <linux/usb/typec_mux.h> 16 #include <linux/usb/typec_dp.h> 17 #include <linux/usb/typec_tbt.h> 131 enum usb_role role; member 153 /* SoC expects the USB Type-C port numbers to start with 0 */ in update_port_status() 154 port_num = port->usb3_port - 1; in update_port_status() [all …]
|
/Linux-v5.10/drivers/usb/mtu3/ |
D | mtu3_dr.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * mtu3_dr.c - dual role switch and host glue layer 10 #include <linux/usb/role.h> 28 switch (state) { in mailbox_state_string() 44 if (!ssusb->otg_switch.is_u3_drd) { in toggle_opstate() 45 mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION); in toggle_opstate() 46 mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN); in toggle_opstate() 50 /* only port0 supports dual-role mode */ 54 void __iomem *ibase = ssusb->ippc_base; in ssusb_port0_switch() 57 dev_dbg(ssusb->dev, "%s (switch u%d port0 to %s)\n", __func__, in ssusb_port0_switch() [all …]
|
/Linux-v5.10/drivers/usb/dwc2/ |
D | drd.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * drd.c - DesignWare USB2 DRD Controller Dual-role support 12 #include <linux/usb/role.h> 20 spin_lock_irqsave(&hsotg->lock, flags); in dwc2_ovr_init() 30 spin_unlock_irqrestore(&hsotg->lock, flags); in dwc2_ovr_init() 37 /* Check if A-Session is already in the right state */ in dwc2_ovr_avalid() 40 return -EALREADY; in dwc2_ovr_avalid() 55 /* Check if B-Session is already in the right state */ in dwc2_ovr_bvalid() 58 return -EALREADY; in dwc2_ovr_bvalid() 69 static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role) in dwc2_drd_role_sw_set() argument [all …]
|