Lines Matching refs:sw

216 	struct ad714x_button_drv *sw = &ad714x->sw->button[idx];  in ad714x_button_state_machine()  local
218 switch (sw->state) { in ad714x_button_state_machine()
223 input_report_key(sw->input, hw->keycode, 1); in ad714x_button_state_machine()
224 input_sync(sw->input); in ad714x_button_state_machine()
225 sw->state = ACTIVE; in ad714x_button_state_machine()
233 input_report_key(sw->input, hw->keycode, 0); in ad714x_button_state_machine()
234 input_sync(sw->input); in ad714x_button_state_machine()
235 sw->state = IDLE; in ad714x_button_state_machine()
269 struct ad714x_slider_drv *sw = &ad714x->sw->slider[idx]; in ad714x_slider_cal_highest_stage() local
271 sw->highest_stage = ad714x_cal_highest_stage(ad714x, hw->start_stage, in ad714x_slider_cal_highest_stage()
275 sw->highest_stage); in ad714x_slider_cal_highest_stage()
294 struct ad714x_slider_drv *sw = &ad714x->sw->slider[idx]; in ad714x_slider_cal_abs_pos() local
296 sw->abs_pos = ad714x_cal_abs_pos(ad714x, hw->start_stage, hw->end_stage, in ad714x_slider_cal_abs_pos()
297 sw->highest_stage, hw->max_coord); in ad714x_slider_cal_abs_pos()
300 sw->abs_pos); in ad714x_slider_cal_abs_pos()
315 struct ad714x_slider_drv *sw = &ad714x->sw->slider[idx]; in ad714x_slider_cal_flt_pos() local
317 sw->flt_pos = (sw->flt_pos * (10 - 4) + in ad714x_slider_cal_flt_pos()
318 sw->abs_pos * 4)/10; in ad714x_slider_cal_flt_pos()
321 sw->flt_pos); in ad714x_slider_cal_flt_pos()
341 struct ad714x_slider_drv *sw = &ad714x->sw->slider[idx]; in ad714x_slider_state_machine() local
350 switch (sw->state) { in ad714x_slider_state_machine()
353 sw->state = JITTER; in ad714x_slider_state_machine()
367 sw->flt_pos = sw->abs_pos; in ad714x_slider_state_machine()
368 sw->state = ACTIVE; in ad714x_slider_state_machine()
379 input_report_abs(sw->input, ABS_X, sw->flt_pos); in ad714x_slider_state_machine()
380 input_report_key(sw->input, BTN_TOUCH, 1); in ad714x_slider_state_machine()
386 sw->state = IDLE; in ad714x_slider_state_machine()
387 input_report_key(sw->input, BTN_TOUCH, 0); in ad714x_slider_state_machine()
391 input_sync(sw->input); in ad714x_slider_state_machine()
410 struct ad714x_wheel_drv *sw = &ad714x->sw->wheel[idx]; in ad714x_wheel_cal_highest_stage() local
412 sw->pre_highest_stage = sw->highest_stage; in ad714x_wheel_cal_highest_stage()
413 sw->highest_stage = ad714x_cal_highest_stage(ad714x, hw->start_stage, in ad714x_wheel_cal_highest_stage()
417 sw->highest_stage); in ad714x_wheel_cal_highest_stage()
452 struct ad714x_wheel_drv *sw = &ad714x->sw->wheel[idx]; in ad714x_wheel_cal_abs_pos() local
457 first_before = (sw->highest_stage + stage_num - 1) % stage_num; in ad714x_wheel_cal_abs_pos()
458 highest = sw->highest_stage; in ad714x_wheel_cal_abs_pos()
459 first_after = (sw->highest_stage + stage_num + 1) % stage_num; in ad714x_wheel_cal_abs_pos()
471 sw->abs_pos = ((hw->max_coord / (hw->end_stage - hw->start_stage)) * in ad714x_wheel_cal_abs_pos()
474 if (sw->abs_pos > hw->max_coord) in ad714x_wheel_cal_abs_pos()
475 sw->abs_pos = hw->max_coord; in ad714x_wheel_cal_abs_pos()
476 else if (sw->abs_pos < 0) in ad714x_wheel_cal_abs_pos()
477 sw->abs_pos = 0; in ad714x_wheel_cal_abs_pos()
483 struct ad714x_wheel_drv *sw = &ad714x->sw->wheel[idx]; in ad714x_wheel_cal_flt_pos() local
484 if (((sw->pre_highest_stage == hw->end_stage) && in ad714x_wheel_cal_flt_pos()
485 (sw->highest_stage == hw->start_stage)) || in ad714x_wheel_cal_flt_pos()
486 ((sw->pre_highest_stage == hw->start_stage) && in ad714x_wheel_cal_flt_pos()
487 (sw->highest_stage == hw->end_stage))) in ad714x_wheel_cal_flt_pos()
488 sw->flt_pos = sw->abs_pos; in ad714x_wheel_cal_flt_pos()
490 sw->flt_pos = ((sw->flt_pos * 30) + (sw->abs_pos * 71)) / 100; in ad714x_wheel_cal_flt_pos()
492 if (sw->flt_pos > hw->max_coord) in ad714x_wheel_cal_flt_pos()
493 sw->flt_pos = hw->max_coord; in ad714x_wheel_cal_flt_pos()
513 struct ad714x_wheel_drv *sw = &ad714x->sw->wheel[idx]; in ad714x_wheel_state_machine() local
522 switch (sw->state) { in ad714x_wheel_state_machine()
525 sw->state = JITTER; in ad714x_wheel_state_machine()
539 sw->flt_pos = sw->abs_pos; in ad714x_wheel_state_machine()
540 sw->state = ACTIVE; in ad714x_wheel_state_machine()
551 input_report_abs(sw->input, ABS_WHEEL, in ad714x_wheel_state_machine()
552 sw->flt_pos); in ad714x_wheel_state_machine()
553 input_report_key(sw->input, BTN_TOUCH, 1); in ad714x_wheel_state_machine()
559 sw->state = IDLE; in ad714x_wheel_state_machine()
560 input_report_key(sw->input, BTN_TOUCH, 0); in ad714x_wheel_state_machine()
565 input_sync(sw->input); in ad714x_wheel_state_machine()
597 struct ad714x_touchpad_drv *sw = &ad714x->sw->touchpad[idx]; in touchpad_cal_highest_stage() local
599 sw->x_highest_stage = ad714x_cal_highest_stage(ad714x, in touchpad_cal_highest_stage()
601 sw->y_highest_stage = ad714x_cal_highest_stage(ad714x, in touchpad_cal_highest_stage()
606 idx, sw->x_highest_stage, sw->y_highest_stage); in touchpad_cal_highest_stage()
618 struct ad714x_touchpad_drv *sw = &ad714x->sw->touchpad[idx]; in touchpad_check_second_peak() local
621 for (i = hw->x_start_stage; i < sw->x_highest_stage; i++) { in touchpad_check_second_peak()
627 for (i = sw->x_highest_stage; i < hw->x_end_stage; i++) { in touchpad_check_second_peak()
633 for (i = hw->y_start_stage; i < sw->y_highest_stage; i++) { in touchpad_check_second_peak()
639 for (i = sw->y_highest_stage; i < hw->y_end_stage; i++) { in touchpad_check_second_peak()
657 struct ad714x_touchpad_drv *sw = &ad714x->sw->touchpad[idx]; in touchpad_cal_abs_pos() local
659 sw->x_abs_pos = ad714x_cal_abs_pos(ad714x, hw->x_start_stage, in touchpad_cal_abs_pos()
660 hw->x_end_stage, sw->x_highest_stage, hw->x_max_coord); in touchpad_cal_abs_pos()
661 sw->y_abs_pos = ad714x_cal_abs_pos(ad714x, hw->y_start_stage, in touchpad_cal_abs_pos()
662 hw->y_end_stage, sw->y_highest_stage, hw->y_max_coord); in touchpad_cal_abs_pos()
665 sw->x_abs_pos, sw->y_abs_pos); in touchpad_cal_abs_pos()
670 struct ad714x_touchpad_drv *sw = &ad714x->sw->touchpad[idx]; in touchpad_cal_flt_pos() local
672 sw->x_flt_pos = (sw->x_flt_pos * (10 - 4) + in touchpad_cal_flt_pos()
673 sw->x_abs_pos * 4)/10; in touchpad_cal_flt_pos()
674 sw->y_flt_pos = (sw->y_flt_pos * (10 - 4) + in touchpad_cal_flt_pos()
675 sw->y_abs_pos * 4)/10; in touchpad_cal_flt_pos()
678 idx, sw->x_flt_pos, sw->y_flt_pos); in touchpad_cal_flt_pos()
702 struct ad714x_touchpad_drv *sw = &ad714x->sw->touchpad[idx]; in touchpad_check_endpoint() local
709 if (!sw->left_ep) { in touchpad_check_endpoint()
711 sw->left_ep = 1; in touchpad_check_endpoint()
712 sw->left_ep_val = in touchpad_check_endpoint()
718 LEFT_RIGHT_END_POINT_DEAVTIVALION_LEVEL + sw->left_ep_val)) in touchpad_check_endpoint()
719 sw->left_ep = 0; in touchpad_check_endpoint()
726 if (!sw->right_ep) { in touchpad_check_endpoint()
728 sw->right_ep = 1; in touchpad_check_endpoint()
729 sw->right_ep_val = in touchpad_check_endpoint()
735 LEFT_RIGHT_END_POINT_DEAVTIVALION_LEVEL + sw->right_ep_val)) in touchpad_check_endpoint()
736 sw->right_ep = 0; in touchpad_check_endpoint()
743 if (!sw->top_ep) { in touchpad_check_endpoint()
745 sw->top_ep = 1; in touchpad_check_endpoint()
746 sw->top_ep_val = in touchpad_check_endpoint()
752 TOP_BOTTOM_END_POINT_DEAVTIVALION_LEVEL + sw->top_ep_val)) in touchpad_check_endpoint()
753 sw->top_ep = 0; in touchpad_check_endpoint()
760 if (!sw->bottom_ep) { in touchpad_check_endpoint()
762 sw->bottom_ep = 1; in touchpad_check_endpoint()
763 sw->bottom_ep_val = in touchpad_check_endpoint()
769 TOP_BOTTOM_END_POINT_DEAVTIVALION_LEVEL + sw->bottom_ep_val)) in touchpad_check_endpoint()
770 sw->bottom_ep = 0; in touchpad_check_endpoint()
773 return sw->left_ep || sw->right_ep || sw->top_ep || sw->bottom_ep; in touchpad_check_endpoint()
794 struct ad714x_touchpad_drv *sw = &ad714x->sw->touchpad[idx]; in ad714x_touchpad_state_machine() local
806 switch (sw->state) { in ad714x_touchpad_state_machine()
809 sw->state = JITTER; in ad714x_touchpad_state_machine()
828 sw->x_flt_pos = sw->x_abs_pos; in ad714x_touchpad_state_machine()
829 sw->y_flt_pos = sw->y_abs_pos; in ad714x_touchpad_state_machine()
830 sw->state = ACTIVE; in ad714x_touchpad_state_machine()
844 input_report_abs(sw->input, ABS_X, in ad714x_touchpad_state_machine()
845 sw->x_flt_pos); in ad714x_touchpad_state_machine()
846 input_report_abs(sw->input, ABS_Y, in ad714x_touchpad_state_machine()
847 sw->y_flt_pos); in ad714x_touchpad_state_machine()
848 input_report_key(sw->input, BTN_TOUCH, in ad714x_touchpad_state_machine()
856 sw->state = IDLE; in ad714x_touchpad_state_machine()
857 input_report_key(sw->input, BTN_TOUCH, 0); in ad714x_touchpad_state_machine()
861 input_sync(sw->input); in ad714x_touchpad_state_machine()
992 ad714x = devm_kzalloc(dev, sizeof(*ad714x) + sizeof(*ad714x->sw) + in ad714x_probe()
1005 ad714x->sw = drv_mem; in ad714x_probe()
1006 drv_mem += sizeof(*ad714x->sw); in ad714x_probe()
1007 ad714x->sw->slider = sd_drv = drv_mem; in ad714x_probe()
1009 ad714x->sw->wheel = wl_drv = drv_mem; in ad714x_probe()
1011 ad714x->sw->touchpad = tp_drv = drv_mem; in ad714x_probe()
1013 ad714x->sw->button = bt_drv = drv_mem; in ad714x_probe()