Lines Matching refs:hba

14 	struct ufs_hba *hba;  member
18 static int ufs_read_temp_enable(struct ufs_hba *hba, u8 mask, long *val) in ufs_read_temp_enable() argument
23 err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR, QUERY_ATTR_IDN_EE_CONTROL, 0, 0, in ufs_read_temp_enable()
33 static int ufs_get_temp(struct ufs_hba *hba, enum attr_idn idn, long *val) in ufs_get_temp() argument
38 err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR, idn, 0, 0, &value); in ufs_get_temp()
54 struct ufs_hba *hba = data->hba; in ufs_hwmon_read() local
57 down(&hba->host_sem); in ufs_hwmon_read()
59 if (!ufshcd_is_user_access_allowed(hba)) { in ufs_hwmon_read()
60 up(&hba->host_sem); in ufs_hwmon_read()
64 ufshcd_rpm_get_sync(hba); in ufs_hwmon_read()
68 err = ufs_read_temp_enable(hba, data->mask, val); in ufs_hwmon_read()
72 err = ufs_get_temp(hba, QUERY_ATTR_IDN_HIGH_TEMP_BOUND, val); in ufs_hwmon_read()
76 err = ufs_get_temp(hba, QUERY_ATTR_IDN_LOW_TEMP_BOUND, val); in ufs_hwmon_read()
80 err = ufs_get_temp(hba, QUERY_ATTR_IDN_CASE_ROUGH_TEMP, val); in ufs_hwmon_read()
89 ufshcd_rpm_put_sync(hba); in ufs_hwmon_read()
91 up(&hba->host_sem); in ufs_hwmon_read()
100 struct ufs_hba *hba = data->hba; in ufs_hwmon_write() local
109 down(&hba->host_sem); in ufs_hwmon_write()
111 if (!ufshcd_is_user_access_allowed(hba)) { in ufs_hwmon_write()
112 up(&hba->host_sem); in ufs_hwmon_write()
116 ufshcd_rpm_get_sync(hba); in ufs_hwmon_write()
119 err = ufshcd_update_ee_usr_mask(hba, MASK_EE_URGENT_TEMP, 0); in ufs_hwmon_write()
121 err = ufshcd_update_ee_usr_mask(hba, 0, MASK_EE_URGENT_TEMP); in ufs_hwmon_write()
123 ufshcd_rpm_put_sync(hba); in ufs_hwmon_write()
125 up(&hba->host_sem); in ufs_hwmon_write()
166 void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask) in ufs_hwmon_probe() argument
168 struct device *dev = hba->dev; in ufs_hwmon_probe()
176 data->hba = hba; in ufs_hwmon_probe()
186 hba->hwmon_device = hwmon; in ufs_hwmon_probe()
189 void ufs_hwmon_remove(struct ufs_hba *hba) in ufs_hwmon_remove() argument
193 if (!hba->hwmon_device) in ufs_hwmon_remove()
196 data = dev_get_drvdata(hba->hwmon_device); in ufs_hwmon_remove()
197 hwmon_device_unregister(hba->hwmon_device); in ufs_hwmon_remove()
198 hba->hwmon_device = NULL; in ufs_hwmon_remove()
202 void ufs_hwmon_notify_event(struct ufs_hba *hba, u8 ee_mask) in ufs_hwmon_notify_event() argument
204 if (!hba->hwmon_device) in ufs_hwmon_notify_event()
208 hwmon_notify_event(hba->hwmon_device, hwmon_temp, hwmon_temp_max_alarm, 0); in ufs_hwmon_notify_event()
211 hwmon_notify_event(hba->hwmon_device, hwmon_temp, hwmon_temp_min_alarm, 0); in ufs_hwmon_notify_event()