Lines Matching refs:md

719 static void cyttsp4_report_slot_liftoff(struct cyttsp4_mt_data *md,  in cyttsp4_report_slot_liftoff()  argument
724 if (md->num_prv_tch == 0) in cyttsp4_report_slot_liftoff()
728 input_mt_slot(md->input, t); in cyttsp4_report_slot_liftoff()
729 input_mt_report_slot_state(md->input, in cyttsp4_report_slot_liftoff()
734 static void cyttsp4_lift_all(struct cyttsp4_mt_data *md) in cyttsp4_lift_all() argument
736 if (!md->si) in cyttsp4_lift_all()
739 if (md->num_prv_tch != 0) { in cyttsp4_lift_all()
740 cyttsp4_report_slot_liftoff(md, in cyttsp4_lift_all()
741 md->si->si_ofs.tch_abs[CY_TCH_T].max); in cyttsp4_lift_all()
742 input_sync(md->input); in cyttsp4_lift_all()
743 md->num_prv_tch = 0; in cyttsp4_lift_all()
747 static void cyttsp4_get_touch_axis(struct cyttsp4_mt_data *md, in cyttsp4_get_touch_axis() argument
754 dev_vdbg(&md->input->dev, in cyttsp4_get_touch_axis()
765 dev_vdbg(&md->input->dev, in cyttsp4_get_touch_axis()
772 static void cyttsp4_get_touch(struct cyttsp4_mt_data *md, in cyttsp4_get_touch() argument
775 struct device *dev = &md->input->dev; in cyttsp4_get_touch()
776 struct cyttsp4_sysinfo *si = md->si; in cyttsp4_get_touch()
782 cyttsp4_get_touch_axis(md, &touch->abs[abs], in cyttsp4_get_touch()
792 if (md->pdata->flags & CY_FLAG_FLIP) { in cyttsp4_get_touch()
800 if (md->pdata->flags & CY_FLAG_INV_X) { in cyttsp4_get_touch()
802 touch->abs[CY_TCH_X] = md->si->si_ofs.max_y - in cyttsp4_get_touch()
805 touch->abs[CY_TCH_X] = md->si->si_ofs.max_x - in cyttsp4_get_touch()
808 if (md->pdata->flags & CY_FLAG_INV_Y) { in cyttsp4_get_touch()
810 touch->abs[CY_TCH_Y] = md->si->si_ofs.max_x - in cyttsp4_get_touch()
813 touch->abs[CY_TCH_Y] = md->si->si_ofs.max_y - in cyttsp4_get_touch()
819 md->pdata->flags & CY_FLAG_INV_X ? "true" : "false", in cyttsp4_get_touch()
820 md->pdata->flags & CY_FLAG_INV_Y ? "true" : "false", in cyttsp4_get_touch()
839 static void cyttsp4_get_mt_touches(struct cyttsp4_mt_data *md, int num_cur_tch) in cyttsp4_get_mt_touches() argument
841 struct device *dev = &md->input->dev; in cyttsp4_get_mt_touches()
842 struct cyttsp4_sysinfo *si = md->si; in cyttsp4_get_mt_touches()
850 cyttsp4_get_touch(md, &tch, si->xy_data + in cyttsp4_get_mt_touches()
852 if ((tch.abs[CY_TCH_T] < md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
854 (tch.abs[CY_TCH_T] > md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
858 md->pdata->frmwrk->abs[(CY_ABS_ID_OST * in cyttsp4_get_mt_touches()
864 sig = md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
867 t = tch.abs[CY_TCH_T] - md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
874 input_mt_slot(md->input, t); in cyttsp4_get_mt_touches()
875 input_mt_report_slot_state(md->input, MT_TOOL_FINGER, in cyttsp4_get_mt_touches()
882 sig = md->pdata->frmwrk->abs[((CY_ABS_X_OST + j) * in cyttsp4_get_mt_touches()
885 input_report_abs(md->input, sig, in cyttsp4_get_mt_touches()
900 sig = md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
904 input_report_abs(md->input, sig, in cyttsp4_get_mt_touches()
931 cyttsp4_final_sync(md->input, si->si_ofs.tch_abs[CY_TCH_T].max, ids); in cyttsp4_get_mt_touches()
933 md->num_prv_tch = num_cur_tch; in cyttsp4_get_mt_touches()
941 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_xy_worker() local
942 struct device *dev = &md->input->dev; in cyttsp4_xy_worker()
943 struct cyttsp4_sysinfo *si = md->si; in cyttsp4_xy_worker()
1015 cyttsp4_get_mt_touches(md, num_cur_tch); in cyttsp4_xy_worker()
1017 cyttsp4_lift_all(md); in cyttsp4_xy_worker()
1028 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_mt_attention() local
1031 if (!md->si) in cyttsp4_mt_attention()
1034 mutex_lock(&md->report_lock); in cyttsp4_mt_attention()
1035 if (!md->is_suspended) { in cyttsp4_mt_attention()
1042 mutex_unlock(&md->report_lock); in cyttsp4_mt_attention()
1636 cyttsp4_lift_all(&cd->md); in cyttsp4_startup_()
1823 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_core_suspend() local
1826 md->is_suspended = true; in cyttsp4_core_suspend()
1839 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_core_resume() local
1842 md->is_suspended = false; in cyttsp4_core_resume()
1868 struct cyttsp4_mt_data *md = input_get_drvdata(input); in cyttsp4_mt_close() local
1869 mutex_lock(&md->report_lock); in cyttsp4_mt_close()
1870 if (!md->is_suspended) in cyttsp4_mt_close()
1872 mutex_unlock(&md->report_lock); in cyttsp4_mt_close()
1879 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_setup_input_device() local
1887 __set_bit(EV_ABS, md->input->evbit); in cyttsp4_setup_input_device()
1888 __set_bit(EV_REL, md->input->evbit); in cyttsp4_setup_input_device()
1889 __set_bit(EV_KEY, md->input->evbit); in cyttsp4_setup_input_device()
1891 max_x_tmp = md->si->si_ofs.max_x; in cyttsp4_setup_input_device()
1892 max_y_tmp = md->si->si_ofs.max_y; in cyttsp4_setup_input_device()
1895 if (md->pdata->flags & CY_FLAG_FLIP) { in cyttsp4_setup_input_device()
1902 max_p = md->si->si_ofs.max_p; in cyttsp4_setup_input_device()
1905 for (i = 0; i < (md->pdata->frmwrk->size / CY_NUM_ABS_SET); i++) { in cyttsp4_setup_input_device()
1906 signal = md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1909 __set_bit(signal, md->input->absbit); in cyttsp4_setup_input_device()
1910 min = md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1912 max = md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1924 input_set_abs_params(md->input, signal, min, max, in cyttsp4_setup_input_device()
1925 md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1927 md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1932 (md->si->si_ofs.tch_rec_size < in cyttsp4_setup_input_device()
1938 input_mt_init_slots(md->input, md->si->si_ofs.tch_abs[CY_TCH_T].max, in cyttsp4_setup_input_device()
1940 rc = input_register_device(md->input); in cyttsp4_setup_input_device()
1950 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_mt_probe() local
1954 mutex_init(&md->report_lock); in cyttsp4_mt_probe()
1955 md->pdata = pdata; in cyttsp4_mt_probe()
1959 md->input = input_allocate_device(); in cyttsp4_mt_probe()
1960 if (md->input == NULL) { in cyttsp4_mt_probe()
1967 md->input->name = pdata->inp_dev_name; in cyttsp4_mt_probe()
1968 scnprintf(md->phys, sizeof(md->phys)-1, "%s", dev_name(dev)); in cyttsp4_mt_probe()
1969 md->input->phys = md->phys; in cyttsp4_mt_probe()
1970 md->input->id.bustype = cd->bus_ops->bustype; in cyttsp4_mt_probe()
1971 md->input->dev.parent = dev; in cyttsp4_mt_probe()
1972 md->input->open = cyttsp4_mt_open; in cyttsp4_mt_probe()
1973 md->input->close = cyttsp4_mt_close; in cyttsp4_mt_probe()
1974 input_set_drvdata(md->input, md); in cyttsp4_mt_probe()
1977 md->si = &cd->sysinfo; in cyttsp4_mt_probe()
1978 if (!md->si) { in cyttsp4_mt_probe()
1980 __func__, md->si); in cyttsp4_mt_probe()
1991 input_free_device(md->input); in cyttsp4_mt_probe()
1993 input_set_drvdata(md->input, NULL); in cyttsp4_mt_probe()
2126 static void cyttsp4_mt_release(struct cyttsp4_mt_data *md) in cyttsp4_mt_release() argument
2128 input_unregister_device(md->input); in cyttsp4_mt_release()
2129 input_set_drvdata(md->input, NULL); in cyttsp4_mt_release()
2136 cyttsp4_mt_release(&cd->md); in cyttsp4_remove()