lm3643 override value set
authorDaniel jeong <daniel.jeong@ti.com>
Wed, 9 Jul 2014 01:56:35 +0000 (10:56 +0900)
committerDaniel jeong <daniel.jeong@ti.com>
Wed, 9 Jul 2014 01:56:35 +0000 (10:56 +0900)
Signed-off-by: Daniel jeong <daniel.jeong@ti.com>
drivers/media/i2c/lm3643.c

index 60301996bc1c862caa295a9a7bb8d5025dc126d9..96a47826e5c69effbc3aa97dbc1659f5a9149960 100644 (file)
@@ -381,6 +381,7 @@ err_out:
 
 static int lm3643_init_device(struct lm3643_flash *flash)
 {
+       struct lm3643_platform_data *pdata = flash->pdata;
        int rval;
        unsigned int reg_val;
 
@@ -402,6 +403,14 @@ static int lm3643_init_device(struct lm3643_flash *flash)
        if (rval < 0)
                return rval;
 
+       /* set override */
+       rval = regmap_update_bits(flash->regmap,
+                 REG_FLASH_LED0_BR, 0x80, pdata->flash1_override);
+       rval |= regmap_update_bits(flash->regmap,
+                 REG_TORCH_LED0_BR, 0x80, pdata->torch1_override);
+       if (rval < 0)
+               return rval;
+
        /* Reset flag 0 register */
        rval = regmap_read(flash->regmap, REG_FLAG0, &reg_val);
        if (rval < 0)