Files
BPI-CM9-Linux/build/patch/kernel/archive/sm8550-6.18/0059_AYN-Odin2-Mini--hynitron--cstxxx.patch

68 lines
2.1 KiB
Diff

From 88703f392f3da6256746854f07546f4f83ad92ee Mon Sep 17 00:00:00 2001
From: Teguh Sobirin <[email protected]>
Date: Fri, 28 Feb 2025 16:22:08 +0800
Subject: [PATCH] Input: hynitron_cstxxx - specific patch for Odin2 Mini
Signed-off-by: Teguh Sobirin <[email protected]>
---
drivers/input/touchscreen/hynitron_cstxxx.c | 23 ++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/hynitron_cstxxx.c b/drivers/input/touchscreen/hynitron_cstxxx.c
index 1d8ca90dcda695..28fdc6d0cfb743 100644
--- a/drivers/input/touchscreen/hynitron_cstxxx.c
+++ b/drivers/input/touchscreen/hynitron_cstxxx.c
@@ -22,6 +22,7 @@
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
+#include <linux/regulator/consumer.h>
#include <linux/unaligned.h>
/* Per chip data */
@@ -41,6 +42,7 @@ struct hynitron_ts_data {
struct input_dev *input_dev;
struct touchscreen_properties prop;
struct gpio_desc *reset_gpio;
+ struct regulator *vdd;
};
/*
@@ -253,6 +255,7 @@ static void cst3xx_report_contact(struct hynitron_ts_data *ts_data,
input_mt_report_slot_state(ts_data->input_dev, MT_TOOL_FINGER, 1);
touchscreen_report_pos(ts_data->input_dev, &ts_data->prop, x, y, true);
input_report_abs(ts_data->input_dev, ABS_MT_TOUCH_MAJOR, w);
+ input_report_abs(ts_data->input_dev, ABS_MT_WIDTH_MAJOR, w);
}
static int cst3xx_finish_touch_read(struct i2c_client *client)
@@ -434,11 +437,25 @@ static int hyn_probe(struct i2c_client *client)
return err;
}
- hyn_reset_proc(client, 60);
+ ts_data->vdd = devm_regulator_get(&client->dev, "vdd");
+ if (IS_ERR(ts_data->vdd)) {
+ err = PTR_ERR(ts_data->vdd);
+ if (err != -EPROBE_DEFER)
+ dev_err(&client->dev, "Failed to request vdd regulator: %d\n", err);
+ return err;
+ }
- err = ts_data->chip->bootloader_enter(client);
- if (err < 0)
+ err = regulator_enable(ts_data->vdd);
+ if (err) {
+ dev_err(&client->dev, "enable regulator failed: %d\n", err);
return err;
+ }
+
+ hyn_reset_proc(client, 60);
+
+ // err = ts_data->chip->bootloader_enter(client);
+ // if (err < 0)
+ // return err;
err = ts_data->chip->init_input(client);
if (err < 0)