Lines Matching +full:deep +full:- +full:sleep

21 #include <linux/crc-itu-t.h>
105 return error ? error : -EIO; in cyapa_get_pip_fixed_info()
107 pip_info->family_id = resp_data[8]; in cyapa_get_pip_fixed_info()
108 pip_info->silicon_id_low = resp_data[10]; in cyapa_get_pip_fixed_info()
109 pip_info->silicon_id_high = resp_data[11]; in cyapa_get_pip_fixed_info()
121 return error ? error : -EIO; in cyapa_get_pip_fixed_info()
126 return -EINVAL; in cyapa_get_pip_fixed_info()
128 pip_info->family_id = resp_data[19]; in cyapa_get_pip_fixed_info()
129 pip_info->silicon_id_low = resp_data[21]; in cyapa_get_pip_fixed_info()
130 pip_info->silicon_id_high = resp_data[22]; in cyapa_get_pip_fixed_info()
145 cyapa->state = CYAPA_STATE_NO_DEVICE; in cyapa_pip_state_parse()
147 /* Try to wake from it deep sleep state if it is. */ in cyapa_pip_state_parse()
172 return -EAGAIN; in cyapa_pip_state_parse()
181 cyapa->gen = CYAPA_GEN6; in cyapa_pip_state_parse()
182 cyapa->state = is_bootloader ? CYAPA_STATE_GEN6_BL in cyapa_pip_state_parse()
186 cyapa->gen = CYAPA_GEN5; in cyapa_pip_state_parse()
187 cyapa->state = is_bootloader ? CYAPA_STATE_GEN5_BL in cyapa_pip_state_parse()
209 return error ? error : -EIO; in cyapa_gen6_read_sys_info()
214 return -EINVAL; in cyapa_gen6_read_sys_info()
216 cyapa->platform_ver = (resp_data[67] >> PIP_BL_PLATFORM_VER_SHIFT) & in cyapa_gen6_read_sys_info()
218 cyapa->fw_maj_ver = resp_data[9]; in cyapa_gen6_read_sys_info()
219 cyapa->fw_min_ver = resp_data[10]; in cyapa_gen6_read_sys_info()
221 cyapa->electrodes_x = resp_data[33]; in cyapa_gen6_read_sys_info()
222 cyapa->electrodes_y = resp_data[34]; in cyapa_gen6_read_sys_info()
224 cyapa->physical_size_x = get_unaligned_le16(&resp_data[35]) / 100; in cyapa_gen6_read_sys_info()
225 cyapa->physical_size_y = get_unaligned_le16(&resp_data[37]) / 100; in cyapa_gen6_read_sys_info()
227 cyapa->max_abs_x = get_unaligned_le16(&resp_data[39]); in cyapa_gen6_read_sys_info()
228 cyapa->max_abs_y = get_unaligned_le16(&resp_data[41]); in cyapa_gen6_read_sys_info()
230 cyapa->max_z = get_unaligned_le16(&resp_data[43]); in cyapa_gen6_read_sys_info()
232 cyapa->x_origin = resp_data[45] & 0x01; in cyapa_gen6_read_sys_info()
233 cyapa->y_origin = resp_data[46] & 0x01; in cyapa_gen6_read_sys_info()
235 cyapa->btn_capability = (resp_data[70] << 3) & CAPABILITY_BTN_MASK; in cyapa_gen6_read_sys_info()
237 memcpy(&cyapa->product_id[0], &resp_data[51], 5); in cyapa_gen6_read_sys_info()
238 cyapa->product_id[5] = '-'; in cyapa_gen6_read_sys_info()
239 memcpy(&cyapa->product_id[6], &resp_data[56], 6); in cyapa_gen6_read_sys_info()
240 cyapa->product_id[12] = '-'; in cyapa_gen6_read_sys_info()
241 memcpy(&cyapa->product_id[13], &resp_data[62], 2); in cyapa_gen6_read_sys_info()
242 cyapa->product_id[15] = '\0'; in cyapa_gen6_read_sys_info()
246 cyapa->electrodes_rx = in cyapa_gen6_read_sys_info()
247 rotat_align ? cyapa->electrodes_y : cyapa->electrodes_x; in cyapa_gen6_read_sys_info()
248 cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u; in cyapa_gen6_read_sys_info()
250 if (!cyapa->electrodes_x || !cyapa->electrodes_y || in cyapa_gen6_read_sys_info()
251 !cyapa->physical_size_x || !cyapa->physical_size_y || in cyapa_gen6_read_sys_info()
252 !cyapa->max_abs_x || !cyapa->max_abs_y || !cyapa->max_z) in cyapa_gen6_read_sys_info()
253 return -EINVAL; in cyapa_gen6_read_sys_info()
271 return error ? error : -EIO; in cyapa_gen6_bl_read_app_info()
273 cyapa->fw_maj_ver = resp_data[8]; in cyapa_gen6_bl_read_app_info()
274 cyapa->fw_min_ver = resp_data[9]; in cyapa_gen6_bl_read_app_info()
276 cyapa->platform_ver = (resp_data[12] >> PIP_BL_PLATFORM_VER_SHIFT) & in cyapa_gen6_bl_read_app_info()
279 memcpy(&cyapa->product_id[0], &resp_data[13], 5); in cyapa_gen6_bl_read_app_info()
280 cyapa->product_id[5] = '-'; in cyapa_gen6_bl_read_app_info()
281 memcpy(&cyapa->product_id[6], &resp_data[18], 6); in cyapa_gen6_bl_read_app_info()
282 cyapa->product_id[12] = '-'; in cyapa_gen6_bl_read_app_info()
283 memcpy(&cyapa->product_id[13], &resp_data[24], 2); in cyapa_gen6_bl_read_app_info()
284 cyapa->product_id[15] = '\0'; in cyapa_gen6_bl_read_app_info()
304 return error < 0 ? error : -EINVAL; in cyapa_gen6_config_dev_irq()
332 return error < 0 ? error : -EINVAL; in cyapa_gen6_change_power_state()
336 return -EAGAIN; in cyapa_gen6_change_power_state()
360 put_unaligned_le16(sizeof(set_interval_cmd) - 2, in cyapa_gen6_set_interval_setting()
364 put_unaligned_le16(interval_setting->active_interval, in cyapa_gen6_set_interval_setting()
366 put_unaligned_le16(interval_setting->lp1_interval, in cyapa_gen6_set_interval_setting()
368 put_unaligned_le16(interval_setting->lp2_interval, in cyapa_gen6_set_interval_setting()
378 return error < 0 ? error : -EINVAL; in cyapa_gen6_set_interval_setting()
381 interval_setting->active_interval = get_unaligned_le16(&resp_data[5]); in cyapa_gen6_set_interval_setting()
382 interval_setting->lp1_interval = get_unaligned_le16(&resp_data[7]); in cyapa_gen6_set_interval_setting()
383 interval_setting->lp2_interval = get_unaligned_le16(&resp_data[9]); in cyapa_gen6_set_interval_setting()
403 return error < 0 ? error : -EINVAL; in cyapa_gen6_get_interval_setting()
405 interval_setting->active_interval = get_unaligned_le16(&resp_data[5]); in cyapa_gen6_get_interval_setting()
406 interval_setting->lp1_interval = get_unaligned_le16(&resp_data[7]); in cyapa_gen6_get_interval_setting()
407 interval_setting->lp2_interval = get_unaligned_le16(&resp_data[9]); in cyapa_gen6_get_interval_setting()
419 * when it's in deep sleep mode. At this time, device will in cyapa_gen6_deep_sleep()
430 struct device *dev = &cyapa->client->dev; in cyapa_gen6_set_power_mode()
432 &cyapa->gen6_interval_setting; in cyapa_gen6_set_power_mode()
436 if (cyapa->state != CYAPA_STATE_GEN6_APP) in cyapa_gen6_set_power_mode()
441 * Assume TP in deep sleep mode when driver is loaded, in cyapa_gen6_set_power_mode()
443 * has been set into deep sleep mode when unloading. in cyapa_gen6_set_power_mode()
467 dev_err(dev, "enter deep sleep fail: %d\n", error); in cyapa_gen6_set_power_mode()
477 * state directly, must be wake up from sleep firstly, then in cyapa_gen6_set_power_mode()
483 dev_err(dev, "deep sleep wake fail: %d\n", error); in cyapa_gen6_set_power_mode()
522 if (interval_setting->lp1_interval == sleep_time) { in cyapa_gen6_set_power_mode()
524 } else if (interval_setting->lp2_interval == sleep_time) { in cyapa_gen6_set_power_mode()
527 if (interval_setting->lp1_interval == 0) { in cyapa_gen6_set_power_mode()
528 interval_setting->lp1_interval = sleep_time; in cyapa_gen6_set_power_mode()
531 interval_setting->lp2_interval = sleep_time; in cyapa_gen6_set_power_mode()
576 put_unaligned_le16(sizeof(cmd) - 2, &cmd.head.length); in cyapa_pip_retrieve_data_structure()
592 return (error < 0) ? error : -EAGAIN; in cyapa_pip_retrieve_data_structure()
597 return -ENOBUFS; in cyapa_pip_retrieve_data_structure()
617 return -EBUSY; in cyapa_gen6_show_baseline()
667 struct device *dev = &cyapa->client->dev; in cyapa_gen6_operational_check()
670 if (cyapa->gen != CYAPA_GEN6) in cyapa_gen6_operational_check()
671 return -ENODEV; in cyapa_gen6_operational_check()
673 switch (cyapa->state) { in cyapa_gen6_operational_check()
682 cyapa->state = CYAPA_STATE_GEN6_APP; in cyapa_gen6_operational_check()
687 * If trackpad device in deep sleep mode, in cyapa_gen6_operational_check()
709 if (memcmp(cyapa->product_id, product_id, in cyapa_gen6_operational_check()
712 __func__, cyapa->product_id); in cyapa_gen6_operational_check()
713 error = -EINVAL; in cyapa_gen6_operational_check()
717 error = -EINVAL; in cyapa_gen6_operational_check()