Lines Matching full:ts

2  * Touchscreen driver for the TS-4800 board
50 struct ts4800_ts *ts = input_get_drvdata(input_dev); in ts4800_ts_open() local
53 ts->pendown = false; in ts4800_ts_open()
54 ts->debounce = DEBOUNCE_COUNT; in ts4800_ts_open()
56 error = regmap_update_bits(ts->regmap, ts->reg, ts->bit, ts->bit); in ts4800_ts_open()
58 dev_warn(ts->dev, "Failed to enable touchscreen: %d\n", error); in ts4800_ts_open()
67 struct ts4800_ts *ts = input_get_drvdata(input_dev); in ts4800_ts_close() local
70 ret = regmap_update_bits(ts->regmap, ts->reg, ts->bit, 0); in ts4800_ts_close()
72 dev_warn(ts->dev, "Failed to disable touchscreen\n"); in ts4800_ts_close()
78 struct ts4800_ts *ts = input_get_drvdata(input_dev); in ts4800_ts_poll() local
79 u16 last_x = readw(ts->base + X_OFFSET); in ts4800_ts_poll()
80 u16 last_y = readw(ts->base + Y_OFFSET); in ts4800_ts_poll()
84 if (ts->debounce) { in ts4800_ts_poll()
85 ts->debounce--; in ts4800_ts_poll()
89 if (!ts->pendown) { in ts4800_ts_poll()
91 ts->pendown = true; in ts4800_ts_poll()
100 } else if (ts->pendown) { in ts4800_ts_poll()
101 ts->pendown = false; in ts4800_ts_poll()
102 ts->debounce = DEBOUNCE_COUNT; in ts4800_ts_poll()
109 struct ts4800_ts *ts) in ts4800_parse_dt() argument
123 ts->regmap = syscon_node_to_regmap(syscon_np); in ts4800_parse_dt()
124 if (IS_ERR(ts->regmap)) { in ts4800_parse_dt()
126 return PTR_ERR(ts->regmap); in ts4800_parse_dt()
135 ts->reg = reg; in ts4800_parse_dt()
143 ts->bit = BIT(bit); in ts4800_parse_dt()
151 struct ts4800_ts *ts; in ts4800_ts_probe() local
154 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); in ts4800_ts_probe()
155 if (!ts) in ts4800_ts_probe()
158 error = ts4800_parse_dt(pdev, ts); in ts4800_ts_probe()
162 ts->base = devm_platform_ioremap_resource(pdev, 0); in ts4800_ts_probe()
163 if (IS_ERR(ts->base)) in ts4800_ts_probe()
164 return PTR_ERR(ts->base); in ts4800_ts_probe()
170 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&pdev->dev)); in ts4800_ts_probe()
171 ts->input = input_dev; in ts4800_ts_probe()
172 ts->dev = &pdev->dev; in ts4800_ts_probe()
174 input_set_drvdata(input_dev, ts); in ts4800_ts_probe()
176 input_dev->name = "TS-4800 Touchscreen"; in ts4800_ts_probe()
177 input_dev->phys = ts->phys; in ts4800_ts_probe()
205 { .compatible = "technologic,ts4800-ts", },
212 .name = "ts4800-ts",
220 MODULE_DESCRIPTION("TS-4800 Touchscreen Driver");