Lines Matching full:hba

93 #define ufshcd_is_link_off(hba) ((hba)->uic_link_state == UIC_LINK_OFF_STATE)  argument
94 #define ufshcd_is_link_active(hba) ((hba)->uic_link_state == \ argument
96 #define ufshcd_is_link_hibern8(hba) ((hba)->uic_link_state == \ argument
98 #define ufshcd_is_link_broken(hba) ((hba)->uic_link_state == \ argument
100 #define ufshcd_set_link_off(hba) ((hba)->uic_link_state = UIC_LINK_OFF_STATE) argument
101 #define ufshcd_set_link_active(hba) ((hba)->uic_link_state = \ argument
103 #define ufshcd_set_link_hibern8(hba) ((hba)->uic_link_state = \ argument
105 #define ufshcd_set_link_broken(hba) ((hba)->uic_link_state = \ argument
229 * @list: list headed by hba->clk_list_head
318 void (*setup_xfer_req)(struct ufs_hba *hba, int tag,
323 int (*apply_dev_quirks)(struct ufs_hba *hba);
324 void (*fixup_dev_quirks)(struct ufs_hba *hba);
328 void (*dbg_register_dump)(struct ufs_hba *hba);
330 int (*device_reset)(struct ufs_hba *hba);
331 void (*config_scaling_param)(struct ufs_hba *hba,
334 int (*program_key)(struct ufs_hba *hba,
336 void (*event_notify)(struct ufs_hba *hba,
657 * support device hardware reset via the hba->device_reset() callback,
775 * @is_powered: flag to check if HBA is powered
781 * @errors: HBA errors
822 * @crypto_profile: the crypto profile of this hba (if applicable)
911 /* HBA Errors */
981 static inline bool ufshcd_is_clkgating_allowed(struct ufs_hba *hba) in ufshcd_is_clkgating_allowed() argument
983 return hba->caps & UFSHCD_CAP_CLK_GATING; in ufshcd_is_clkgating_allowed()
985 static inline bool ufshcd_can_hibern8_during_gating(struct ufs_hba *hba) in ufshcd_can_hibern8_during_gating() argument
987 return hba->caps & UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; in ufshcd_can_hibern8_during_gating()
989 static inline int ufshcd_is_clkscaling_supported(struct ufs_hba *hba) in ufshcd_is_clkscaling_supported() argument
991 return hba->caps & UFSHCD_CAP_CLK_SCALING; in ufshcd_is_clkscaling_supported()
993 static inline bool ufshcd_can_autobkops_during_suspend(struct ufs_hba *hba) in ufshcd_can_autobkops_during_suspend() argument
995 return hba->caps & UFSHCD_CAP_AUTO_BKOPS_SUSPEND; in ufshcd_can_autobkops_during_suspend()
997 static inline bool ufshcd_is_rpm_autosuspend_allowed(struct ufs_hba *hba) in ufshcd_is_rpm_autosuspend_allowed() argument
999 return hba->caps & UFSHCD_CAP_RPM_AUTOSUSPEND; in ufshcd_is_rpm_autosuspend_allowed()
1002 static inline bool ufshcd_is_intr_aggr_allowed(struct ufs_hba *hba) in ufshcd_is_intr_aggr_allowed() argument
1004 return (hba->caps & UFSHCD_CAP_INTR_AGGR) && in ufshcd_is_intr_aggr_allowed()
1005 !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR); in ufshcd_is_intr_aggr_allowed()
1008 static inline bool ufshcd_can_aggressive_pc(struct ufs_hba *hba) in ufshcd_can_aggressive_pc() argument
1010 return !!(ufshcd_is_link_hibern8(hba) && in ufshcd_can_aggressive_pc()
1011 (hba->caps & UFSHCD_CAP_AGGR_POWER_COLLAPSE)); in ufshcd_can_aggressive_pc()
1014 static inline bool ufshcd_is_auto_hibern8_supported(struct ufs_hba *hba) in ufshcd_is_auto_hibern8_supported() argument
1016 return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) && in ufshcd_is_auto_hibern8_supported()
1017 !(hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8); in ufshcd_is_auto_hibern8_supported()
1020 static inline bool ufshcd_is_auto_hibern8_enabled(struct ufs_hba *hba) in ufshcd_is_auto_hibern8_enabled() argument
1022 return FIELD_GET(UFSHCI_AHIBERN8_TIMER_MASK, hba->ahit); in ufshcd_is_auto_hibern8_enabled()
1025 static inline bool ufshcd_is_wb_allowed(struct ufs_hba *hba) in ufshcd_is_wb_allowed() argument
1027 return hba->caps & UFSHCD_CAP_WB_EN; in ufshcd_is_wb_allowed()
1030 static inline bool ufshcd_enable_wb_if_scaling_up(struct ufs_hba *hba) in ufshcd_enable_wb_if_scaling_up() argument
1032 return hba->caps & UFSHCD_CAP_WB_WITH_CLK_SCALING; in ufshcd_enable_wb_if_scaling_up()
1035 #define ufshcd_writel(hba, val, reg) \ argument
1036 writel((val), (hba)->mmio_base + (reg))
1037 #define ufshcd_readl(hba, reg) \ argument
1038 readl((hba)->mmio_base + (reg))
1042 * @hba: per adapter instance
1047 static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg) in ufshcd_rmwl() argument
1051 tmp = ufshcd_readl(hba, reg); in ufshcd_rmwl()
1054 ufshcd_writel(hba, tmp, reg); in ufshcd_rmwl()
1059 int ufshcd_hba_enable(struct ufs_hba *hba);
1061 int ufshcd_link_recovery(struct ufs_hba *hba);
1062 int ufshcd_make_hba_operational(struct ufs_hba *hba);
1064 int ufshcd_uic_hibern8_enter(struct ufs_hba *hba);
1065 int ufshcd_uic_hibern8_exit(struct ufs_hba *hba);
1067 void ufshcd_parse_dev_ref_clk_freq(struct ufs_hba *hba, struct clk *refclk);
1068 void ufshcd_update_evt_hist(struct ufs_hba *hba, u32 id, u32 val);
1069 void ufshcd_hba_stop(struct ufs_hba *hba);
1070 void ufshcd_schedule_eh_work(struct ufs_hba *hba);
1079 * ufshcd_set_variant - set variant specific data to the hba
1080 * @hba: per adapter instance
1083 static inline void ufshcd_set_variant(struct ufs_hba *hba, void *variant) in ufshcd_set_variant() argument
1085 BUG_ON(!hba); in ufshcd_set_variant()
1086 hba->priv = variant; in ufshcd_set_variant()
1090 * ufshcd_get_variant - get variant specific data from the hba
1091 * @hba: per adapter instance
1093 static inline void *ufshcd_get_variant(struct ufs_hba *hba) in ufshcd_get_variant() argument
1095 BUG_ON(!hba); in ufshcd_get_variant()
1096 return hba->priv; in ufshcd_get_variant()
1107 extern int ufshcd_shutdown(struct ufs_hba *hba);
1108 extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
1111 extern int ufshcd_dme_set_attr(struct ufs_hba *hba, u32 attr_sel,
1113 extern int ufshcd_dme_get_attr(struct ufs_hba *hba, u32 attr_sel,
1115 extern int ufshcd_config_pwr_mode(struct ufs_hba *hba,
1117 extern int ufshcd_uic_change_pwr_mode(struct ufs_hba *hba, u8 mode);
1125 static inline int ufshcd_dme_set(struct ufs_hba *hba, u32 attr_sel, in ufshcd_dme_set() argument
1128 return ufshcd_dme_set_attr(hba, attr_sel, ATTR_SET_NOR, in ufshcd_dme_set()
1132 static inline int ufshcd_dme_st_set(struct ufs_hba *hba, u32 attr_sel, in ufshcd_dme_st_set() argument
1135 return ufshcd_dme_set_attr(hba, attr_sel, ATTR_SET_ST, in ufshcd_dme_st_set()
1139 static inline int ufshcd_dme_peer_set(struct ufs_hba *hba, u32 attr_sel, in ufshcd_dme_peer_set() argument
1142 return ufshcd_dme_set_attr(hba, attr_sel, ATTR_SET_NOR, in ufshcd_dme_peer_set()
1146 static inline int ufshcd_dme_peer_st_set(struct ufs_hba *hba, u32 attr_sel, in ufshcd_dme_peer_st_set() argument
1149 return ufshcd_dme_set_attr(hba, attr_sel, ATTR_SET_ST, in ufshcd_dme_peer_st_set()
1153 static inline int ufshcd_dme_get(struct ufs_hba *hba, in ufshcd_dme_get() argument
1156 return ufshcd_dme_get_attr(hba, attr_sel, mib_val, DME_LOCAL); in ufshcd_dme_get()
1159 static inline int ufshcd_dme_peer_get(struct ufs_hba *hba, in ufshcd_dme_peer_get() argument
1162 return ufshcd_dme_get_attr(hba, attr_sel, mib_val, DME_PEER); in ufshcd_dme_peer_get()
1173 static inline int ufshcd_disable_host_tx_lcc(struct ufs_hba *hba) in ufshcd_disable_host_tx_lcc() argument
1175 return ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0); in ufshcd_disable_host_tx_lcc()
1178 void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
1179 void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
1180 void ufshcd_fixup_dev_quirks(struct ufs_hba *hba,
1184 int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
1187 int ufshcd_hold(struct ufs_hba *hba, bool async);
1188 void ufshcd_release(struct ufs_hba *hba);
1192 void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
1195 u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba);
1199 int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd);
1201 int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
1208 int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
1209 int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable);
1215 static inline int ufshcd_vops_init(struct ufs_hba *hba) in ufshcd_vops_init() argument
1217 if (hba->vops && hba->vops->init) in ufshcd_vops_init()
1218 return hba->vops->init(hba); in ufshcd_vops_init()
1223 static inline int ufshcd_vops_phy_initialization(struct ufs_hba *hba) in ufshcd_vops_phy_initialization() argument
1225 if (hba->vops && hba->vops->phy_initialization) in ufshcd_vops_phy_initialization()
1226 return hba->vops->phy_initialization(hba); in ufshcd_vops_phy_initialization()
1233 int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,
1236 int __ufshcd_write_ee_control(struct ufs_hba *hba, u32 ee_ctrl_mask);
1237 int ufshcd_write_ee_control(struct ufs_hba *hba);
1238 int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask,