Lines Matching refs:ts

51 	struct ts4800_ts *ts = dev->private;  in ts4800_ts_open()  local
54 ts->pendown = false; in ts4800_ts_open()
55 ts->debounce = DEBOUNCE_COUNT; in ts4800_ts_open()
57 ret = regmap_update_bits(ts->regmap, ts->reg, ts->bit, ts->bit); in ts4800_ts_open()
59 dev_warn(ts->dev, "Failed to enable touchscreen\n"); in ts4800_ts_open()
64 struct ts4800_ts *ts = dev->private; in ts4800_ts_close() local
67 ret = regmap_update_bits(ts->regmap, ts->reg, ts->bit, 0); in ts4800_ts_close()
69 dev_warn(ts->dev, "Failed to disable touchscreen\n"); in ts4800_ts_close()
76 struct ts4800_ts *ts = dev->private; in ts4800_ts_poll() local
77 u16 last_x = readw(ts->base + X_OFFSET); in ts4800_ts_poll()
78 u16 last_y = readw(ts->base + Y_OFFSET); in ts4800_ts_poll()
82 if (ts->debounce) { in ts4800_ts_poll()
83 ts->debounce--; in ts4800_ts_poll()
87 if (!ts->pendown) { in ts4800_ts_poll()
89 ts->pendown = true; in ts4800_ts_poll()
98 } else if (ts->pendown) { in ts4800_ts_poll()
99 ts->pendown = false; in ts4800_ts_poll()
100 ts->debounce = DEBOUNCE_COUNT; in ts4800_ts_poll()
107 struct ts4800_ts *ts) in ts4800_parse_dt() argument
121 ts->regmap = syscon_node_to_regmap(syscon_np); in ts4800_parse_dt()
123 if (IS_ERR(ts->regmap)) { in ts4800_parse_dt()
125 return PTR_ERR(ts->regmap); in ts4800_parse_dt()
134 ts->reg = reg; in ts4800_parse_dt()
142 ts->bit = BIT(bit); in ts4800_parse_dt()
150 struct ts4800_ts *ts; in ts4800_ts_probe() local
153 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); in ts4800_ts_probe()
154 if (!ts) in ts4800_ts_probe()
157 error = ts4800_parse_dt(pdev, ts); in ts4800_ts_probe()
161 ts->base = devm_platform_ioremap_resource(pdev, 0); in ts4800_ts_probe()
162 if (IS_ERR(ts->base)) in ts4800_ts_probe()
163 return PTR_ERR(ts->base); in ts4800_ts_probe()
169 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&pdev->dev)); in ts4800_ts_probe()
170 ts->poll_dev = poll_dev; in ts4800_ts_probe()
171 ts->dev = &pdev->dev; in ts4800_ts_probe()
173 poll_dev->private = ts; in ts4800_ts_probe()
180 poll_dev->input->phys = ts->phys; in ts4800_ts_probe()