leds-lm3560: Use both LEDs

parent b4f38d13
......@@ -213,8 +213,9 @@ static int lm3560_brightness_set(struct led_classdev *cdev, enum led_brightness
}
ret = regmap_update_bits(priv->regmap, LM3560_TORCH_BRIGHT_REG,
LM3560_TORCH_BRIGHT_LED2_MASK,
((brightness - 1) << LM3560_TORCH_BRIGHT_LED2_SHIFT));
LM3560_TORCH_BRIGHT_LED2_MASK | LM3560_TORCH_BRIGHT_LED1_MASK,
((brightness - 1) << LM3560_TORCH_BRIGHT_LED2_SHIFT) |
((brightness - 1) << LM3560_TORCH_BRIGHT_LED1_SHIFT));
if (ret < 0)
goto out;
......@@ -222,7 +223,7 @@ static int lm3560_brightness_set(struct led_classdev *cdev, enum led_brightness
LM3560_ENABLE_MASK |
LM3560_ENABLE_LED1_FLAG |
LM3560_ENABLE_LED2_FLAG,
LM3560_ENABLE_LED2_FLAG |
LM3560_ENABLE_LED1_FLAG | LM3560_ENABLE_LED2_FLAG |
LM3560_ENABLE_TORCH);
out:
mutex_unlock(&priv->lock);
......@@ -287,7 +288,7 @@ static int lm3560_flash_brightness_set(struct led_classdev_flash *fled_cdev, u32
brightness_val = brightness / LM3560_FLASH_BRIGHT_STEP_uA;
ret = regmap_update_bits(priv->regmap, LM3560_FLASH_BRIGHT_REG,
LM3560_FLASH_BRIGHT_LED2_MASK,
LM3560_FLASH_BRIGHT_LED2_MASK | LM3560_FLASH_BRIGHT_LED1_MASK,
((brightness_val - 1) << LM3560_FLASH_BRIGHT_LED1_SHIFT) |
((brightness_val - 1) << LM3560_FLASH_BRIGHT_LED2_SHIFT));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment