diff options
author | Mark Chang <changmark@google.com> | 2021-04-03 01:43:03 +0800 |
---|---|---|
committer | Mark Chang <changmark@google.com> | 2021-04-03 18:10:38 +0800 |
commit | b14f9d30fb76bf1e6ade5cbd49950dbc0a4ee088 (patch) | |
tree | 9cb9ae7d682e9a146f63846c91f8534c290bbb05 | |
parent | 8736ef44fc2cc74ef0ade6590690155613ea2c36 (diff) | |
download | sec_touch-b14f9d30fb76bf1e6ade5cbd49950dbc0a4ee088.tar.gz |
input: touchscreen: sec: Read touch_offload device_id from DT.
Bug: 174189879
Test: Verified device_id with locally built ROM.
Signed-off-by: Mark Chang <changmark@google.com>
Change-Id: Iec8037c750274121fb39c9c963cf46d8f6b80b95
-rw-r--r-- | sec_ts.c | 18 | ||||
-rw-r--r-- | sec_ts.h | 1 |
2 files changed, 16 insertions, 3 deletions
@@ -3021,6 +3021,7 @@ static int sec_ts_parse_dt(struct spi_device *client) struct sec_ts_plat_data *pdata = dev->platform_data; struct device_node *np = dev->of_node; u32 coords[2]; + u8 offload_id[4]; int ret = 0; int count = 0; u32 ic_match_value; @@ -3281,6 +3282,19 @@ static int sec_ts_parse_dt(struct spi_device *client) pdata->support_mt_pressure = true; + pdata->offload_id = 0; + if (of_property_read_u8_array(np, "sec,touch_offload_id", + offload_id, 4) == -EINVAL) + input_err(true, &client->dev, + "%s: Failed to read sec,touch_offload_id\n"); + else { + pdata->offload_id = *(u32 *)offload_id; + input_info(true, &client->dev, + "%s: Offload device ID = \"%c%c%c%c\" / 0x%08X\n", + __func__, offload_id[0], offload_id[1], offload_id[2], + offload_id[3], pdata->offload_id); + } + if (of_property_read_u8(np, "sec,mm2px", &pdata->mm2px) < 0) pdata->mm2px = 1; input_info(true, &client->dev, @@ -3973,9 +3987,7 @@ static int sec_ts_probe(struct spi_device *client) #if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD) ts->offload.caps.touch_offload_major_version = 1; ts->offload.caps.touch_offload_minor_version = 0; - /* ID equivalent to the 4-byte, little-endian string: '00r3' */ - ts->offload.caps.device_id = - '3' << 24 | 'r' << 16 | '0' << 8 | '0' << 0; + ts->offload.caps.device_id = ts->plat_data->offload_id; ts->offload.caps.display_width = ts->plat_data->max_x + 1; ts->offload.caps.display_height = ts->plat_data->max_y + 1; ts->offload.caps.tx_size = ts->tx_count; @@ -1139,6 +1139,7 @@ struct sec_ts_plat_data { struct drm_panel *panel; u32 initial_panel_index; + u32 offload_id; /* convert mm to pixel for major and minor */ u8 mm2px; |