| /OK3568_Linux_fs/kernel/drivers/usb/roles/ |
| H A 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 …]
|
| H A 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 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.
|
| H A 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 …]
|
| /OK3568_Linux_fs/kernel/drivers/usb/cdns3/ |
| H A 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 …]
|
| H A D | core.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 5 * Copyright (C) 2017-2018 NXP 6 * Copyright (C) 2018-2019 Cadence. 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 [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/misc/ |
| H A D | hisilicon-hikey-usb.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 4 --- 5 $id: "http://devicetree.org/schemas/misc/hisilicon-hikey-usb.yaml#" 6 $schema: "http://devicetree.org/meta-schemas/core.yaml#" 11 - John Stultz <john.stultz@linaro.org> 15 role-switch intermediary to detect the state of the USB-C 16 port, to switch the hub into dual-role USB-C or host mode, 17 which enables the onboard USB-A host ports. 20 …https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey96… 25 - const: hisilicon,gpio_hubv1 [all …]
|
| /OK3568_Linux_fs/kernel/include/linux/usb/ |
| H A 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) 33 * device controller behind the USB connector with the role switch. If 36 * usb_role_switch_register() before registering the switch. [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/usb/ |
| H A 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 …]
|
| H A 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", 16 - clocks : a list of phandle + clock-specifier pairs, one for [all …]
|
| H A D | usb-drd.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: http://devicetree.org/schemas/usb/usb-drd.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Greg Kroah-Hartman <gregkh@linuxfoundation.org> 13 otg-rev: 16 which the device and its descriptors are compliant, in binary-coded 18 features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be 24 Tells Dual-Role USB controllers that we want to work on a particular 30 hnp-disable: [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/ABI/testing/ |
| H A 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
|
| /OK3568_Linux_fs/u-boot/drivers/usb/cdns3/ |
| H A D | core.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2018-2019 Cadence. 6 * Copyright (C) 2017-2018 NXP 16 #include <dm/device-internal.h> 24 #include "host-export.h" 25 #include "gadget-export.h" 42 WARN_ON(!cdns->roles[cdns->role]); in cdns3_get_current_role_driver() 43 return cdns->roles[cdns->role]; in cdns3_get_current_role_driver() 46 static int cdns3_role_start(struct cdns3 *cdns, enum usb_role role) in cdns3_role_start() argument 50 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns3_role_start() [all …]
|
| H A D | core.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 5 * Copyright (C) 2017-2018 NXP 6 * Copyright (C) 2018-2019 Cadence. 14 #include <generic-phy.h> 28 * struct cdns3_role_driver - host/gadget role driver 29 * @start: start this role 30 * @stop: stop this role 31 * @suspend: suspend callback for this role 32 * @resume: resume callback for this role 33 * @irq: irq handler for this role [all …]
|
| /OK3568_Linux_fs/kernel/drivers/usb/dwc3/ |
| H A D | drd.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * drd.c - DesignWare USB3 DRD Controller Dual-role support 5 * Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com 21 u32 reg = dwc3_readl(dwc->regs, DWC3_OEVTEN); in dwc3_otg_disable_events() 24 dwc3_writel(dwc->regs, DWC3_OEVTEN, reg); in dwc3_otg_disable_events() 29 u32 reg = dwc3_readl(dwc->regs, DWC3_OEVTEN); in dwc3_otg_enable_events() 32 dwc3_writel(dwc->regs, DWC3_OEVTEN, reg); in dwc3_otg_enable_events() 37 u32 reg = dwc3_readl(dwc->regs, DWC3_OEVT); in dwc3_otg_clear_events() 39 dwc3_writel(dwc->regs, DWC3_OEVTEN, reg); in dwc3_otg_clear_events() 56 spin_lock(&dwc->lock); in dwc3_otg_thread_irq() [all …]
|
| /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/phl/hal_g6/mac/mac_ax/ |
| H A D | security_cam.c | 64 sec_cam_table = &adapter->hw_info->sec_cam_table_bk; in sec_info_tbl_init() 66 sec_cam_table = &adapter->hw_info->sec_cam_table; in sec_info_tbl_init() 77 (*sec_cam_table)->sec_cam_entry[i] = in sec_info_tbl_init() 81 if (!(*sec_cam_table)->sec_cam_entry[i]) in sec_info_tbl_init() 84 (*sec_cam_table)->sec_cam_entry[i]->sec_cam_info = in sec_info_tbl_init() 88 if (!(*sec_cam_table)->sec_cam_entry[i]->sec_cam_info) in sec_info_tbl_init() 92 (*sec_cam_table)->sec_cam_entry[i]->valid = INVALID; in sec_info_tbl_init() 93 (*sec_cam_table)->sec_cam_entry[i]->mac_id = 0; in sec_info_tbl_init() 94 (*sec_cam_table)->sec_cam_entry[i]->key_id = 0; in sec_info_tbl_init() 95 (*sec_cam_table)->sec_cam_entry[i]->key_type = 0; in sec_info_tbl_init() [all …]
|
| H A D | cpuio.c | 26 struct mac_role_tbl *role, 55 val32 = SET_CLR_WORD(val32, buf_req_p->len, B_AX_WD_BUF_REQ_LEN); in mac_dle_buf_req_wd() 60 while (timeout--) { in mac_dle_buf_req_wd() 69 buf_req_p->len); in mac_dle_buf_req_wd() 73 buf_req_p->pktid = GET_FIELD(val32, B_AX_WD_BUF_STAT_PKTID); in mac_dle_buf_req_wd() 75 if (buf_req_p->pktid == 0xfff) { in mac_dle_buf_req_wd() 77 buf_req_p->len); in mac_dle_buf_req_wd() 91 val32 = SET_CLR_WORD(val32, buf_req_p->len, B_AX_PL_BUF_REQ_LEN); in mac_dle_buf_req_pl() 96 while (timeout--) { in mac_dle_buf_req_pl() 105 buf_req_p->len); in mac_dle_buf_req_pl() [all …]
|
| /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852bs/phl/hal_g6/mac/mac_ax/ |
| H A D | security_cam.c | 64 sec_cam_table = &adapter->hw_info->sec_cam_table_bk; in sec_info_tbl_init() 66 sec_cam_table = &adapter->hw_info->sec_cam_table; in sec_info_tbl_init() 77 (*sec_cam_table)->sec_cam_entry[i] = in sec_info_tbl_init() 81 if (!(*sec_cam_table)->sec_cam_entry[i]) in sec_info_tbl_init() 84 (*sec_cam_table)->sec_cam_entry[i]->sec_cam_info = in sec_info_tbl_init() 88 if (!(*sec_cam_table)->sec_cam_entry[i]->sec_cam_info) in sec_info_tbl_init() 92 (*sec_cam_table)->sec_cam_entry[i]->valid = INVALID; in sec_info_tbl_init() 93 (*sec_cam_table)->sec_cam_entry[i]->mac_id = 0; in sec_info_tbl_init() 94 (*sec_cam_table)->sec_cam_entry[i]->key_id = 0; in sec_info_tbl_init() 95 (*sec_cam_table)->sec_cam_entry[i]->key_type = 0; in sec_info_tbl_init() [all …]
|
| H A D | cpuio.c | 26 struct mac_role_tbl *role, 55 val32 = SET_CLR_WORD(val32, buf_req_p->len, B_AX_WD_BUF_REQ_LEN); in mac_dle_buf_req_wd() 60 while (timeout--) { in mac_dle_buf_req_wd() 69 buf_req_p->len); in mac_dle_buf_req_wd() 73 buf_req_p->pktid = GET_FIELD(val32, B_AX_WD_BUF_STAT_PKTID); in mac_dle_buf_req_wd() 75 if (buf_req_p->pktid == 0xfff) { in mac_dle_buf_req_wd() 77 buf_req_p->len); in mac_dle_buf_req_wd() 91 val32 = SET_CLR_WORD(val32, buf_req_p->len, B_AX_PL_BUF_REQ_LEN); in mac_dle_buf_req_pl() 96 while (timeout--) { in mac_dle_buf_req_pl() 105 buf_req_p->len); in mac_dle_buf_req_pl() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/usb/dwc2/ |
| H A D | drd.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * drd.c - DesignWare USB2 DRD Controller Dual-role support 13 #include <linux/usb/role.h> 21 spin_lock_irqsave(&hsotg->lock, flags); in dwc2_ovr_init() 29 spin_unlock_irqrestore(&hsotg->lock, flags); in dwc2_ovr_init() 31 dwc2_force_mode(hsotg, (hsotg->dr_mode == USB_DR_MODE_HOST)); in dwc2_ovr_init() 38 /* Check if A-Session is already in the right state */ in dwc2_ovr_avalid() 41 return -EALREADY; in dwc2_ovr_avalid() 57 /* Check if B-Session is already in the right state */ in dwc2_ovr_bvalid() 60 return -EALREADY; in dwc2_ovr_bvalid() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/usb/mtu3/ |
| H A 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 mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION); in toggle_opstate() 45 mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN); in toggle_opstate() 48 /* only port0 supports dual-role mode */ 52 void __iomem *ibase = ssusb->ippc_base; in ssusb_port0_switch() 55 dev_dbg(ssusb->dev, "%s (switch u%d port0 to %s)\n", __func__, in ssusb_port0_switch() 91 dev_dbg(ssusb->dev, "%s\n", __func__); in switch_port_to_host() [all …]
|
| /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852bs/core/ |
| H A D | rtw_csa.c | 3 * Copyright(c) 2019 - 2021 Realtek Corporation. 21 rfctl->csa_mode = 0; in reset_csa_param() 22 rfctl->csa_switch_cnt = 0; in reset_csa_param() 23 rfctl->csa_ch_width = 0; in reset_csa_param() 24 _rtw_memset(&(rfctl->csa_chandef), 0, sizeof(struct rtw_chan_def)); in reset_csa_param() 39 if (rtw_chset_search_ch(rfctl->channel_set, rfctl->csa_chandef.chan) >= 0 in rtw_get_csa_setting() 40 && !rtw_chset_is_ch_non_ocp(rfctl->channel_set, rfctl->csa_chandef.chan) in rtw_get_csa_setting() 43 *req_ch = rfctl->csa_chandef.chan; in rtw_get_csa_setting() 45 rfctl->csa_chandef.chan); in rtw_get_csa_setting() 54 if (!is_supported_24g(dvobj_to_regsty(d)->band_type)) in rtw_get_csa_setting() [all …]
|
| /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/core/ |
| H A D | rtw_csa.c | 3 * Copyright(c) 2019 - 2021 Realtek Corporation. 21 rfctl->csa_mode = 0; in reset_csa_param() 22 rfctl->csa_switch_cnt = 0; in reset_csa_param() 23 rfctl->csa_ch_width = 0; in reset_csa_param() 24 _rtw_memset(&(rfctl->csa_chandef), 0, sizeof(struct rtw_chan_def)); in reset_csa_param() 39 if (rtw_chset_search_ch(rfctl->channel_set, rfctl->csa_chandef.chan) >= 0 in rtw_get_csa_setting() 40 && !rtw_chset_is_ch_non_ocp(rfctl->channel_set, rfctl->csa_chandef.chan) in rtw_get_csa_setting() 43 *req_ch = rfctl->csa_chandef.chan; in rtw_get_csa_setting() 45 rfctl->csa_chandef.chan); in rtw_get_csa_setting() 54 if (!is_supported_24g(dvobj_to_regsty(d)->band_type)) in rtw_get_csa_setting() [all …]
|
| /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/include/ |
| H A D | rtw_csa.h | 3 * Copyright(c) 2019 - 2021 Realtek Corporation. 19 #define CSA_IE_LEN 3 /* Length of Channel Switch element */ 25 #define CS_WR_DATA_LEN 5 /* Length of Channel Switch Wrapper element */ 35 ECSA_ST_SW_START, /* ready to switch */ 36 ECSA_ST_SW_DONE /* switch done */ 44 /* @channel_width defined in 802.11-2016, Table 9-252 VHT operation information subfields 48 * 3 for non-contiguous 80+80 MHz (deprecated) 57 ecsa_info->state = state; in set_ecsa_state() 62 if (ecsa_info->state == state) in check_ecsa_state() 67 #define SET_ECSA_STATE(adapter, state) set_ecsa_state(&((adapter)->ecsa_info), (state)) [all …]
|
| /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852bs/include/ |
| H A D | rtw_csa.h | 3 * Copyright(c) 2019 - 2021 Realtek Corporation. 19 #define CSA_IE_LEN 3 /* Length of Channel Switch element */ 25 #define CS_WR_DATA_LEN 5 /* Length of Channel Switch Wrapper element */ 35 ECSA_ST_SW_START, /* ready to switch */ 36 ECSA_ST_SW_DONE /* switch done */ 44 /* @channel_width defined in 802.11-2016, Table 9-252 VHT operation information subfields 48 * 3 for non-contiguous 80+80 MHz (deprecated) 57 ecsa_info->state = state; in set_ecsa_state() 62 if (ecsa_info->state == state) in check_ecsa_state() 67 #define SET_ECSA_STATE(adapter, state) set_ecsa_state(&((adapter)->ecsa_info), (state)) [all …]
|
| /OK3568_Linux_fs/kernel/drivers/misc/ |
| H A D | hisi_hikey_usb.c | 1 // SPDX-License-Identifier: GPL-2.0 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() 70 ret = regulator_disable(hisi_hikey_usb->regulator); in hub_power_ctrl() [all …]
|