Lines Matching refs:hba

9 static inline bool ufshcd_is_user_access_allowed(struct ufs_hba *hba)
11 return !hba->shutting_down;
14 void ufshcd_schedule_eh_work(struct ufs_hba *hba);
17 struct ufs_hba *hba)
19 return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND;
22 static inline u8 ufshcd_wb_get_query_index(struct ufs_hba *hba)
24 if (hba->dev_info.wb_buffer_type == WB_BUF_MODE_LU_DEDICATED)
25 return hba->dev_info.wb_dedicated_lu;
29 static inline bool ufshcd_is_wb_buf_flush_allowed(struct ufs_hba *hba)
31 return ufshcd_is_wb_allowed(hba) &&
32 !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL);
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) {}
41 static inline void ufs_hwmon_remove(struct ufs_hba *hba) {}
42 static inline void ufs_hwmon_notify_event(struct ufs_hba *hba, u8 ee_mask) {}
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);
64 void ufshcd_compl_one_cqe(struct ufs_hba *hba, int task_tag,
66 int ufshcd_mcq_init(struct ufs_hba *hba);
67 int ufshcd_mcq_decide_queue_depth(struct ufs_hba *hba);
68 int ufshcd_mcq_memory_alloc(struct ufs_hba *hba);
69 void ufshcd_mcq_make_queues_operational(struct ufs_hba *hba);
70 void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds);
71 u32 ufshcd_mcq_read_cqis(struct ufs_hba *hba, int i);
72 void ufshcd_mcq_write_cqis(struct ufs_hba *hba, u32 val, int i);
73 struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba,
75 unsigned long ufshcd_mcq_poll_cqe_lock(struct ufs_hba *hba,
77 void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
80 int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag);
82 int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag);
83 void ufshcd_release_scsi_cmd(struct ufs_hba *hba,
88 int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
91 int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd);
93 int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
100 int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
103 static inline const char *ufshcd_get_var_name(struct ufs_hba *hba)
105 if (hba->vops)
106 return hba->vops->name;
110 static inline void ufshcd_vops_exit(struct ufs_hba *hba)
112 if (hba->vops && hba->vops->exit)
113 return hba->vops->exit(hba);
116 static inline u32 ufshcd_vops_get_ufs_hci_version(struct ufs_hba *hba)
118 if (hba->vops && hba->vops->get_ufs_hci_version)
119 return hba->vops->get_ufs_hci_version(hba);
121 return ufshcd_readl(hba, REG_UFS_VERSION);
124 static inline int ufshcd_vops_clk_scale_notify(struct ufs_hba *hba,
127 if (hba->vops && hba->vops->clk_scale_notify)
128 return hba->vops->clk_scale_notify(hba, up, status);
132 static inline void ufshcd_vops_event_notify(struct ufs_hba *hba,
136 if (hba->vops && hba->vops->event_notify)
137 hba->vops->event_notify(hba, evt, data);
140 static inline int ufshcd_vops_setup_clocks(struct ufs_hba *hba, bool on,
143 if (hba->vops && hba->vops->setup_clocks)
144 return hba->vops->setup_clocks(hba, on, status);
148 static inline int ufshcd_vops_hce_enable_notify(struct ufs_hba *hba,
151 if (hba->vops && hba->vops->hce_enable_notify)
152 return hba->vops->hce_enable_notify(hba, status);
156 static inline int ufshcd_vops_link_startup_notify(struct ufs_hba *hba,
159 if (hba->vops && hba->vops->link_startup_notify)
160 return hba->vops->link_startup_notify(hba, status);
165 static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba,
170 if (hba->vops && hba->vops->pwr_change_notify)
171 return hba->vops->pwr_change_notify(hba, status,
177 static inline void ufshcd_vops_setup_task_mgmt(struct ufs_hba *hba,
180 if (hba->vops && hba->vops->setup_task_mgmt)
181 return hba->vops->setup_task_mgmt(hba, tag, tm_function);
184 static inline void ufshcd_vops_hibern8_notify(struct ufs_hba *hba,
188 if (hba->vops && hba->vops->hibern8_notify)
189 return hba->vops->hibern8_notify(hba, cmd, status);
192 static inline int ufshcd_vops_apply_dev_quirks(struct ufs_hba *hba)
194 if (hba->vops && hba->vops->apply_dev_quirks)
195 return hba->vops->apply_dev_quirks(hba);
199 static inline void ufshcd_vops_fixup_dev_quirks(struct ufs_hba *hba)
201 if (hba->vops && hba->vops->fixup_dev_quirks)
202 hba->vops->fixup_dev_quirks(hba);
205 static inline int ufshcd_vops_suspend(struct ufs_hba *hba, enum ufs_pm_op op,
208 if (hba->vops && hba->vops->suspend)
209 return hba->vops->suspend(hba, op, status);
214 static inline int ufshcd_vops_resume(struct ufs_hba *hba, enum ufs_pm_op op)
216 if (hba->vops && hba->vops->resume)
217 return hba->vops->resume(hba, op);
222 static inline void ufshcd_vops_dbg_register_dump(struct ufs_hba *hba)
224 if (hba->vops && hba->vops->dbg_register_dump)
225 hba->vops->dbg_register_dump(hba);
228 static inline int ufshcd_vops_device_reset(struct ufs_hba *hba)
230 if (hba->vops && hba->vops->device_reset)
231 return hba->vops->device_reset(hba);
236 static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
240 if (hba->vops && hba->vops->config_scaling_param)
241 hba->vops->config_scaling_param(hba, p, data);
244 static inline void ufshcd_vops_reinit_notify(struct ufs_hba *hba)
246 if (hba->vops && hba->vops->reinit_notify)
247 hba->vops->reinit_notify(hba);
250 static inline int ufshcd_vops_mcq_config_resource(struct ufs_hba *hba)
252 if (hba->vops && hba->vops->mcq_config_resource)
253 return hba->vops->mcq_config_resource(hba);
258 static inline int ufshcd_mcq_vops_get_hba_mac(struct ufs_hba *hba)
260 if (hba->vops && hba->vops->get_hba_mac)
261 return hba->vops->get_hba_mac(hba);
266 static inline int ufshcd_mcq_vops_op_runtime_config(struct ufs_hba *hba)
268 if (hba->vops && hba->vops->op_runtime_config)
269 return hba->vops->op_runtime_config(hba);
274 static inline int ufshcd_vops_get_outstanding_cqs(struct ufs_hba *hba,
277 if (hba->vops && hba->vops->get_outstanding_cqs)
278 return hba->vops->get_outstanding_cqs(hba, ocqs);
283 static inline int ufshcd_mcq_vops_config_esi(struct ufs_hba *hba)
285 if (hba->vops && hba->vops->config_esi)
286 return hba->vops->config_esi(hba);
308 int __ufshcd_write_ee_control(struct ufs_hba *hba, u32 ee_ctrl_mask);
309 int ufshcd_write_ee_control(struct ufs_hba *hba);
310 int ufshcd_update_ee_control(struct ufs_hba *hba, u16 *mask,
313 static inline int ufshcd_update_ee_drv_mask(struct ufs_hba *hba,
316 return ufshcd_update_ee_control(hba, &hba->ee_drv_mask,
317 &hba->ee_usr_mask, set, clr);
320 static inline int ufshcd_update_ee_usr_mask(struct ufs_hba *hba,
323 return ufshcd_update_ee_control(hba, &hba->ee_usr_mask,
324 &hba->ee_drv_mask, set, clr);
327 static inline int ufshcd_rpm_get_sync(struct ufs_hba *hba)
329 return pm_runtime_get_sync(&hba->ufs_device_wlun->sdev_gendev);
332 static inline int ufshcd_rpm_put_sync(struct ufs_hba *hba)
334 return pm_runtime_put_sync(&hba->ufs_device_wlun->sdev_gendev);
337 static inline void ufshcd_rpm_get_noresume(struct ufs_hba *hba)
339 pm_runtime_get_noresume(&hba->ufs_device_wlun->sdev_gendev);
342 static inline int ufshcd_rpm_resume(struct ufs_hba *hba)
344 return pm_runtime_resume(&hba->ufs_device_wlun->sdev_gendev);
347 static inline int ufshcd_rpm_put(struct ufs_hba *hba)
349 return pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev);