Home
last modified time | relevance | path

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

12345678910>>...39

/kernel/linux/linux-4.19/drivers/usb/roles/
Dclass.c3 * USB Role Switch Support
10 #include <linux/usb/role.h>
21 enum usb_role role; member
35 * usb_role_switch_set_role - Set USB role for a switch
36 * @sw: USB role switch
37 * @role: USB role to be switched to
39 * Set USB role @role for @sw.
41 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument
50 ret = sw->set(sw->dev.parent, role); in usb_role_switch_set_role()
52 sw->role = role; in usb_role_switch_set_role()
[all …]
DKconfig2 tristate "USB Role Switch Support"
4 USB Role Switch is a device that can select the USB role - host or
5 device - for a USB port (connector). In most cases dual-role capable
17 tristate "Intel XHCI USB Role Switch"
20 Driver for the internal USB role switch for switching the USB data
25 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
22 #include <linux/usb/role.h>
42 static int intel_xhci_usb_set_role(struct device *dev, enum usb_role role) in intel_xhci_usb_set_role() argument
64 switch (role) { in intel_xhci_usb_set_role()
90 if (!!(val & HOST_MODE) == (role == USB_ROLE_HOST)) { in intel_xhci_usb_set_role()
101 dev_warn(dev, "Timeout waiting for role-switch\n"); in intel_xhci_usb_set_role()
108 enum usb_role role; in intel_xhci_usb_get_role() local
116 role = USB_ROLE_HOST; in intel_xhci_usb_get_role()
118 role = USB_ROLE_DEVICE; in intel_xhci_usb_get_role()
120 role = USB_ROLE_NONE; 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>
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 …]
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)
63 * @role: current role
73 * @role_sw: pointer to role switch object.
[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-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
214 enum ci_role role; member
264 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]); in ci_role()
[all …]
/kernel/linux/linux-5.10/drivers/usb/dwc2/
Ddrd.c3 * 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 …]
/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-4.19/drivers/extcon/
Dextcon-usbc-cros-ec.c27 unsigned int dr; /* data role */
28 bool pr; /* power role (true if VBUS enabled) */
135 * cros_ec_usb_get_role() - Get role info about possible PD device attached to a
140 * Return: role info on success, -ENOTCONN if no cable is connected, <0 on
151 pd_control.role = USB_PD_CTRL_ROLE_NO_CHANGE; in cros_ec_usb_get_role()
165 return resp.role; in cros_ec_usb_get_role()
187 static const char *cros_ec_usb_role_string(unsigned int role) in cros_ec_usb_role_string() argument
189 return role == DR_NONE ? "DISCONNECTED" : in cros_ec_usb_role_string()
190 (role == DR_HOST ? "DFP" : "UFP"); in cros_ec_usb_role_string()
222 unsigned int role) in cros_ec_usb_power_type_is_wall_wart() argument
[all …]
Dextcon-axp288.c30 #include <linux/usb/role.h>
158 * The below code to control the USB role-switch on devices with an AXP288
160 * to control the USB role-switch on such devices:
161 * 1) On many devices the USB role is controlled by AML code, but the AML code
166 * 2) In order for our BC1.2 charger detection to work properly the role
173 enum usb_role role; in axp288_get_id_pin() local
179 role = usb_role_switch_get_role(info->role_sw); in axp288_get_id_pin()
180 return role != USB_ROLE_HOST; in axp288_get_id_pin()
187 enum usb_role role; in axp288_usb_role_work() local
193 role = USB_ROLE_HOST; in axp288_usb_role_work()
[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
Dtypec.h192 * @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 …]
/kernel/linux/linux-4.19/drivers/usb/chipidea/
Dci.h124 * struct ci_role_driver - host/gadget role driver
125 * @start: start this role
126 * @stop: stop this role
127 * @irq: irq handler for this role
128 * @name: role name string (host/gadget)
164 * @role: current role
171 * @work: work for role changing
212 enum ci_role role; member
261 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]); in ci_role()
262 return ci->roles[ci->role]; in ci_role()
[all …]
/kernel/linux/linux-4.19/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/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-4.19/include/linux/usb/
Drole.h16 typedef int (*usb_role_switch_set_t)(struct device *dev, enum usb_role role);
20 * struct usb_role_switch_desc - USB Role Switch Descriptor
24 * @set: Callback for setting the role
25 * @get: Callback for getting the role (optional)
26 * @allow_userspace_control: If true userspace may change the role through sysfs
29 * device controller behind the USB connector with the role switch. If
43 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role);
/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 …]
/kernel/linux/linux-5.10/drivers/usb/common/
Dusb-conn-gpio.c22 #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 …]
/kernel/linux/linux-4.19/security/selinux/ss/
Dpolicydb.h63 /* Options how a new object user, role, and type should be decided */
79 /* Role attributes */
81 u32 value; /* internal role value */
82 u32 bounds; /* boundary of role */
83 struct ebitmap dominates; /* set of roles dominated by this role */
84 struct ebitmap types; /* set of authorized types for role */
88 u32 role; /* current role */ member
91 u32 new_role; /* new role */
107 u32 role; /* current role */ member
108 u32 new_role; /* new role */
[all …]
/kernel/linux/linux-5.10/security/selinux/ss/
Dpolicydb.h59 /* 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 …]

12345678910>>...39