aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/sun4i.txt3
-rw-r--r--drivers/input/touchscreen/sun4i-ts.c16
2 files changed, 15 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt b/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt
index 433332d3b2ba..d59d25281e9f 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt
@@ -2,7 +2,8 @@ sun4i resistive touchscreen controller
2-------------------------------------- 2--------------------------------------
3 3
4Required properties: 4Required properties:
5 - compatible: "allwinner,sun4i-a10-ts" or "allwinner,sun6i-a31-ts" 5 - compatible: "allwinner,sun4i-a10-ts", "allwinner,sun5i-a13-ts" or
6 "allwinner,sun6i-a31-ts"
6 - reg: mmio address range of the chip 7 - reg: mmio address range of the chip
7 - interrupts: interrupt to which the chip is connected 8 - interrupts: interrupt to which the chip is connected
8 - #thermal-sensor-cells: shall be 0 9 - #thermal-sensor-cells: shall be 0
diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index b93a28b955fd..66ccd5af537d 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -258,6 +258,15 @@ static int sun4i_ts_probe(struct platform_device *pdev)
258 /* Allwinner SDK has temperature = -271 + (value / 6) (C) */ 258 /* Allwinner SDK has temperature = -271 + (value / 6) (C) */
259 ts->temp_offset = 1626; 259 ts->temp_offset = 1626;
260 ts->temp_step = 167; 260 ts->temp_step = 167;
261 } else if (of_device_is_compatible(np, "allwinner,sun4i-a10-ts")) {
262 /*
263 * The A10 temperature sensor has quite a wide spread, these
264 * parameters are based on the averaging of the calibration
265 * results of 4 completely different boards, with a spread of
266 * temp_step from 96 - 170 and temp_offset from 1758 - 3310.
267 */
268 ts->temp_offset = 2570;
269 ts->temp_step = 133;
261 } else { 270 } else {
262 /* 271 /*
263 * The user manuals do not contain the formula for calculating 272 * The user manuals do not contain the formula for calculating
@@ -330,10 +339,10 @@ static int sun4i_ts_probe(struct platform_device *pdev)
330 * finally enable tp mode. 339 * finally enable tp mode.
331 */ 340 */
332 reg = STYLUS_UP_DEBOUN(5) | STYLUS_UP_DEBOUN_EN(1); 341 reg = STYLUS_UP_DEBOUN(5) | STYLUS_UP_DEBOUN_EN(1);
333 if (of_device_is_compatible(np, "allwinner,sun4i-a10-ts")) 342 if (of_device_is_compatible(np, "allwinner,sun6i-a31-ts"))
334 reg |= TP_MODE_EN(1);
335 else
336 reg |= SUN6I_TP_MODE_EN(1); 343 reg |= SUN6I_TP_MODE_EN(1);
344 else
345 reg |= TP_MODE_EN(1);
337 writel(reg, ts->base + TP_CTRL1); 346 writel(reg, ts->base + TP_CTRL1);
338 347
339 /* 348 /*
@@ -383,6 +392,7 @@ static int sun4i_ts_remove(struct platform_device *pdev)
383 392
384static const struct of_device_id sun4i_ts_of_match[] = { 393static const struct of_device_id sun4i_ts_of_match[] = {
385 { .compatible = "allwinner,sun4i-a10-ts", }, 394 { .compatible = "allwinner,sun4i-a10-ts", },
395 { .compatible = "allwinner,sun5i-a13-ts", },
386 { .compatible = "allwinner,sun6i-a31-ts", }, 396 { .compatible = "allwinner,sun6i-a31-ts", },
387 { /* sentinel */ } 397 { /* sentinel */ }
388}; 398};