Home
last modified time | relevance | path

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

12345678910>>...25

/Linux-v6.1/drivers/usb/cdns3/
Dcore.c28 static int cdns_role_start(struct cdns *cdns, enum usb_role role) in cdns_role_start() argument
32 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns_role_start()
36 cdns->role = role; in cdns_role_start()
39 if (!cdns->roles[role]) in cdns_role_start()
42 if (cdns->roles[role]->state == CDNS_ROLE_STATE_ACTIVE) in cdns_role_start()
46 ret = cdns->roles[role]->start(cdns); in cdns_role_start()
48 cdns->roles[role]->state = CDNS_ROLE_STATE_ACTIVE; in cdns_role_start()
56 enum usb_role role = cdns->role; in cdns_role_stop() local
58 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns_role_stop()
61 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)
65 * @role: current role
75 * @role_sw: pointer to role switch object.
[all …]
DKconfig8 dual-role controller.
9 It supports: dual-role switch, Host-only, and Peripheral-only.
17 tristate "Cadence USB3 Dual-Role Controller"
20 Say Y here if your system has a Cadence USB3 dual-role controller.
21 It supports: dual-role switch, Host-only, and Peripheral-only.
86 tristate "Cadence CDNSP Dual-Role Controller"
89 Say Y here if your system has a Cadence CDNSP dual-role controller.
90 It supports: dual-role switch Host-only, and Peripheral-only.
/Linux-v6.1/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 …]
/Linux-v6.1/drivers/usb/dwc2/
Ddrd.c3 * drd.c - DesignWare USB2 DRD Controller Dual-role support
13 #include <linux/usb/role.h>
85 static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role) in dwc2_drd_role_sw_set() argument
92 if ((role == USB_ROLE_DEVICE && hsotg->dr_mode == USB_DR_MODE_HOST) || in dwc2_drd_role_sw_set()
93 (role == USB_ROLE_HOST && hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)) in dwc2_drd_role_sw_set()
99 if (role == USB_ROLE_NONE && hsotg->test_mode) { in dwc2_drd_role_sw_set()
108 * If role-switch set is called before the udc_start, we need to enable in dwc2_drd_role_sw_set()
121 if (role == USB_ROLE_NONE) { in dwc2_drd_role_sw_set()
122 /* default operation mode when usb role is USB_ROLE_NONE */ in dwc2_drd_role_sw_set()
124 role = USB_ROLE_HOST; in dwc2_drd_role_sw_set()
[all …]
/Linux-v6.1/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 …]
/Linux-v6.1/drivers/staging/r8188eu/include/
Drtw_p2p.h44 void init_wifidirect_info(struct adapter *padapter, enum P2P_ROLE role);
45 int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role);
62 enum P2P_ROLE role) in _rtw_p2p_set_role() argument
64 if (wdinfo->role != role) in _rtw_p2p_set_role()
65 wdinfo->role = role; in _rtw_p2p_set_role()
80 return wdinfo->role; in _rtw_p2p_role()
90 enum P2P_ROLE role) in _rtw_p2p_chk_role() argument
92 return wdinfo->role == role; in _rtw_p2p_chk_role()
98 #define rtw_p2p_set_role(wdinfo, role) _rtw_p2p_set_role(wdinfo, role) argument
104 #define rtw_p2p_chk_role(wdinfo, role) _rtw_p2p_chk_role(wdinfo, role) argument
/Linux-v6.1/drivers/usb/chipidea/
Dci.h19 #include <linux/usb/role.h>
127 * struct ci_role_driver - host/gadget role driver
128 * @start: start this role
129 * @stop: stop this role
130 * @irq: irq handler for this role
131 * @name: role name string (host/gadget)
167 * @role: current role
174 * @work: work for role changing
214 enum ci_role role; member
263 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]); in ci_role()
[all …]
Dotg.c119 * 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()
170 enum ci_role role = ci_otg_role(ci); in ci_handle_id_switch() local
172 if (role != ci->role) { in ci_handle_id_switch()
174 ci_role(ci)->name, ci->roles[role]->name); in ci_handle_id_switch()
176 if (ci->vbus_active && ci->role == CI_ROLE_GADGET) in ci_handle_id_switch()
178 * vbus disconnect event is lost due to role in ci_handle_id_switch()
185 if (role == CI_ROLE_GADGET && in ci_handle_id_switch()
196 ci_role_start(ci, role); in ci_handle_id_switch()
[all …]
/Linux-v6.1/Documentation/devicetree/bindings/usb/
Dmediatek,mtu3.yaml98 Regulator of USB VBUS5v, needed when supports dual-role mode.
126 when supports dual-role mode.
128 new bindings, and use "usb-role-switch" property instead.
130 usb-role-switch:
132 description: Support role switch.
135 role-switch-default-mode:
142 Connector for dual role switch, especially for "gpio-usb-b-connector"
148 using the OF graph bindings specified, if the "usb-role-switch"
155 supports manual dual-role switch via debugfs; usually used when
156 receptacle is TYPE-A and also wants to support dual-role mode.
[all …]
Danalogix,anx7411.yaml35 power-role: true
37 data-role: true
39 try-power-role: true
66 power-role = "dual";
67 data-role = "dual";
68 try-power-role = "source";
/Linux-v6.1/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.h57 static inline int is_sink(enum typec_role role) in is_sink() argument
59 return role == TYPEC_SINK; in is_sink()
62 static inline int is_source(enum typec_role role) in is_source() argument
64 return role == TYPEC_SOURCE; in is_source()
223 * @try_role: Set data role preference for DRP port
224 * @dr_set: Set Data Role
225 * @pr_set: Set Power Role
232 int (*try_role)(struct typec_port *port, int role);
233 int (*dr_set)(struct typec_port *port, enum typec_data_role role);
234 int (*pr_set)(struct typec_port *port, enum typec_role role);
[all …]
/Linux-v6.1/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 …]
Dextcon-axp288.c22 #include <linux/usb/role.h>
153 * The below code to control the USB role-switch on devices with an AXP288
155 * to control the USB role-switch on such devices:
156 * 1) On many devices the USB role is controlled by AML code, but the AML code
161 * 2) In order for our BC1.2 charger detection to work properly the role
168 enum usb_role role; in axp288_get_id_pin() local
174 role = usb_role_switch_get_role(info->role_sw); in axp288_get_id_pin()
175 return role != USB_ROLE_HOST; in axp288_get_id_pin()
182 enum usb_role role; in axp288_usb_role_work() local
188 role = USB_ROLE_HOST; in axp288_usb_role_work()
[all …]
/Linux-v6.1/drivers/net/ethernet/intel/ice/
Dice_lag.c29 if (lag->role != ICE_LAG_UNSET && lag->role != ICE_LAG_BACKUP) { in ice_lag_set_primary()
35 lag->role = ICE_LAG_PRIMARY; in ice_lag_set_primary()
49 if (lag->role != ICE_LAG_UNSET && lag->role != ICE_LAG_PRIMARY) { in ice_lag_set_backup()
55 lag->role = ICE_LAG_BACKUP; in ice_lag_set_backup()
64 const char *name, *peer, *upper, *role, *bonded, *primary; in ice_display_lag_info() local
73 switch (lag->role) { in ice_display_lag_info()
75 role = "NONE"; in ice_display_lag_info()
78 role = "PRIMARY"; in ice_display_lag_info()
81 role = "BACKUP"; in ice_display_lag_info()
84 role = "UNSET"; in ice_display_lag_info()
[all …]
/Linux-v6.1/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
/Linux-v6.1/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 %s -> %s, gpios: id %d, vbus %d\n", in usb_conn_detect_cable()
87 usb_role_string(info->last_role), usb_role_string(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: %s\n", usb_role_string(role)); in usb_conn_detect_cable()
[all …]
/Linux-v6.1/drivers/misc/
Dhisi_hikey_usb.c22 #include <linux/usb/role.h>
44 enum usb_role role; member
98 enum usb_role role; in relay_set_role_switch() local
104 switch (hisi_hikey_usb->role) { in relay_set_role_switch()
124 role = hisi_hikey_usb->role; in relay_set_role_switch()
127 usb_role_switch_set_role(sw, role); in relay_set_role_switch()
130 static int hub_usb_role_switch_set(struct usb_role_switch *sw, enum usb_role role) in hub_usb_role_switch_set() argument
138 hisi_hikey_usb->role = role; in hub_usb_role_switch_set()
152 if (!device_property_read_bool(dev, "usb-role-switch")) in hisi_hikey_usb_of_role_switch()
184 dev_err(dev, "get device role switch failed with error %ld\n", in hisi_hikey_usb_of_role_switch()
[all …]
/Linux-v6.1/net/bridge/
Dbr_mrp.c270 * - when node role is MRM, in this case test_monitor is always set to false
273 * - when node role is MRA, there are 2 subcases:
274 * - when MRA behaves as MRM, in this case is similar with MRM role
297 * role MRA and behaves as MRC. The reason is that the in br_mrp_test_work_expired()
300 * the role of a MRM. in br_mrp_test_work_expired()
348 /* This function is continuously called when the node has the interconnect role
437 /* Stop sending MRP_InTest frames if has an interconnect role */ in br_mrp_del_impl()
614 /* Set port role, port role can be primary or secondary
618 enum br_mrp_port_role_type role) in br_mrp_set_port_role() argument
630 switch (role) { in br_mrp_set_port_role()
[all …]
Dbr_mrp_netlink.c109 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-v6.1/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 …]
/Linux-v6.1/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).
124 the PD spec chapter 6.4.1. Required for power source and power dual role.
[all …]

12345678910>>...25