[PATCH 9/9] as3645a: use the same timeout for hw and sw strobes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems the timeout value couldn't be different for either external or
software strobe (accordingly to as3645a datasheet, table 6).

This patch doesn't prevent to use software watchdog, because it will use
another mechanism to stop strobing (i.e. low "out" pin).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/media/video/as3645a.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/drivers/media/video/as3645a.c b/drivers/media/video/as3645a.c
index 5f8fa68..5462209 100644
--- a/drivers/media/video/as3645a.c
+++ b/drivers/media/video/as3645a.c
@@ -187,18 +187,8 @@ static int as3645a_set_config(struct as3645a *flash)
 	if (ret < 0)
 		return ret;
 
-	if (flash->strobe_source == V4L2_FLASH_STROBE_SOURCE_EXTERNAL) {
-		/* Use timeout to protect the flash in case the external
-		 * strobe gets stuck. Minimum value 100 ms, maximum 850 ms.
-		 */
-		u32 timeout = DIV_ROUND_UP(flash->timeout, 1000);
-		timeout = max_t(u32, DIV_ROUND_UP(timeout, 50) * 50, 100);
-		val = AS_TIMER_MS_TO_CODE(timeout)
+	val = AS_TIMER_MS_TO_CODE(flash->timeout / 1000)
 		    << AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT;
-	} else {
-		val = AS_TIMER_MS_TO_CODE(flash->timeout / 1000)
-		    << AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT;
-	}
 
 	val |= (flash->pdata->vref << AS_INDICATOR_AND_TIMER_VREF_SHIFT)
 	    |  ((flash->indicator_current ? flash->indicator_current - 1 : 0)
-- 
1.7.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux