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 switch (cl_data->sensor_idx[i]) { in amd_sfh_hid_client_deinit()
85 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_hid_client_deinit()
86 privdata->mp2_ops->stop(privdata, cl_data->sensor_idx[i]); in amd_sfh_hid_client_deinit()
88 (privdata, cl_data->sensor_idx[i], DISABLE_SENSOR); in amd_sfh_hid_client_deinit()
90 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_hid_client_deinit()
92 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_hid_client_deinit()
93 cl_data->sensor_sts[i]); in amd_sfh_hid_client_deinit()
97 cancel_delayed_work_sync(&cl_data->work); in amd_sfh_hid_client_deinit()
98 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_hid_client_deinit()
99 amdtp_hid_remove(cl_data); in amd_sfh_hid_client_deinit()
107 struct amdtp_cl_data *cl_data = privdata->cl_data; in amd_sfh1_1_hid_client_init() local
117 req_list = &cl_data->req_list; in amd_sfh1_1_hid_client_init()
121 cl_data->num_hid_devices = amd_sfh_get_sensor_num(privdata, &cl_data->sensor_idx[0]); in amd_sfh1_1_hid_client_init()
122 if (cl_data->num_hid_devices == 0) in amd_sfh1_1_hid_client_init()
124 cl_data->is_any_sensor_enabled = false; in amd_sfh1_1_hid_client_init()
126 INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); in amd_sfh1_1_hid_client_init()
127 INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); in amd_sfh1_1_hid_client_init()
129 cl_data->in_data = in_data; in amd_sfh1_1_hid_client_init()
131 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh1_1_hid_client_init()
132 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh1_1_hid_client_init()
133 cl_data->sensor_requested_cnt[i] = 0; in amd_sfh1_1_hid_client_init()
134 cl_data->cur_hid_dev = i; in amd_sfh1_1_hid_client_init()
135 cl_idx = cl_data->sensor_idx[i]; in amd_sfh1_1_hid_client_init()
137 cl_data->report_descr_sz[i] = mp2_ops->get_desc_sz(cl_idx, descr_size); in amd_sfh1_1_hid_client_init()
138 if (!cl_data->report_descr_sz[i]) { in amd_sfh1_1_hid_client_init()
152 cl_data->feature_report[i] = devm_kzalloc(dev, feature_report_size, GFP_KERNEL); in amd_sfh1_1_hid_client_init()
153 if (!cl_data->feature_report[i]) { in amd_sfh1_1_hid_client_init()
165 cl_data->report_descr[i] = in amd_sfh1_1_hid_client_init()
166 devm_kzalloc(dev, cl_data->report_descr_sz[i], GFP_KERNEL); in amd_sfh1_1_hid_client_init()
167 if (!cl_data->report_descr[i]) { in amd_sfh1_1_hid_client_init()
171 rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]); in amd_sfh1_1_hid_client_init()
178 (privdata, cl_data->sensor_idx[i], ENABLE_SENSOR); in amd_sfh1_1_hid_client_init()
180 cl_data->sensor_sts[i] = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED; in amd_sfh1_1_hid_client_init()
183 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh1_1_hid_client_init()
184 cl_data->cur_hid_dev = i; in amd_sfh1_1_hid_client_init()
185 if (cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh1_1_hid_client_init()
186 cl_data->is_any_sensor_enabled = true; in amd_sfh1_1_hid_client_init()
187 rc = amdtp_hid_probe(i, cl_data); in amd_sfh1_1_hid_client_init()
190 switch (cl_data->sensor_idx[i]) { in amd_sfh1_1_hid_client_init()
200 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh1_1_hid_client_init()
201 cl_data->sensor_sts[i]); in amd_sfh1_1_hid_client_init()
204 if (!cl_data->is_any_sensor_enabled) { in amd_sfh1_1_hid_client_init()
206 cl_data->is_any_sensor_enabled); in amd_sfh1_1_hid_client_init()
211 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh1_1_hid_client_init()
216 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh1_1_hid_client_init()
217 devm_kfree(dev, cl_data->feature_report[i]); in amd_sfh1_1_hid_client_init()
219 devm_kfree(dev, cl_data->report_descr[i]); in amd_sfh1_1_hid_client_init()
226 struct amdtp_cl_data *cl_data = mp2->cl_data; in amd_sfh_resume() local
230 if (!cl_data->is_any_sensor_enabled) { in amd_sfh_resume()
235 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_resume()
236 if (cl_data->sensor_sts[i] == SENSOR_DISABLED) { in amd_sfh_resume()
237 info.sensor_idx = cl_data->sensor_idx[i]; in amd_sfh_resume()
240 (mp2, cl_data->sensor_idx[i], ENABLE_SENSOR); in amd_sfh_resume()
244 cl_data->sensor_sts[i] = SENSOR_ENABLED; in amd_sfh_resume()
246 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_resume()
247 cl_data->sensor_sts[i]); in amd_sfh_resume()
251 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); in amd_sfh_resume()
257 struct amdtp_cl_data *cl_data = mp2->cl_data; in amd_sfh_suspend() local
260 if (!cl_data->is_any_sensor_enabled) { in amd_sfh_suspend()
265 for (i = 0; i < cl_data->num_hid_devices; i++) { in amd_sfh_suspend()
266 if (cl_data->sensor_idx[i] != HPD_IDX && in amd_sfh_suspend()
267 cl_data->sensor_sts[i] == SENSOR_ENABLED) { in amd_sfh_suspend()
268 mp2->mp2_ops->stop(mp2, cl_data->sensor_idx[i]); in amd_sfh_suspend()
270 (mp2, cl_data->sensor_idx[i], DISABLE_SENSOR); in amd_sfh_suspend()
274 cl_data->sensor_sts[i] = SENSOR_DISABLED; in amd_sfh_suspend()
276 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), in amd_sfh_suspend()
277 cl_data->sensor_sts[i]); in amd_sfh_suspend()
281 cancel_delayed_work_sync(&cl_data->work_buffer); in amd_sfh_suspend()