Lines Matching refs:tb_switch
171 struct tb_switch { struct
270 struct tb_switch *sw;
497 int (*runtime_suspend_switch)(struct tb_switch *sw);
498 int (*runtime_resume_switch)(struct tb_switch *sw);
503 int (*disapprove_switch)(struct tb *tb, struct tb_switch *sw);
504 int (*approve_switch)(struct tb *tb, struct tb_switch *sw);
505 int (*add_switch_key)(struct tb *tb, struct tb_switch *sw);
506 int (*challenge_switch_key)(struct tb *tb, struct tb_switch *sw,
515 int (*usb4_switch_op)(struct tb_switch *sw, u16 opcode, u32 *metadata,
518 int (*usb4_switch_nvm_authenticate_status)(struct tb_switch *sw,
541 static inline struct tb_port *tb_upstream_port(struct tb_switch *sw) in tb_upstream_port()
559 static inline u64 tb_route(const struct tb_switch *sw) in tb_route()
564 static inline struct tb_port *tb_port_at(u64 route, struct tb_switch *sw) in tb_port_at()
632 static inline int tb_sw_read(struct tb_switch *sw, void *buffer, in tb_sw_read()
646 static inline int tb_sw_write(struct tb_switch *sw, const void *buffer, in tb_sw_write()
696 const struct tb_switch *__sw = (sw); \
744 int tb_domain_disapprove_switch(struct tb *tb, struct tb_switch *sw);
745 int tb_domain_approve_switch(struct tb *tb, struct tb_switch *sw);
746 int tb_domain_approve_switch_key(struct tb *tb, struct tb_switch *sw);
747 int tb_domain_challenge_switch_key(struct tb *tb, struct tb_switch *sw);
790 int tb_switch_nvm_read(struct tb_switch *sw, unsigned int address, void *buf,
792 struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent,
794 struct tb_switch *tb_switch_alloc_safe_mode(struct tb *tb,
796 int tb_switch_configure(struct tb_switch *sw);
797 int tb_switch_configuration_valid(struct tb_switch *sw);
798 int tb_switch_add(struct tb_switch *sw);
799 void tb_switch_remove(struct tb_switch *sw);
800 void tb_switch_suspend(struct tb_switch *sw, bool runtime);
801 int tb_switch_resume(struct tb_switch *sw);
802 int tb_switch_reset(struct tb_switch *sw);
803 int tb_switch_wait_for_bit(struct tb_switch *sw, u32 offset, u32 bit,
805 void tb_sw_set_unplugged(struct tb_switch *sw);
806 struct tb_port *tb_switch_find_port(struct tb_switch *sw,
808 struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link,
810 struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid);
811 struct tb_switch *tb_switch_find_by_route(struct tb *tb, u64 route);
824 static inline struct tb_switch *tb_switch_get(struct tb_switch *sw) in tb_switch_get()
831 static inline void tb_switch_put(struct tb_switch *sw) in tb_switch_put()
841 static inline struct tb_switch *tb_to_switch(const struct device *dev) in tb_to_switch()
844 return container_of(dev, struct tb_switch, dev); in tb_to_switch()
848 static inline struct tb_switch *tb_switch_parent(struct tb_switch *sw) in tb_switch_parent()
860 static inline struct tb_port *tb_switch_downstream_port(struct tb_switch *sw) in tb_switch_downstream_port()
867 static inline bool tb_switch_is_light_ridge(const struct tb_switch *sw) in tb_switch_is_light_ridge()
873 static inline bool tb_switch_is_eagle_ridge(const struct tb_switch *sw) in tb_switch_is_eagle_ridge()
879 static inline bool tb_switch_is_cactus_ridge(const struct tb_switch *sw) in tb_switch_is_cactus_ridge()
891 static inline bool tb_switch_is_falcon_ridge(const struct tb_switch *sw) in tb_switch_is_falcon_ridge()
903 static inline bool tb_switch_is_alpine_ridge(const struct tb_switch *sw) in tb_switch_is_alpine_ridge()
918 static inline bool tb_switch_is_titan_ridge(const struct tb_switch *sw) in tb_switch_is_titan_ridge()
931 static inline bool tb_switch_is_tiger_lake(const struct tb_switch *sw) in tb_switch_is_tiger_lake()
954 static inline bool tb_switch_is_icm(const struct tb_switch *sw) in tb_switch_is_icm()
959 int tb_switch_lane_bonding_enable(struct tb_switch *sw);
960 void tb_switch_lane_bonding_disable(struct tb_switch *sw);
961 int tb_switch_configure_link(struct tb_switch *sw);
962 void tb_switch_unconfigure_link(struct tb_switch *sw);
964 bool tb_switch_query_dp_resource(struct tb_switch *sw, struct tb_port *in);
965 int tb_switch_alloc_dp_resource(struct tb_switch *sw, struct tb_port *in);
966 void tb_switch_dealloc_dp_resource(struct tb_switch *sw, struct tb_port *in);
968 int tb_switch_tmu_init(struct tb_switch *sw);
969 int tb_switch_tmu_post_time(struct tb_switch *sw);
970 int tb_switch_tmu_disable(struct tb_switch *sw);
971 int tb_switch_tmu_enable(struct tb_switch *sw);
972 int tb_switch_tmu_configure(struct tb_switch *sw, enum tb_switch_tmu_mode mode);
982 static inline bool tb_switch_tmu_is_configured(const struct tb_switch *sw, in tb_switch_tmu_is_configured()
995 static inline bool tb_switch_tmu_is_enabled(const struct tb_switch *sw) in tb_switch_tmu_is_enabled()
1003 int tb_switch_clx_init(struct tb_switch *sw);
1004 bool tb_switch_clx_is_supported(const struct tb_switch *sw);
1005 int tb_switch_clx_enable(struct tb_switch *sw, unsigned int clx);
1006 int tb_switch_clx_disable(struct tb_switch *sw);
1018 static inline bool tb_switch_clx_is_enabled(const struct tb_switch *sw, in tb_switch_clx_is_enabled()
1024 int tb_switch_pcie_l1_enable(struct tb_switch *sw);
1026 int tb_switch_xhci_connect(struct tb_switch *sw);
1027 void tb_switch_xhci_disconnect(struct tb_switch *sw);
1069 int tb_switch_find_vse_cap(struct tb_switch *sw, enum tb_switch_vse_cap vsec);
1070 int tb_switch_find_cap(struct tb_switch *sw, enum tb_switch_cap cap);
1071 int tb_switch_next_cap(struct tb_switch *sw, unsigned int offset);
1114 int tb_drom_read(struct tb_switch *sw);
1115 int tb_drom_read_uid_only(struct tb_switch *sw, u64 *uid);
1117 int tb_lc_read_uuid(struct tb_switch *sw, u32 *uuid);
1128 int tb_lc_set_wake(struct tb_switch *sw, unsigned int flags);
1129 int tb_lc_set_sleep(struct tb_switch *sw);
1130 bool tb_lc_lane_bonding_possible(struct tb_switch *sw);
1131 bool tb_lc_dp_sink_query(struct tb_switch *sw, struct tb_port *in);
1132 int tb_lc_dp_sink_alloc(struct tb_switch *sw, struct tb_port *in);
1133 int tb_lc_dp_sink_dealloc(struct tb_switch *sw, struct tb_port *in);
1134 int tb_lc_force_power(struct tb_switch *sw);
1165 static inline struct tb_switch *tb_xdomain_parent(struct tb_xdomain *xd) in tb_xdomain_parent()
1205 static inline unsigned int usb4_switch_version(const struct tb_switch *sw) in usb4_switch_version()
1216 static inline bool tb_switch_is_usb4(const struct tb_switch *sw) in tb_switch_is_usb4()
1221 int usb4_switch_setup(struct tb_switch *sw);
1222 int usb4_switch_configuration_valid(struct tb_switch *sw);
1223 int usb4_switch_read_uid(struct tb_switch *sw, u64 *uid);
1224 int usb4_switch_drom_read(struct tb_switch *sw, unsigned int address, void *buf,
1226 bool usb4_switch_lane_bonding_possible(struct tb_switch *sw);
1227 int usb4_switch_set_wake(struct tb_switch *sw, unsigned int flags);
1228 int usb4_switch_set_sleep(struct tb_switch *sw);
1229 int usb4_switch_nvm_sector_size(struct tb_switch *sw);
1230 int usb4_switch_nvm_read(struct tb_switch *sw, unsigned int address, void *buf,
1232 int usb4_switch_nvm_set_offset(struct tb_switch *sw, unsigned int address);
1233 int usb4_switch_nvm_write(struct tb_switch *sw, unsigned int address,
1235 int usb4_switch_nvm_authenticate(struct tb_switch *sw);
1236 int usb4_switch_nvm_authenticate_status(struct tb_switch *sw, u32 *status);
1237 int usb4_switch_credits_init(struct tb_switch *sw);
1238 bool usb4_switch_query_dp_resource(struct tb_switch *sw, struct tb_port *in);
1239 int usb4_switch_alloc_dp_resource(struct tb_switch *sw, struct tb_port *in);
1240 int usb4_switch_dealloc_dp_resource(struct tb_switch *sw, struct tb_port *in);
1241 struct tb_port *usb4_switch_map_pcie_down(struct tb_switch *sw,
1243 struct tb_port *usb4_switch_map_usb3_down(struct tb_switch *sw,
1245 int usb4_switch_add_ports(struct tb_switch *sw);
1246 void usb4_switch_remove_ports(struct tb_switch *sw);
1333 void tb_check_quirks(struct tb_switch *sw);
1366 void tb_switch_debugfs_init(struct tb_switch *sw);
1367 void tb_switch_debugfs_remove(struct tb_switch *sw);
1375 static inline void tb_switch_debugfs_init(struct tb_switch *sw) { } in tb_switch_debugfs_init()
1376 static inline void tb_switch_debugfs_remove(struct tb_switch *sw) { } in tb_switch_debugfs_remove()