* Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624
@ 2020-12-15 14:59 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-12-15 14:59 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2435 bytes --]
In-Reply-To: <fa6a0e3f95803d6eab39cd0e3ba188842274a1e0.1607669375.git.mirq-linux@rere.qmqm.pl>
References: <fa6a0e3f95803d6eab39cd0e3ba188842274a1e0.1607669375.git.mirq-linux@rere.qmqm.pl>
TO: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
TO: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Dmitry Osipenko <digetx@gmail.com>
CC: Johnny Chuang <johnny.chuang.emc@gmail.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi "Michał,
I love your patch! Perhaps something to improve:
[auto build test WARNING on input/next]
[also build test WARNING on v5.10]
[cannot apply to next-20201215]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Micha-Miros-aw/input-elants-Support-Asus-TF300T-and-Nexus-7-touchscreens/20201211-145956
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: x86_64-randconfig-a014-20201215 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project a29ecca7819a6ed4250d3689b12b1f664bb790d7)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/17d65584ccce6dce7fc20191ae5e3c3be136f128
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Micha-Miros-aw/input-elants-Support-Asus-TF300T-and-Nexus-7-touchscreens/20201211-145956
git checkout 17d65584ccce6dce7fc20191ae5e3c3be136f128
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_initialize()+0x2fb: sibling call from callable instruction with modified stack frame
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32850 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624
@ 2020-12-18 12:04 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-12-18 12:04 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2411 bytes --]
In-Reply-To: <fa6a0e3f95803d6eab39cd0e3ba188842274a1e0.1607669375.git.mirq-linux@rere.qmqm.pl>
References: <fa6a0e3f95803d6eab39cd0e3ba188842274a1e0.1607669375.git.mirq-linux@rere.qmqm.pl>
TO: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
TO: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Dmitry Osipenko <digetx@gmail.com>
CC: Johnny Chuang <johnny.chuang.emc@gmail.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi "Michał,
I love your patch! Perhaps something to improve:
[auto build test WARNING on input/next]
[also build test WARNING on v5.10]
[cannot apply to next-20201218]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Micha-Miros-aw/input-elants-Support-Asus-TF300T-and-Nexus-7-touchscreens/20201211-145956
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: x86_64-randconfig-a006-20201218 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/17d65584ccce6dce7fc20191ae5e3c3be136f128
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Micha-Miros-aw/input-elants-Support-Asus-TF300T-and-Nexus-7-touchscreens/20201211-145956
git checkout 17d65584ccce6dce7fc20191ae5e3c3be136f128
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_initialize() falls through to next function elants_i2c_irq()
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34361 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens
@ 2020-12-11 6:53 Michał Mirosław
2020-12-11 6:53 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław
0 siblings, 1 reply; 6+ messages in thread
From: Michał Mirosław @ 2020-12-11 6:53 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Dmitry Osipenko, Johnny Chuang, linux-input, linux-kernel
This series cleans up the driver a bit and implements changes needed to
support EKTF3624-based touchscreen used in Asus TF300T, Google Nexus 7
and similar Tegra3-based tablets.
---
v2: extended with Dmitry's patches (replaced v1 patches 3 and 4)
v3: rebased for v5.7-rc1
v4: rebased onto v5.7-rc2+ (current Linus' master)
update "remove unused axes" and "refactor
elants_i2c_execute_command()" patches after review
add David's patch converting DT binding to YAML
v5: rebased onto dtor/input/for-linus
v6: rebased onto newer dtor/input/for-linus
remove yet unused constants from patch 1
added a new drive-by cleanup (last patch)
v7: rebased onto current dtor/input/for-next
v8: rebased onto current dtor/input/for-linus
v8-resend: rebased again, no changes though
---
Dmitry Osipenko (1):
input: elants: support 0x66 reply opcode for reporting touches
Michał Mirosław (3):
input: elants: document some registers and values
input: elants: support old touch report format
input: elants: read touchscreen size for EKTF3624
drivers/input/touchscreen/elants_i2c.c | 149 +++++++++++++++++++++----
1 file changed, 127 insertions(+), 22 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 2020-12-11 6:53 [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens Michał Mirosław @ 2020-12-11 6:53 ` Michał Mirosław 2020-12-11 7:22 ` Dmitry Torokhov 0 siblings, 1 reply; 6+ messages in thread From: Michał Mirosław @ 2020-12-11 6:53 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: Dmitry Osipenko, Johnny Chuang, linux-input, linux-kernel EKTF3624 as present in Asus TF300T tablet has touchscreen size encoded in different registers. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Tested-by: Dmitry Osipenko <digetx@gmail.com> --- drivers/input/touchscreen/elants_i2c.c | 84 ++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index f1bf3e000e96..c24d8cdc4251 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -35,7 +35,7 @@ #include <linux/input/mt.h> #include <linux/input/touchscreen.h> #include <linux/acpi.h> -#include <linux/of.h> +#include <linux/of_device.h> #include <linux/gpio/consumer.h> #include <linux/regulator/consumer.h> #include <asm/unaligned.h> @@ -43,6 +43,10 @@ /* Device, Driver information */ #define DEVICE_NAME "elants_i2c" +/* Device IDs */ +#define EKTH3500 0 +#define EKTF3624 1 + /* Convert from rows or columns into resolution */ #define ELAN_TS_RESOLUTION(n, m) (((n) - 1) * (m)) @@ -94,6 +98,8 @@ #define E_ELAN_INFO_REK 0xD0 #define E_ELAN_INFO_TEST_VER 0xE0 #define E_ELAN_INFO_FW_ID 0xF0 +#define E_INFO_X_RES 0x60 +#define E_INFO_Y_RES 0x63 #define E_INFO_OSR 0xD6 #define E_INFO_PHY_SCAN 0xD7 #define E_INFO_PHY_DRIVER 0xD8 @@ -157,6 +163,7 @@ struct elants_data { bool wake_irq_enabled; bool keep_power_in_suspend; + u8 chip_id; /* Must be last to be used for DMA operations */ u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned; @@ -434,7 +441,58 @@ static int elants_i2c_query_bc_version(struct elants_data *ts) return 0; } -static int elants_i2c_query_ts_info(struct elants_data *ts) +static int elants_i2c_query_ts_info_ektf(struct elants_data *ts) +{ + struct i2c_client *client = ts->client; + int error; + u8 resp[4]; + u16 phy_x, phy_y; + const u8 get_xres_cmd[] = { + CMD_HEADER_READ, E_INFO_X_RES, 0x00, 0x00 + }; + const u8 get_yres_cmd[] = { + CMD_HEADER_READ, E_INFO_Y_RES, 0x00, 0x00 + }; + + /* Get X/Y size in mm */ + error = elants_i2c_execute_command(client, get_xres_cmd, + sizeof(get_xres_cmd), + resp, sizeof(resp), 1, + "get X size"); + if (error) + return error; + + phy_x = resp[2] | ((resp[3] & 0xF0) << 4); + + error = elants_i2c_execute_command(client, get_yres_cmd, + sizeof(get_yres_cmd), + resp, sizeof(resp), 1, + "get Y size"); + if (error) + return error; + + phy_y = resp[2] | ((resp[3] & 0xF0) << 4); + + if (!phy_x || !phy_y) { + dev_warn(&client->dev, + "invalid size data: %d x %d mm\n", + phy_x, phy_y); + return 0; + } + + dev_dbg(&client->dev, "phy_x=%d, phy_y=%d\n", phy_x, phy_y); + + /* calculate resolution from size */ + ts->x_max = 2240-1; + ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, phy_x); + + ts->y_max = 1408-1; + ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, phy_y); + + return 0; +} + +static int elants_i2c_query_ts_info_ekth(struct elants_data *ts) { struct i2c_client *client = ts->client; int error; @@ -588,8 +646,20 @@ static int elants_i2c_initialize(struct elants_data *ts) error = elants_i2c_query_fw_version(ts); if (!error) error = elants_i2c_query_test_version(ts); - if (!error) - error = elants_i2c_query_ts_info(ts); + + switch (ts->chip_id) { + case EKTH3500: + if (!error) + error = elants_i2c_query_ts_info_ekth(ts); + break; + case EKTF3624: + if (!error) + error = elants_i2c_query_ts_info_ektf(ts); + break; + default: + unreachable(); + break; + } if (error) ts->iap_mode = ELAN_IAP_RECOVERY; @@ -1266,6 +1336,9 @@ static int elants_i2c_probe(struct i2c_client *client, ts->client = client; i2c_set_clientdata(client, ts); + if (client->dev.of_node) + ts->chip_id = (uintptr_t)of_device_get_match_data(&client->dev); + ts->vcc33 = devm_regulator_get(&client->dev, "vcc33"); if (IS_ERR(ts->vcc33)) { error = PTR_ERR(ts->vcc33); @@ -1495,7 +1568,8 @@ MODULE_DEVICE_TABLE(acpi, elants_acpi_id); #ifdef CONFIG_OF static const struct of_device_id elants_of_match[] = { - { .compatible = "elan,ekth3500" }, + { .compatible = "elan,ekth3500", .data = (void *)EKTH3500 }, + { .compatible = "elan,ektf3624", .data = (void *)EKTF3624 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, elants_of_match); -- 2.20.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 2020-12-11 6:53 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław @ 2020-12-11 7:22 ` Dmitry Torokhov 2020-12-11 16:38 ` Michał Mirosław 0 siblings, 1 reply; 6+ messages in thread From: Dmitry Torokhov @ 2020-12-11 7:22 UTC (permalink / raw) To: Michał Mirosław Cc: Dmitry Osipenko, Johnny Chuang, linux-input, linux-kernel Hi Michał, On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote: > + > + if (!phy_x || !phy_y) { > + dev_warn(&client->dev, > + "invalid size data: %d x %d mm\n", > + phy_x, phy_y); > + return 0; Given we are not treating this as hard error mind dropping this "return" and making the below an "else" branch? > + } > + > + dev_dbg(&client->dev, "phy_x=%d, phy_y=%d\n", phy_x, phy_y); > + > + /* calculate resolution from size */ > + ts->x_max = 2240-1; > + ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, phy_x); > + > + ts->y_max = 1408-1; > + ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, phy_y); > + > + return 0; > +} > + > > + if (client->dev.of_node) > + ts->chip_id = (uintptr_t)of_device_get_match_data(&client->dev); Why don't we add EKTH3500 tag to the ACPI entry and make this unconditional device_get_match_data()? > + > ts->vcc33 = devm_regulator_get(&client->dev, "vcc33"); > if (IS_ERR(ts->vcc33)) { > error = PTR_ERR(ts->vcc33); > @@ -1495,7 +1568,8 @@ MODULE_DEVICE_TABLE(acpi, elants_acpi_id); > > #ifdef CONFIG_OF > static const struct of_device_id elants_of_match[] = { > - { .compatible = "elan,ekth3500" }, > + { .compatible = "elan,ekth3500", .data = (void *)EKTH3500 }, > + { .compatible = "elan,ektf3624", .data = (void *)EKTF3624 }, > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, elants_of_match); > -- > 2.20.1 > Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 2020-12-11 7:22 ` Dmitry Torokhov @ 2020-12-11 16:38 ` Michał Mirosław 0 siblings, 0 replies; 6+ messages in thread From: Michał Mirosław @ 2020-12-11 16:38 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: Dmitry Osipenko, Johnny Chuang, linux-input, linux-kernel On Thu, Dec 10, 2020 at 11:22:09PM -0800, Dmitry Torokhov wrote: > Hi Michał, > > On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote: > > + > > + if (!phy_x || !phy_y) { > > + dev_warn(&client->dev, > > + "invalid size data: %d x %d mm\n", > > + phy_x, phy_y); > > + return 0; > > Given we are not treating this as hard error mind dropping this "return" > and making the below an "else" branch? It is an error, still, and saves a bit of indentation in the following normal-path code. But I see that there is already a similar code with an 'else' branch. Best Regards, Michał Mirosław ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens
@ 2020-11-09 17:28 Michał Mirosław
2020-11-09 17:28 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław
0 siblings, 1 reply; 6+ messages in thread
From: Michał Mirosław @ 2020-11-09 17:28 UTC (permalink / raw)
To: Dmitry Torokhov, Johnny Chuang
Cc: Dmitry Osipenko, linux-input, linux-kernel, Peter Hutterer
This series cleans up the driver a bit and implements changes needed to
support EKTF3624-based touchscreen used in Asus TF300T, Google Nexus 7
and similar Tegra3-based tablets.
---
v2: extended with Dmitry's patches (replaced v1 patches 3 and 4)
v3: rebased for v5.7-rc1
v4: rebased onto v5.7-rc2+ (current Linus' master)
update "remove unused axes" and "refactor
elants_i2c_execute_command()" patches after review
add David's patch converting DT binding to YAML
v5: rebased onto dtor/input/for-linus
v6: rebased onto newer dtor/input/for-linus
remove yet unused constants from patch 1
added a new drive-by cleanup (last patch)
v7: rebased onto current dtor/input/for-next
v8: rebased onto current dtor/input/for-linus
---
Dmitry Osipenko (1):
input: elants: support 0x66 reply opcode for reporting touches
Michał Mirosław (3):
input: elants: document some registers and values
input: elants: support old touch report format
input: elants: read touchscreen size for EKTF3624
drivers/input/touchscreen/elants_i2c.c | 149 +++++++++++++++++++++----
1 file changed, 127 insertions(+), 22 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 2020-11-09 17:28 [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens Michał Mirosław @ 2020-11-09 17:28 ` Michał Mirosław 0 siblings, 0 replies; 6+ messages in thread From: Michał Mirosław @ 2020-11-09 17:28 UTC (permalink / raw) To: Dmitry Torokhov, Johnny Chuang Cc: Dmitry Osipenko, linux-input, linux-kernel, Peter Hutterer EKTF3624 as present in Asus TF300T tablet has touchscreen size encoded in different registers. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Tested-by: Dmitry Osipenko <digetx@gmail.com> --- drivers/input/touchscreen/elants_i2c.c | 84 ++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index f1bf3e000e96..c24d8cdc4251 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -35,7 +35,7 @@ #include <linux/input/mt.h> #include <linux/input/touchscreen.h> #include <linux/acpi.h> -#include <linux/of.h> +#include <linux/of_device.h> #include <linux/gpio/consumer.h> #include <linux/regulator/consumer.h> #include <asm/unaligned.h> @@ -43,6 +43,10 @@ /* Device, Driver information */ #define DEVICE_NAME "elants_i2c" +/* Device IDs */ +#define EKTH3500 0 +#define EKTF3624 1 + /* Convert from rows or columns into resolution */ #define ELAN_TS_RESOLUTION(n, m) (((n) - 1) * (m)) @@ -94,6 +98,8 @@ #define E_ELAN_INFO_REK 0xD0 #define E_ELAN_INFO_TEST_VER 0xE0 #define E_ELAN_INFO_FW_ID 0xF0 +#define E_INFO_X_RES 0x60 +#define E_INFO_Y_RES 0x63 #define E_INFO_OSR 0xD6 #define E_INFO_PHY_SCAN 0xD7 #define E_INFO_PHY_DRIVER 0xD8 @@ -157,6 +163,7 @@ struct elants_data { bool wake_irq_enabled; bool keep_power_in_suspend; + u8 chip_id; /* Must be last to be used for DMA operations */ u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned; @@ -434,7 +441,58 @@ static int elants_i2c_query_bc_version(struct elants_data *ts) return 0; } -static int elants_i2c_query_ts_info(struct elants_data *ts) +static int elants_i2c_query_ts_info_ektf(struct elants_data *ts) +{ + struct i2c_client *client = ts->client; + int error; + u8 resp[4]; + u16 phy_x, phy_y; + const u8 get_xres_cmd[] = { + CMD_HEADER_READ, E_INFO_X_RES, 0x00, 0x00 + }; + const u8 get_yres_cmd[] = { + CMD_HEADER_READ, E_INFO_Y_RES, 0x00, 0x00 + }; + + /* Get X/Y size in mm */ + error = elants_i2c_execute_command(client, get_xres_cmd, + sizeof(get_xres_cmd), + resp, sizeof(resp), 1, + "get X size"); + if (error) + return error; + + phy_x = resp[2] | ((resp[3] & 0xF0) << 4); + + error = elants_i2c_execute_command(client, get_yres_cmd, + sizeof(get_yres_cmd), + resp, sizeof(resp), 1, + "get Y size"); + if (error) + return error; + + phy_y = resp[2] | ((resp[3] & 0xF0) << 4); + + if (!phy_x || !phy_y) { + dev_warn(&client->dev, + "invalid size data: %d x %d mm\n", + phy_x, phy_y); + return 0; + } + + dev_dbg(&client->dev, "phy_x=%d, phy_y=%d\n", phy_x, phy_y); + + /* calculate resolution from size */ + ts->x_max = 2240-1; + ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, phy_x); + + ts->y_max = 1408-1; + ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, phy_y); + + return 0; +} + +static int elants_i2c_query_ts_info_ekth(struct elants_data *ts) { struct i2c_client *client = ts->client; int error; @@ -588,8 +646,20 @@ static int elants_i2c_initialize(struct elants_data *ts) error = elants_i2c_query_fw_version(ts); if (!error) error = elants_i2c_query_test_version(ts); - if (!error) - error = elants_i2c_query_ts_info(ts); + + switch (ts->chip_id) { + case EKTH3500: + if (!error) + error = elants_i2c_query_ts_info_ekth(ts); + break; + case EKTF3624: + if (!error) + error = elants_i2c_query_ts_info_ektf(ts); + break; + default: + unreachable(); + break; + } if (error) ts->iap_mode = ELAN_IAP_RECOVERY; @@ -1266,6 +1336,9 @@ static int elants_i2c_probe(struct i2c_client *client, ts->client = client; i2c_set_clientdata(client, ts); + if (client->dev.of_node) + ts->chip_id = (uintptr_t)of_device_get_match_data(&client->dev); + ts->vcc33 = devm_regulator_get(&client->dev, "vcc33"); if (IS_ERR(ts->vcc33)) { error = PTR_ERR(ts->vcc33); @@ -1495,7 +1568,8 @@ MODULE_DEVICE_TABLE(acpi, elants_acpi_id); #ifdef CONFIG_OF static const struct of_device_id elants_of_match[] = { - { .compatible = "elan,ekth3500" }, + { .compatible = "elan,ekth3500", .data = (void *)EKTH3500 }, + { .compatible = "elan,ektf3624", .data = (void *)EKTF3624 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, elants_of_match); -- 2.20.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-12-18 12:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-12-15 14:59 [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 kernel test robot -- strict thread matches above, loose matches on Subject: below -- 2020-12-18 12:04 kernel test robot 2020-12-11 6:53 [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens Michał Mirosław 2020-12-11 6:53 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław 2020-12-11 7:22 ` Dmitry Torokhov 2020-12-11 16:38 ` Michał Mirosław 2020-11-09 17:28 [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens Michał Mirosław 2020-11-09 17:28 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.