Lines Matching full:hba
9 static inline bool ufshcd_is_user_access_allowed(struct ufs_hba *hba) in ufshcd_is_user_access_allowed() argument
11 return !hba->shutting_down; in ufshcd_is_user_access_allowed()
14 void ufshcd_schedule_eh_work(struct ufs_hba *hba);
17 struct ufs_hba *hba) in ufshcd_keep_autobkops_enabled_except_suspend() argument
19 return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND; in ufshcd_keep_autobkops_enabled_except_suspend()
22 static inline u8 ufshcd_wb_get_query_index(struct ufs_hba *hba) in ufshcd_wb_get_query_index() argument
24 if (hba->dev_info.wb_buffer_type == WB_BUF_MODE_LU_DEDICATED) in ufshcd_wb_get_query_index()
25 return hba->dev_info.wb_dedicated_lu; in ufshcd_wb_get_query_index()
29 static inline bool ufshcd_is_wb_buf_flush_allowed(struct ufs_hba *hba) in ufshcd_is_wb_buf_flush_allowed() argument
31 return ufshcd_is_wb_allowed(hba) && in ufshcd_is_wb_buf_flush_allowed()
32 !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL); in ufshcd_is_wb_buf_flush_allowed()
36 void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask);
37 void ufs_hwmon_remove(struct ufs_hba *hba);
38 void ufs_hwmon_notify_event(struct ufs_hba *hba, u8 ee_mask);
40 static inline void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask) {} in ufs_hwmon_probe() argument
41 static inline void ufs_hwmon_remove(struct ufs_hba *hba) {} in ufs_hwmon_remove() argument
42 static inline void ufs_hwmon_notify_event(struct ufs_hba *hba, u8 ee_mask) {} in ufs_hwmon_notify_event() argument
45 int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
50 int ufshcd_read_desc_param(struct ufs_hba *hba,
56 int ufshcd_query_attr_retry(struct ufs_hba *hba, enum query_opcode opcode,
59 int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
61 int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
63 void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
67 int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
70 int ufshcd_hold(struct ufs_hba *hba, bool async);
71 void ufshcd_release(struct ufs_hba *hba);
73 void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
76 int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd);
78 int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
85 int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
88 static inline const char *ufshcd_get_var_name(struct ufs_hba *hba) in ufshcd_get_var_name() argument
90 if (hba->vops) in ufshcd_get_var_name()
91 return hba->vops->name; in ufshcd_get_var_name()
95 static inline void ufshcd_vops_exit(struct ufs_hba *hba) in ufshcd_vops_exit() argument
97 if (hba->vops && hba->vops->exit) in ufshcd_vops_exit()
98 return hba->vops->exit(hba); in ufshcd_vops_exit()
101 static inline u32 ufshcd_vops_get_ufs_hci_version(struct ufs_hba *hba) in ufshcd_vops_get_ufs_hci_version() argument
103 if (hba->vops && hba->vops->get_ufs_hci_version) in ufshcd_vops_get_ufs_hci_version()
104 return hba->vops->get_ufs_hci_version(hba); in ufshcd_vops_get_ufs_hci_version()
106 return ufshcd_readl(hba, REG_UFS_VERSION); in ufshcd_vops_get_ufs_hci_version()
109 static inline int ufshcd_vops_clk_scale_notify(struct ufs_hba *hba, in ufshcd_vops_clk_scale_notify() argument
112 if (hba->vops && hba->vops->clk_scale_notify) in ufshcd_vops_clk_scale_notify()
113 return hba->vops->clk_scale_notify(hba, up, status); in ufshcd_vops_clk_scale_notify()
117 static inline void ufshcd_vops_event_notify(struct ufs_hba *hba, in ufshcd_vops_event_notify() argument
121 if (hba->vops && hba->vops->event_notify) in ufshcd_vops_event_notify()
122 hba->vops->event_notify(hba, evt, data); in ufshcd_vops_event_notify()
125 static inline int ufshcd_vops_setup_clocks(struct ufs_hba *hba, bool on, in ufshcd_vops_setup_clocks() argument
128 if (hba->vops && hba->vops->setup_clocks) in ufshcd_vops_setup_clocks()
129 return hba->vops->setup_clocks(hba, on, status); in ufshcd_vops_setup_clocks()
133 static inline int ufshcd_vops_hce_enable_notify(struct ufs_hba *hba, in ufshcd_vops_hce_enable_notify() argument
136 if (hba->vops && hba->vops->hce_enable_notify) in ufshcd_vops_hce_enable_notify()
137 return hba->vops->hce_enable_notify(hba, status); in ufshcd_vops_hce_enable_notify()
141 static inline int ufshcd_vops_link_startup_notify(struct ufs_hba *hba, in ufshcd_vops_link_startup_notify() argument
144 if (hba->vops && hba->vops->link_startup_notify) in ufshcd_vops_link_startup_notify()
145 return hba->vops->link_startup_notify(hba, status); in ufshcd_vops_link_startup_notify()
150 static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba, in ufshcd_vops_pwr_change_notify() argument
155 if (hba->vops && hba->vops->pwr_change_notify) in ufshcd_vops_pwr_change_notify()
156 return hba->vops->pwr_change_notify(hba, status, in ufshcd_vops_pwr_change_notify()
162 static inline void ufshcd_vops_setup_task_mgmt(struct ufs_hba *hba, in ufshcd_vops_setup_task_mgmt() argument
165 if (hba->vops && hba->vops->setup_task_mgmt) in ufshcd_vops_setup_task_mgmt()
166 return hba->vops->setup_task_mgmt(hba, tag, tm_function); in ufshcd_vops_setup_task_mgmt()
169 static inline void ufshcd_vops_hibern8_notify(struct ufs_hba *hba, in ufshcd_vops_hibern8_notify() argument
173 if (hba->vops && hba->vops->hibern8_notify) in ufshcd_vops_hibern8_notify()
174 return hba->vops->hibern8_notify(hba, cmd, status); in ufshcd_vops_hibern8_notify()
177 static inline int ufshcd_vops_apply_dev_quirks(struct ufs_hba *hba) in ufshcd_vops_apply_dev_quirks() argument
179 if (hba->vops && hba->vops->apply_dev_quirks) in ufshcd_vops_apply_dev_quirks()
180 return hba->vops->apply_dev_quirks(hba); in ufshcd_vops_apply_dev_quirks()
184 static inline void ufshcd_vops_fixup_dev_quirks(struct ufs_hba *hba) in ufshcd_vops_fixup_dev_quirks() argument
186 if (hba->vops && hba->vops->fixup_dev_quirks) in ufshcd_vops_fixup_dev_quirks()
187 hba->vops->fixup_dev_quirks(hba); in ufshcd_vops_fixup_dev_quirks()
190 static inline int ufshcd_vops_suspend(struct ufs_hba *hba, enum ufs_pm_op op, in ufshcd_vops_suspend() argument
193 if (hba->vops && hba->vops->suspend) in ufshcd_vops_suspend()
194 return hba->vops->suspend(hba, op, status); in ufshcd_vops_suspend()
199 static inline int ufshcd_vops_resume(struct ufs_hba *hba, enum ufs_pm_op op) in ufshcd_vops_resume() argument
201 if (hba->vops && hba->vops->resume) in ufshcd_vops_resume()
202 return hba->vops->resume(hba, op); in ufshcd_vops_resume()
207 static inline void ufshcd_vops_dbg_register_dump(struct ufs_hba *hba) in ufshcd_vops_dbg_register_dump() argument
209 if (hba->vops && hba->vops->dbg_register_dump) in ufshcd_vops_dbg_register_dump()
210 hba->vops->dbg_register_dump(hba); in ufshcd_vops_dbg_register_dump()
213 static inline int ufshcd_vops_device_reset(struct ufs_hba *hba) in ufshcd_vops_device_reset() argument
215 if (hba->vops && hba->vops->device_reset) in ufshcd_vops_device_reset()
216 return hba->vops->device_reset(hba); in ufshcd_vops_device_reset()
221 static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba, in ufshcd_vops_config_scaling_param() argument
225 if (hba->vops && hba->vops->config_scaling_param) in ufshcd_vops_config_scaling_param()
226 hba->vops->config_scaling_param(hba, p, data); in ufshcd_vops_config_scaling_param()
246 int __ufshcd_write_ee_control(struct ufs_hba *hba, u32 ee_ctrl_mask);
247 int ufshcd_write_ee_control(struct ufs_hba *hba);
248 int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask,
251 static inline int ufshcd_update_ee_drv_mask(struct ufs_hba *hba, in ufshcd_update_ee_drv_mask() argument
254 return ufshcd_update_ee_control(hba, &hba->ee_drv_mask, in ufshcd_update_ee_drv_mask()
255 &hba->ee_usr_mask, set, clr); in ufshcd_update_ee_drv_mask()
258 static inline int ufshcd_update_ee_usr_mask(struct ufs_hba *hba, in ufshcd_update_ee_usr_mask() argument
261 return ufshcd_update_ee_control(hba, &hba->ee_usr_mask, in ufshcd_update_ee_usr_mask()
262 &hba->ee_drv_mask, set, clr); in ufshcd_update_ee_usr_mask()
265 static inline int ufshcd_rpm_get_sync(struct ufs_hba *hba) in ufshcd_rpm_get_sync() argument
267 return pm_runtime_get_sync(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_get_sync()
270 static inline int ufshcd_rpm_put_sync(struct ufs_hba *hba) in ufshcd_rpm_put_sync() argument
272 return pm_runtime_put_sync(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_put_sync()
275 static inline void ufshcd_rpm_get_noresume(struct ufs_hba *hba) in ufshcd_rpm_get_noresume() argument
277 pm_runtime_get_noresume(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_get_noresume()
280 static inline int ufshcd_rpm_resume(struct ufs_hba *hba) in ufshcd_rpm_resume() argument
282 return pm_runtime_resume(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_resume()
285 static inline int ufshcd_rpm_put(struct ufs_hba *hba) in ufshcd_rpm_put() argument
287 return pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_put()