driver, sensors: fix compile err
authorZorro Liu <lyx@rock-chips.com>
Mon, 4 Jul 2016 06:16:53 +0000 (14:16 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 12 Jul 2016 06:18:34 +0000 (14:18 +0800)
Change-Id: Ice9e31086b29a20e37bf5ba3bf08d1e77a9a36a3
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
drivers/input/sensors/compass/ak8963.c
drivers/input/sensors/compass/ak8975.c
drivers/input/sensors/gyro/ewtsa.c
drivers/input/sensors/sensor-dev.c
drivers/input/sensors/sensor-i2c.c

index 305f9385deebc0082060c0d2364a4f284c33b913..d44fcb9c942fc607a710eb5193de0159daf5fba8 100644 (file)
@@ -340,8 +340,6 @@ static void compass_set_YPR(int *rbuf)
 \r
 static int compass_dev_open(struct inode *inode, struct file *file)\r
 {\r
-       struct sensor_private_data* sensor = \r
-               (struct sensor_private_data *)i2c_get_clientdata(this_client); \r
        int result = 0;\r
        DBG("%s\n",__func__);\r
 \r
@@ -351,8 +349,6 @@ static int compass_dev_open(struct inode *inode, struct file *file)
 \r
 static int compass_dev_release(struct inode *inode, struct file *file)\r
 {\r
-       struct sensor_private_data* sensor = \r
-               (struct sensor_private_data *)i2c_get_clientdata(this_client); \r
        int result = 0; \r
        DBG("%s\n",__func__);\r
 \r
index 3d372cb7230eba211aa039e9fda2838b33569dd1..62e38911cd9b51c44b42f137da6e8b2bffbaa130 100755 (executable)
@@ -312,8 +312,6 @@ static void compass_set_YPR(short *rbuf)
 \r
 static int compass_dev_open(struct inode *inode, struct file *file)\r
 {\r
-       struct sensor_private_data* sensor = \r
-               (struct sensor_private_data *)i2c_get_clientdata(this_client); \r
        int result = 0;\r
        DBG("%s\n",__func__);\r
 \r
@@ -323,8 +321,6 @@ static int compass_dev_open(struct inode *inode, struct file *file)
 \r
 static int compass_dev_release(struct inode *inode, struct file *file)\r
 {\r
-       struct sensor_private_data* sensor = \r
-               (struct sensor_private_data *)i2c_get_clientdata(this_client); \r
        int result = 0; \r
        DBG("%s\n",__func__);\r
 \r
index 436a3710755a638eb702b3de32bc8c78ca450d89..78684d6ea678751d3ae64249d5b60c680d6a5b88 100755 (executable)
@@ -293,11 +293,12 @@ void gyro_dev_reset(struct i2c_client *client)
 \r
 static int sensor_active(struct i2c_client *client, int enable, int rate)\r
 {\r
+       /*
        struct sensor_private_data *sensor =\r
            (struct sensor_private_data *) i2c_get_clientdata(client);  \r
-       int result = 0;\r
        int status = 0;\r
-       //register setting according to chip datasheet          \r
+       */
+       int result = 0;
        if(enable)\r
        {       \r
                result=ewtsa_enable(client);\r
@@ -319,11 +320,12 @@ static int sensor_init(struct i2c_client *client)
        struct sensor_private_data *sensor =\r
            (struct sensor_private_data *) i2c_get_clientdata(client);  \r
        int result = 0; \r
+       /*
        unsigned char buf[5];           \r
        unsigned char data = 0;\r
        int i = 0;\r
        char pReadData=0;\r
-       \r
+       */
        sensor->status_cur = SENSOR_OFF;\r
        gyro_dev_reset(client);\r
        ewtsa_system_restart(client);\r
@@ -356,7 +358,7 @@ static int sensor_report_value(struct i2c_client *client)
        struct sensor_axis axis;\r
        char buffer[6] = {0};   \r
        int i = 0;\r
-       int value = 0;\r
+       /* int value = 0; */
 \r
        memset(buffer, 0, 6);\r
 #if 0  \r
index d7536fc421f75aa2766bfaa3ea4988939a573b18..1c4a0208b2e24c7752a0be2a6b00c82781dd9077 100755 (executable)
@@ -460,7 +460,6 @@ static long angle_dev_ioctl(struct file *file,
                                }       \r
                                else\r
                                {\r
-                                       PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                        schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                }\r
                                sensor->status_cur = SENSOR_ON;\r
@@ -608,7 +607,6 @@ static long gsensor_dev_ioctl(struct file *file,
                                }       \r
                                else\r
                                {\r
-                                       PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                        schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                }\r
                                sensor->status_cur = SENSOR_ON;\r
@@ -940,7 +938,6 @@ static long gyro_dev_ioctl(struct file *file,
                                }       \r
                                else\r
                                {\r
-                                       PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                        schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                }\r
                                sensor->status_cur = SENSOR_ON;\r
@@ -995,7 +992,6 @@ static long gyro_dev_ioctl(struct file *file,
                        }       \r
                        else\r
                        {\r
-                               PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                        }\r
                        sensor->status_cur = SENSOR_ON;\r
@@ -1076,7 +1072,6 @@ static long light_dev_ioctl(struct file *file,
                                        }       \r
                                        else\r
                                        {\r
-                                               PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                                schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                        }\r
                                        \r
@@ -1177,7 +1172,6 @@ static long proximity_dev_ioctl(struct file *file,
                                        }       \r
                                        else\r
                                        {\r
-                                               PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                                schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                        }\r
                                        \r
@@ -1277,7 +1271,6 @@ static long temperature_dev_ioctl(struct file *file,
                                        }       \r
                                        else\r
                                        {\r
-                                               PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                                schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                        }\r
                                        \r
@@ -1380,7 +1373,6 @@ static long pressure_dev_ioctl(struct file *file,
                                        }       \r
                                        else\r
                                        {\r
-                                               PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func);\r
                                                schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms));\r
                                        }\r
                                        \r
index 7a36954cd24dc4249b188f0aea577883d5c7d0b9..f54835096e88e3feee249eea71c34df8838ae187 100755 (executable)
@@ -50,7 +50,6 @@ static int sensor_i2c_write(struct i2c_adapter *i2c_adap,
        msgs[0].flags = 0;      /* write */\r
        msgs[0].buf = (unsigned char *)data;\r
        msgs[0].len = len;\r
-       msgs[0].scl_rate = SENSOR_I2C_RATE;\r
 \r
        res = i2c_transfer(i2c_adap, msgs, 1);\r
        if (res == 1)\r
@@ -78,13 +77,11 @@ static int senosr_i2c_read(struct i2c_adapter *i2c_adap,
        msgs[0].flags = 0;      /* write */\r
        msgs[0].buf = &reg;\r
        msgs[0].len = 1;\r
-       msgs[0].scl_rate = SENSOR_I2C_RATE;\r
        \r
        msgs[1].addr = address;\r
        msgs[1].flags = I2C_M_RD;\r
        msgs[1].buf = data;\r
        msgs[1].len = len;\r
-       msgs[1].scl_rate = SENSOR_I2C_RATE;     \r
 \r
        res = i2c_transfer(i2c_adap, msgs, 2);\r
        if (res == 2)\r
@@ -174,7 +171,6 @@ static int i2c_master_normal_recv(const struct i2c_client *client, char *buf, in
     msg.flags = client->flags | I2C_M_RD;\r
        msg.len = count;\r
        msg.buf = (char *)buf;\r
-       msg.scl_rate = scl_rate;\r
        ret = i2c_transfer(adap, &msg, 1);\r
 \r
                 return (ret == 1) ? count : ret;\r
@@ -190,7 +186,6 @@ static int i2c_master_normal_send(const struct i2c_client *client, const char *b
        msg.flags = client->flags;\r
        msg.len = count;\r
        msg.buf = (char *)buf;\r
-       msg.scl_rate = scl_rate;\r
 \r
        ret = i2c_transfer(adap, &msg, 1);\r
        return (ret == 1) ? count : ret;\r