From 867974483c0808f162d6b6b5cf7488b063e67a07 Mon Sep 17 00:00:00 2001 From: lyx Date: Wed, 3 Aug 2011 01:07:37 -0700 Subject: [PATCH] rk29sdk l/p sensor: modify driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1.初始化时增加对light sensor中断范围寄存器的配置, 否则这个值可能不是我们想要的默认值,由此造成light sensor产生中断,影响psensor功能 --- drivers/input/misc/isl29028.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/input/misc/isl29028.c b/drivers/input/misc/isl29028.c index 375e2f4ddef1..6ee147b03336 100755 --- a/drivers/input/misc/isl29028.c +++ b/drivers/input/misc/isl29028.c @@ -71,6 +71,11 @@ #define ISL_REG_ALSIR_LDATA (0x09) #define ISL_REG_ALSIR_HDATA (0x0a) + +#define ISL_REG_ALSIR_TH1 (0x05) +#define ISL_REG_ALSIR_TH2 (0x06) +#define ISL_REG_ALSIR_TH3 (0x07) + struct isl29028_data { struct input_dev *psensor_input_dev; struct input_dev *lsensor_input_dev; @@ -707,6 +712,24 @@ static int isl29028_config(struct i2c_client *client) printk("%s: config isl29028 PROX_HT(0x04) reg %#x \n", __FUNCTION__, value); #endif + buf[0] = ISL_REG_ALSIR_TH1; + buf[1] = 0x0; + if ((ret = i2c_master_send(client, buf, 2)) < 2) { + printk("%s: config isl29028 register %#x err %d\n", __FUNCTION__, buf[0], ret); + } + + buf[0] = ISL_REG_ALSIR_TH2; + buf[1] = 0xF0; + if ((ret = i2c_master_send(client, buf, 2)) < 2) { + printk("%s: config isl29028 register %#x err %d\n", __FUNCTION__, buf[0], ret); + } + + buf[0] = ISL_REG_ALSIR_TH3; + buf[1] = 0xFF; + if ((ret = i2c_master_send(client, buf, 2)) < 2) { + printk("%s: config isl29028 register %#x err %d\n", __FUNCTION__, buf[0], ret); + } + mutex_unlock(&isl->lock); return 0; -- 2.34.1