Lines Matching refs:cl_data

161 	struct amdtp_cl_data *cl_data = mp2->cl_data;  in amd_sfh_resume()  local
165 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_resume()
166 if (cl_data->sensor_sts[i] == SENSOR_DISABLED) { in amd_sfh_resume()
168 info.sensor_idx = cl_data->sensor_idx[i]; in amd_sfh_resume()
169 info.dma_address = cl_data->sensor_dma_addr[i]; in amd_sfh_resume()
172 (mp2, cl_data->sensor_idx[i], SENSOR_ENABLED); in amd_sfh_resume()
174 cl_data->sensor_sts[i] = SENSOR_ENABLED; in amd_sfh_resume()
176 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_resume()
177 cl_data->sensor_sts[i]); in amd_sfh_resume()
181 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh_resume()
187 struct amdtp_cl_data *cl_data = mp2->cl_data; in amd_sfh_suspend() local
190 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_suspend()
191 if (cl_data->sensor_idx[i] != HPD_IDX && in amd_sfh_suspend()
192 cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_suspend()
193 mp2->mp2_ops->stop(mp2, cl_data->sensor_idx[i]); in amd_sfh_suspend()
195 (mp2, cl_data->sensor_idx[i], SENSOR_DISABLED); in amd_sfh_suspend()
197 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_suspend()
199 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_suspend()
200 cl_data->sensor_sts[i]); in amd_sfh_suspend()
204 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_suspend()
211 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh_hid_client_init() local
221 req_list = &cl_data->req_list; in amd_sfh_hid_client_init()
228 cl_data->num_hid_devices = amd_mp2_get_sensor_num(privdata, &cl_data->sensor_idx[0]); in amd_sfh_hid_client_init()
229 if (cl_data->num_hid_devices == 0) in amd_sfh_hid_client_init()
231 cl_data->is_any_sensor_enabled = false; in amd_sfh_hid_client_init()
233 INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); in amd_sfh_hid_client_init()
234 INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); in amd_sfh_hid_client_init()
236 cl_data->in_data = in_data; in amd_sfh_hid_client_init()
238 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_init()
240 &cl_data->sensor_dma_addr[i], in amd_sfh_hid_client_init()
246 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_init()
247 cl_data->sensor_requested_cnt[i] = 0; in amd_sfh_hid_client_init()
248 cl_data->cur_hid_dev = i; in amd_sfh_hid_client_init()
249 cl_idx = cl_data->sensor_idx[i]; in amd_sfh_hid_client_init()
250 cl_data->report_descr_sz[i] = mp2_ops->get_desc_sz(cl_idx, descr_size); in amd_sfh_hid_client_init()
251 if (!cl_data->report_descr_sz[i]) { in amd_sfh_hid_client_init()
265 cl_data->feature_report[i] = devm_kzalloc(dev, feature_report_size, GFP_KERNEL); in amd_sfh_hid_client_init()
266 if (!cl_data->feature_report[i]) { in amd_sfh_hid_client_init()
277 info.dma_address = cl_data->sensor_dma_addr[i]; in amd_sfh_hid_client_init()
279 cl_data->report_descr[i] = in amd_sfh_hid_client_init()
280 devm_kzalloc(dev, cl_data->report_descr_sz[i], GFP_KERNEL); in amd_sfh_hid_client_init()
281 if (!cl_data->report_descr[i]) { in amd_sfh_hid_client_init()
285 rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]); in amd_sfh_hid_client_init()
289 cl_data->sensor_sts[i] = amd_sfh_wait_for_response in amd_sfh_hid_client_init()
290 (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); in amd_sfh_hid_client_init()
292 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) in amd_sfh_hid_client_init()
293 cl_data->is_any_sensor_enabled = true; in amd_sfh_hid_client_init()
296 if (!cl_data->is_any_sensor_enabled || in amd_sfh_hid_client_init()
299 cl_data->is_any_sensor_enabled); in amd_sfh_hid_client_init()
304 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_init()
305 cl_data->cur_hid_dev = i; in amd_sfh_hid_client_init()
306 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_hid_client_init()
307 rc = amdtp_hid_probe(i, cl_data); in amd_sfh_hid_client_init()
311 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_init()
314 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_init()
315 cl_data->sensor_sts[i]); in amd_sfh_hid_client_init()
318 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()
324 devm_kfree(dev, cl_data->feature_report[i]); in amd_sfh_hid_client_init()
326 devm_kfree(dev, cl_data->report_descr[i]); in amd_sfh_hid_client_init()
333 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh_hid_client_deinit() local
336 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_hid_client_deinit()
337 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_hid_client_deinit()
338 privdata->mp2_ops->stop(privdata, cl_data->sensor_idx[i]); in amd_sfh_hid_client_deinit()
340 (privdata, cl_data->sensor_idx[i], SENSOR_DISABLED); in amd_sfh_hid_client_deinit()
342 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_deinit()
344 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_deinit()
345 cl_data->sensor_sts[i]); in amd_sfh_hid_client_deinit()
349 cancel_delayed_work_sync(&cl_data->work); in amd_sfh_hid_client_deinit()
350 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_hid_client_deinit()
351 amdtp_hid_remove(cl_data); in amd_sfh_hid_client_deinit()