linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "jingle" <jingle.wu@emc.com.tw>
To: "'Dmitry Torokhov'" <dmitry.torokhov@gmail.com>
Cc: "'linux-kernel'" <linux-kernel@vger.kernel.org>,
	"'linux-input'" <linux-input@vger.kernel.org>,
	"'phoenix'" <phoenix@emc.com.tw>,
	"'josh.chen'" <josh.chen@emc.com.tw>,
	"'kai.heng.feng'" <kai.heng.feng@canonical.com>
Subject: RE: [PATCH 2/2] Input: elan_i2c - Modify the IAP related functio n for page sizes 128, 512 bytes.
Date: Fri, 17 Jul 2020 16:20:16 +0800	[thread overview]
Message-ID: <002b01d65c13$1a19f0d0$4e4dd270$@emc.com.tw> (raw)
In-Reply-To: <20200717061010.GD1665100@dtor-ws>

Hi Dmitry:

In this "static int elan_i2c_prepare_fw_update(struct i2c_client *client,
u16 ic_type, u8 iap_version)" function
If IC is old_pattern, it must be modified to iap_version
	-> u16 type = pattern >= 0x01 ? ic_type : iap_version;

Thanks

-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Friday, July 17, 2020 2:10 PM
To: jingle.wu
Cc: linux-kernel; linux-input; phoenix; josh.chen; kai.heng.feng
Subject: Re: [PATCH 2/2] Input: elan_i2c - Modify the IAP related functio n
for page sizes 128, 512 bytes.

On Thu, Jul 16, 2020 at 06:27:19PM -0700, Dmitry Torokhov wrote:
> Hi Jingle,
> 
> On Thu, Jul 16, 2020 at 02:15:23PM +0800, jingle.wu wrote:
> > HI Dmitry:
> > 
> > Just to confirm, the older devices (I assume that pattern 0 means 
> > older)  have version command that is numerically higher than the one 
> > for the  newer (pattern >= 1) devices?
> > 
> > >> Yes, Pattern 1, 2 are newer devices.
> > 
> > > @@ -324,7 +342,14 @@ static int elan_i2c_get_sm_version(struct
i2c_client *client,
> > >  			return error;
> > >  		}
> > >  		*version = val[0];
> > > -		*ic_type = val[1];
> > > +
> > > +		error = elan_i2c_read_cmd(client, ETP_I2C_IAP_VERSION_CMD,
val);
> > > +		if (error) {
> > > +			dev_err(&client->dev, "failed to get ic type: %d\n",
> > > +				error);
> > > +			return error;
> > > +		}
> > 
> > Could you please tell me why this chunk is needed?
> > >> Modify the old pattern IC firmware read the correct ic_type.
> > 
> > In the elan_i2c_core.c, move this code to elan_i2c_i2c.c. 
> > static int elan_query_device_info(struct elan_tp_data *data) {
> > 	.....
> > 	if (data->pattern == 0x01)
> > 		ic_type = data->ic_type;
> > 	else
> > 		ic_type = data->iap_version;
> > 	.....
> > 	return 0;
> > }
> 
> I am concerned that unconditionally substituting iap_version for 
> ic_type for "pattern 0" devices will break check in
> elan_check_ASUS_special_fw() as it operates on the ic_type returned by 
> ETP_I2C_OSM_VERSION_CMD and not iap_version.

I split the firmware handling code into a few patches and uploaded it to a
new elan-i2c branch:

https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git elan-i2c

Please take a look and let me know if I messed it up or not. I will be
looking at the new packet format next.

Thanks.

--
Dmitry


  reply	other threads:[~2020-07-17  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 10:56 [PATCH 2/2] Input: elan_i2c - Modify the IAP related function for page sizes 128, 512 bytes Jingle Wu
2020-07-16  5:39 ` Dmitry Torokhov
2020-07-16  6:15   ` [PATCH 2/2] Input: elan_i2c - Modify the IAP related functio n " jingle.wu
2020-07-17  1:27     ` Dmitry Torokhov
2020-07-17  6:10       ` Dmitry Torokhov
2020-07-17  8:20         ` jingle [this message]
2020-07-17  8:31         ` jingle
2020-07-17 16:02           ` 'Dmitry Torokhov'

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='002b01d65c13$1a19f0d0$4e4dd270$@emc.com.tw' \
    --to=jingle.wu@emc.com.tw \
    --cc=dmitry.torokhov@gmail.com \
    --cc=josh.chen@emc.com.tw \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phoenix@emc.com.tw \
    /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;
as well as URLs for NNTP newsgroup(s).