/linux/drivers/thunderbolt/ |
A D | switch.c | 890 if (prev->sw == end->sw) { in tb_next_port_on_path() 1508 if (sw && sw->authorized) { in disapprove_switch() 2138 sw = kzalloc(sizeof(*sw), GFP_KERNEL); in tb_switch_alloc() 2166 sw->ports = kcalloc(sw->config.max_port_number + 1, sizeof(*sw->ports), in tb_switch_alloc() 2175 sw->ports[i].sw = sw; in tb_switch_alloc() 2232 sw = kzalloc(sizeof(*sw), GFP_KERNEL); in tb_switch_alloc_safe_mode() 2407 sw->dma_port = dma_port_alloc(sw); in tb_switch_add_dma_port() 2730 tb_sw_dbg(sw, "uid: %#llx\n", sw->uid); in tb_switch_add() 2771 sw->vendor, sw->device); in tb_switch_add() 2772 if (sw->vendor_name && sw->device_name) in tb_switch_add() [all …]
|
A D | eeprom.c | 20 return tb_sw_write(sw, ctl, TB_CFG_SWITCH, sw->cap_plug_events + 4, 1); in tb_eeprom_ctl_write() 146 res = tb_sw_read(sw, &cap, TB_CFG_SWITCH, sw->cap_plug_events, in tb_eeprom_get_drom_offset() 349 if (!sw->vendor && !sw->device) { in tb_drom_parse_entry_generic() 507 tb_drom_read_uid_only(sw, &sw->uid); in tb_drom_copy_nvm() 530 ret = usb4_switch_drom_read(sw, 0, sw->drom, *size); in usb4_copy_host_drom() 560 if (!sw->uid) in tb_drom_parse() 608 if (sw->drom) in tb_drom_read() 628 usb4_switch_read_uid(sw, &sw->uid); in tb_drom_read() 637 tb_drom_read_uid_only(sw, &sw->uid); in tb_drom_read() 657 res = tb_drom_read_n(sw, 0, sw->drom, size); in tb_drom_read() [all …]
|
A D | tmu.c | 18 switch (sw->tmu.rate) { in tb_switch_tmu_mode_name() 26 if (sw->tmu.unidirectional) in tb_switch_tmu_mode_name() 168 sw->tmu.cap = ret; in tb_switch_tmu_init() 182 sw->tmu.rate = ret; in tb_switch_tmu_init() 184 sw->tmu.has_ucap = tb_switch_tmu_ucap_supported(sw); in tb_switch_tmu_init() 185 if (sw->tmu.has_ucap) { in tb_switch_tmu_init() 188 if (tb_route(sw)) { in tb_switch_tmu_init() 198 tb_sw_dbg(sw, "TMU: current mode: %s\n", tb_switch_tmu_mode_name(sw)); in tb_switch_tmu_init() 216 if (!tb_route(sw)) in tb_switch_tmu_post_time() 354 if (tb_route(sw) && sw->tmu.unidirectional) { in tb_switch_tmu_enable() [all …]
|
A D | lc.c | 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() 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 51 struct tb_switch *sw = port->sw; in tb_lc_set_port_configured() local 55 if (sw->generation < 2) in tb_lc_set_port_configured() 109 struct tb_switch *sw = port->sw; in tb_lc_set_xdomain_configured() local 173 struct tb_switch *sw = port->sw; in tb_lc_start_lane_initialization() local 177 if (!tb_route(sw)) in tb_lc_start_lane_initialization() [all …]
|
A D | tb.h | 231 struct tb_switch *sw; member 488 return &sw->ports[sw->config.upstream_port_number]; in tb_upstream_port() 506 return ((u64) sw->config.route_hi) << 32 | sw->config.route_lo; in tb_route() 580 if (sw->is_unplugged) in tb_sw_read() 584 tb_route(sw), in tb_sw_read() 594 if (sw->is_unplugged) in tb_sw_write() 598 tb_route(sw), in tb_sw_write() 648 #define tb_sw_dbg(sw, fmt, arg...) __TB_SW_PRINT(tb_dbg, sw, fmt, ##arg) argument 760 (p) <= &(sw)->ports[(sw)->config.max_port_number]; (p)++) 764 if (sw) in tb_switch_get() [all …]
|
A D | tb.c | 101 if (port->sw == sw) { in tb_remove_dp_resources() 184 struct tb_switch *sw = port->sw; in tb_scan_xdomain() local 288 if (dst_port->sw->config.depth > src_port->sw->config.depth) in tb_find_first_usb3_tunnel() 289 sw = dst_port->sw; in tb_find_first_usb3_tunnel() 291 sw = src_port->sw; in tb_find_first_usb3_tunnel() 531 ret = tb_tunnel_usb3(sw->tb, sw); in tb_create_usb3_tunnels() 601 sw = tb_switch_alloc(port->sw->tb, &port->sw->dev, in tb_scan_port() 609 if (PTR_ERR(sw) == -EIO || PTR_ERR(sw) == -EADDRNOTAVAIL) in tb_scan_port() 641 sw->rpm = sw->generation > 1; in tb_scan_port() 674 if (tcm->hotplug_active && tb_tunnel_usb3(sw->tb, sw)) in tb_scan_port() [all …]
|
A D | icm.c | 442 *route = get_route(sw->route_hi, sw->route_lo); in icm_fr_get_route() 628 return sw; in alloc_switch() 755 if (sw) { in icm_fr_device_connected() 810 if (!sw) { in icm_fr_device_connected() 817 if (sw) { in icm_fr_device_connected() 887 if (!sw) { in icm_fr_device_disconnected() 972 if (sw) { in icm_fr_xdomain_connected() 1236 if (sw) { in __icm_tr_device_connected() 1252 if (sw) { in __icm_tr_device_connected() 1365 if (sw) { in icm_tr_xdomain_connected() [all …]
|
A D | usb4.c | 187 if (tb_route(sw)) { in usb4_switch_check_wakes() 251 usb4_switch_check_wakes(sw); in usb4_switch_setup() 253 if (!tb_route(sw)) in usb4_switch_setup() 263 tb_sw_dbg(sw, "link: %s\n", sw->link_usb4 ? "USB4" : "TBT"); in usb4_switch_setup() 326 struct tb_switch *sw = data; in usb4_switch_drom_read_block() local 374 up = tb_upstream_port(sw); in usb4_switch_lane_bonding_possible() 392 u64 route = tb_route(sw); in usb4_switch_set_wake() 515 struct tb_switch *sw = data; in usb4_switch_nvm_read_block() local 581 struct tb_switch *sw = data; in usb4_switch_nvm_write_next_block() local 1010 if (tb_switch_is_icm(sw) || !tb_switch_is_usb4(sw)) in usb4_switch_add_ports() [all …]
|
A D | debugfs.c | 127 struct tb *tb = sw->tb; in regs_write() 212 struct tb_switch *sw = port->sw; in counters_write() local 409 struct tb_switch *sw = port->sw; in port_regs_show() local 410 struct tb *tb = sw->tb; in port_regs_show() 496 if (tb_switch_is_usb4(sw)) in switch_basic_regs_show() 514 struct tb *tb = sw->tb; in switch_regs_show() 530 switch_caps_show(sw, s); in switch_regs_show() 565 struct tb_switch *sw = port->sw; in path_show() local 566 struct tb *tb = sw->tb; in path_show() 628 struct tb_switch *sw = port->sw; in counters_show() local [all …]
|
A 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 59 if (q->vendor && q->vendor != sw->vendor) in tb_check_quirks() 61 if (q->device && q->device != sw->device) in tb_check_quirks() [all …]
|
A D | test.c | 43 sw = kunit_kzalloc(test, sizeof(*sw), GFP_KERNEL); in alloc_switch() 44 if (!sw) in alloc_switch() 60 sw->ports[i].sw = sw; in alloc_switch() 77 if (!sw) in alloc_host() 92 sw->ports[1].dual_link_port = &sw->ports[2]; in alloc_host() 99 sw->ports[2].dual_link_port = &sw->ports[1]; in alloc_host() 107 sw->ports[3].dual_link_port = &sw->ports[4]; in alloc_host() 114 sw->ports[4].dual_link_port = &sw->ports[3]; in alloc_host() 196 sw->ports[1].dual_link_port = &sw->ports[2]; in alloc_dev_default() 203 sw->ports[2].dual_link_port = &sw->ports[1]; in alloc_dev_default() [all …]
|
A D | dma_port.c | 181 ret = dma_port_read(sw->tb->ctl, &type, tb_route(sw), ports[i], in dma_find_port() 220 dma->sw = sw; in dma_port_alloc() 243 struct tb_switch *sw = dma->sw; in dma_port_wait_for_completion() local 249 ret = dma_port_read(sw->tb->ctl, &in, tb_route(sw), dma->port, in dma_port_wait_for_completion() 281 struct tb_switch *sw = dma->sw; in dma_port_request() local 285 ret = dma_port_write(sw->tb->ctl, &in, tb_route(sw), dma->port, in dma_port_request() 294 ret = dma_port_read(sw->tb->ctl, &out, tb_route(sw), dma->port, in dma_port_request() 306 struct tb_switch *sw = dma->sw; in dma_port_flash_read_block() local 320 return dma_port_read(sw->tb->ctl, buf, tb_route(sw), dma->port, in dma_port_flash_read_block() 328 struct tb_switch *sw = dma->sw; in dma_port_flash_write_block() local [all …]
|
A 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() 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() 196 offset = tb_switch_next_cap(sw, offset); in tb_switch_find_cap() [all …]
|
/linux/drivers/usb/roles/ |
A D | class.c | 51 ret = sw->set(sw, role); in usb_role_switch_set_role() 79 if (sw->get) in usb_role_switch_get_role() 80 role = sw->get(sw); in usb_role_switch_get_role() 128 if (!sw) in usb_role_switch_get() 135 return sw; in usb_role_switch_get() 151 if (!sw) in fwnode_usb_role_switch_get() 157 return sw; in fwnode_usb_role_switch_get() 290 kfree(sw); in usb_role_switch_release() 324 sw = kzalloc(sizeof(*sw), GFP_KERNEL); in usb_role_switch_register() 325 if (!sw) in usb_role_switch_register() [all …]
|
/linux/drivers/input/joystick/ |
A D | sidewinder.c | 98 struct sw { struct 409 static int sw_read(struct sw *sw) in sw_read() argument 440 sw->ok++; in sw_read() 486 struct sw *sw = gameport_get_drvdata(gameport); in sw_poll() local 495 struct sw *sw = input_get_drvdata(dev); in sw_open() local 503 struct sw *sw = input_get_drvdata(dev); in sw_close() local 572 struct sw *sw; in sw_connect() local 583 sw = kzalloc(sizeof(struct sw), GFP_KERNEL); in sw_connect() 726 snprintf(sw->name, sizeof(sw->name), in sw_connect() 728 snprintf(sw->phys[i], sizeof(sw->phys[i]), in sw_connect() [all …]
|
/linux/drivers/net/ethernet/marvell/prestera/ |
A D | prestera_main.c | 337 port->sw = sw; in prestera_port_create() 557 return prestera_hw_switch_mac_set(sw, sw->base_mac); in prestera_switch_set_base_mac_addr() 562 return id < sw->lag_max ? &sw->lags[id] : NULL; in prestera_lag_by_id() 610 struct prestera_switch *sw = port->sw; in prestera_lag_port_add() local 640 struct prestera_switch *sw = port->sw; in prestera_lag_port_del() local 683 sw->lags = kcalloc(sw->lag_max, sizeof(*sw->lags), GFP_KERNEL); in prestera_lag_init() 684 if (!sw->lags) in prestera_lag_init() 700 kfree(sw->lags); in prestera_lag_fini() 981 if (!sw) in prestera_device_register() 984 dev->priv = sw; in prestera_device_register() [all …]
|
A D | prestera_hw.h | 128 int prestera_hw_switch_init(struct prestera_switch *sw); 129 void prestera_hw_switch_fini(struct prestera_switch *sw); 166 int prestera_hw_vlan_create(struct prestera_switch *sw, u16 vid); 167 int prestera_hw_vlan_delete(struct prestera_switch *sw, u16 vid); 190 int prestera_hw_acl_ruleset_create(struct prestera_switch *sw, 192 int prestera_hw_acl_ruleset_del(struct prestera_switch *sw, 194 int prestera_hw_acl_rule_add(struct prestera_switch *sw, 198 int prestera_hw_acl_rule_stats_get(struct prestera_switch *sw, 212 int prestera_hw_event_handler_register(struct prestera_switch *sw, 221 int prestera_hw_rxtx_init(struct prestera_switch *sw, [all …]
|
/linux/drivers/input/misc/ |
A D | ad714x.c | 317 sw->flt_pos = (sw->flt_pos * (10 - 4) + in ad714x_slider_cal_flt_pos() 367 sw->flt_pos = sw->abs_pos; in ad714x_slider_state_machine() 412 sw->pre_highest_stage = sw->highest_stage; in ad714x_wheel_cal_highest_stage() 488 sw->flt_pos = sw->abs_pos; in ad714x_wheel_cal_flt_pos() 490 sw->flt_pos = ((sw->flt_pos * 30) + (sw->abs_pos * 71)) / 100; in ad714x_wheel_cal_flt_pos() 539 sw->flt_pos = sw->abs_pos; in ad714x_wheel_state_machine() 665 sw->x_abs_pos, sw->y_abs_pos); in touchpad_cal_abs_pos() 678 idx, sw->x_flt_pos, sw->y_flt_pos); in touchpad_cal_flt_pos() 773 return sw->left_ep || sw->right_ep || sw->top_ep || sw->bottom_ep; in touchpad_check_endpoint() 828 sw->x_flt_pos = sw->x_abs_pos; in ad714x_touchpad_state_machine() [all …]
|
/linux/arch/mips/alchemy/common/ |
A 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) 46 sw k0, 0x20(sp) 48 sw k0, 0x1c(sp) 50 sw k0, 0x18(sp) [all …]
|
/linux/drivers/usb/typec/ |
A D | mux.c | 66 struct typec_switch *sw; in fwnode_typec_switch_get() local 70 if (!IS_ERR_OR_NULL(sw)) in fwnode_typec_switch_get() 73 return sw; in fwnode_typec_switch_get() 87 put_device(&sw->dev); in typec_switch_put() 122 sw = kzalloc(sizeof(*sw), GFP_KERNEL); in typec_switch_register() 123 if (!sw) in typec_switch_register() 126 sw->set = desc->set; in typec_switch_register() 140 put_device(&sw->dev); in typec_switch_register() 144 return sw; in typec_switch_register() 151 if (IS_ERR_OR_NULL(sw)) in typec_switch_set() [all …]
|
/linux/arch/openrisc/kernel/ |
A D | entry.S | 232 l.sw 0(reg),r0 430 l.sw PT_PC(r1),r5 443 l.bf sw 457 l.sw 0(r4),r5 467 l.sw 0(r4),r5 483 l.sw 0(r4),r5 499 l.sw 0(r4),r5 511 sw: 554 l.sw 0x0(r1),r3 1210 l.sw 0(r4),r27 [all …]
|
/linux/drivers/gpu/drm/nouveau/nvkm/engine/sw/ |
A D | base.c | 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() 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() 82 return sw->func->chan_new(sw, fifoch, oclass, pobject); in nvkm_sw_cclass_get() 102 struct nvkm_sw *sw; in nvkm_sw_new_() local 104 if (!(sw = *psw = kzalloc(sizeof(*sw), GFP_KERNEL))) in nvkm_sw_new_() 106 INIT_LIST_HEAD(&sw->chan); in nvkm_sw_new_() [all …]
|
/linux/arch/alpha/include/uapi/asm/ |
A 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() 99 fp |= (~sw & (IEEE_TRAP_ENABLE_INV 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() 113 sw |= (fp >> 36) & IEEE_MAP_DMZ; in ieee_fpcr_to_swcr() 114 sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV in ieee_fpcr_to_swcr() 118 sw |= (fp >> 47) & IEEE_MAP_UMZ; in ieee_fpcr_to_swcr() [all …]
|
/linux/drivers/block/ |
A D | swim3.c | 291 out_8(&sw->select, sw->select | LSTRB); in swim3_action() 293 out_8(&sw->select, sw->select & ~LSTRB); in swim3_action() 379 in_8(&sw->error); in scan_track() 392 sw->nseek = n; in seek_track() 395 sw->nseek = -n; in seek_track() 399 in_8(&sw->error); in seek_track() 476 in_8(&sw->error); in setup_transfer() 480 in_8(&sw->intr); in setup_transfer() 1042 sw = fs->swim3; in floppy_revalidate() 1091 sw = fs->swim3; in swim3_mb_event() [all …]
|
/linux/include/linux/usb/ |
A 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); 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 92 static inline void usb_role_switch_put(struct usb_role_switch *sw) { } in usb_role_switch_put() argument 104 usb_role_switch_set_drvdata(struct usb_role_switch *sw, void *data) in usb_role_switch_set_drvdata() argument [all …]
|