/Linux-v5.10/drivers/usb/roles/ |
D | class.c | 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 51 ret = sw->set(sw, role); in usb_role_switch_set_role() 53 sw->role = role; in usb_role_switch_set_role() [all …]
|
D | Kconfig | 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 19 tristate "Intel XHCI USB Role Switch" 22 Driver for the internal USB role switch for switching the USB data 27 be called intel-xhci-usb-role-switch.
|
D | intel-xhci-usb-role-switch.c | 3 * Intel XHCI (Cherry Trail, Broxton and others) USB OTG role switch driver 23 #include <linux/usb/role.h> 56 enum usb_role role) in intel_xhci_usb_set_role() argument 80 * SW_SWITCH_EN bits to be zero for role switch, in intel_xhci_usb_set_role() 84 switch (role) { in intel_xhci_usb_set_role() 116 if (!!(val & HOST_MODE) == (role == USB_ROLE_HOST)) { in intel_xhci_usb_set_role() 127 dev_warn(data->dev, "Timeout waiting for role-switch\n"); in intel_xhci_usb_set_role() 134 enum usb_role role; in intel_xhci_usb_get_role() local 142 role = USB_ROLE_HOST; in intel_xhci_usb_get_role() 144 role = USB_ROLE_DEVICE; in intel_xhci_usb_get_role() [all …]
|
/Linux-v5.10/drivers/usb/cdns3/ |
D | core.c | 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() 38 cdns->role = role; in cdns3_role_start() 41 if (!cdns->roles[role]) in cdns3_role_start() 44 if (cdns->roles[role]->state == CDNS3_ROLE_STATE_ACTIVE) in cdns3_role_start() 48 ret = cdns->roles[role]->start(cdns); in cdns3_role_start() 50 cdns->roles[role]->state = CDNS3_ROLE_STATE_ACTIVE; in cdns3_role_start() 58 enum usb_role role = cdns->role; in cdns3_role_stop() local 60 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns3_role_stop() 63 if (cdns->roles[role]->state == CDNS3_ROLE_STATE_INACTIVE) in cdns3_role_stop() [all …]
|
D | core.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 25 * @irq: irq handler for this role 26 * @name: role name string (host/gadget) 61 * @role: current role 71 * @role_sw: pointer to role switch object. [all …]
|
/Linux-v5.10/drivers/usb/typec/ |
D | qcom-pmic-typec.c | 15 #include <linux/usb/role.h> 69 enum usb_role role; in qcom_pmic_typec_check_connection() local 82 role = (stat & SNK_SRC_MODE) ? USB_ROLE_HOST : USB_ROLE_DEVICE; in qcom_pmic_typec_check_connection() 83 if (role == USB_ROLE_HOST) in qcom_pmic_typec_check_connection() 88 role = USB_ROLE_NONE; in qcom_pmic_typec_check_connection() 93 usb_role_switch_set_role(qcom_usb->role_sw, role); in qcom_pmic_typec_check_connection() 136 int ret, irq, role; in qcom_pmic_typec_probe() local 166 ret = fwnode_property_read_string(fwnode, "power-role", &buf); in qcom_pmic_typec_probe() 168 role = typec_find_port_power_role(buf); in qcom_pmic_typec_probe() 169 if (role < 0) in qcom_pmic_typec_probe() [all …]
|
/Linux-v5.10/drivers/usb/chipidea/ |
D | ci.h | 19 #include <linux/usb/role.h> 126 * struct ci_role_driver - host/gadget role driver 127 * @start: start this role 128 * @stop: stop this role 129 * @irq: irq handler for this role 130 * @name: role name string (host/gadget) 166 * @role: current role 173 * @work: work for role changing 214 enum ci_role role; member 264 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]); in ci_role() [all …]
|
D | otg.c | 119 * ci_otg_role - pick role based on ID pin state 124 enum ci_role role = hw_read_otgsc(ci, OTGSC_ID) in ci_otg_role() local 128 return role; in ci_otg_role() 169 enum ci_role role = ci_otg_role(ci); in ci_handle_id_switch() local 171 if (role != ci->role) { in ci_handle_id_switch() 173 ci_role(ci)->name, ci->roles[role]->name); in ci_handle_id_switch() 175 if (ci->vbus_active && ci->role == CI_ROLE_GADGET) in ci_handle_id_switch() 177 * vbus disconnect event is lost due to role in ci_handle_id_switch() 184 if (role == CI_ROLE_GADGET && in ci_handle_id_switch() 195 ci_role_start(ci, role); in ci_handle_id_switch() [all …]
|
/Linux-v5.10/drivers/usb/dwc2/ |
D | drd.c | 3 * drd.c - DesignWare USB2 DRD Controller Dual-role support 12 #include <linux/usb/role.h> 69 static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role) in dwc2_drd_role_sw_set() argument 76 if ((role == USB_ROLE_DEVICE && hsotg->dr_mode == USB_DR_MODE_HOST) || in dwc2_drd_role_sw_set() 77 (role == USB_ROLE_HOST && hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)) in dwc2_drd_role_sw_set() 83 if (role == USB_ROLE_NONE && hsotg->test_mode) { in dwc2_drd_role_sw_set() 91 if (role == USB_ROLE_HOST) { in dwc2_drd_role_sw_set() 93 } else if (role == USB_ROLE_DEVICE) { in dwc2_drd_role_sw_set() 111 dwc2_force_mode(hsotg, role == USB_ROLE_HOST); in dwc2_drd_role_sw_set() 114 role == USB_ROLE_NONE ? "No" : in dwc2_drd_role_sw_set() [all …]
|
/Linux-v5.10/drivers/extcon/ |
D | extcon-usbc-cros-ec.c | 28 unsigned int dr; /* data role */ 29 bool pr; /* power role (true if VBUS enabled) */ 136 * cros_ec_usb_get_role() - Get role info about possible PD device attached to a 141 * Return: role info on success, -ENOTCONN if no cable is connected, <0 on 152 pd_control.role = USB_PD_CTRL_ROLE_NO_CHANGE; in cros_ec_usb_get_role() 166 return resp.role; in cros_ec_usb_get_role() 188 static const char *cros_ec_usb_role_string(unsigned int role) in cros_ec_usb_role_string() argument 190 return role == DR_NONE ? "DISCONNECTED" : in cros_ec_usb_role_string() 191 (role == DR_HOST ? "DFP" : "UFP"); in cros_ec_usb_role_string() 223 unsigned int role) in cros_ec_usb_power_type_is_wall_wart() argument [all …]
|
D | extcon-axp288.c | 22 #include <linux/usb/role.h> 152 * The below code to control the USB role-switch on devices with an AXP288 154 * to control the USB role-switch on such devices: 155 * 1) On many devices the USB role is controlled by AML code, but the AML code 160 * 2) In order for our BC1.2 charger detection to work properly the role 167 enum usb_role role; in axp288_get_id_pin() local 173 role = usb_role_switch_get_role(info->role_sw); in axp288_get_id_pin() 174 return role != USB_ROLE_HOST; in axp288_get_id_pin() 181 enum usb_role role; in axp288_usb_role_work() local 187 role = USB_ROLE_HOST; in axp288_usb_role_work() [all …]
|
/Linux-v5.10/include/linux/usb/ |
D | role.h | 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 33 * device controller behind the USB connector with the role switch. If 52 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role); 70 enum usb_role role) in usb_role_switch_set_role() argument
|
D | typec.h | 192 * @try_role: Set data role preference for DRP port 193 * @dr_set: Set Data Role 194 * @pr_set: Set Power Role 199 int (*try_role)(struct typec_port *port, int role); 200 int (*dr_set)(struct typec_port *port, enum typec_data_role role); 201 int (*pr_set)(struct typec_port *port, enum typec_role role); 202 int (*vconn_set)(struct typec_port *port, enum typec_role role); 209 * @type: Supported power role of the port 210 * @data: Supported data role of the port 213 * @prefer_role: Initial role preference (DRP ports). [all …]
|
/Linux-v5.10/Documentation/devicetree/bindings/connector/ |
D | usb-connector.yaml | 62 mode or dual role mode is supported. 67 power-role: 68 description: Determines the power role that the Type C connector will 69 support. "dual" refers to Dual Role Port (DRP). 77 try-power-role: 78 description: Preferred power role. 86 data-role: 87 description: Data role if Type C connector supports USB data. "dual" refers 88 Dual Role Device (DRD). 103 the PD spec chapter 6.4.1. Required for power source and power dual role. [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
|
/Linux-v5.10/net/bridge/ |
D | br_mrp.c | 236 * - when node role is MRM, in this case test_monitor is always set to false 239 * - when node role is MRA, there are 2 subcases: 240 * - when MRA behaves as MRM, in this case is similar with MRM role 263 * role MRA and behaves as MRC. The reason is that the in br_mrp_test_work_expired() 266 * the role of a MRM. in br_mrp_test_work_expired() 314 /* This function is continuously called when the node has the interconnect role 403 /* Stop sending MRP_InTest frames if has an interconnect role */ in br_mrp_del_impl() 564 /* Set port role, port role can be primary or secondary 568 enum br_mrp_port_role_type role) in br_mrp_set_port_role() argument 580 switch (role) { in br_mrp_set_port_role() [all …]
|
D | br_mrp_netlink.c | 109 enum br_mrp_port_role_type role; in br_mrp_port_role_parse() local 118 NL_SET_ERR_MSG_MOD(extack, "Missing attribute: ROLE"); in br_mrp_port_role_parse() 122 role = nla_get_u32(tb[IFLA_BRIDGE_MRP_PORT_ROLE_ROLE]); in br_mrp_port_role_parse() 124 return br_mrp_set_port_role(p, role); in br_mrp_port_role_parse() 172 struct br_mrp_ring_role role; in br_mrp_ring_role_parse() local 183 "Missing attribute: RING_ID or ROLE"); in br_mrp_ring_role_parse() 187 memset(&role, 0x0, sizeof(role)); in br_mrp_ring_role_parse() 189 role.ring_id = nla_get_u32(tb[IFLA_BRIDGE_MRP_RING_ROLE_RING_ID]); in br_mrp_ring_role_parse() 190 role.ring_role = nla_get_u32(tb[IFLA_BRIDGE_MRP_RING_ROLE_ROLE]); in br_mrp_ring_role_parse() 192 return br_mrp_set_ring_role(br, &role); in br_mrp_ring_role_parse() [all …]
|
/Linux-v5.10/security/selinux/ss/ |
D | policydb.h | 59 /* Options how a new object user, role, and type should be decided */ 76 /* Role attributes */ 78 u32 value; /* internal role value */ 79 u32 bounds; /* boundary of role */ 80 struct ebitmap dominates; /* set of roles dominated by this role */ 81 struct ebitmap types; /* set of authorized types for role */ 85 u32 role; /* current role */ member 91 u32 new_role; /* new role */ 107 u32 role; /* current role */ member 108 u32 new_role; /* new role */ [all …]
|
/Linux-v5.10/drivers/usb/common/ |
D | usb-conn-gpio.c | 22 #include <linux/usb/role.h> 53 * Role | ID | VBUS 67 enum usb_role role; in usb_conn_detect_cable() local 80 role = USB_ROLE_HOST; in usb_conn_detect_cable() 82 role = USB_ROLE_DEVICE; in usb_conn_detect_cable() 84 role = USB_ROLE_NONE; in usb_conn_detect_cable() 86 dev_dbg(info->dev, "role %d/%d, gpios: id %d, vbus %d\n", in usb_conn_detect_cable() 87 info->last_role, role, id, vbus); in usb_conn_detect_cable() 89 if (info->last_role == role) { in usb_conn_detect_cable() 90 dev_warn(info->dev, "repeated role: %d\n", role); in usb_conn_detect_cable() [all …]
|
/Linux-v5.10/Documentation/devicetree/bindings/net/dsa/ |
D | sja1105.txt | 24 - sja1105,role-mac: 25 - sja1105,role-phy: 37 1. If sja1105,role-mac is specified, and the phy-mode property is one 41 2. If sja1105,role-phy is specified, and the phy-mode property is one 51 to have sja1105,role-mac, while the other sja1105,role-phy. 90 /* Implicit "sja1105,role-mac;" */ 98 /* Implicit "sja1105,role-mac;" */ 106 /* Implicit "sja1105,role-mac;" */ 114 /* Implicit "sja1105,role-mac;" */ 121 /* Implicit "sja1105,role-phy;" */
|
/Linux-v5.10/arch/x86/kvm/mmu/ |
D | mmutrace.h | 14 __field(__u32, role) \ 21 __entry->role = sp->role.word; \ 30 union kvm_mmu_page_role role; \ 32 role.word = __entry->role; \ 37 __entry->gfn, role.level, \ 38 role.gpte_is_8_bytes ? 8 : 4, \ 39 role.quadrant, \ 40 role.direct ? " direct" : "", \ 41 access_str[role.access], \ 42 role.invalid ? " invalid" : "", \ [all …]
|
/Linux-v5.10/Documentation/devicetree/bindings/usb/ |
D | mediatek,mtu3.txt | 30 when supports dual-role mode. 32 new bindings, and use "usb-role-switch" property instead. 34 dual-role mode. 47 - usb-role-switch : use USB Role Switch to support dual-role switch, but 49 - enable-manual-drd : supports manual dual-role switch via debugfs; usually 50 used when receptacle is TYPE-A and also wants to support dual-role 71 The port would be added as subnode if use "usb-role-switch" property.
|
/Linux-v5.10/Documentation/virt/kvm/ |
D | mmu.rst | 151 role.level: 154 role.direct: 159 by role.level (2MB for first level, 1GB for second level, 0.5TB for third 163 role.quadrant: 164 When role.gpte_is_8_bytes=0, the guest uses 32-bit gptes while the host uses 64-bit 167 For first-level shadow pages, role.quadrant can be 0 or 1 and denotes the 171 shadow pages) so role.quadrant takes values in the range 0..3. Each 173 role.access: 176 role.invalid: 180 role.gpte_is_8_bytes: [all …]
|
/Linux-v5.10/drivers/misc/ |
D | hisi_hikey_usb.c | 22 #include <linux/usb/role.h> 45 enum usb_role role; member 102 enum usb_role role; in relay_set_role_switch() local 108 switch (hisi_hikey_usb->role) { in relay_set_role_switch() 128 role = hisi_hikey_usb->role; in relay_set_role_switch() 131 usb_role_switch_set_role(sw, role); in relay_set_role_switch() 134 static int hub_usb_role_switch_set(struct usb_role_switch *sw, enum usb_role role) in hub_usb_role_switch_set() argument 142 hisi_hikey_usb->role = role; in hub_usb_role_switch_set()
|
/Linux-v5.10/drivers/usb/typec/mux/ |
D | intel_pmc_mux.c | 14 #include <linux/usb/role.h> 131 enum usb_role role; member 240 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; in pmc_usb_mux_dp() 271 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; in pmc_usb_mux_tbt() 312 req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT; in pmc_usb_mux_usb4() 364 static int pmc_usb_connect(struct pmc_usb_port *port, enum usb_role role) in pmc_usb_connect() argument 366 u8 ufp = role == USB_ROLE_DEVICE ? 1 : 0; in pmc_usb_connect() 374 if (port->role == role || port->role == USB_ROLE_NONE) in pmc_usb_connect() 377 /* Role swap */ in pmc_usb_connect() 401 if (port->orientation == TYPEC_ORIENTATION_NONE || port->role == USB_ROLE_NONE) in pmc_usb_mux_set() [all …]
|