rk3188 ds1006h: fix light photoresistor
authorwuhao <wuhao@wuhao@rock-chips.com>
Mon, 4 Feb 2013 04:43:42 +0000 (12:43 +0800)
committerwuhao <wuhao@wuhao@rock-chips.com>
Mon, 4 Feb 2013 04:43:42 +0000 (12:43 +0800)
arch/arm/configs/rk3188_ds1006h_defconfig
arch/arm/mach-rk3188/board-rk3188-ds1006h.c
drivers/input/sensors/lsensor/ls_photoresistor.c
drivers/input/sensors/sensor-dev.c

index 535db22eb75b876aab00ceac8682f3f8286b249e..69480a40aade0837be17d00ebaabec01ad9973a7 100644 (file)
@@ -21,8 +21,6 @@ CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_ARCH_RK3188=y
-# CONFIG_DDR_INIT_CHANGE_FREQ is not set
-CONFIG_DDR_FREQ=y
 # CONFIG_DDR_TEST is not set
 CONFIG_RK_CLOCK_PROC=y
 CONFIG_CLK_SWITCH_TO_32K=y
@@ -246,11 +244,12 @@ CONFIG_GS_MMA8452=y
 CONFIG_GS_LIS3DH=y
 CONFIG_GYRO_L3G4200D=y
 CONFIG_LIGHT_SENSOR_DEVICE=y
-CONFIG_LS_US5151=y
 CONFIG_SENSOR_DEVICE=y
 CONFIG_GSENSOR_DEVICE=y
 CONFIG_COMPASS_DEVICE=y
 CONFIG_GYROSCOPE_DEVICE=y
+CONFIG_LIGHT_DEVICE=y
+CONFIG_LS_PHOTORESISTOR=y
 # CONFIG_SERIO is not set
 # CONFIG_CONSOLE_TRANSLATIONS is not set
 # CONFIG_LEGACY_PTYS is not set
index cab890ea34f3ea48b1deca5a8d0fdf39d60284a6..20911c743d624257e2612f07c22b65c7cd81d056 100755 (executable)
@@ -269,7 +269,7 @@ static struct akm8963_platform_data akm_platform_data_8963 = {
 static struct sensor_platform_data light_photoresistor_info = {
        .type = SENSOR_TYPE_LIGHT,
        .irq_enable = 0,
-        .address = 2 ;
+        .address = 2   ,
        .poll_delay_ms = 200,
 };
 #endif
index 1abd2ff7f8b5311901f1f704f71a8279fe65620c..fe131858457af73fac2eb33835755973cc2ea06d 100644 (file)
 #endif
 #include <linux/sensor-dev.h>
 
-#if 0
+static int ls_photoresistor_dbg_level = 0;
+module_param_named(dbg_level, ls_photoresistor_dbg_level, int, 0644);
+#if 1
 #define SENSOR_DEBUG_TYPE SENSOR_TYPE_LIGHT
-#define DBG(x...)  printk(x)
+#define DBG( args...) \
+       do { \
+               if (ls_photoresistor_dbg_level) { \
+                       pr_info(args); \
+               } \
+       } while (0)
 #else
 #define DBG(x...) printk(x)
 #endif
index d24972d45a4e3dd7f63cf99e596fffef05d14264..de9498f2075f44a8ec07dc0c14102578b1623c66 100755 (executable)
@@ -1155,7 +1155,7 @@ int sensor_probe(struct i2c_client *client, const struct i2c_device_id *devid)
        struct sensor_platform_data *pdata;\r
        int result = 0;\r
        int type = 0;\r
-       dev_info(&client->adapter->dev, "-------------------------------------%s: %s,0x%x\n", __func__, devid->name,(unsigned int)client);\r
+       dev_info(&client->adapter->dev, "%s: %s,0x%x\n", __func__, devid->name,(unsigned int)client);\r
 \r
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {\r
                result = -ENODEV;\r