Lines Matching refs:ts
100 struct stmpe_touch *ts = in stmpe_work() local
103 int_sta = stmpe_reg_read(ts->stmpe, STMPE_REG_INT_STA); in stmpe_work()
114 int_sta = stmpe_reg_read(ts->stmpe, STMPE_REG_INT_STA); in stmpe_work()
119 __stmpe_reset_fifo(ts->stmpe); in stmpe_work()
121 input_report_abs(ts->idev, ABS_PRESSURE, 0); in stmpe_work()
122 input_report_key(ts->idev, BTN_TOUCH, 0); in stmpe_work()
123 input_sync(ts->idev); in stmpe_work()
130 struct stmpe_touch *ts = data; in stmpe_ts_handler() local
136 cancel_delayed_work_sync(&ts->work); in stmpe_ts_handler()
144 stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, in stmpe_ts_handler()
147 stmpe_block_read(ts->stmpe, STMPE_REG_TSC_DATA_XYZ, 4, data_set); in stmpe_ts_handler()
153 input_report_abs(ts->idev, ABS_X, x); in stmpe_ts_handler()
154 input_report_abs(ts->idev, ABS_Y, y); in stmpe_ts_handler()
155 input_report_abs(ts->idev, ABS_PRESSURE, z); in stmpe_ts_handler()
156 input_report_key(ts->idev, BTN_TOUCH, 1); in stmpe_ts_handler()
157 input_sync(ts->idev); in stmpe_ts_handler()
160 __stmpe_reset_fifo(ts->stmpe); in stmpe_ts_handler()
163 stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, in stmpe_ts_handler()
167 schedule_delayed_work(&ts->work, msecs_to_jiffies(50)); in stmpe_ts_handler()
172 static int stmpe_init_hw(struct stmpe_touch *ts) in stmpe_init_hw() argument
176 struct stmpe *stmpe = ts->stmpe; in stmpe_init_hw()
177 struct device *dev = ts->dev; in stmpe_init_hw()
185 adc_ctrl1 = SAMPLE_TIME(ts->sample_time) | MOD_12B(ts->mod_12b) | in stmpe_init_hw()
186 REF_SEL(ts->ref_sel); in stmpe_init_hw()
197 ADC_FREQ(0xff), ADC_FREQ(ts->adc_freq)); in stmpe_init_hw()
203 tsc_cfg = AVE_CTRL(ts->ave_ctrl) | DET_DELAY(ts->touch_det_delay) | in stmpe_init_hw()
204 SETTLING(ts->settling); in stmpe_init_hw()
214 FRACTION_Z(0xff), FRACTION_Z(ts->fraction_z)); in stmpe_init_hw()
221 I_DRIVE(0xff), I_DRIVE(ts->i_drive)); in stmpe_init_hw()
246 struct stmpe_touch *ts = input_get_drvdata(dev); in stmpe_ts_open() local
249 ret = __stmpe_reset_fifo(ts->stmpe); in stmpe_ts_open()
253 return stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, in stmpe_ts_open()
259 struct stmpe_touch *ts = input_get_drvdata(dev); in stmpe_ts_close() local
261 cancel_delayed_work_sync(&ts->work); in stmpe_ts_close()
263 stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, in stmpe_ts_close()
268 struct stmpe_touch *ts) in stmpe_ts_get_platform_info() argument
274 ts->stmpe = stmpe; in stmpe_ts_get_platform_info()
276 if (stmpe->pdata && stmpe->pdata->ts) { in stmpe_ts_get_platform_info()
277 ts_pdata = stmpe->pdata->ts; in stmpe_ts_get_platform_info()
279 ts->sample_time = ts_pdata->sample_time; in stmpe_ts_get_platform_info()
280 ts->mod_12b = ts_pdata->mod_12b; in stmpe_ts_get_platform_info()
281 ts->ref_sel = ts_pdata->ref_sel; in stmpe_ts_get_platform_info()
282 ts->adc_freq = ts_pdata->adc_freq; in stmpe_ts_get_platform_info()
283 ts->ave_ctrl = ts_pdata->ave_ctrl; in stmpe_ts_get_platform_info()
284 ts->touch_det_delay = ts_pdata->touch_det_delay; in stmpe_ts_get_platform_info()
285 ts->settling = ts_pdata->settling; in stmpe_ts_get_platform_info()
286 ts->fraction_z = ts_pdata->fraction_z; in stmpe_ts_get_platform_info()
287 ts->i_drive = ts_pdata->i_drive; in stmpe_ts_get_platform_info()
292 ts->sample_time = val; in stmpe_ts_get_platform_info()
294 ts->mod_12b = val; in stmpe_ts_get_platform_info()
296 ts->ref_sel = val; in stmpe_ts_get_platform_info()
298 ts->adc_freq = val; in stmpe_ts_get_platform_info()
300 ts->ave_ctrl = val; in stmpe_ts_get_platform_info()
302 ts->touch_det_delay = val; in stmpe_ts_get_platform_info()
304 ts->settling = val; in stmpe_ts_get_platform_info()
306 ts->fraction_z = val; in stmpe_ts_get_platform_info()
308 ts->i_drive = val; in stmpe_ts_get_platform_info()
314 struct stmpe_touch *ts; in stmpe_input_probe() local
323 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); in stmpe_input_probe()
324 if (!ts) in stmpe_input_probe()
331 platform_set_drvdata(pdev, ts); in stmpe_input_probe()
332 ts->idev = idev; in stmpe_input_probe()
333 ts->dev = &pdev->dev; in stmpe_input_probe()
335 stmpe_ts_get_platform_info(pdev, ts); in stmpe_input_probe()
337 INIT_DELAYED_WORK(&ts->work, stmpe_work); in stmpe_input_probe()
341 IRQF_ONESHOT, STMPE_TS_NAME, ts); in stmpe_input_probe()
347 error = stmpe_init_hw(ts); in stmpe_input_probe()
360 input_set_drvdata(idev, ts); in stmpe_input_probe()
377 struct stmpe_touch *ts = platform_get_drvdata(pdev); in stmpe_ts_remove() local
379 stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); in stmpe_ts_remove()