From 58dcb07c34e93a23e871913166de483cc3537004 Mon Sep 17 00:00:00 2001 From: wuhao Date: Mon, 4 Feb 2013 12:43:42 +0800 Subject: [PATCH] rk3188 ds1006h: fix light photoresistor --- arch/arm/configs/rk3188_ds1006h_defconfig | 5 ++--- arch/arm/mach-rk3188/board-rk3188-ds1006h.c | 2 +- drivers/input/sensors/lsensor/ls_photoresistor.c | 11 +++++++++-- drivers/input/sensors/sensor-dev.c | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/arm/configs/rk3188_ds1006h_defconfig b/arch/arm/configs/rk3188_ds1006h_defconfig index 535db22eb75b..69480a40aade 100644 --- a/arch/arm/configs/rk3188_ds1006h_defconfig +++ b/arch/arm/configs/rk3188_ds1006h_defconfig @@ -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 diff --git a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c index cab890ea34f3..20911c743d62 100755 --- a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c +++ b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c @@ -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 diff --git a/drivers/input/sensors/lsensor/ls_photoresistor.c b/drivers/input/sensors/lsensor/ls_photoresistor.c index 1abd2ff7f8b5..fe131858457a 100644 --- a/drivers/input/sensors/lsensor/ls_photoresistor.c +++ b/drivers/input/sensors/lsensor/ls_photoresistor.c @@ -33,9 +33,16 @@ #endif #include -#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 diff --git a/drivers/input/sensors/sensor-dev.c b/drivers/input/sensors/sensor-dev.c index d24972d45a4e..de9498f2075f 100755 --- a/drivers/input/sensors/sensor-dev.c +++ b/drivers/input/sensors/sensor-dev.c @@ -1155,7 +1155,7 @@ int sensor_probe(struct i2c_client *client, const struct i2c_device_id *devid) struct sensor_platform_data *pdata; int result = 0; int type = 0; - dev_info(&client->adapter->dev, "-------------------------------------%s: %s,0x%x\n", __func__, devid->name,(unsigned int)client); + dev_info(&client->adapter->dev, "%s: %s,0x%x\n", __func__, devid->name,(unsigned int)client); if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { result = -ENODEV; -- 2.34.1