diff options
author | Charlie Huang <chahuang@nvidia.com> | 2012-10-25 14:06:10 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-11-05 18:29:52 -0800 |
commit | 36f31832aafbec18ff2ac0227d577d41a94e7b62 (patch) | |
tree | fe05faa1cfd2f3421aa386b06b7c7e7b9b4f51a9 /drivers/media | |
parent | 326a9b4fd44c0dcd7b4cf1622b01f44da343a23f (diff) |
drivers: media: tegra: max77665: torch control fix
the torch timer and led enable registers were not updated properly.
bug 1116953
Change-Id: If94a5a62e2cb36b3c75c1a69f22cebffdd8cbe27
Signed-off-by: Charlie Huang <chahuang@nvidia.com>
Reviewed-on: http://git-master/r/147707
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Anton Poon <antonp@nvidia.com>
Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/tegra/max77665-flash.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/media/video/tegra/max77665-flash.c b/drivers/media/video/tegra/max77665-flash.c index 153a6d8d5319..cdf9ca055a45 100644 --- a/drivers/media/video/tegra/max77665-flash.c +++ b/drivers/media/video/tegra/max77665-flash.c @@ -297,8 +297,6 @@ static int max77665_f_set_leds(struct max77665_f_info *info, goto update_led_en_reg; if (mask & 1) { - fled_en |= (info->fled_settings & LED1_TORCH_TRIG_MASK); - if (info->op_mode == MAXFLASH_MODE_FLASH) { if (curr1 > f_levels) curr1 = f_levels; @@ -318,12 +316,11 @@ static int max77665_f_set_leds(struct max77665_f_info *info, curr1 = t_levels; t_curr = curr1; + fled_en |= (info->fled_settings & LED1_TORCH_TRIG_MASK); } } if (mask & 2) { - fled_en |= (info->fled_settings & LED2_TORCH_TRIG_MASK); - if (info->op_mode == MAXFLASH_MODE_FLASH) { if (curr2 > f_levels) curr2 = f_levels; @@ -343,6 +340,7 @@ static int max77665_f_set_leds(struct max77665_f_info *info, curr2 = t_levels; t_curr |= curr2 << 4; + fled_en |= (info->fled_settings & LED2_TORCH_TRIG_MASK); } } @@ -372,9 +370,7 @@ static int max77665_f_set_leds(struct max77665_f_info *info, val = (info->regs.t_timer & TORCH_TIMER_CTL_MASK) | (info->new_ttimer & 0x0f); err = max77665_f_reg_wr(info, MAX77665_F_RW_TORCH_TIMER, val, - info->regs.regs_stale, - (info->regs.t_timer & 0x0f) != - info->new_ttimer); + false, true); if (err) goto set_led_end; info->regs.t_timer = val; @@ -518,7 +514,7 @@ update_end: switch (pcfg->torch_mode) { case 1: - info->regs.t_timer = FIELD(TIMER_ONESHOT, 7) | + info->regs.t_timer = FIELD(TIMER_MAX, 7) | FIELD(TORCH_TIMER_SAFETY_DIS, 6); break; case 2: @@ -1442,6 +1438,7 @@ static int max77665_f_status_show(struct seq_file *s, void *data) " Output Mode = %s\n" " Led Settings = 0x%02x\n" " Flash TimeOut = 0x%02x\n" + " Torch TimeOut = 0x%02x\n" " PinState Mask = 0x%04x\n" " PinState Values = 0x%04x\n" " Max_Peak_Current = %dmA\n" @@ -1454,6 +1451,7 @@ static int max77665_f_status_show(struct seq_file *s, void *data) info->op_mode == MAXFLASH_MODE_TORCH ? "TORCH" : "NONE", info->fled_settings, info->regs.f_timer, + info->regs.t_timer, info->pdata->pinstate.mask, info->pdata->pinstate.values, info->config.max_peak_current_mA |