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()
781 cyttsp4_get_touch_axis(md, &touch->abs[abs], in cyttsp4_get_touch()
791 if (md->pdata->flags & CY_FLAG_FLIP) { in cyttsp4_get_touch()
797 if (md->pdata->flags & CY_FLAG_INV_X) { in cyttsp4_get_touch()
799 touch->abs[CY_TCH_X] = md->si->si_ofs.max_y - in cyttsp4_get_touch()
802 touch->abs[CY_TCH_X] = md->si->si_ofs.max_x - in cyttsp4_get_touch()
805 if (md->pdata->flags & CY_FLAG_INV_Y) { in cyttsp4_get_touch()
807 touch->abs[CY_TCH_Y] = md->si->si_ofs.max_x - in cyttsp4_get_touch()
810 touch->abs[CY_TCH_Y] = md->si->si_ofs.max_y - in cyttsp4_get_touch()
816 md->pdata->flags & CY_FLAG_INV_X ? "true" : "false", in cyttsp4_get_touch()
817 md->pdata->flags & CY_FLAG_INV_Y ? "true" : "false", in cyttsp4_get_touch()
836 static void cyttsp4_get_mt_touches(struct cyttsp4_mt_data *md, int num_cur_tch) in cyttsp4_get_mt_touches() argument
838 struct device *dev = &md->input->dev; in cyttsp4_get_mt_touches()
839 struct cyttsp4_sysinfo *si = md->si; in cyttsp4_get_mt_touches()
847 cyttsp4_get_touch(md, &tch, si->xy_data + in cyttsp4_get_mt_touches()
849 if ((tch.abs[CY_TCH_T] < md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
851 (tch.abs[CY_TCH_T] > md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
855 md->pdata->frmwrk->abs[(CY_ABS_ID_OST * in cyttsp4_get_mt_touches()
861 sig = md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
864 t = tch.abs[CY_TCH_T] - md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
871 input_mt_slot(md->input, t); in cyttsp4_get_mt_touches()
872 input_mt_report_slot_state(md->input, MT_TOOL_FINGER, in cyttsp4_get_mt_touches()
879 sig = md->pdata->frmwrk->abs[((CY_ABS_X_OST + j) * in cyttsp4_get_mt_touches()
882 input_report_abs(md->input, sig, in cyttsp4_get_mt_touches()
897 sig = md->pdata->frmwrk->abs in cyttsp4_get_mt_touches()
901 input_report_abs(md->input, sig, in cyttsp4_get_mt_touches()
928 cyttsp4_final_sync(md->input, si->si_ofs.tch_abs[CY_TCH_T].max, ids); in cyttsp4_get_mt_touches()
930 md->num_prv_tch = num_cur_tch; in cyttsp4_get_mt_touches()
938 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_xy_worker() local
939 struct device *dev = &md->input->dev; in cyttsp4_xy_worker()
940 struct cyttsp4_sysinfo *si = md->si; in cyttsp4_xy_worker()
1012 cyttsp4_get_mt_touches(md, num_cur_tch); in cyttsp4_xy_worker()
1014 cyttsp4_lift_all(md); in cyttsp4_xy_worker()
1025 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_mt_attention() local
1028 if (!md->si) in cyttsp4_mt_attention()
1031 mutex_lock(&md->report_lock); in cyttsp4_mt_attention()
1032 if (!md->is_suspended) { in cyttsp4_mt_attention()
1039 mutex_unlock(&md->report_lock); in cyttsp4_mt_attention()
1633 cyttsp4_lift_all(&cd->md); in cyttsp4_startup_()
1820 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_core_suspend() local
1823 md->is_suspended = true; in cyttsp4_core_suspend()
1836 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_core_resume() local
1839 md->is_suspended = false; in cyttsp4_core_resume()
1865 struct cyttsp4_mt_data *md = input_get_drvdata(input); in cyttsp4_mt_close() local
1866 mutex_lock(&md->report_lock); in cyttsp4_mt_close()
1867 if (!md->is_suspended) in cyttsp4_mt_close()
1869 mutex_unlock(&md->report_lock); in cyttsp4_mt_close()
1876 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_setup_input_device() local
1884 __set_bit(EV_ABS, md->input->evbit); in cyttsp4_setup_input_device()
1885 __set_bit(EV_REL, md->input->evbit); in cyttsp4_setup_input_device()
1886 __set_bit(EV_KEY, md->input->evbit); in cyttsp4_setup_input_device()
1888 max_x_tmp = md->si->si_ofs.max_x; in cyttsp4_setup_input_device()
1889 max_y_tmp = md->si->si_ofs.max_y; in cyttsp4_setup_input_device()
1892 if (md->pdata->flags & CY_FLAG_FLIP) { in cyttsp4_setup_input_device()
1899 max_p = md->si->si_ofs.max_p; in cyttsp4_setup_input_device()
1902 for (i = 0; i < (md->pdata->frmwrk->size / CY_NUM_ABS_SET); i++) { in cyttsp4_setup_input_device()
1903 signal = md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1906 __set_bit(signal, md->input->absbit); in cyttsp4_setup_input_device()
1907 min = md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1909 max = md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1921 input_set_abs_params(md->input, signal, min, max, in cyttsp4_setup_input_device()
1922 md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1924 md->pdata->frmwrk->abs in cyttsp4_setup_input_device()
1929 (md->si->si_ofs.tch_rec_size < in cyttsp4_setup_input_device()
1935 input_mt_init_slots(md->input, md->si->si_ofs.tch_abs[CY_TCH_T].max, in cyttsp4_setup_input_device()
1937 rc = input_register_device(md->input); in cyttsp4_setup_input_device()
1947 struct cyttsp4_mt_data *md = &cd->md; in cyttsp4_mt_probe() local
1951 mutex_init(&md->report_lock); in cyttsp4_mt_probe()
1952 md->pdata = pdata; in cyttsp4_mt_probe()
1956 md->input = input_allocate_device(); in cyttsp4_mt_probe()
1957 if (md->input == NULL) { in cyttsp4_mt_probe()
1964 md->input->name = pdata->inp_dev_name; in cyttsp4_mt_probe()
1965 scnprintf(md->phys, sizeof(md->phys)-1, "%s", dev_name(dev)); in cyttsp4_mt_probe()
1966 md->input->phys = md->phys; in cyttsp4_mt_probe()
1967 md->input->id.bustype = cd->bus_ops->bustype; in cyttsp4_mt_probe()
1968 md->input->dev.parent = dev; in cyttsp4_mt_probe()
1969 md->input->open = cyttsp4_mt_open; in cyttsp4_mt_probe()
1970 md->input->close = cyttsp4_mt_close; in cyttsp4_mt_probe()
1971 input_set_drvdata(md->input, md); in cyttsp4_mt_probe()
1974 md->si = &cd->sysinfo; in cyttsp4_mt_probe()
1975 if (!md->si) { in cyttsp4_mt_probe()
1977 __func__, md->si); in cyttsp4_mt_probe()
1988 input_free_device(md->input); in cyttsp4_mt_probe()
1990 input_set_drvdata(md->input, NULL); in cyttsp4_mt_probe()
2123 static void cyttsp4_mt_release(struct cyttsp4_mt_data *md) in cyttsp4_mt_release() argument
2125 input_unregister_device(md->input); in cyttsp4_mt_release()
2126 input_set_drvdata(md->input, NULL); in cyttsp4_mt_release()
2133 cyttsp4_mt_release(&cd->md); in cyttsp4_remove()