Lines Matching refs:hba

13 	struct ufs_hba *hba;  member
17 static int ufs_read_temp_enable(struct ufs_hba *hba, u8 mask, long *val) in ufs_read_temp_enable() argument
22 err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR, QUERY_ATTR_IDN_EE_CONTROL, 0, 0, in ufs_read_temp_enable()
32 static int ufs_get_temp(struct ufs_hba *hba, enum attr_idn idn, long *val) in ufs_get_temp() argument
37 err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR, idn, 0, 0, &value); in ufs_get_temp()
53 struct ufs_hba *hba = data->hba; in ufs_hwmon_read() local
56 down(&hba->host_sem); in ufs_hwmon_read()
58 if (!ufshcd_is_user_access_allowed(hba)) { in ufs_hwmon_read()
59 up(&hba->host_sem); in ufs_hwmon_read()
63 ufshcd_rpm_get_sync(hba); in ufs_hwmon_read()
67 err = ufs_read_temp_enable(hba, data->mask, val); in ufs_hwmon_read()
71 err = ufs_get_temp(hba, QUERY_ATTR_IDN_HIGH_TEMP_BOUND, val); in ufs_hwmon_read()
75 err = ufs_get_temp(hba, QUERY_ATTR_IDN_LOW_TEMP_BOUND, val); in ufs_hwmon_read()
79 err = ufs_get_temp(hba, QUERY_ATTR_IDN_CASE_ROUGH_TEMP, val); in ufs_hwmon_read()
88 ufshcd_rpm_put_sync(hba); in ufs_hwmon_read()
90 up(&hba->host_sem); in ufs_hwmon_read()
99 struct ufs_hba *hba = data->hba; in ufs_hwmon_write() local
108 down(&hba->host_sem); in ufs_hwmon_write()
110 if (!ufshcd_is_user_access_allowed(hba)) { in ufs_hwmon_write()
111 up(&hba->host_sem); in ufs_hwmon_write()
115 ufshcd_rpm_get_sync(hba); in ufs_hwmon_write()
118 err = ufshcd_update_ee_usr_mask(hba, MASK_EE_URGENT_TEMP, 0); in ufs_hwmon_write()
120 err = ufshcd_update_ee_usr_mask(hba, 0, MASK_EE_URGENT_TEMP); in ufs_hwmon_write()
122 ufshcd_rpm_put_sync(hba); in ufs_hwmon_write()
124 up(&hba->host_sem); in ufs_hwmon_write()
164 void ufs_hwmon_probe(struct ufs_hba *hba, u8 mask) in ufs_hwmon_probe() argument
166 struct device *dev = hba->dev; in ufs_hwmon_probe()
174 data->hba = hba; in ufs_hwmon_probe()
184 hba->hwmon_device = hwmon; in ufs_hwmon_probe()
187 void ufs_hwmon_remove(struct ufs_hba *hba) in ufs_hwmon_remove() argument
191 if (!hba->hwmon_device) in ufs_hwmon_remove()
194 data = dev_get_drvdata(hba->hwmon_device); in ufs_hwmon_remove()
195 hwmon_device_unregister(hba->hwmon_device); in ufs_hwmon_remove()
196 hba->hwmon_device = NULL; in ufs_hwmon_remove()
200 void ufs_hwmon_notify_event(struct ufs_hba *hba, u8 ee_mask) in ufs_hwmon_notify_event() argument
202 if (!hba->hwmon_device) in ufs_hwmon_notify_event()
206 hwmon_notify_event(hba->hwmon_device, hwmon_temp, hwmon_temp_max_alarm, 0); in ufs_hwmon_notify_event()
209 hwmon_notify_event(hba->hwmon_device, hwmon_temp, hwmon_temp_min_alarm, 0); in ufs_hwmon_notify_event()