/Linux-v5.15/drivers/thunderbolt/ |
D | switch.c | 37 static struct nvm_auth_status *__nvm_get_auth_status(const struct tb_switch *sw) in __nvm_get_auth_status() argument 42 if (uuid_equal(&st->uuid, sw->uuid)) in __nvm_get_auth_status() 49 static void nvm_get_auth_status(const struct tb_switch *sw, u32 *status) in nvm_get_auth_status() argument 54 st = __nvm_get_auth_status(sw); in nvm_get_auth_status() 60 static void nvm_set_auth_status(const struct tb_switch *sw, u32 status) in nvm_set_auth_status() argument 64 if (WARN_ON(!sw->uuid)) in nvm_set_auth_status() 68 st = __nvm_get_auth_status(sw); in nvm_set_auth_status() 75 memcpy(&st->uuid, sw->uuid, sizeof(st->uuid)); in nvm_set_auth_status() 85 static void nvm_clear_auth_status(const struct tb_switch *sw) in nvm_clear_auth_status() argument 90 st = __nvm_get_auth_status(sw); in nvm_clear_auth_status() [all …]
|
D | eeprom.c | 18 static int tb_eeprom_ctl_write(struct tb_switch *sw, struct tb_eeprom_ctl *ctl) in tb_eeprom_ctl_write() argument 20 return tb_sw_write(sw, ctl, TB_CFG_SWITCH, sw->cap_plug_events + 4, 1); in tb_eeprom_ctl_write() 26 static int tb_eeprom_ctl_read(struct tb_switch *sw, struct tb_eeprom_ctl *ctl) in tb_eeprom_ctl_read() argument 28 return tb_sw_read(sw, ctl, TB_CFG_SWITCH, sw->cap_plug_events + 4, 1); in tb_eeprom_ctl_read() 42 static int tb_eeprom_active(struct tb_switch *sw, bool enable) in tb_eeprom_active() argument 45 int res = tb_eeprom_ctl_read(sw, &ctl); in tb_eeprom_active() 50 res = tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() 54 return tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() 57 res = tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() 61 return tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() [all …]
|
D | tmu.c | 14 static const char *tb_switch_tmu_mode_name(const struct tb_switch *sw) in tb_switch_tmu_mode_name() argument 16 bool root_switch = !tb_route(sw); in tb_switch_tmu_mode_name() 18 switch (sw->tmu.rate) { in tb_switch_tmu_mode_name() 26 if (sw->tmu.unidirectional) in tb_switch_tmu_mode_name() 40 static bool tb_switch_tmu_ucap_supported(struct tb_switch *sw) in tb_switch_tmu_ucap_supported() argument 45 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, in tb_switch_tmu_ucap_supported() 46 sw->tmu.cap + TMU_RTR_CS_0, 1); in tb_switch_tmu_ucap_supported() 53 static int tb_switch_tmu_rate_read(struct tb_switch *sw) in tb_switch_tmu_rate_read() argument 58 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, in tb_switch_tmu_rate_read() 59 sw->tmu.cap + TMU_RTR_CS_3, 1); in tb_switch_tmu_rate_read() [all …]
|
D | lc.c | 16 int tb_lc_read_uuid(struct tb_switch *sw, u32 *uuid) in tb_lc_read_uuid() argument 18 if (!sw->cap_lc) in tb_lc_read_uuid() 20 return tb_sw_read(sw, uuid, TB_CFG_SWITCH, sw->cap_lc + TB_LC_FUSE, 4); in tb_lc_read_uuid() 23 static int read_lc_desc(struct tb_switch *sw, u32 *desc) in read_lc_desc() argument 25 if (!sw->cap_lc) in read_lc_desc() 27 return tb_sw_read(sw, desc, TB_CFG_SWITCH, sw->cap_lc + TB_LC_DESC, 1); in read_lc_desc() 32 struct tb_switch *sw = port->sw; in find_port_lc_cap() local 36 ret = read_lc_desc(sw, &desc); in find_port_lc_cap() 45 return sw->cap_lc + start + phys * size; in find_port_lc_cap() 51 struct tb_switch *sw = port->sw; in tb_lc_set_port_configured() local [all …]
|
D | tb.h | 231 struct tb_switch *sw; member 442 int (*runtime_suspend_switch)(struct tb_switch *sw); 443 int (*runtime_resume_switch)(struct tb_switch *sw); 448 int (*disapprove_switch)(struct tb *tb, struct tb_switch *sw); 449 int (*approve_switch)(struct tb *tb, struct tb_switch *sw); 450 int (*add_switch_key)(struct tb *tb, struct tb_switch *sw); 451 int (*challenge_switch_key)(struct tb *tb, struct tb_switch *sw, 460 int (*usb4_switch_op)(struct tb_switch *sw, u16 opcode, u32 *metadata, 463 int (*usb4_switch_nvm_authenticate_status)(struct tb_switch *sw, 486 static inline struct tb_port *tb_upstream_port(struct tb_switch *sw) in tb_upstream_port() argument [all …]
|
D | tb.c | 72 static void tb_add_dp_resources(struct tb_switch *sw) in tb_add_dp_resources() argument 74 struct tb_cm *tcm = tb_priv(sw->tb); in tb_add_dp_resources() 77 tb_switch_for_each_port(sw, port) { in tb_add_dp_resources() 81 if (!tb_switch_query_dp_resource(sw, port)) in tb_add_dp_resources() 89 static void tb_remove_dp_resources(struct tb_switch *sw) in tb_remove_dp_resources() argument 91 struct tb_cm *tcm = tb_priv(sw->tb); in tb_remove_dp_resources() 95 tb_switch_for_each_port(sw, port) { in tb_remove_dp_resources() 97 tb_remove_dp_resources(port->remote->sw); in tb_remove_dp_resources() 101 if (port->sw == sw) { in tb_remove_dp_resources() 108 static void tb_discover_tunnels(struct tb_switch *sw) in tb_discover_tunnels() argument [all …]
|
D | quirks.c | 10 static void quirk_force_power_link(struct tb_switch *sw) in quirk_force_power_link() argument 12 sw->quirks |= QUIRK_FORCE_POWER_LINK_CONTROLLER; in quirk_force_power_link() 15 static void quirk_dp_credit_allocation(struct tb_switch *sw) in quirk_dp_credit_allocation() argument 17 if (sw->credit_allocation && sw->min_dp_main_credits == 56) { in quirk_dp_credit_allocation() 18 sw->min_dp_main_credits = 18; in quirk_dp_credit_allocation() 19 tb_sw_dbg(sw, "quirked DP main: %u\n", sw->min_dp_main_credits); in quirk_dp_credit_allocation() 28 void (*hook)(struct tb_switch *sw); 48 void tb_check_quirks(struct tb_switch *sw) in tb_check_quirks() argument 55 if (q->hw_vendor_id && q->hw_vendor_id != sw->config.vendor_id) in tb_check_quirks() 57 if (q->hw_device_id && q->hw_device_id != sw->config.device_id) in tb_check_quirks() [all …]
|
D | icm.c | 400 struct icm_fr_pkg_get_topology_response *switches, *sw; in icm_fr_get_route() local 417 sw = &switches[0]; in icm_fr_get_route() 418 index = icm_fr_get_switch_index(sw->ports[link]); in icm_fr_get_route() 424 sw = &switches[index]; in icm_fr_get_route() 428 if (!(sw->first_data & ICM_SWITCH_USED)) { in icm_fr_get_route() 433 for (j = 0; j < ARRAY_SIZE(sw->ports); j++) { in icm_fr_get_route() 434 index = icm_fr_get_switch_index(sw->ports[j]); in icm_fr_get_route() 435 if (index > sw->switch_index) { in icm_fr_get_route() 436 sw = &switches[index]; in icm_fr_get_route() 442 *route = get_route(sw->route_hi, sw->route_lo); in icm_fr_get_route() [all …]
|
D | usb4.c | 53 static int usb4_switch_wait_for_bit(struct tb_switch *sw, u32 offset, u32 bit, in usb4_switch_wait_for_bit() argument 62 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, offset, 1); in usb4_switch_wait_for_bit() 75 static int usb4_native_switch_op(struct tb_switch *sw, u16 opcode, in usb4_native_switch_op() argument 84 ret = tb_sw_write(sw, metadata, TB_CFG_SWITCH, ROUTER_CS_25, 1); in usb4_native_switch_op() 89 ret = tb_sw_write(sw, tx_data, TB_CFG_SWITCH, ROUTER_CS_9, in usb4_native_switch_op() 96 ret = tb_sw_write(sw, &val, TB_CFG_SWITCH, ROUTER_CS_26, 1); in usb4_native_switch_op() 100 ret = usb4_switch_wait_for_bit(sw, ROUTER_CS_26, ROUTER_CS_26_OV, 0, 500); in usb4_native_switch_op() 104 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, ROUTER_CS_26, 1); in usb4_native_switch_op() 116 ret = tb_sw_read(sw, metadata, TB_CFG_SWITCH, ROUTER_CS_25, 1); in usb4_native_switch_op() 121 ret = tb_sw_read(sw, rx_data, TB_CFG_SWITCH, ROUTER_CS_9, in usb4_native_switch_op() [all …]
|
D | debugfs.c | 123 static ssize_t regs_write(struct tb_switch *sw, struct tb_port *port, in regs_write() argument 127 struct tb *tb = sw->tb; in regs_write() 136 pm_runtime_get_sync(&sw->dev); in regs_write() 151 ret = tb_sw_write(sw, &val, TB_CFG_SWITCH, offset, 1); in regs_write() 159 pm_runtime_mark_last_busy(&sw->dev); in regs_write() 160 pm_runtime_put_autosuspend(&sw->dev); in regs_write() 172 return regs_write(port->sw, port, user_buf, count, ppos); in port_regs_write() 179 struct tb_switch *sw = s->private; in switch_regs_write() local 181 return regs_write(sw, NULL, user_buf, count, ppos); in switch_regs_write() 212 struct tb_switch *sw = port->sw; in counters_write() local [all …]
|
D | test.c | 39 struct tb_switch *sw; in alloc_switch() local 43 sw = kunit_kzalloc(test, sizeof(*sw), GFP_KERNEL); in alloc_switch() 44 if (!sw) in alloc_switch() 47 sw->config.upstream_port_number = upstream_port; in alloc_switch() 48 sw->config.depth = tb_route_length(route); in alloc_switch() 49 sw->config.route_hi = upper_32_bits(route); in alloc_switch() 50 sw->config.route_lo = lower_32_bits(route); in alloc_switch() 51 sw->config.enabled = 0; in alloc_switch() 52 sw->config.max_port_number = max_port_number; in alloc_switch() 54 size = (sw->config.max_port_number + 1) * sizeof(*sw->ports); in alloc_switch() [all …]
|
D | cap.c | 20 struct tb_switch *sw = port->sw; in tb_port_enable_tmu() local 28 if (tb_switch_is_light_ridge(sw)) in tb_port_enable_tmu() 30 else if (tb_switch_is_eagle_ridge(sw)) in tb_port_enable_tmu() 35 ret = tb_sw_read(sw, &value, TB_CFG_SWITCH, offset, 1); in tb_port_enable_tmu() 44 return tb_sw_write(sw, &value, TB_CFG_SWITCH, offset, 1); in tb_port_enable_tmu() 55 if (tb_switch_is_light_ridge(port->sw)) { in tb_port_dummy_read() 145 int tb_switch_next_cap(struct tb_switch *sw, unsigned int offset) in tb_switch_next_cap() argument 151 return sw->config.first_cap_offset; in tb_switch_next_cap() 153 ret = tb_sw_read(sw, &header, TB_CFG_SWITCH, offset, 2); in tb_switch_next_cap() 170 tb_sw_dbg(sw, "unknown capability %#x at %#x\n", in tb_switch_next_cap() [all …]
|
/Linux-v5.15/drivers/usb/roles/ |
D | class.c | 42 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument 46 if (IS_ERR_OR_NULL(sw)) in usb_role_switch_set_role() 49 mutex_lock(&sw->lock); in usb_role_switch_set_role() 51 ret = sw->set(sw, role); in usb_role_switch_set_role() 53 sw->role = role; in usb_role_switch_set_role() 54 kobject_uevent(&sw->dev.kobj, KOBJ_CHANGE); in usb_role_switch_set_role() 57 mutex_unlock(&sw->lock); in usb_role_switch_set_role() 70 enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw) in usb_role_switch_get_role() argument 74 if (IS_ERR_OR_NULL(sw)) in usb_role_switch_get_role() 77 mutex_lock(&sw->lock); in usb_role_switch_get_role() [all …]
|
/Linux-v5.15/drivers/net/ethernet/marvell/prestera/ |
D | prestera_main.c | 54 struct prestera_port *prestera_port_find_by_hwid(struct prestera_switch *sw, in prestera_port_find_by_hwid() argument 59 read_lock(&sw->port_list_lock); in prestera_port_find_by_hwid() 60 list_for_each_entry(port, &sw->port_list, list) { in prestera_port_find_by_hwid() 64 read_unlock(&sw->port_list_lock); in prestera_port_find_by_hwid() 69 struct prestera_port *prestera_find_port(struct prestera_switch *sw, u32 id) in prestera_find_port() argument 73 read_lock(&sw->port_list_lock); in prestera_find_port() 74 list_for_each_entry(port, &sw->port_list, list) { in prestera_find_port() 78 read_unlock(&sw->port_list_lock); in prestera_find_port() 120 if (memcmp(port->sw->base_mac, addr, ETH_ALEN - 1)) in prestera_is_valid_mac_addr() 277 write_lock(&port->sw->port_list_lock); in prestera_port_list_add() [all …]
|
D | prestera_hw.c | 469 static int __prestera_cmd_ret(struct prestera_switch *sw, in __prestera_cmd_ret() argument 475 struct prestera_device *dev = sw->dev; in __prestera_cmd_ret() 492 static int prestera_cmd_ret(struct prestera_switch *sw, in prestera_cmd_ret() argument 497 return __prestera_cmd_ret(sw, type, cmd, clen, ret, rlen, 0); in prestera_cmd_ret() 500 static int prestera_cmd_ret_wait(struct prestera_switch *sw, in prestera_cmd_ret_wait() argument 506 return __prestera_cmd_ret(sw, type, cmd, clen, ret, rlen, waitms); in prestera_cmd_ret_wait() 509 static int prestera_cmd(struct prestera_switch *sw, in prestera_cmd() argument 515 return prestera_cmd_ret(sw, type, cmd, clen, &resp.ret, sizeof(resp)); in prestera_cmd() 563 __find_event_handler(const struct prestera_switch *sw, in __find_event_handler() argument 568 list_for_each_entry_rcu(eh, &sw->event_handlers, list) { in __find_event_handler() [all …]
|
D | prestera_hw.h | 106 (struct prestera_switch *sw, struct prestera_event *evt, void *arg); 111 int prestera_hw_switch_init(struct prestera_switch *sw); 112 void prestera_hw_switch_fini(struct prestera_switch *sw); 113 int prestera_hw_switch_ageing_set(struct prestera_switch *sw, u32 ageing_ms); 114 int prestera_hw_switch_mac_set(struct prestera_switch *sw, const char *mac); 152 int prestera_hw_vlan_create(struct prestera_switch *sw, u16 vid); 153 int prestera_hw_vlan_delete(struct prestera_switch *sw, u16 vid); 165 int prestera_hw_fdb_flush_vlan(struct prestera_switch *sw, u16 vid, u32 mode); 170 int prestera_hw_bridge_create(struct prestera_switch *sw, u16 *bridge_id); 171 int prestera_hw_bridge_delete(struct prestera_switch *sw, u16 bridge_id); [all …]
|
D | prestera_devlink.c | 127 struct prestera_switch *sw; member 348 static void prestera_devlink_traps_fini(struct prestera_switch *sw); 358 struct prestera_switch *sw = devlink_priv(dl); in prestera_dl_info_get() local 367 sw->dev->fw_rev.maj, in prestera_dl_info_get() 368 sw->dev->fw_rev.min, in prestera_dl_info_get() 369 sw->dev->fw_rev.sub); in prestera_dl_info_get() 384 static int prestera_devlink_traps_register(struct prestera_switch *sw); 403 void prestera_devlink_free(struct prestera_switch *sw) in prestera_devlink_free() argument 405 struct devlink *dl = priv_to_devlink(sw); in prestera_devlink_free() 410 int prestera_devlink_register(struct prestera_switch *sw) in prestera_devlink_register() argument [all …]
|
/Linux-v5.15/drivers/input/joystick/ |
D | sidewinder.c | 98 struct sw { struct 199 #define GB(pos,num) sw_get_bits(buf, pos, num, sw->bits) 285 static int sw_parse(unsigned char *buf, struct sw *sw) in sw_parse() argument 290 switch (sw->type) { in sw_parse() 297 dev = sw->dev[0]; in sw_parse() 319 for (i = 0; i < sw->number; i ++) { in sw_parse() 324 input_report_abs(sw->dev[i], ABS_X, GB(i*15+3,1) - GB(i*15+2,1)); in sw_parse() 325 input_report_abs(sw->dev[i], ABS_Y, GB(i*15+0,1) - GB(i*15+1,1)); in sw_parse() 328 input_report_key(sw->dev[i], sw_btn[SW_ID_GP][j], !GB(i*15+j+4,1)); in sw_parse() 330 input_sync(sw->dev[i]); in sw_parse() [all …]
|
/Linux-v5.15/arch/mips/alchemy/common/ |
D | sleeper.S | 25 sw $1, PT_R1(sp) 26 sw $2, PT_R2(sp) 27 sw $3, PT_R3(sp) 28 sw $4, PT_R4(sp) 29 sw $5, PT_R5(sp) 30 sw $6, PT_R6(sp) 31 sw $7, PT_R7(sp) 32 sw $16, PT_R16(sp) 33 sw $17, PT_R17(sp) 34 sw $18, PT_R18(sp) [all …]
|
/Linux-v5.15/drivers/input/misc/ |
D | ad714x.c | 216 struct ad714x_button_drv *sw = &ad714x->sw->button[idx]; in ad714x_button_state_machine() local 218 switch (sw->state) { in ad714x_button_state_machine() 223 input_report_key(sw->input, hw->keycode, 1); in ad714x_button_state_machine() 224 input_sync(sw->input); in ad714x_button_state_machine() 225 sw->state = ACTIVE; in ad714x_button_state_machine() 233 input_report_key(sw->input, hw->keycode, 0); in ad714x_button_state_machine() 234 input_sync(sw->input); in ad714x_button_state_machine() 235 sw->state = IDLE; in ad714x_button_state_machine() 269 struct ad714x_slider_drv *sw = &ad714x->sw->slider[idx]; in ad714x_slider_cal_highest_stage() local 271 sw->highest_stage = ad714x_cal_highest_stage(ad714x, hw->start_stage, in ad714x_slider_cal_highest_stage() [all …]
|
/Linux-v5.15/drivers/usb/typec/ |
D | mux.c | 66 struct typec_switch *sw; in fwnode_typec_switch_get() local 68 sw = fwnode_connection_find_match(fwnode, "orientation-switch", NULL, in fwnode_typec_switch_get() 70 if (!IS_ERR_OR_NULL(sw)) in fwnode_typec_switch_get() 71 WARN_ON(!try_module_get(sw->dev.parent->driver->owner)); in fwnode_typec_switch_get() 73 return sw; in fwnode_typec_switch_get() 83 void typec_switch_put(struct typec_switch *sw) in typec_switch_put() argument 85 if (!IS_ERR_OR_NULL(sw)) { in typec_switch_put() 86 module_put(sw->dev.parent->driver->owner); in typec_switch_put() 87 put_device(&sw->dev); in typec_switch_put() 116 struct typec_switch *sw; in typec_switch_register() local [all …]
|
/Linux-v5.15/arch/alpha/include/uapi/asm/ |
D | fpu.h | 93 ieee_swcr_to_fpcr(unsigned long sw) in ieee_swcr_to_fpcr() argument 96 fp = (sw & IEEE_STATUS_MASK) << 35; in ieee_swcr_to_fpcr() 97 fp |= (sw & IEEE_MAP_DMZ) << 36; in ieee_swcr_to_fpcr() 98 fp |= (sw & IEEE_STATUS_MASK ? FPCR_SUM : 0); in ieee_swcr_to_fpcr() 99 fp |= (~sw & (IEEE_TRAP_ENABLE_INV in ieee_swcr_to_fpcr() 102 fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57; in ieee_swcr_to_fpcr() 103 fp |= (sw & IEEE_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0); in ieee_swcr_to_fpcr() 104 fp |= (~sw & IEEE_TRAP_ENABLE_DNO) << 41; in ieee_swcr_to_fpcr() 111 unsigned long sw; in ieee_fpcr_to_swcr() local 112 sw = (fp >> 35) & IEEE_STATUS_MASK; in ieee_fpcr_to_swcr() [all …]
|
/Linux-v5.15/drivers/gpu/drm/nouveau/nvkm/engine/sw/ |
D | base.c | 30 nvkm_sw_mthd(struct nvkm_sw *sw, int chid, int subc, u32 mthd, u32 data) in nvkm_sw_mthd() argument 36 spin_lock_irqsave(&sw->engine.lock, flags); in nvkm_sw_mthd() 37 list_for_each_entry(chan, &sw->chan, head) { in nvkm_sw_mthd() 41 list_add(&chan->head, &sw->chan); in nvkm_sw_mthd() 45 spin_unlock_irqrestore(&sw->engine.lock, flags); in nvkm_sw_mthd() 61 struct nvkm_sw *sw = nvkm_sw(oclass->engine); in nvkm_sw_oclass_get() local 64 while (sw->func->sclass[c].ctor) { in nvkm_sw_oclass_get() 66 oclass->engn = &sw->func->sclass[index]; in nvkm_sw_oclass_get() 67 oclass->base = sw->func->sclass[index].base; in nvkm_sw_oclass_get() 81 struct nvkm_sw *sw = nvkm_sw(oclass->engine); in nvkm_sw_cclass_get() local [all …]
|
/Linux-v5.15/arch/openrisc/kernel/ |
D | entry.S | 46 l.sw -8(r1),r2 /* store frame pointer */ ;\ 47 l.sw -4(r1),r9 /* store return address */ ;\ 59 l.sw -12(r1),t1 /* save extra reg */ ;\ 60 l.sw -8(r1),r2 /* store frame pointer */ ;\ 61 l.sw -4(r1),r9 /* store return address */ ;\ 147 l.sw PT_GPR2(r1),r2 ;\ 148 l.sw PT_GPR3(r1),r3 ;\ 150 l.sw PT_GPR5(r1),r5 ;\ 151 l.sw PT_GPR6(r1),r6 ;\ 152 l.sw PT_GPR7(r1),r7 ;\ [all …]
|
/Linux-v5.15/include/linux/usb/ |
D | role.h | 16 typedef int (*usb_role_switch_set_t)(struct usb_role_switch *sw, 18 typedef enum usb_role (*usb_role_switch_get_t)(struct usb_role_switch *sw); 52 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role); 53 enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw); 56 void usb_role_switch_put(struct usb_role_switch *sw); 64 void usb_role_switch_unregister(struct usb_role_switch *sw); 66 void usb_role_switch_set_drvdata(struct usb_role_switch *sw, void *data); 67 void *usb_role_switch_get_drvdata(struct usb_role_switch *sw); 70 static inline int usb_role_switch_set_role(struct usb_role_switch *sw, in usb_role_switch_set_role() argument 76 static inline enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw) in usb_role_switch_get_role() argument [all …]
|