modify sensors driver to support selecting all items one time
authorlw@rock-chips.com <lw@rock-chips.com>
Wed, 8 Aug 2012 06:59:10 +0000 (14:59 +0800)
committerlw <lw@rock-chips.com>
Wed, 8 Aug 2012 06:59:54 +0000 (14:59 +0800)
12 files changed:
drivers/input/sensors/accel/kxtik.c
drivers/input/sensors/accel/lis3dh.c
drivers/input/sensors/accel/mma8452.c
drivers/input/sensors/compass/ak8975.c
drivers/input/sensors/gyro/l3g4200d.c
drivers/input/sensors/lsensor/cm3217.c
drivers/input/sensors/lsensor/ls_al3006.c
drivers/input/sensors/lsensor/ls_stk3171.c
drivers/input/sensors/psensor/ps_al3006.c
drivers/input/sensors/psensor/ps_stk3171.c
drivers/input/sensors/sensor-dev.c
include/linux/sensor-dev.h

index ba131f729536dd859b22330a0c7647c2f991037e..d251f44c0a8b4239a39d9e65d82b203c12e767b7 100755 (executable)
@@ -216,7 +216,7 @@ static int sensor_report_value(struct i2c_client *client)
        return ret;\r
 }\r
 \r
-struct sensor_operate gsensor_ops = {\r
+struct sensor_operate gsensor_kxtik_ops = {\r
        .name                           = "kxtik",\r
        .type                           = SENSOR_TYPE_ACCEL,            //sensor type and it should be correct\r
        .id_i2c                         = ACCEL_ID_KXTIK,               //i2c id number\r
@@ -237,14 +237,13 @@ struct sensor_operate gsensor_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *gsensor_get_ops(void)\r
+static struct sensor_operate *gsensor_get_ops(void)\r
 {\r
-       return &gsensor_ops;\r
+       return &gsensor_kxtik_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(gsensor_get_ops);\r
 \r
-static int __init gsensor_init(void)\r
+static int __init gsensor_kxtik_init(void)\r
 {\r
        struct sensor_operate *ops = gsensor_get_ops();\r
        int result = 0;\r
@@ -254,7 +253,7 @@ static int __init gsensor_init(void)
        return result;\r
 }\r
 \r
-static void __exit gsensor_exit(void)\r
+static void __exit gsensor_kxtik_exit(void)\r
 {\r
        struct sensor_operate *ops = gsensor_get_ops();\r
        int type = ops->type;\r
@@ -262,7 +261,7 @@ static void __exit gsensor_exit(void)
 }\r
 \r
 \r
-module_init(gsensor_init);\r
-module_exit(gsensor_exit);\r
+module_init(gsensor_kxtik_init);\r
+module_exit(gsensor_kxtik_exit);\r
 \r
 \r
index ac9c059f71ad5db317a3b1c147a51deed74c2893..8ce14bbe6cd6bfddc7dfb2b34ad765c0c3d52795 100755 (executable)
@@ -293,7 +293,7 @@ static int sensor_report_value(struct i2c_client *client)
        return ret;\r
 }\r
 \r
-struct sensor_operate gsensor_ops = {\r
+struct sensor_operate gsensor_lis3dh_ops = {\r
        .name                           = "lis3dh",\r
        .type                           = SENSOR_TYPE_ACCEL,            //sensor type and it should be correct\r
        .id_i2c                         = ACCEL_ID_LIS3DH,              //i2c id number\r
@@ -314,14 +314,13 @@ struct sensor_operate gsensor_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *gsensor_get_ops(void)\r
+static struct sensor_operate *gsensor_get_ops(void)\r
 {\r
-       return &gsensor_ops;\r
+       return &gsensor_lis3dh_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(gsensor_get_ops);\r
 \r
-static int __init gsensor_init(void)\r
+static int __init gsensor_lis3dh_init(void)\r
 {\r
        struct sensor_operate *ops = gsensor_get_ops();\r
        int result = 0;\r
@@ -331,7 +330,7 @@ static int __init gsensor_init(void)
        return result;\r
 }\r
 \r
-static void __exit gsensor_exit(void)\r
+static void __exit gsensor_lis3dh_exit(void)\r
 {\r
        struct sensor_operate *ops = gsensor_get_ops();\r
        int type = ops->type;\r
@@ -339,7 +338,7 @@ static void __exit gsensor_exit(void)
 }\r
 \r
 \r
-module_init(gsensor_init);\r
-module_exit(gsensor_exit);\r
+module_init(gsensor_lis3dh_init);\r
+module_exit(gsensor_lis3dh_exit);\r
 \r
 \r
index a5e5f40f2e1a2fa4e9c6ec90934e7e4689f000d6..c489c95ce54a3326b7113f568101f684af6c5eee 100755 (executable)
@@ -253,7 +253,7 @@ static int sensor_report_value(struct i2c_client *client)
 }\r
 \r
 \r
-struct sensor_operate gsensor_ops = {\r
+struct sensor_operate gsensor_mma8452_ops = {\r
        .name                           = "mma8452",\r
        .type                           = SENSOR_TYPE_ACCEL,                    //sensor type and it should be correct\r
        .id_i2c                         = ACCEL_ID_MMA845X,                     //i2c id number\r
@@ -274,14 +274,13 @@ struct sensor_operate gsensor_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *gsensor_get_ops(void)\r
+static struct sensor_operate *gsensor_get_ops(void)\r
 {\r
-       return &gsensor_ops;\r
+       return &gsensor_mma8452_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(gsensor_get_ops);\r
 \r
-static int __init gsensor_init(void)\r
+static int __init gsensor_mma8452_init(void)\r
 {\r
        struct sensor_operate *ops = gsensor_get_ops();\r
        int result = 0;\r
@@ -291,7 +290,7 @@ static int __init gsensor_init(void)
        return result;\r
 }\r
 \r
-static void __exit gsensor_exit(void)\r
+static void __exit gsensor_mma8452_exit(void)\r
 {\r
        struct sensor_operate *ops = gsensor_get_ops();\r
        int type = ops->type;\r
@@ -299,8 +298,8 @@ static void __exit gsensor_exit(void)
 }\r
 \r
 \r
-module_init(gsensor_init);\r
-module_exit(gsensor_exit);\r
+module_init(gsensor_mma8452_init);\r
+module_exit(gsensor_mma8452_exit);\r
 \r
 \r
 \r
index a8fbf21efe209df0a57902d391cfc16898f42264..3319618705ae4e1c10efa21ae1e866d3cb4ff034 100755 (executable)
@@ -693,7 +693,7 @@ static struct miscdevice compass_dev_device =
        .fops = &compass_dev_fops,\r
 };\r
 \r
-struct sensor_operate akm8975_ops = {\r
+struct sensor_operate akm8975_akm8975_ops = {\r
        .name                           = "akm8975",\r
        .type                           = SENSOR_TYPE_COMPASS,  //it is important\r
        .id_i2c                         = COMPASS_ID_AK8975,\r
@@ -715,15 +715,13 @@ struct sensor_operate akm8975_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *compass_get_ops(void)\r
+static struct sensor_operate *compass_get_ops(void)\r
 {\r
-       return &akm8975_ops;\r
+       return &akm8975_akm8975_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(compass_get_ops);\r
 \r
-\r
-static int __init compass_init(void)\r
+static int __init compass_akm8975_init(void)\r
 {\r
        struct sensor_operate *ops = compass_get_ops();\r
        int result = 0;\r
@@ -748,7 +746,7 @@ error:
        return result;\r
 }\r
 \r
-static void __exit compass_exit(void)\r
+static void __exit compass_akm8975_exit(void)\r
 {\r
        struct sensor_operate *ops = compass_get_ops();\r
        int type = ops->type;\r
@@ -756,7 +754,7 @@ static void __exit compass_exit(void)
 }\r
 \r
 \r
-module_init(compass_init);\r
-module_exit(compass_exit);\r
+module_init(compass_akm8975_init);\r
+module_exit(compass_akm8975_exit);\r
 \r
 \r
index 45acad2bb9db1c032107f0135800c46108059e2a..03a0d264fe14f14f4413f83bc9f418526727633a 100755 (executable)
@@ -213,7 +213,7 @@ static int sensor_report_value(struct i2c_client *client)
 }\r
 \r
 \r
-struct sensor_operate gyro_ops = {\r
+struct sensor_operate gyro_l3g4200d_ops = {\r
        .name                           = "l3g4200d",\r
        .type                           = SENSOR_TYPE_GYROSCOPE,//sensor type and it should be correct\r
        .id_i2c                         = GYRO_ID_L3G4200D,             //i2c id number\r
@@ -234,14 +234,13 @@ struct sensor_operate gyro_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *gyro_get_ops(void)\r
+static struct sensor_operate *gyro_get_ops(void)\r
 {\r
-       return &gyro_ops;\r
+       return &gyro_l3g4200d_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(gyro_get_ops);\r
 \r
-static int __init gyro_init(void)\r
+static int __init gyro_l3g4200d_init(void)\r
 {\r
        struct sensor_operate *ops = gyro_get_ops();\r
        int result = 0;\r
@@ -251,7 +250,7 @@ static int __init gyro_init(void)
        return result;\r
 }\r
 \r
-static void __exit gyro_exit(void)\r
+static void __exit gyro_l3g4200d_exit(void)\r
 {\r
        struct sensor_operate *ops = gyro_get_ops();\r
        int type = ops->type;\r
@@ -259,7 +258,7 @@ static void __exit gyro_exit(void)
 }\r
 \r
 \r
-module_init(gyro_init);\r
-module_exit(gyro_exit);\r
+module_init(gyro_l3g4200d_init);\r
+module_exit(gyro_l3g4200d_exit);\r
 \r
 \r
index b51f27154ebe9b58843aed22fd4a20bcc4635577..31f09b02d0fc554343f964526e5a0fe1c974787e 100755 (executable)
@@ -186,7 +186,7 @@ static int sensor_report_value(struct i2c_client *client)
 }\r
 \r
 \r
-struct sensor_operate light_ops = {\r
+struct sensor_operate light_cm3217_ops = {\r
        .name                           = "cm3217",\r
        .type                           = SENSOR_TYPE_LIGHT,    //sensor type and it should be correct\r
        .id_i2c                         = LIGHT_ID_CM3217,      //i2c id number\r
@@ -207,14 +207,13 @@ struct sensor_operate light_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *light_get_ops(void)\r
+static struct sensor_operate *light_get_ops(void)\r
 {\r
-       return &light_ops;\r
+       return &light_cm3217_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(light_get_ops);\r
 \r
-static int __init light_init(void)\r
+static int __init light_cm3217_init(void)\r
 {\r
        struct sensor_operate *ops = light_get_ops();\r
        int result = 0;\r
@@ -224,7 +223,7 @@ static int __init light_init(void)
        return result;\r
 }\r
 \r
-static void __exit light_exit(void)\r
+static void __exit light_cm3217_exit(void)\r
 {\r
        struct sensor_operate *ops = light_get_ops();\r
        int type = ops->type;\r
@@ -232,7 +231,7 @@ static void __exit light_exit(void)
 }\r
 \r
 \r
-module_init(light_init);\r
-module_exit(light_exit);\r
+module_init(light_cm3217_init);\r
+module_exit(light_cm3217_exit);\r
 \r
 \r
index 4b12770215c4616ea6c5048c95a1fc3e102b8f4a..e9a1f52852f8fede145ab11248aabe168fce7a96 100755 (executable)
@@ -251,7 +251,7 @@ static int sensor_report_value(struct i2c_client *client)
        return result;\r
 }\r
 \r
-struct sensor_operate light_ops = {\r
+struct sensor_operate light_al3006_ops = {\r
        .name                           = "ls_al3006",\r
        .type                           = SENSOR_TYPE_LIGHT,    //sensor type and it should be correct\r
        .id_i2c                         = LIGHT_ID_AL3006,      //i2c id number\r
@@ -272,14 +272,13 @@ struct sensor_operate light_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *light_get_ops(void)\r
+static struct sensor_operate *light_get_ops(void)\r
 {\r
-       return &light_ops;\r
+       return &light_al3006_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(light_get_ops);\r
 \r
-static int __init light_init(void)\r
+static int __init light_al3006_init(void)\r
 {\r
        struct sensor_operate *ops = light_get_ops();\r
        int result = 0;\r
@@ -289,7 +288,7 @@ static int __init light_init(void)
        return result;\r
 }\r
 \r
-static void __exit light_exit(void)\r
+static void __exit light_al3006_exit(void)\r
 {\r
        struct sensor_operate *ops = light_get_ops();\r
        int type = ops->type;\r
@@ -297,7 +296,7 @@ static void __exit light_exit(void)
 }\r
 \r
 \r
-module_init(light_init);\r
-module_exit(light_exit);\r
+module_init(light_al3006_init);\r
+module_exit(light_al3006_exit);\r
 \r
 \r
index ef4f1fc3f0482ee62290c310ca4fe45beafd19b3..9edd1bff906b08fce76ff3615358cb3dca09b794 100755 (executable)
@@ -270,7 +270,7 @@ static int sensor_report_value(struct i2c_client *client)
        return result;\r
 }\r
 \r
-struct sensor_operate light_ops = {\r
+struct sensor_operate light_stk3171_ops = {\r
        .name                           = "ls_stk3171",\r
        .type                           = SENSOR_TYPE_LIGHT,    //sensor type and it should be correct\r
        .id_i2c                         = LIGHT_ID_STK3171,     //i2c id number\r
@@ -291,14 +291,13 @@ struct sensor_operate light_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *light_get_ops(void)\r
+static struct sensor_operate *light_get_ops(void)\r
 {\r
-       return &light_ops;\r
+       return &light_stk3171_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(light_get_ops);\r
 \r
-static int __init light_init(void)\r
+static int __init light_stk3171_init(void)\r
 {\r
        struct sensor_operate *ops = light_get_ops();\r
        int result = 0;\r
@@ -308,7 +307,7 @@ static int __init light_init(void)
        return result;\r
 }\r
 \r
-static void __exit light_exit(void)\r
+static void __exit light_stk3171_exit(void)\r
 {\r
        struct sensor_operate *ops = light_get_ops();\r
        int type = ops->type;\r
@@ -316,7 +315,7 @@ static void __exit light_exit(void)
 }\r
 \r
 \r
-module_init(light_init);\r
-module_exit(light_exit);\r
+module_init(light_stk3171_init);\r
+module_exit(light_stk3171_exit);\r
 \r
 \r
index b78e08dc80611e2b64d893093962b5b239ef4897..83be85d6572ce1a400553d00be18b6bd627cbac9 100755 (executable)
@@ -213,7 +213,7 @@ static int sensor_report_value(struct i2c_client *client)
        return result;\r
 }\r
 \r
-struct sensor_operate proximity_ops = {\r
+struct sensor_operate proximity_al3006_ops = {\r
        .name                           = "ps_al3006",\r
        .type                           = SENSOR_TYPE_PROXIMITY,//sensor type and it should be correct\r
        .id_i2c                         = PROXIMITY_ID_AL3006,  //i2c id number\r
@@ -234,14 +234,13 @@ struct sensor_operate proximity_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *proximity_get_ops(void)\r
+static struct sensor_operate *proximity_get_ops(void)\r
 {\r
-       return &proximity_ops;\r
+       return &proximity_al3006_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(proximity_get_ops);\r
 \r
-static int __init proximity_init(void)\r
+static int __init proximity_al3006_init(void)\r
 {\r
        struct sensor_operate *ops = proximity_get_ops();\r
        int result = 0;\r
@@ -251,7 +250,7 @@ static int __init proximity_init(void)
        return result;\r
 }\r
 \r
-static void __exit proximity_exit(void)\r
+static void __exit proximity_al3006_exit(void)\r
 {\r
        struct sensor_operate *ops = proximity_get_ops();\r
        int type = ops->type;\r
@@ -259,7 +258,7 @@ static void __exit proximity_exit(void)
 }\r
 \r
 \r
-module_init(proximity_init);\r
-module_exit(proximity_exit);\r
+module_init(proximity_al3006_init);\r
+module_exit(proximity_al3006_exit);\r
 \r
 \r
index c7ce75dd78611ec95c321cb3677ea62b01e8baa1..431b8f7a90fadbd8f9c52bd4b61b62eecaa872f8 100755 (executable)
@@ -220,7 +220,7 @@ static int sensor_report_value(struct i2c_client *client)
        return result;\r
 }\r
 \r
-struct sensor_operate proximity_ops = {\r
+struct sensor_operate proximity_stk3171_ops = {\r
        .name                           = "ps_stk3171",\r
        .type                           = SENSOR_TYPE_PROXIMITY,        //sensor type and it should be correct\r
        .id_i2c                         = PROXIMITY_ID_STK3171,         //i2c id number\r
@@ -241,14 +241,12 @@ struct sensor_operate proximity_ops = {
 /****************operate according to sensor chip:end************/\r
 \r
 //function name should not be changed\r
-struct sensor_operate *proximity_get_ops(void)\r
+static struct sensor_operate *proximity_get_ops(void)\r
 {\r
-       return &proximity_ops;\r
+       return &proximity_stk3171_ops;\r
 }\r
 \r
-EXPORT_SYMBOL(proximity_get_ops);\r
-\r
-static int __init proximity_init(void)\r
+static int __init proximity_stk3171_init(void)\r
 {\r
        struct sensor_operate *ops = proximity_get_ops();\r
        int result = 0;\r
@@ -258,7 +256,7 @@ static int __init proximity_init(void)
        return result;\r
 }\r
 \r
-static void __exit proximity_exit(void)\r
+static void __exit proximity_stk3171_exit(void)\r
 {\r
        struct sensor_operate *ops = proximity_get_ops();\r
        int type = ops->type;\r
@@ -266,7 +264,7 @@ static void __exit proximity_exit(void)
 }\r
 \r
 \r
-module_init(proximity_init);\r
-module_exit(proximity_exit);\r
+module_init(proximity_stk3171_init);\r
+module_exit(proximity_stk3171_exit);\r
 \r
 \r
index 2dc9b8676d52ac017d3dd884297fea888e0f7daf..4e7d0683ec4bbf444ccf49c00e3e4b5e5ad38b4d 100755 (executable)
@@ -46,7 +46,7 @@
 #endif\r
 \r
 struct sensor_private_data *g_sensor[SENSOR_NUM_TYPES];\r
-static struct sensor_operate *sensor_ops[SENSOR_NUM_TYPES]; \r
+static struct sensor_operate *sensor_ops[SENSOR_NUM_ID]; \r
 \r
 static int sensor_get_id(struct i2c_client *client, int *value)\r
 {\r
@@ -106,7 +106,7 @@ static int sensor_chip_init(struct i2c_client *client)
 {\r
        struct sensor_private_data *sensor =\r
            (struct sensor_private_data *) i2c_get_clientdata(client);  \r
-       struct sensor_operate *ops = sensor_ops[sensor->type];\r
+       struct sensor_operate *ops = sensor_ops[(int)sensor->i2c_id->driver_data];\r
        int result = 0;\r
        \r
        if(ops)\r
@@ -120,9 +120,9 @@ static int sensor_chip_init(struct i2c_client *client)
                goto error;\r
        }\r
 \r
-       if(sensor->type != ops->type)\r
+       if((sensor->type != ops->type) || ((int)sensor->i2c_id->driver_data != ops->id_i2c))\r
        {\r
-               printk("%s:type is different:%d,%d\n",__func__,sensor->type, sensor->type);\r
+               printk("%s:type or id is different:type=%d,%d,id=%d,%d\n",__func__,sensor->type, ops->type, (int)sensor->i2c_id->driver_data, ops->id_i2c);\r
                result = -1;\r
                goto error;\r
        }\r
@@ -137,11 +137,11 @@ static int sensor_chip_init(struct i2c_client *client)
        result = sensor_get_id(sensor->client, &sensor->devid);//get id\r
        if(result < 0)\r
        {       \r
-               printk("%s:fail to read devid:0x%x\n",__func__,sensor->devid);  \r
+               printk("%s:fail to read %s devid:0x%x\n",__func__, sensor->i2c_id->name, sensor->devid);        \r
                goto error;\r
        }\r
        \r
-       printk("%s:sensor->devid=0x%x,ops=0x%p\n",__func__,sensor->devid,sensor->ops);\r
+       printk("%s:%s:devid=0x%x,ops=0x%p\n",__func__, sensor->i2c_id->name, sensor->devid,sensor->ops);\r
 \r
        result = sensor_initial(sensor->client);        //init sensor\r
        if(result < 0)\r
@@ -1027,8 +1027,14 @@ int sensor_register_slave(int type,struct i2c_client *client,
                        struct sensor_operate *(*get_sensor_ops)(void))\r
 {\r
        int result = 0;\r
-       sensor_ops[type] = get_sensor_ops();\r
-       printk("%s:%s\n",__func__,sensor_ops[type]->name);\r
+       struct sensor_operate *ops = get_sensor_ops();\r
+       if((ops->id_i2c >= SENSOR_NUM_ID) || (ops->id_i2c <= ID_INVALID))\r
+       {       \r
+               printk("%s:%s id is error %d\n", __func__, ops->name, ops->id_i2c);\r
+               return -1;      \r
+       }\r
+       sensor_ops[ops->id_i2c] = ops;\r
+       printk("%s:%s,id=%d\n",__func__,sensor_ops[ops->id_i2c]->name, ops->id_i2c);\r
        return result;\r
 }\r
 \r
@@ -1038,8 +1044,14 @@ int sensor_unregister_slave(int type,struct i2c_client *client,
                        struct sensor_operate *(*get_sensor_ops)(void))\r
 {\r
        int result = 0;\r
-       printk("%s:%s\n",__func__,sensor_ops[type]->name);\r
-       sensor_ops[type] = NULL;        \r
+       struct sensor_operate *ops = get_sensor_ops();\r
+       if((ops->id_i2c >= SENSOR_NUM_ID) || (ops->id_i2c <= ID_INVALID))\r
+       {       \r
+               printk("%s:%s id is error %d\n", __func__, ops->name, ops->id_i2c);\r
+               return -1;      \r
+       }\r
+       printk("%s:%s,id=%d\n",__func__,sensor_ops[ops->id_i2c]->name, ops->id_i2c);\r
+       sensor_ops[ops->id_i2c] = NULL; \r
        return result;\r
 }\r
 \r
@@ -1080,6 +1092,13 @@ int sensor_probe(struct i2c_client *client, const struct i2c_device_id *devid)
                result = -EFAULT;\r
                goto out_no_free;       \r
        }\r
+\r
+       if(((int)devid->driver_data >= SENSOR_NUM_ID) || ((int)devid->driver_data <= ID_INVALID))\r
+       {       \r
+               dev_err(&client->adapter->dev, "sensor id is error %d\n", (int)devid->driver_data);\r
+               result = -EFAULT;\r
+               goto out_no_free;       \r
+       }\r
        \r
        i2c_set_clientdata(client, sensor);\r
        sensor->client = client;        \r
@@ -1226,7 +1245,7 @@ int sensor_probe(struct i2c_client *client, const struct i2c_device_id *devid)
        }\r
 #endif\r
 \r
-       printk("%s:initialized ok,sensor name:%s,type:%d\n",__func__,sensor->ops->name,type);\r
+       printk("%s:initialized ok,sensor name:%s,type:%d,id=%d\n\n",__func__,sensor->ops->name,type,(int)sensor->i2c_id->driver_data);\r
 \r
        return result;\r
        \r
@@ -1285,6 +1304,7 @@ static const struct i2c_device_id sensor_id[] = {
        {"k3g", GYRO_ID_K3G},\r
        /*light sensor*/\r
        {"lightsensor", LIGHT_ID_ALL},  \r
+       {"light_cm3217", LIGHT_ID_CM3217},\r
        {"light_al3006", LIGHT_ID_AL3006},\r
        {"ls_stk3171", LIGHT_ID_STK3171},\r
        /*proximity sensor*/\r
index c087b1bcf8b1a2c938bbe342b13f44cffc0a29f2..710ce1e3661491b068e1bea132a7b04fef10eb76 100755 (executable)
@@ -52,6 +52,7 @@ enum sensor_id {
        ACCEL_ID_ADXL34X,\r
        ACCEL_ID_MMA8450,\r
        ACCEL_ID_MMA845X,\r
+       ACCEL_ID_MMA7660,\r
        ACCEL_ID_MPU6050,\r
 \r
        COMPASS_ID_ALL,\r
@@ -84,6 +85,7 @@ enum sensor_id {
 \r
        PRESSURE_ID_ALL,\r
        PRESSURE_ID_BMA085,\r
+       SENSOR_NUM_ID,\r
 };\r
 \r
 \r