Lines Matching refs:cl_data
72 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh_hid_client_deinit() local
75 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_deinit()
76 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_hid_client_deinit()
77 privdata->mp2_ops->stop(privdata, cl_data->sensor_idx[i]); in amd_sfh_hid_client_deinit()
79 (privdata, cl_data->sensor_idx[i], DISABLE_SENSOR); in amd_sfh_hid_client_deinit()
81 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_deinit()
83 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_deinit()
84 cl_data->sensor_sts[i]); in amd_sfh_hid_client_deinit()
88 cancel_delayed_work_sync(&cl_data->work); in amd_sfh_hid_client_deinit()
89 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_hid_client_deinit()
90 amdtp_hid_remove(cl_data); in amd_sfh_hid_client_deinit()
98 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh1_1_hid_client_init() local
108 req_list = &cl_data->req_list; in amd_sfh1_1_hid_client_init()
112 cl_data->num_hid_devices = amd_sfh_get_sensor_num(privdata, &cl_data->sensor_idx[0]); in amd_sfh1_1_hid_client_init()
113 if (cl_data->num_hid_devices == 0) in amd_sfh1_1_hid_client_init()
116 INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); in amd_sfh1_1_hid_client_init()
117 INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); in amd_sfh1_1_hid_client_init()
119 cl_data->in_data = in_data; in amd_sfh1_1_hid_client_init()
121 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh1_1_hid_client_init()
122 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh1_1_hid_client_init()
123 cl_data->sensor_requested_cnt[i] = 0; in amd_sfh1_1_hid_client_init()
124 cl_data->cur_hid_dev = i; in amd_sfh1_1_hid_client_init()
125 cl_idx = cl_data->sensor_idx[i]; in amd_sfh1_1_hid_client_init()
127 cl_data->report_descr_sz[i] = mp2_ops->get_desc_sz(cl_idx, descr_size); in amd_sfh1_1_hid_client_init()
128 if (!cl_data->report_descr_sz[i]) { in amd_sfh1_1_hid_client_init()
142 cl_data->feature_report[i] = devm_kzalloc(dev, feature_report_size, GFP_KERNEL); in amd_sfh1_1_hid_client_init()
143 if (!cl_data->feature_report[i]) { in amd_sfh1_1_hid_client_init()
155 cl_data->report_descr[i] = in amd_sfh1_1_hid_client_init()
156 devm_kzalloc(dev, cl_data->report_descr_sz[i], GFP_KERNEL); in amd_sfh1_1_hid_client_init()
157 if (!cl_data->report_descr[i]) { in amd_sfh1_1_hid_client_init()
161 rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]); in amd_sfh1_1_hid_client_init()
168 (privdata, cl_data->sensor_idx[i], ENABLE_SENSOR); in amd_sfh1_1_hid_client_init()
173 cl_data->sensor_sts[i] = SENSOR_ENABLED; in amd_sfh1_1_hid_client_init()
174 rc = amdtp_hid_probe(i, cl_data); in amd_sfh1_1_hid_client_init()
176 mp2_ops->stop(privdata, cl_data->sensor_idx[i]); in amd_sfh1_1_hid_client_init()
178 (privdata, cl_data->sensor_idx[i], DISABLE_SENSOR); in amd_sfh1_1_hid_client_init()
182 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh1_1_hid_client_init()
184 cl_data->sensor_idx[i], in amd_sfh1_1_hid_client_init()
185 get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh1_1_hid_client_init()
186 cl_data->sensor_sts[i]); in amd_sfh1_1_hid_client_init()
191 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh1_1_hid_client_init()
192 cl_data->sensor_sts[i]); in amd_sfh1_1_hid_client_init()
195 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh1_1_hid_client_init()
200 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh1_1_hid_client_init()
201 devm_kfree(dev, cl_data->feature_report[i]); in amd_sfh1_1_hid_client_init()
203 devm_kfree(dev, cl_data->report_descr[i]); in amd_sfh1_1_hid_client_init()
210 struct amdtp_cl_data *cl_data = mp2->cl_data; in amd_sfh_resume() local
214 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_resume()
215 if (cl_data->sensor_sts[i] == SENSOR_DISABLED) { in amd_sfh_resume()
216 info.sensor_idx = cl_data->sensor_idx[i]; in amd_sfh_resume()
219 (mp2, cl_data->sensor_idx[i], ENABLE_SENSOR); in amd_sfh_resume()
223 cl_data->sensor_sts[i] = SENSOR_ENABLED; in amd_sfh_resume()
225 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_resume()
226 cl_data->sensor_sts[i]); in amd_sfh_resume()
230 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh_resume()
236 struct amdtp_cl_data *cl_data = mp2->cl_data; in amd_sfh_suspend() local
239 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_suspend()
240 if (cl_data->sensor_idx[i] != HPD_IDX && in amd_sfh_suspend()
241 cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_suspend()
242 mp2->mp2_ops->stop(mp2, cl_data->sensor_idx[i]); in amd_sfh_suspend()
244 (mp2, cl_data->sensor_idx[i], DISABLE_SENSOR); in amd_sfh_suspend()
248 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_suspend()
250 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_suspend()
251 cl_data->sensor_sts[i]); in amd_sfh_suspend()
255 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_suspend()