- \r
- return result;\r
-}\r
-\r
-struct sensor_operate light_ap321xx_ops = {\r
- .name = "ls_ap321xx",\r
- .type = SENSOR_TYPE_LIGHT, //sensor type and it should be correct\r
- .id_i2c = LIGHT_ID_AP321XX, //i2c id number\r
- .read_reg = SENSOR_UNKNOW_DATA, //read data //there are two regs, we fix them in code.\r
- .read_len = 1, //data length\r
- .id_reg = SENSOR_UNKNOW_DATA, //read device id from this register //there are 3 regs, we fix them in code.\r
- .id_data = SENSOR_UNKNOW_DATA, //device id\r
- .precision = 16, //8 bits\r
- .ctrl_reg = AP3212B_MODE_COMMAND, //enable or disable \r
- .int_status_reg = AP3212B_INT_COMMAND, //intterupt status register\r
- .range = {100,65535}, //range\r
- .brightness ={10,255}, // brightness\r
- .trig = IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_SHARED, \r
- .active = sensor_active, \r
- .init = sensor_init,\r
- .report = sensor_report_value,\r
-};\r
-\r
-/****************operate according to sensor chip:end************/\r
-\r
-//function name should not be changed\r
-static struct sensor_operate *light_get_ops(void)\r
-{\r
- return &light_ap321xx_ops;\r
-}\r
-\r
-\r
-static int __init light_ap321xx_init(void)\r
-{\r
- struct sensor_operate *ops = light_get_ops();\r
- int result = 0;\r
- int type = ops->type;\r
- result = sensor_register_slave(type, NULL, NULL, light_get_ops);\r
- return result;\r
-}\r
-\r
-static void __exit light_ap321xx_exit(void)\r
-{\r
- struct sensor_operate *ops = light_get_ops();\r
- int type = ops->type;\r
- sensor_unregister_slave(type, NULL, NULL, light_get_ops);\r
-}\r
-\r
-\r
-module_init(light_ap321xx_init);\r
-module_exit(light_ap321xx_exit);\r
-\r
-\r
+
+ return result;
+}
+
+struct sensor_operate light_ap321xx_ops = {
+ .name = "ls_ap321xx",
+ .type = SENSOR_TYPE_LIGHT, //sensor type and it should be correct
+ .id_i2c = LIGHT_ID_AP321XX, //i2c id number
+ .read_reg = SENSOR_UNKNOW_DATA, //read data //there are two regs, we fix them in code.
+ .read_len = 1, //data length
+ .id_reg = SENSOR_UNKNOW_DATA, //read device id from this register //there are 3 regs, we fix them in code.
+ .id_data = SENSOR_UNKNOW_DATA, //device id
+ .precision = 16, //8 bits
+ .ctrl_reg = AP3212B_MODE_COMMAND, //enable or disable
+ .int_status_reg = AP3212B_INT_COMMAND, //intterupt status register
+ .range = {100,65535}, //range
+ .brightness ={10,255}, // brightness
+ .trig = IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_SHARED,
+ .active = sensor_active,
+ .init = sensor_init,
+ .report = sensor_report_value,
+};
+
+/****************operate according to sensor chip:end************/
+
+//function name should not be changed
+static struct sensor_operate *light_get_ops(void)
+{
+ return &light_ap321xx_ops;
+}
+
+
+static int __init light_ap321xx_init(void)
+{
+ struct sensor_operate *ops = light_get_ops();
+ int result = 0;
+ int type = ops->type;
+ result = sensor_register_slave(type, NULL, NULL, light_get_ops);
+ return result;
+}
+
+static void __exit light_ap321xx_exit(void)
+{
+ struct sensor_operate *ops = light_get_ops();
+ int type = ops->type;
+ sensor_unregister_slave(type, NULL, NULL, light_get_ops);
+}
+
+
+module_init(light_ap321xx_init);
+module_exit(light_ap321xx_exit);
+
+