Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222212 > unrolled thread

[PATCH] Input: elan_i2c - Expand maxmium product_id form 0xFF to 0xFFFF

Started byduson <dusonlin@emc.com.tw>
First post2015-09-10 16:00 +0200
Last post2015-09-21 18:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Input: elan_i2c - Expand maxmium product_id form 0xFF to  0xFFFF  duson <dusonlin@emc.com.tw> - 2015-09-10 16:00 +0200
    Re: [PATCH] Input: elan_i2c - Expand maxmium product_id form 0xFF to  0xFFFF Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-09-21 18:40 +0200

#1222212 — [PATCH] Input: elan_i2c - Expand maxmium product_id form 0xFF to 0xFFFF

Fromduson <dusonlin@emc.com.tw>
Date2015-09-10 16:00 +0200
Subject[PATCH] Input: elan_i2c - Expand maxmium product_id form 0xFF to 0xFFFF
Message-ID<q7ayl-3dh-3@gated-at.bofh.it>
In order to support more projects in the feture, we expand the
maxmium product_id value form 0xFF to 0xFFFF.

Signed-off by: Duson Lin <dusonlin@emc.com.tw>
---
 drivers/input/mouse/elan_i2c.h       |    2 +-
 drivers/input/mouse/elan_i2c_core.c  |    6 +++---
 drivers/input/mouse/elan_i2c_i2c.c   |    4 ++--
 drivers/input/mouse/elan_i2c_smbus.c |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c.h b/drivers/input/mouse/elan_i2c.h
index 73670f2..c0ec261 100644
--- a/drivers/input/mouse/elan_i2c.h
+++ b/drivers/input/mouse/elan_i2c.h
@@ -60,7 +60,7 @@ struct elan_transport_ops {
 	int (*get_sm_version)(struct i2c_client *client,
 			      u8* ic_type, u8 *version);
 	int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
-	int (*get_product_id)(struct i2c_client *client, u8 *id);
+	int (*get_product_id)(struct i2c_client *client, u16 *id);
 
 	int (*get_max)(struct i2c_client *client,
 		       unsigned int *max_x, unsigned int *max_y);
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index e2b7420..4a5450d 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -4,7 +4,7 @@
  * Copyright (c) 2013 ELAN Microelectronics Corp.
  *
  * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>
- * Version: 1.6.0
+ * Version: 1.6.1
  *
  * Based on cyapa driver:
  * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
@@ -40,7 +40,7 @@
 #include "elan_i2c.h"
 
 #define DRIVER_NAME		"elan_i2c"
-#define ELAN_DRIVER_VERSION	"1.6.0"
+#define ELAN_DRIVER_VERSION	"1.6.1"
 #define ETP_MAX_PRESSURE	255
 #define ETP_FWIDTH_REDUCE	90
 #define ETP_FINGER_WIDTH	15
@@ -76,7 +76,7 @@ struct elan_tp_data {
 	unsigned int		x_res;
 	unsigned int		y_res;
 
-	u8			product_id;
+	u16			product_id;
 	u8			fw_version;
 	u8			sm_version;
 	u8			iap_version;
diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c
index 683c840..a679e56 100644
--- a/drivers/input/mouse/elan_i2c_i2c.c
+++ b/drivers/input/mouse/elan_i2c_i2c.c
@@ -276,7 +276,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
 	return 0;
 }
 
-static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
+static int elan_i2c_get_product_id(struct i2c_client *client, u16 *id)
 {
 	int error;
 	u8 val[3];
@@ -287,7 +287,7 @@ static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
 		return error;
 	}
 
-	*id = val[0];
+	*id = le16_to_cpup((__le16 *)val);
 	return 0;
 }
 
diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
index ff36a36..cb6aecb 100644
--- a/drivers/input/mouse/elan_i2c_smbus.c
+++ b/drivers/input/mouse/elan_i2c_smbus.c
@@ -183,7 +183,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client,
 	return 0;
 }
 
-static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
+static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id)
 {
 	int error;
 	u8 val[3];
@@ -195,7 +195,7 @@ static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
 		return error;
 	}
 
-	*id = val[1];
+	*id = be16_to_cpup((__be16 *)val);
 	return 0;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1229548

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2015-09-21 18:40 +0200
Message-ID<qbcie-3Gm-19@gated-at.bofh.it>
In reply to#1222212
On Thu, Sep 10, 2015 at 09:55:47PM +0800, duson wrote:
> In order to support more projects in the feture, we expand the
> maxmium product_id value form 0xFF to 0xFFFF.
> 
> Signed-off by: Duson Lin <dusonlin@emc.com.tw>

Applied, thank you.

> ---
>  drivers/input/mouse/elan_i2c.h       |    2 +-
>  drivers/input/mouse/elan_i2c_core.c  |    6 +++---
>  drivers/input/mouse/elan_i2c_i2c.c   |    4 ++--
>  drivers/input/mouse/elan_i2c_smbus.c |    4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c.h b/drivers/input/mouse/elan_i2c.h
> index 73670f2..c0ec261 100644
> --- a/drivers/input/mouse/elan_i2c.h
> +++ b/drivers/input/mouse/elan_i2c.h
> @@ -60,7 +60,7 @@ struct elan_transport_ops {
>  	int (*get_sm_version)(struct i2c_client *client,
>  			      u8* ic_type, u8 *version);
>  	int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
> -	int (*get_product_id)(struct i2c_client *client, u8 *id);
> +	int (*get_product_id)(struct i2c_client *client, u16 *id);
>  
>  	int (*get_max)(struct i2c_client *client,
>  		       unsigned int *max_x, unsigned int *max_y);
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index e2b7420..4a5450d 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -4,7 +4,7 @@
>   * Copyright (c) 2013 ELAN Microelectronics Corp.
>   *
>   * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>
> - * Version: 1.6.0
> + * Version: 1.6.1
>   *
>   * Based on cyapa driver:
>   * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
> @@ -40,7 +40,7 @@
>  #include "elan_i2c.h"
>  
>  #define DRIVER_NAME		"elan_i2c"
> -#define ELAN_DRIVER_VERSION	"1.6.0"
> +#define ELAN_DRIVER_VERSION	"1.6.1"
>  #define ETP_MAX_PRESSURE	255
>  #define ETP_FWIDTH_REDUCE	90
>  #define ETP_FINGER_WIDTH	15
> @@ -76,7 +76,7 @@ struct elan_tp_data {
>  	unsigned int		x_res;
>  	unsigned int		y_res;
>  
> -	u8			product_id;
> +	u16			product_id;
>  	u8			fw_version;
>  	u8			sm_version;
>  	u8			iap_version;
> diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c
> index 683c840..a679e56 100644
> --- a/drivers/input/mouse/elan_i2c_i2c.c
> +++ b/drivers/input/mouse/elan_i2c_i2c.c
> @@ -276,7 +276,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
>  	return 0;
>  }
>  
> -static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
> +static int elan_i2c_get_product_id(struct i2c_client *client, u16 *id)
>  {
>  	int error;
>  	u8 val[3];
> @@ -287,7 +287,7 @@ static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
>  		return error;
>  	}
>  
> -	*id = val[0];
> +	*id = le16_to_cpup((__le16 *)val);
>  	return 0;
>  }
>  
> diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
> index ff36a36..cb6aecb 100644
> --- a/drivers/input/mouse/elan_i2c_smbus.c
> +++ b/drivers/input/mouse/elan_i2c_smbus.c
> @@ -183,7 +183,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client,
>  	return 0;
>  }
>  
> -static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
> +static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id)
>  {
>  	int error;
>  	u8 val[3];
> @@ -195,7 +195,7 @@ static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
>  		return error;
>  	}
>  
> -	*id = val[1];
> +	*id = be16_to_cpup((__be16 *)val);
>  	return 0;
>  }
> 

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web