• Home
  • Raw
  • Download

Lines Matching refs:pip

350 	struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip;  in cyapa_pip_cmd_state_initialize()  local
352 init_completion(&pip->cmd_ready); in cyapa_pip_cmd_state_initialize()
353 atomic_set(&pip->cmd_issued, 0); in cyapa_pip_cmd_state_initialize()
354 mutex_init(&pip->cmd_lock); in cyapa_pip_cmd_state_initialize()
356 mutex_init(&pip->pm_stage_lock); in cyapa_pip_cmd_state_initialize()
357 pip->pm_stage = CYAPA_PM_DEACTIVE; in cyapa_pip_cmd_state_initialize()
359 pip->resp_sort_func = NULL; in cyapa_pip_cmd_state_initialize()
360 pip->in_progress_cmd = PIP_INVALID_CMD; in cyapa_pip_cmd_state_initialize()
361 pip->resp_data = NULL; in cyapa_pip_cmd_state_initialize()
362 pip->resp_len = NULL; in cyapa_pip_cmd_state_initialize()
409 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_set_pip_pm_state() local
411 mutex_lock(&pip->pm_stage_lock); in cyapa_set_pip_pm_state()
412 pip->pm_stage = pm_stage; in cyapa_set_pip_pm_state()
413 mutex_unlock(&pip->pm_stage_lock); in cyapa_set_pip_pm_state()
418 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_reset_pip_pm_state() local
421 mutex_lock(&pip->pm_stage_lock); in cyapa_reset_pip_pm_state()
422 pip->pm_stage = CYAPA_PM_DEACTIVE; in cyapa_reset_pip_pm_state()
423 mutex_unlock(&pip->pm_stage_lock); in cyapa_reset_pip_pm_state()
428 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_get_pip_pm_state() local
431 mutex_lock(&pip->pm_stage_lock); in cyapa_get_pip_pm_state()
432 pm_stage = pip->pm_stage; in cyapa_get_pip_pm_state()
433 mutex_unlock(&pip->pm_stage_lock); in cyapa_get_pip_pm_state()
446 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_empty_pip_output_data() local
479 error = cyapa_i2c_pip_read(cyapa, pip->empty_buf, in cyapa_empty_pip_output_data()
484 length = get_unaligned_le16(pip->empty_buf); in cyapa_empty_pip_output_data()
495 func(cyapa, pip->empty_buf, length)) { in cyapa_empty_pip_output_data()
497 memcpy(buf, pip->empty_buf, length); in cyapa_empty_pip_output_data()
505 error = cyapa_i2c_pip_read(cyapa, pip->empty_buf, length); in cyapa_empty_pip_output_data()
511 length = get_unaligned_le16(pip->empty_buf); in cyapa_empty_pip_output_data()
515 func(cyapa, pip->empty_buf, length)) { in cyapa_empty_pip_output_data()
517 memcpy(buf, pip->empty_buf, length); in cyapa_empty_pip_output_data()
527 (struct cyapa_pip_report_data *)pip->empty_buf); in cyapa_empty_pip_output_data()
541 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_do_i2c_pip_cmd_irq_sync() local
545 init_completion(&pip->cmd_ready); in cyapa_do_i2c_pip_cmd_irq_sync()
547 atomic_inc(&pip->cmd_issued); in cyapa_do_i2c_pip_cmd_irq_sync()
550 atomic_dec(&pip->cmd_issued); in cyapa_do_i2c_pip_cmd_irq_sync()
555 timeout = wait_for_completion_timeout(&pip->cmd_ready, in cyapa_do_i2c_pip_cmd_irq_sync()
558 atomic_dec(&pip->cmd_issued); in cyapa_do_i2c_pip_cmd_irq_sync()
572 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_do_i2c_pip_cmd_polling() local
577 atomic_inc(&pip->cmd_issued); in cyapa_do_i2c_pip_cmd_polling()
580 atomic_dec(&pip->cmd_issued); in cyapa_do_i2c_pip_cmd_polling()
601 atomic_dec(&pip->cmd_issued); in cyapa_do_i2c_pip_cmd_polling()
613 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_i2c_pip_cmd_irq_sync() local
620 error = mutex_lock_interruptible(&pip->cmd_lock); in cyapa_i2c_pip_cmd_irq_sync()
624 pip->resp_sort_func = func; in cyapa_i2c_pip_cmd_irq_sync()
625 pip->resp_data = resp_data; in cyapa_i2c_pip_cmd_irq_sync()
626 pip->resp_len = resp_len; in cyapa_i2c_pip_cmd_irq_sync()
631 pip->in_progress_cmd = cmd[6] & 0x7f; in cyapa_i2c_pip_cmd_irq_sync()
635 pip->in_progress_cmd = cmd[7]; in cyapa_i2c_pip_cmd_irq_sync()
640 pip->is_irq_mode = true; in cyapa_i2c_pip_cmd_irq_sync()
656 pip->is_irq_mode = false; in cyapa_i2c_pip_cmd_irq_sync()
661 pip->resp_sort_func = NULL; in cyapa_i2c_pip_cmd_irq_sync()
662 pip->resp_data = NULL; in cyapa_i2c_pip_cmd_irq_sync()
663 pip->resp_len = NULL; in cyapa_i2c_pip_cmd_irq_sync()
664 pip->in_progress_cmd = PIP_INVALID_CMD; in cyapa_i2c_pip_cmd_irq_sync()
666 mutex_unlock(&pip->cmd_lock); in cyapa_i2c_pip_cmd_irq_sync()
688 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_sort_tsg_pip_app_resp_data() local
699 data[5] == pip->in_progress_cmd) { in cyapa_sort_tsg_pip_app_resp_data()
703 pip->in_progress_cmd) { in cyapa_sort_tsg_pip_app_resp_data()
925 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in gen5_cmd_resp_header_parse() local
935 ret = cyapa_i2c_pip_read(cyapa, pip->empty_buf, length); in gen5_cmd_resp_header_parse()
951 } else if ((pip->empty_buf[PIP_RESP_REPORT_ID_OFFSET] == in gen5_cmd_resp_header_parse()
953 (pip->empty_buf[PIP_RESP_RSVD_OFFSET] == in gen5_cmd_resp_header_parse()
955 (pip->empty_buf[PIP_RESP_BL_SOP_OFFSET] == in gen5_cmd_resp_header_parse()
957 (pip->empty_buf[length - 1] == in gen5_cmd_resp_header_parse()
962 } else if (pip->empty_buf[PIP_RESP_REPORT_ID_OFFSET] == in gen5_cmd_resp_header_parse()
964 pip->empty_buf[PIP_RESP_RSVD_OFFSET] == in gen5_cmd_resp_header_parse()
2608 struct cyapa_pip_cmd_states *pip = &cyapa->cmd_states.pip; in cyapa_pip_irq_cmd_handler() local
2611 if (atomic_read(&pip->cmd_issued)) { in cyapa_pip_irq_cmd_handler()
2613 if (pip->is_irq_mode == false) in cyapa_pip_irq_cmd_handler()
2621 cyapa_i2c_pip_read(cyapa, pip->irq_cmd_buf, in cyapa_pip_irq_cmd_handler()
2623 length = get_unaligned_le16(pip->irq_cmd_buf); in cyapa_pip_irq_cmd_handler()
2628 pip->irq_cmd_buf, length); in cyapa_pip_irq_cmd_handler()
2629 if (!(pip->resp_sort_func && in cyapa_pip_irq_cmd_handler()
2630 pip->resp_sort_func(cyapa, in cyapa_pip_irq_cmd_handler()
2631 pip->irq_cmd_buf, length))) { in cyapa_pip_irq_cmd_handler()
2646 if (pip->resp_len) in cyapa_pip_irq_cmd_handler()
2647 length = *pip->resp_len; in cyapa_pip_irq_cmd_handler()
2649 pip->resp_data, in cyapa_pip_irq_cmd_handler()
2651 pip->resp_sort_func); in cyapa_pip_irq_cmd_handler()
2652 if (pip->resp_len && length != 0) { in cyapa_pip_irq_cmd_handler()
2653 *pip->resp_len = length; in cyapa_pip_irq_cmd_handler()
2654 atomic_dec(&pip->cmd_issued); in cyapa_pip_irq_cmd_handler()
2655 complete(&pip->cmd_ready); in cyapa_pip_irq_cmd_handler()
2660 if (pip->resp_data && pip->resp_len) { in cyapa_pip_irq_cmd_handler()
2661 *pip->resp_len = (*pip->resp_len < length) ? in cyapa_pip_irq_cmd_handler()
2662 *pip->resp_len : length; in cyapa_pip_irq_cmd_handler()
2663 memcpy(pip->resp_data, pip->irq_cmd_buf, in cyapa_pip_irq_cmd_handler()
2664 *pip->resp_len); in cyapa_pip_irq_cmd_handler()
2666 atomic_dec(&pip->cmd_issued); in cyapa_pip_irq_cmd_handler()
2667 complete(&pip->cmd_ready); in cyapa_pip_irq_cmd_handler()