Lines Matching refs:cl_data

160 	struct amdtp_cl_data *cl_data = mp2->cl_data;  in amd_sfh_resume()  local
164 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_resume()
165 if (cl_data->sensor_sts[i] == SENSOR_DISABLED) { in amd_sfh_resume()
167 info.sensor_idx = cl_data->sensor_idx[i]; in amd_sfh_resume()
168 info.dma_address = cl_data->sensor_dma_addr[i]; in amd_sfh_resume()
171 (mp2, cl_data->sensor_idx[i], SENSOR_ENABLED); in amd_sfh_resume()
173 cl_data->sensor_sts[i] = SENSOR_ENABLED; in amd_sfh_resume()
175 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_resume()
176 cl_data->sensor_sts[i]); in amd_sfh_resume()
180 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh_resume()
186 struct amdtp_cl_data *cl_data = mp2->cl_data; in amd_sfh_suspend() local
189 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_suspend()
190 if (cl_data->sensor_idx[i] != HPD_IDX && in amd_sfh_suspend()
191 cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_suspend()
192 mp2->mp2_ops->stop(mp2, cl_data->sensor_idx[i]); in amd_sfh_suspend()
194 (mp2, cl_data->sensor_idx[i], SENSOR_DISABLED); in amd_sfh_suspend()
196 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_suspend()
198 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_suspend()
199 cl_data->sensor_sts[i]); in amd_sfh_suspend()
203 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_suspend()
210 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh_hid_client_init() local
220 req_list = &cl_data->req_list; in amd_sfh_hid_client_init()
227 cl_data->num_hid_devices = amd_mp2_get_sensor_num(privdata, &cl_data->sensor_idx[0]); in amd_sfh_hid_client_init()
228 if (cl_data->num_hid_devices == 0) in amd_sfh_hid_client_init()
231 INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); in amd_sfh_hid_client_init()
232 INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); in amd_sfh_hid_client_init()
234 cl_data->in_data = in_data; in amd_sfh_hid_client_init()
236 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_init()
238 &cl_data->sensor_dma_addr[i], in amd_sfh_hid_client_init()
244 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_init()
245 cl_data->sensor_requested_cnt[i] = 0; in amd_sfh_hid_client_init()
246 cl_data->cur_hid_dev = i; in amd_sfh_hid_client_init()
247 cl_idx = cl_data->sensor_idx[i]; in amd_sfh_hid_client_init()
248 cl_data->report_descr_sz[i] = mp2_ops->get_desc_sz(cl_idx, descr_size); in amd_sfh_hid_client_init()
249 if (!cl_data->report_descr_sz[i]) { in amd_sfh_hid_client_init()
263 cl_data->feature_report[i] = devm_kzalloc(dev, feature_report_size, GFP_KERNEL); in amd_sfh_hid_client_init()
264 if (!cl_data->feature_report[i]) { in amd_sfh_hid_client_init()
275 info.dma_address = cl_data->sensor_dma_addr[i]; in amd_sfh_hid_client_init()
277 cl_data->report_descr[i] = in amd_sfh_hid_client_init()
278 devm_kzalloc(dev, cl_data->report_descr_sz[i], GFP_KERNEL); in amd_sfh_hid_client_init()
279 if (!cl_data->report_descr[i]) { in amd_sfh_hid_client_init()
283 rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]); in amd_sfh_hid_client_init()
288 (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); in amd_sfh_hid_client_init()
290 cl_data->sensor_sts[i] = SENSOR_ENABLED; in amd_sfh_hid_client_init()
291 rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data); in amd_sfh_hid_client_init()
293 mp2_ops->stop(privdata, cl_data->sensor_idx[i]); in amd_sfh_hid_client_init()
295 (privdata, cl_data->sensor_idx[i], SENSOR_DISABLED); in amd_sfh_hid_client_init()
297 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_init()
299 cl_data->sensor_idx[i], in amd_sfh_hid_client_init()
300 get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_init()
301 cl_data->sensor_sts[i]); in amd_sfh_hid_client_init()
306 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_init()
307 cl_data->sensor_sts[i]); in amd_sfh_hid_client_init()
311 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_init()
312 devm_kfree(dev, cl_data->feature_report[i]); in amd_sfh_hid_client_init()
314 devm_kfree(dev, cl_data->report_descr[i]); in amd_sfh_hid_client_init()
319 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh_hid_client_init()
323 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_init()
327 cl_data->sensor_dma_addr[i]); in amd_sfh_hid_client_init()
329 devm_kfree(dev, cl_data->feature_report[i]); in amd_sfh_hid_client_init()
331 devm_kfree(dev, cl_data->report_descr[i]); in amd_sfh_hid_client_init()
338 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh_hid_client_deinit() local
339 struct amd_input_data *in_data = cl_data->in_data; in amd_sfh_hid_client_deinit()
342 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_deinit()
343 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_hid_client_deinit()
344 privdata->mp2_ops->stop(privdata, cl_data->sensor_idx[i]); in amd_sfh_hid_client_deinit()
346 (privdata, cl_data->sensor_idx[i], SENSOR_DISABLED); in amd_sfh_hid_client_deinit()
348 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_deinit()
350 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_deinit()
351 cl_data->sensor_sts[i]); in amd_sfh_hid_client_deinit()
355 cancel_delayed_work_sync(&cl_data->work); in amd_sfh_hid_client_deinit()
356 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_hid_client_deinit()
357 amdtp_hid_remove(cl_data); in amd_sfh_hid_client_deinit()
359 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_deinit()
363 cl_data->sensor_dma_addr[i]); in amd_sfh_hid_client_deinit()