"FLASH",
};
+static char *s2mu106_fled_operating_mode_string[] = {
+ "AUTO",
+ "BOOST",
+ "TA",
+ "SYS",
+};
+
/* IC current limit */
static int s2mu106_fled_torch_curr_max[] = {
0, 320, 320, 320
}
+static void s2mu106_fled_operating_mode(struct s2mu106_fled_data *fled,
+ int mode)
+{
+ u8 value;
+
+ if (mode < 0 || mode > 3) {
+ pr_info ("%s, wrong mode\n", __func__);
+ mode = AUTO_MODE;
+ }
+
+ pr_info ("%s = %s\n", __func__,
+ s2mu106_fled_operating_mode_string[mode]);
+
+ value = mode << 6;
+ s2mu106_update_reg(fled->i2c, S2MU106_FLED_CTRL0, value, 0xC0);
+}
+
static int s2mu106_fled_get_mode(struct s2mu106_fled_data *fled, int chan)
{
u8 status;
bit = S2MU106_FLED_EN << 3;
break;
case S2MU106_FLED_MODE_TORCH:
+ s2mu106_fled_operating_mode(fled, SYS_MODE);
mask = S2MU106_CHX_TORCH_FLED_EN;
bit = S2MU106_FLED_EN;
break;
}
s2mu106_update_reg(fled->i2c, dest, bit, mask);
+ if (mode == S2MU106_FLED_MODE_OFF)
+ s2mu106_fled_operating_mode(fled, AUTO_MODE);
+
return 0;
}
#define S2MU106_F2C_LC_IBAT MASK(6,0)
#define S2MU106_F2C_SYS_MIN_REG MASK(3,0)
+/* FLED operating mode enable */
+enum operating_mode {
+ AUTO_MODE = 0,
+ BOOST_MODE,
+ TA_MODE,
+ SYS_MODE,
+};
+
enum cam_flash_mode{
CAM_FLASH_MODE_NONE=0, //CAM2_FLASH_MODE_NONE=0,
CAM_FLASH_MODE_OFF, //CAM2_FLASH_MODE_OFF,