diff --git a/drivers/input/misc/bh1780gli.c b/drivers/input/misc/bh1780gli.c index c7e1eb0..1271eb0 100644 --- a/drivers/input/misc/bh1780gli.c +++ b/drivers/input/misc/bh1780gli.c @@ -48,7 +48,7 @@ #define BH1780_PON_DELAY 2 /* Delayed work queue polling rate in seconds */ -#define BH1780_POLL_RATE 5000 +#define BH1780_POLL_RATE 500 #define LUX_MAX_CHANGE 200 @@ -268,12 +268,8 @@ static void bh1780_input_work_func(struct work_struct *work) input_work); bh1780_read_data(als); - - if ((abs(als->current_lux - als->old_lux) > LUX_MAX_CHANGE) || - (als->old_lux < 0)) { - bh1780_report_data(als); - als->old_lux = als->current_lux; - } + bh1780_report_data(als); + als->old_lux = als->current_lux; schedule_delayed_work(&als->input_work, msecs_to_jiffies(als->req_poll_rate)); @@ -343,6 +339,15 @@ static int __devinit bh1780_probe(struct i2c_client *client, register_early_suspend(&ddata->early_suspend); #endif #endif + + ret = bh1780_write(ddata, BH1780_REG_CONTROL, BH1780_PON, "CONTROL"); + if (ret < 0) { + goto err_op_failed; + } + ddata->enable = BH1780_PON; + ddata->power_state = BH1780_PON; + schedule_delayed_work(&ddata->input_work, + msecs_to_jiffies(ddata->req_poll_rate)); return 0; err_sysfs_failed: