summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Pfetsch <spfetsch@google.com>2020-11-11 18:51:56 -0800
committerSteve Pfetsch <spfetsch@google.com>2020-11-20 00:20:08 +0000
commit2f8fde2c7952fe49cf385b7ac81bd16ad2017227 (patch)
tree359c91508f1f5187795be8a627d4184d04b7ee28
parent55811e84497a879b315560f10a7106017997e7ab (diff)
downloadfts_touch-2f8fde2c7952fe49cf385b7ac81bd16ad2017227.tar.gz
input: touchscreen: stm: Read touch_offload device_id from DT
Bug: 172058450 Signed-off-by: Steve Pfetsch <spfetsch@google.com> Change-Id: If75fd20aebdc90882ff796c3d562836c7ef477a4
-rw-r--r--fts.c18
-rw-r--r--fts.h1
2 files changed, 16 insertions, 3 deletions
diff --git a/fts.c b/fts.c
index 18aa84c..ddb727a 100644
--- a/fts.c
+++ b/fts.c
@@ -5943,6 +5943,7 @@ static int parse_dt(struct device *dev, struct fts_hw_platform_data *bdata)
const char *name;
struct device_node *np = dev->of_node;
u32 coords[2];
+ u8 offload_id[4];
if (of_property_read_bool(np, "st,panel_map")) {
for (index = 0 ;; index++) {
@@ -6046,6 +6047,19 @@ static int parse_dt(struct device *dev, struct fts_hw_platform_data *bdata)
bdata->sensor_inverted_y = 1;
pr_info("Sensor inverted y = %u\n", bdata->sensor_inverted_y);
+ bdata->offload_id = 0;
+ retval = of_property_read_u8_array(np, "st,touch_offload_id",
+ offload_id, 4);
+ if (retval == -EINVAL)
+ pr_err("Failed to read st,touch_offload_id with error = %d\n",
+ retval);
+ else {
+ bdata->offload_id = *(u32 *)offload_id;
+ pr_info("Offload device ID = \"%c%c%c%c\" / 0x%08X\n",
+ offload_id[0], offload_id[1], offload_id[2], offload_id[3],
+ bdata->offload_id);
+ }
+
return OK;
}
@@ -6380,9 +6394,7 @@ static int fts_probe(struct spi_device *client)
#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
info->offload.caps.touch_offload_major_version = 1;
info->offload.caps.touch_offload_minor_version = 0;
- /* ID equivalent to the 4-byte, little-endian string: '00b5' */
- info->offload.caps.device_id =
- '5' << 24 | 'b' << 16 | '0' << 8 | '0' << 0;
+ info->offload.caps.device_id = info->board->offload_id;
info->offload.caps.display_width = info->board->x_axis_max;
info->offload.caps.display_height = info->board->y_axis_max;
info->offload.caps.tx_size = getForceLen();
diff --git a/fts.h b/fts.h
index c38d8d6..aba0ef4 100644
--- a/fts.h
+++ b/fts.h
@@ -300,6 +300,7 @@ struct fts_hw_platform_data {
struct drm_panel *panel;
u32 initial_panel_index;
u32 *force_pi_cfg_ver;
+ u32 offload_id;
};
/* Bits for the bus reference mask */