From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: haibo.chen@nxp.com
Cc: linux-input@vger.kernel.org, linux-imx@nxp.com, festevam@gmail.com
Subject: Re: [PATCH V3 2/2] input: egalax_ts: fix the get_firmware_command
Date: Sun, 19 Apr 2020 11:28:20 -0700 [thread overview]
Message-ID: <20200419182820.GM166864@dtor-ws> (raw)
In-Reply-To: <1586937663-13342-2-git-send-email-haibo.chen@nxp.com>
Hi Haibo,
On Wed, Apr 15, 2020 at 04:01:03PM +0800, haibo.chen@nxp.com wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
>
> According to the User Guide, the get firmware command is
> { 0x03, 0x03, 0xa, 0x01, 'D' }, ASCII value of 'D' is 0x44.
>
> This patch fix that.
You are absolutely right that 0x03 0x03 0x0a 0x01 0x44 is the proper
sequence for the "get firmware version" command, however, despite the function
name, we are not fetching firmware here, but rather try to check if
device operates normally via the "check active" command. So if anything
we should rename the function to egalax_check_active(). We should also
try reading the data sent back by the device and verify that it is what
we expect.
And if you indeed want to retrieve firmware version and controller type,
that should be separate functions.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> ---
> drivers/input/touchscreen/egalax_ts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
> index d3dc6d14bb78..1da6ddb9b4ee 100644
> --- a/drivers/input/touchscreen/egalax_ts.c
> +++ b/drivers/input/touchscreen/egalax_ts.c
> @@ -171,7 +171,7 @@ static int egalax_wake_up_device(struct i2c_client *client)
>
> static int egalax_firmware_version(struct i2c_client *client)
> {
> - static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 };
> + static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x44 };
> int ret;
>
> ret = i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);
> --
> 2.17.1
>
Thanks.
--
Dmitry
prev parent reply other threads:[~2020-04-19 18:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 8:01 [PATCH V3 1/2] input: egalax_ts: free irq resource before request the line as GPIO haibo.chen
2020-04-15 8:01 ` [PATCH V3 2/2] input: egalax_ts: fix the get_firmware_command haibo.chen
2020-04-19 18:28 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200419182820.GM166864@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=festevam@gmail.com \
--cc=haibo.chen@nxp.com \
--cc=linux-imx@nxp.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox