linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [ADD] 1.support new ic type for version 4.
@ 2015-01-06  8:10 Sam hung
  2015-01-07  7:21 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Sam hung @ 2015-01-06  8:10 UTC (permalink / raw)
  To: linux-input, dmitry.torokhov; +Cc: dusonlin, Sam hung

---
 drivers/input/mouse/elantech.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index f2b9780..4891d07 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -700,14 +700,14 @@ static int elantech_packet_check_v1(struct psmouse *psmouse)
 
 static int elantech_debounce_check_v2(struct psmouse *psmouse)
 {
-        /*
-         * When we encounter packet that matches this exactly, it means the
-         * hardware is in debounce status. Just ignore the whole packet.
-         */
-        const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
-        unsigned char *packet = psmouse->packet;
-
-        return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
+	/*
+	* When we encounter packet that matches this exactly, it means the
+	* hardware is in debounce status. Just ignore the whole packet.
+	*/
+	const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
+	unsigned char *packet = psmouse->packet;
+
+	return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
 }
 
 static int elantech_packet_check_v2(struct psmouse *psmouse)
@@ -1499,7 +1499,7 @@ static const struct dmi_system_id no_hw_res_dmi_table[] = {
 /*
  * determine hardware version and set some properties according to it.
  */
-static int elantech_set_properties(struct elantech_data *etd)
+static int elantech_set_properties(struct psmouse *psmouse, struct elantech_data *etd)
 {
 	/* This represents the version of IC body. */
 	int ver = (etd->fw_version & 0x0f0000) >> 16;
@@ -1520,9 +1520,12 @@ static int elantech_set_properties(struct elantech_data *etd)
 		case 7:
 		case 8:
 		case 9:
+		case 10:
+		case 13:
 			etd->hw_version = 4;
 			break;
 		default:
+			psmouse_err(psmouse, "failed to setting hw version.\n");
 			return -1;
 		}
 	}
@@ -1593,7 +1596,7 @@ int elantech_init(struct psmouse *psmouse)
 	}
 	etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
 
-	if (elantech_set_properties(etd)) {
+	if (elantech_set_properties(psmouse, etd)) {
 		psmouse_err(psmouse, "unknown hardware version, aborting...\n");
 		goto init_fail;
 	}
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [ADD] 1.support new ic type for version 4.
  2015-01-06  8:10 [PATCH] [ADD] 1.support new ic type for version 4 Sam hung
@ 2015-01-07  7:21 ` Dmitry Torokhov
  2015-01-07  7:25   ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2015-01-07  7:21 UTC (permalink / raw)
  To: Sam hung; +Cc: linux-input, dusonlin

Hi Sam,

On Tue, Jan 06, 2015 at 04:10:16PM +0800, Sam hung wrote:
> ---
>  drivers/input/mouse/elantech.c | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index f2b9780..4891d07 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -700,14 +700,14 @@ static int elantech_packet_check_v1(struct psmouse *psmouse)
>  
>  static int elantech_debounce_check_v2(struct psmouse *psmouse)
>  {
> -        /*
> -         * When we encounter packet that matches this exactly, it means the
> -         * hardware is in debounce status. Just ignore the whole packet.
> -         */
> -        const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
> -        unsigned char *packet = psmouse->packet;
> -
> -        return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
> +	/*
> +	* When we encounter packet that matches this exactly, it means the
> +	* hardware is in debounce status. Just ignore the whole packet.
> +	*/
> +	const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
> +	unsigned char *packet = psmouse->packet;
> +
> +	return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
>  }

Hmm, this chunk seems to be replacing spaces with tabs... I'd rather had
it separate from the hardware version changes.

I'll pick up the chunk below though.

>  
>  static int elantech_packet_check_v2(struct psmouse *psmouse)
> @@ -1499,7 +1499,7 @@ static const struct dmi_system_id no_hw_res_dmi_table[] = {
>  /*
>   * determine hardware version and set some properties according to it.
>   */
> -static int elantech_set_properties(struct elantech_data *etd)
> +static int elantech_set_properties(struct psmouse *psmouse, struct elantech_data *etd)
>  {
>  	/* This represents the version of IC body. */
>  	int ver = (etd->fw_version & 0x0f0000) >> 16;
> @@ -1520,9 +1520,12 @@ static int elantech_set_properties(struct elantech_data *etd)
>  		case 7:
>  		case 8:
>  		case 9:
> +		case 10:
> +		case 13:
>  			etd->hw_version = 4;
>  			break;
>  		default:
> +			psmouse_err(psmouse, "failed to setting hw version.\n");
>  			return -1;
>  		}
>  	}
> @@ -1593,7 +1596,7 @@ int elantech_init(struct psmouse *psmouse)
>  	}
>  	etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
>  
> -	if (elantech_set_properties(etd)) {
> +	if (elantech_set_properties(psmouse, etd)) {
>  		psmouse_err(psmouse, "unknown hardware version, aborting...\n");
>  		goto init_fail;
>  	}
> -- 
> 1.8.3.2
> 

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [ADD] 1.support new ic type for version 4.
  2015-01-07  7:21 ` Dmitry Torokhov
@ 2015-01-07  7:25   ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2015-01-07  7:25 UTC (permalink / raw)
  To: Sam hung; +Cc: linux-input, dusonlin

On Tue, Jan 06, 2015 at 11:21:36PM -0800, Dmitry Torokhov wrote:
> Hi Sam,
> 
> On Tue, Jan 06, 2015 at 04:10:16PM +0800, Sam hung wrote:
> > ---
> >  drivers/input/mouse/elantech.c | 23 +++++++++++++----------
> >  1 file changed, 13 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> > index f2b9780..4891d07 100644
> > --- a/drivers/input/mouse/elantech.c
> > +++ b/drivers/input/mouse/elantech.c
> > @@ -700,14 +700,14 @@ static int elantech_packet_check_v1(struct psmouse *psmouse)
> >  
> >  static int elantech_debounce_check_v2(struct psmouse *psmouse)
> >  {
> > -        /*
> > -         * When we encounter packet that matches this exactly, it means the
> > -         * hardware is in debounce status. Just ignore the whole packet.
> > -         */
> > -        const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
> > -        unsigned char *packet = psmouse->packet;
> > -
> > -        return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
> > +	/*
> > +	* When we encounter packet that matches this exactly, it means the
> > +	* hardware is in debounce status. Just ignore the whole packet.
> > +	*/
> > +	const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
> > +	unsigned char *packet = psmouse->packet;
> > +
> > +	return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
> >  }
> 
> Hmm, this chunk seems to be replacing spaces with tabs... I'd rather had
> it separate from the hardware version changes.
> 
> I'll pick up the chunk below though.

Ah, I missed the fact that the patch does not have your "signed-off-by"
signature (see Documentation/SubmittingPatches). Please resend with it.

> 
> >  
> >  static int elantech_packet_check_v2(struct psmouse *psmouse)
> > @@ -1499,7 +1499,7 @@ static const struct dmi_system_id no_hw_res_dmi_table[] = {
> >  /*
> >   * determine hardware version and set some properties according to it.
> >   */
> > -static int elantech_set_properties(struct elantech_data *etd)
> > +static int elantech_set_properties(struct psmouse *psmouse, struct elantech_data *etd)
> >  {
> >  	/* This represents the version of IC body. */
> >  	int ver = (etd->fw_version & 0x0f0000) >> 16;
> > @@ -1520,9 +1520,12 @@ static int elantech_set_properties(struct elantech_data *etd)
> >  		case 7:
> >  		case 8:
> >  		case 9:
> > +		case 10:
> > +		case 13:
> >  			etd->hw_version = 4;
> >  			break;
> >  		default:
> > +			psmouse_err(psmouse, "failed to setting hw version.\n");

The caller of elantech_set_properties() already issues message about
unknown hardware version, why do we need to have it here as well?

> >  			return -1;
> >  		}
> >  	}
> > @@ -1593,7 +1596,7 @@ int elantech_init(struct psmouse *psmouse)
> >  	}
> >  	etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
> >  
> > -	if (elantech_set_properties(etd)) {
> > +	if (elantech_set_properties(psmouse, etd)) {
> >  		psmouse_err(psmouse, "unknown hardware version, aborting...\n");
> >  		goto init_fail;
> >  	}
> > -- 
> > 1.8.3.2
> > 

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [ADD] 1.support new ic type for version 4.
       [not found] <013d01d02b25$cdb240e0$6916c2a0$@emc.com.tw>
@ 2015-01-08 21:32 ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2015-01-08 21:32 UTC (permalink / raw)
  To: 洪一竹; +Cc: linux-input, dusonlin

Hi Sam,

FYI:

You sent this message as both plain/text and html, but vger.kernel.org
mailing lists are configured to discard all emails with html in them, so
while I did get your reply others did not. Please try to find mail agent
allowing you to use only plain text when interacting with Linux-related
mailing list.

In any case I received your updated patch and applied it. It should show
up in mainline with my next pull request (couple of days).

Thanks!

On Thu, Jan 08, 2015 at 05:30:54PM +0800, 洪一竹  wrote:
> Thank you for your prompt reply!
> 
> Reply message below.
> 
>  
> 
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
> Sent: Wednesday, January 07, 2015 3:26 PM
> To: Sam hung
> Cc: linux-input@vger.kernel.org; dusonlin@emc.com.tw
> Subject: Re: [PATCH] [ADD] 1.support new ic type for version 4.
> 
>  
> 
> On Tue, Jan 06, 2015 at 11:21:36PM -0800, Dmitry Torokhov wrote:
> 
> > Hi Sam,
> 
> > 
> 
> > On Tue, Jan 06, 2015 at 04:10:16PM +0800, Sam hung wrote:
> 
> > > ---
> 
> > >  drivers/input/mouse/elantech.c | 23 +++++++++++++----------
> 
> > >  1 file changed, 13 insertions(+), 10 deletions(-)
> 
> > > 
> 
> > > diff --git a/drivers/input/mouse/elantech.c 
> 
> > > b/drivers/input/mouse/elantech.c index f2b9780..4891d07 100644
> 
> > > --- a/drivers/input/mouse/elantech.c
> 
> > > +++ b/drivers/input/mouse/elantech.c
> 
> > > @@ -700,14 +700,14 @@ static int elantech_packet_check_v1(struct 
> 
> > > psmouse *psmouse)
> 
> > >  
> 
> > >  static int elantech_debounce_check_v2(struct psmouse *psmouse)  {
> 
> > > -        /*
> 
> > > -         * When we encounter packet that matches this exactly, it means
> the
> 
> > > -         * hardware is in debounce status. Just ignore the whole
> packet.
> 
> > > -         */
> 
> > > -        const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff,
> 0xff };
> 
> > > -        unsigned char *packet = psmouse->packet;
> 
> > > -
> 
> > > -        return !memcmp(packet, debounce_packet,
> sizeof(debounce_packet));
> 
> > > +        /*
> 
> > > +        * When we encounter packet that matches this exactly, it means
> the
> 
> > > +        * hardware is in debounce status. Just ignore the whole packet.
> 
> > > +        */
> 
> > > +        const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff,
> 0xff };
> 
> > > +        unsigned char *packet = psmouse->packet;
> 
> > > +
> 
> > > +        return !memcmp(packet, debounce_packet,
> sizeof(debounce_packet));
> 
> > >  }
> 
> > 
> 
> > Hmm, this chunk seems to be replacing spaces with tabs... I'd rather 
> 
> > had it separate from the hardware version changes.
> 
> > 
> 
> > I'll pick up the chunk below though.
> 
> OK,In this Patch I will not change these lines (‘space’to ‘tab’).
> 
>  
> 
> Ah, I missed the fact that the patch does not have your "signed-off-by"
> 
> signature (see Documentation/SubmittingPatches). Please resend with it.
> 
>  
> 
> Thanks for your reminder.
> 
> I will fix this problem.
> 
> > 
> 
> > >  
> 
> > >  static int elantech_packet_check_v2(struct psmouse *psmouse) @@ 
> 
> > > -1499,7 +1499,7 @@ static const struct dmi_system_id 
> 
> > > no_hw_res_dmi_table[] = {
> 
> > >  /*
> 
> > >   * determine hardware version and set some properties according to it.
> 
> > >   */
> 
> > > -static int elantech_set_properties(struct elantech_data *etd)
> 
> > > +static int elantech_set_properties(struct psmouse *psmouse, struct 
> 
> > > +elantech_data *etd)
> 
> > >  {
> 
> > >         /* This represents the version of IC body. */
> 
> > >         int ver = (etd->fw_version & 0x0f0000) >> 16; @@ -1520,9
> +1520,12 
> 
> > > @@ static int elantech_set_properties(struct elantech_data *etd)
> 
> > >                 case 7:
> 
> > >                 case 8:
> 
> > >                 case 9:
> 
> > > +                case 10:
> 
> > > +                case 13:
> 
> > >                         etd->hw_version = 4;
> 
> > >                         break;
> 
> > >                 default:
> 
> > > +                        psmouse_err(psmouse, "failed to setting hw
> version.\n");
> 
>  
> 
> The caller of elantech_set_properties() already issues message about unknown
> hardware version, why do we need to have it here as well?
> 
>  
> 
> I think you're right.
> 
> I will fix this line.
> 
>  
> 
> > >                         return -1;
> 
> > >                 }
> 
> > >         }
> 
> > > @@ -1593,7 +1596,7 @@ int elantech_init(struct psmouse *psmouse)
> 
> > >         }
> 
> > >         etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
> 
> > >  
> 
> > > - if (elantech_set_properties(etd)) {
> 
> > > +        if (elantech_set_properties(psmouse, etd)) {
> 
> > >                 psmouse_err(psmouse, "unknown hardware version,
> aborting...\n");
> 
> > >                 goto init_fail;
> 
> > >         }
> 
> > > --
> 
> > > 1.8.3.2
> 
> > > 
> 
>  
> 
> Thanks.
> 
>  
> 
> -- 
> 
> Dmitry
> 
>  
> 

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-08 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-06  8:10 [PATCH] [ADD] 1.support new ic type for version 4 Sam hung
2015-01-07  7:21 ` Dmitry Torokhov
2015-01-07  7:25   ` Dmitry Torokhov
     [not found] <013d01d02b25$cdb240e0$6916c2a0$@emc.com.tw>
2015-01-08 21:32 ` Dmitry Torokhov

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).