armbian_build/patch/kernel/archive/sunxi-5.12/olimex_0016-input-touchscreen-sun4i-Enable-parsing.patch
Igor Pečovnik 3b3d85e25c
Upgrade EDGE to 5.12.y (#2825)
* Bump imx6 edge to 5.12.y

* Bump odroid xu4 edge to 5.12.y

* Bump Jetson nano edge to 5.12.y

* WIP: Bump sunxi to 5.12.y

- create a copy of patches and make a new link
- wireless patches needs adjutement to 5.12
- some patches are still failing

* Adjust wireless patches to build on 5.12.y

* Remove template wireless patch

* Move Espressobin edge to 5.12.y

* Bump mvebu to 5.12

- patch 92-mvebu-gpio-remove-hardcoded-timer-assignment.patch was disabled @heisath
- adjusted wireless driver for 8723ds

* Adjust sunxi / sunxi64 edge to compile

* Fix kernel config for Jetson nano edge

* bump meson64 to 5.12.y

* bump rockchip edge to 5.12.y

* Bump rockchip64 to 5.12.y

* Bump rk322x edge to 5.12.y

@paolosabatino

* Cleanup im6, re-add 5.10.y patches since one is missing in 5.12.y

* Update odroidxu4 edge links

* rk322x: moved rk322x-edge to kernel 5.12, fix overlay compilation, retouched included kernel modules

* Cleanup: remove deprecated config

Co-authored-by: Paolo Sabatino <paolo.sabatino@gmail.com>
2021-05-22 17:08:44 +02:00

64 lines
2.2 KiB
Diff

From e06a7969a316149e35c96d7cbd98c9762dc144c8 Mon Sep 17 00:00:00 2001
From: Mitko Gamishev <hehopmajieh@debian.bg>
Date: Wed, 5 Feb 2020 15:18:04 +0200
Subject: [PATCH 16/48] input-touchscreen-sun4i-Enable-parsing-
---
drivers/input/touchscreen/sun4i-ts.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index 742a7e96c1b5..be7a65786a87 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -32,6 +32,7 @@
#include <linux/thermal.h>
#include <linux/init.h>
#include <linux/input.h>
+#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
@@ -106,6 +107,7 @@
struct sun4i_ts_data {
struct device *dev;
struct input_dev *input;
+ struct touchscreen_properties prop;
void __iomem *base;
unsigned int irq;
bool ignore_fifo_data;
@@ -123,8 +125,8 @@ static void sun4i_ts_irq_handle_input(struct sun4i_ts_data *ts, u32 reg_val)
y = readl(ts->base + TP_DATA);
/* The 1st location reported after an up event is unreliable */
if (!ts->ignore_fifo_data) {
- input_report_abs(ts->input, ABS_X, x);
- input_report_abs(ts->input, ABS_Y, y);
+ touchscreen_report_pos(ts->input, &ts->prop, x, y, false);
+
/*
* The hardware has a separate down status bit, but
* that gets set before we get the first location,
@@ -296,8 +298,17 @@ static int sun4i_ts_probe(struct platform_device *pdev)
ts->input->id.version = 0x0100;
ts->input->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS);
__set_bit(BTN_TOUCH, ts->input->keybit);
- input_set_abs_params(ts->input, ABS_X, 0, 4095, 0, 0);
- input_set_abs_params(ts->input, ABS_Y, 0, 4095, 0, 0);
+
+ touchscreen_parse_properties(ts->input, false, &ts->prop);
+
+ if (!ts->prop.max_x || !ts->prop.max_y) {
+ dev_info(&pdev->dev, "Invalid configuration, using defaults\n");
+ ts->prop.max_x = 4095;
+ ts->prop.max_y = 4095;
+ }
+
+ input_set_abs_params(ts->input, ABS_X, 0, ts->prop.max_x, 0, 0);
+ input_set_abs_params(ts->input, ABS_Y, 0, ts->prop.max_y, 0, 0);
input_set_drvdata(ts->input, ts);
}
--
2.25.1