Input: elan_i2c - use iap_version to get firmware information
authorDuson Lin <dusonlin@emc.com.tw>
Thu, 3 Sep 2015 16:46:45 +0000 (09:46 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 3 Sep 2015 17:00:16 +0000 (10:00 -0700)
When driver is in IAP mode ic_type query may return 0xff. However
iap_version will always be valid, so let's use it to determine parameters
of the firmware that the controller is supposed to accept.

Signed-off-by: Duson Lin <dusonlin@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/elan_i2c_core.c

index d4a38caa1ab13648fd98ba13c443bb26d597f7ad..e2b7420eed97d8ac0390909118b369dc800fd566 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2013 ELAN Microelectronics Corp.
  *
  * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>
- * Version: 1.5.9
+ * Version: 1.6.0
  *
  * 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.5.9"
+#define ELAN_DRIVER_VERSION    "1.6.0"
 #define ETP_MAX_PRESSURE       255
 #define ETP_FWIDTH_REDUCE      90
 #define ETP_FINGER_WIDTH       15
@@ -94,10 +94,10 @@ struct elan_tp_data {
        bool                    baseline_ready;
 };
 
-static int elan_get_fwinfo(u8 ic_type, u16 *validpage_count,
+static int elan_get_fwinfo(u8 iap_version, u16 *validpage_count,
                           u16 *signature_address)
 {
-       switch(ic_type) {
+       switch (iap_version) {
        case 0x08:
                *validpage_count = 512;
                break;
@@ -264,11 +264,11 @@ static int elan_query_device_info(struct elan_tp_data *data)
        if (error)
                return error;
 
-       error = elan_get_fwinfo(data->ic_type, &data->fw_validpage_count,
+       error = elan_get_fwinfo(data->iap_version, &data->fw_validpage_count,
                                &data->fw_signature_address);
        if (error) {
                dev_err(&data->client->dev,
-                       "unknown ic type %d\n", data->ic_type);
+                       "unknown iap version %d\n", data->iap_version);
                return error;
        }