\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
\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
\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
\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
\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
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
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
} \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
} \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
} \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
} \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
} \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
} \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
} \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
} \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
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
msgs[0].flags = 0; /* write */\r
msgs[0].buf = ®\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
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
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