Home
last modified time | relevance | path

Searched full:role (Results 1 – 25 of 1225) sorted by relevance

12345678910>>...49

/kernel/linux/linux-6.6/drivers/usb/cdns3/
Dcore.c29 static int cdns_role_start(struct cdns *cdns, enum usb_role role) in cdns_role_start() argument
33 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns_role_start()
37 cdns->role = role; in cdns_role_start()
40 if (!cdns->roles[role]) in cdns_role_start()
43 if (cdns->roles[role]->state == CDNS_ROLE_STATE_ACTIVE) in cdns_role_start()
47 ret = cdns->roles[role]->start(cdns); in cdns_role_start()
49 cdns->roles[role]->state = CDNS_ROLE_STATE_ACTIVE; in cdns_role_start()
57 enum usb_role role = cdns->role; in cdns_role_stop() local
59 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns_role_stop()
62 if (cdns->roles[role]->state == CDNS_ROLE_STATE_INACTIVE) in cdns_role_stop()
[all …]
Dcore.h15 #include <linux/usb/role.h>
20 * struct cdns_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)
66 * @role: current role
76 * @role_sw: pointer to role switch object.
[all …]
/kernel/linux/linux-6.6/drivers/usb/roles/
Dclass.c3 * USB Role Switch Support
10 #include <linux/usb/role.h>
25 enum usb_role role; member
40 * usb_role_switch_set_role - Set USB role for a switch
41 * @sw: USB role switch
42 * @role: USB role to be switched to
44 * Set USB role @role for @sw.
46 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument
58 ret = sw->set(sw, role); in usb_role_switch_set_role()
60 sw->role = role; in usb_role_switch_set_role()
[all …]
DKconfig4 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.
Dintel-xhci-usb-role-switch.c3 * 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 …]
/kernel/linux/linux-5.10/drivers/usb/roles/
Dclass.c3 * USB Role Switch Support
10 #include <linux/usb/role.h>
23 enum usb_role role; member
37 * usb_role_switch_set_role - Set USB role for a switch
38 * @sw: USB role switch
39 * @role: USB role to be switched to
41 * Set USB role @role for @sw.
43 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument
52 ret = sw->set(sw, role); in usb_role_switch_set_role()
54 sw->role = role; in usb_role_switch_set_role()
[all …]
DKconfig4 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.
Dintel-xhci-usb-role-switch.c3 * 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 …]
/kernel/linux/linux-5.10/drivers/usb/cdns3/
Dcore.c30 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 …]
Dcore.h12 #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)
65 * @role: current role
75 * @role_sw: pointer to role switch object.
[all …]
/kernel/linux/linux-6.6/drivers/usb/dwc2/
Ddrd.c3 * drd.c - DesignWare USB2 DRD Controller Dual-role support
13 #include <linux/usb/role.h>
86 static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role) in dwc2_drd_role_sw_set() argument
93 if ((role == USB_ROLE_DEVICE && hsotg->dr_mode == USB_DR_MODE_HOST) || in dwc2_drd_role_sw_set()
94 (role == USB_ROLE_HOST && hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)) in dwc2_drd_role_sw_set()
100 if (role == USB_ROLE_NONE && hsotg->test_mode) { in dwc2_drd_role_sw_set()
109 * If role-switch set is called before the udc_start, we need to enable in dwc2_drd_role_sw_set()
122 if (role == USB_ROLE_NONE) { in dwc2_drd_role_sw_set()
123 /* default operation mode when usb role is USB_ROLE_NONE */ in dwc2_drd_role_sw_set()
125 role = USB_ROLE_HOST; in dwc2_drd_role_sw_set()
[all …]
/kernel/linux/linux-5.10/drivers/usb/typec/
Dqcom-pmic-typec.c15 #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 …]
/kernel/linux/linux-6.6/drivers/usb/chipidea/
Dci.h19 #include <linux/usb/role.h>
128 * struct ci_role_driver - host/gadget role driver
129 * @start: start this role
130 * @stop: stop this role
131 * @suspend: system suspend handler for this role
132 * @resume: system resume handler for this role
133 * @irq: irq handler for this role
134 * @name: role name string (host/gadget)
172 * @role: current role
179 * @work: work for role changing
[all …]
/kernel/linux/linux-5.10/drivers/usb/chipidea/
Dci.h19 #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
207 * @mutex: protect code from concorrent running when doing role switch
215 enum ci_role role; member
[all …]
/kernel/linux/linux-6.6/Documentation/devicetree/bindings/usb/
Dmediatek,mtu3.yaml104 Regulator of USB VBUS5v, needed when supports dual-role mode.
132 when supports dual-role mode.
134 new bindings, and use "usb-role-switch" property instead.
136 usb-role-switch:
138 description: Support role switch.
141 role-switch-default-mode:
148 Connector for dual role switch, especially for "gpio-usb-b-connector"
154 using the OF graph bindings specified, if the "usb-role-switch"
161 supports manual dual-role switch via debugfs; usually used when
162 receptacle is TYPE-A and also wants to support dual-role mode.
[all …]
/kernel/linux/linux-6.6/include/linux/usb/
Drole.h17 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);
68 const char *usb_role_string(enum usb_role role);
71 enum usb_role role) in usb_role_switch_set_role() argument
[all …]
Dtypec.h58 static inline int is_sink(enum typec_role role) in is_sink() argument
60 return role == TYPEC_SINK; in is_sink()
63 static inline int is_source(enum typec_role role) in is_source() argument
65 return role == TYPEC_SOURCE; in is_source()
224 * @try_role: Set data role preference for DRP port
225 * @dr_set: Set Data Role
226 * @pr_set: Set Power Role
233 int (*try_role)(struct typec_port *port, int role);
234 int (*dr_set)(struct typec_port *port, enum typec_data_role role);
235 int (*pr_set)(struct typec_port *port, enum typec_role role);
[all …]
/kernel/linux/linux-5.10/drivers/usb/dwc2/
Ddrd.c3 * drd.c - DesignWare USB2 DRD Controller Dual-role support
13 #include <linux/usb/role.h>
72 static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role) in dwc2_drd_role_sw_set() argument
79 if ((role == USB_ROLE_DEVICE && hsotg->dr_mode == USB_DR_MODE_HOST) || in dwc2_drd_role_sw_set()
80 (role == USB_ROLE_HOST && hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)) in dwc2_drd_role_sw_set()
86 if (role == USB_ROLE_NONE && hsotg->test_mode) { in dwc2_drd_role_sw_set()
95 * If role-switch set is called before the udc_start, we need to enable in dwc2_drd_role_sw_set()
108 if (role == USB_ROLE_HOST) { in dwc2_drd_role_sw_set()
110 } else if (role == USB_ROLE_DEVICE) { in dwc2_drd_role_sw_set()
130 dwc2_force_mode(hsotg, role == USB_ROLE_HOST); in dwc2_drd_role_sw_set()
[all …]
/kernel/linux/linux-6.6/drivers/extcon/
Dextcon-usbc-cros-ec.c28 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 …]
/kernel/linux/linux-5.10/drivers/extcon/
Dextcon-usbc-cros-ec.c28 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 …]
/kernel/linux/linux-5.10/include/linux/usb/
Drole.h17 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
/kernel/linux/linux-5.10/Documentation/ABI/testing/
Dsysfs-class-usb_role5 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
/kernel/linux/linux-6.6/Documentation/ABI/testing/
Dsysfs-class-usb_role5 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
/kernel/linux/linux-5.10/Documentation/devicetree/bindings/connector/
Dusb-connector.yaml62 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 …]
/kernel/linux/linux-5.10/net/bridge/
Dbr_mrp.c236 * - 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()
567 /* Set port role, port role can be primary or secondary
571 enum br_mrp_port_role_type role) in br_mrp_set_port_role() argument
583 switch (role) { in br_mrp_set_port_role()
[all …]

12345678910>>...49