From 4cac6138d2d7658e779a665c21cd029492f22b61 Mon Sep 17 00:00:00 2001 From: Qinggang Zhou Date: Mon, 22 Aug 2011 19:51:03 -0700 Subject: Revert "media: video: tegra: sh532u: remove focuser init_pos" This reverts commit 713b0fe85ab640016918062fed8b62486f88f92e. bug 866141 Change-Id: I5c1c9c78fc6a7078d20d0e5e5e2103e78e9211cc Reviewed-on: http://git-master/r/48618 Reviewed-by: Qinggang Zhou Tested-by: Qinggang Zhou Reviewed-by: Patrick Shehane Reviewed-by: Ryan Wong Tested-by: Ryan Wong --- drivers/media/video/tegra/sh532u.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/media/video/tegra/sh532u.c b/drivers/media/video/tegra/sh532u.c index 0038359c79f4..ee3e67f66914 100644 --- a/drivers/media/video/tegra/sh532u.c +++ b/drivers/media/video/tegra/sh532u.c @@ -300,6 +300,19 @@ get_rom_info_error: info->config.pos_low = POS_LOW; } +static void init_hvca_pos(struct sh532u_sensor *info) +{ + struct i2c_client *client = info->i2c_client; + short sBottomLimit, sTopLimit; + + get_rom_info(info); + sBottomLimit = (((int)info->config.limit_low * 5) >> 3) & 0xFFC0; + lens_move_pulse(client, sBottomLimit); + sTopLimit = (((int)info->config.limit_high * 5) >> 3) & 0xFFC0; + lens_move_pulse(client, sTopLimit); + lens_move_pulse(client, info->config.pos_high); +} + static unsigned int a2buf[] = { 0x0018019c, 0x0018019d, @@ -463,6 +476,9 @@ static void init_driver(struct sh532u_sensor *info) } } } + msleep(300); + + init_hvca_pos(info); } -- cgit v1.2.3