Lines Matching +full:ufs +full:- +full:wrapper

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
7 #include <ufs/ufshcd.h>
11 return !hba->shutting_down; in ufshcd_is_user_access_allowed()
19 return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND; in ufshcd_keep_autobkops_enabled_except_suspend()
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()
32 !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL); in ufshcd_is_wb_buf_flush_allowed()
87 /* Wrapper functions for safely calling variant operations */
90 if (hba->vops) in ufshcd_get_var_name()
91 return hba->vops->name; in ufshcd_get_var_name()
97 if (hba->vops && hba->vops->exit) in ufshcd_vops_exit()
98 return hba->vops->exit(hba); in ufshcd_vops_exit()
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()
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()
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()
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()
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()
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()
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()
159 return -ENOTSUPP; in ufshcd_vops_pwr_change_notify()
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()
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()
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()
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()
193 if (hba->vops && hba->vops->suspend) in ufshcd_vops_suspend()
194 return hba->vops->suspend(hba, op, status); in ufshcd_vops_suspend()
201 if (hba->vops && hba->vops->resume) in ufshcd_vops_resume()
202 return hba->vops->resume(hba, op); in ufshcd_vops_resume()
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()
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()
218 return -EOPNOTSUPP; in ufshcd_vops_device_reset()
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()
232 * ufshcd_scsi_to_upiu_lun - maps scsi LUN to UPIU LUN
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()
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()
267 return pm_runtime_get_sync(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_get_sync()
272 return pm_runtime_put_sync(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_put_sync()
277 pm_runtime_get_noresume(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_get_noresume()
282 return pm_runtime_resume(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_resume()
287 return pm_runtime_put(&hba->ufs_device_wlun->sdev_gendev); in ufshcd_rpm_put()
291 * ufs_is_valid_unit_desc_lun - checks if the given LUN has a unit descriptor
299 if (!dev_info || !dev_info->max_lu_supported) { in ufs_is_valid_unit_desc_lun()
300 pr_err("Max General LU supported by UFS isn't initialized\n"); in ufs_is_valid_unit_desc_lun()
306 return lun == UFS_UPIU_RPMB_WLUN || (lun < dev_info->max_lu_supported); in ufs_is_valid_unit_desc_lun()