Evo MR3 updates

file:b572cae65542443d42cf87777c9ce5f7c5a090d3 -> file:d1647e833edbf10d61455bf64f198bca9039661b
--- a/arch/arm/mach-msm/board-incrediblec.c
+++ b/arch/arm/mach-msm/board-incrediblec.c
@@ -55,9 +55,7 @@
#include "devices.h"
#include "proc_comm.h"
#include "smd_private.h"
-#if 1 /*allenou, bt for bcm, 2009/7/8 */
#include <mach/msm_serial_hs.h>
-#endif
#include <mach/tpa6130.h>
#include <mach/msm_flashlight.h>
#include <linux/atmel_qt602240.h>
@@ -847,25 +845,6 @@ MODULE_PARM_DESC(bdaddress, "BT MAC ADDR
#endif
static uint32_t camera_off_gpio_table[] = {
-
-#if 0 /* CAMERA OFF*/
- PCOM_GPIO_CFG(0, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT0 */
- PCOM_GPIO_CFG(1, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT1 */
- PCOM_GPIO_CFG(2, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT2 */
- PCOM_GPIO_CFG(3, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT3 */
- PCOM_GPIO_CFG(4, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT4 */
- PCOM_GPIO_CFG(5, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT5 */
- PCOM_GPIO_CFG(6, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT6 */
- PCOM_GPIO_CFG(7, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT7 */
- PCOM_GPIO_CFG(8, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT8 */
- PCOM_GPIO_CFG(9, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT9 */
- PCOM_GPIO_CFG(10, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT10 */
- PCOM_GPIO_CFG(11, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* DAT11 */
- PCOM_GPIO_CFG(12, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* PCLK */
- PCOM_GPIO_CFG(13, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* HSYNC */
- PCOM_GPIO_CFG(14, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_4MA), /* VSYNC */
- PCOM_GPIO_CFG(15, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* MCLK */
-#endif
/* CAMERA SUSPEND*/
PCOM_GPIO_CFG(0, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* DAT0 */
PCOM_GPIO_CFG(1, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* DAT1 */
@@ -947,6 +926,26 @@ static int flashlight_control(int mode)
return aat1271_flashlight_control(mode);
}
+enum msm_camera_source camera_source;
+static void incrediblec_set_source(enum msm_camera_source source)
+{
+ camera_source = source;
+}
+
+enum msm_camera_source incrediblec_get_source(void){
+ return camera_source;
+}
+
+static int camera_main_probed = 0;
+static int incrediblec_camera_main_get_probe(void)
+{
+ return camera_main_probed;
+}
+static void incrediblec_camera_main_set_probe(int probed)
+{
+ camera_main_probed = probed;
+}
+
static struct camera_flash_cfg msm_camera_sensor_flash_cfg = {
.camera_flash = flashlight_control,
.num_flash_levels = FLASHLIGHT_NUM,
@@ -958,6 +957,9 @@ static struct msm_camera_sensor_info msm
.sensor_name = "ov8810",
.sensor_reset = INCREDIBLEC_CAM_RST, /* CAM1_RST */
.sensor_pwd = INCREDIBLEC_CAM_PWD, /* CAM1_PWDN, enabled in a9 */
+ .camera_set_source = incrediblec_set_source,
+ .camera_main_get_probe = incrediblec_camera_main_get_probe,
+ .camera_main_set_probe = incrediblec_camera_main_set_probe,
.pdata = &msm_camera_device_data,
.resource = msm_camera_resources,
.num_resources = ARRAY_SIZE(msm_camera_resources),
file:b37047a6f838730313a567cc0978ddfa77321922 -> file:557dce29f9c5b7522ef93f8b35c5863034631cfb
--- a/arch/arm/mach-msm/board-supersonic-mmc.c
+++ b/arch/arm/mach-msm/board-supersonic-mmc.c
@@ -288,7 +288,16 @@ static void (*wimax_status_cb)(int card_
static void *wimax_status_cb_devid;
static int mmc_wimax_cd = 0;
static int mmc_wimax_sdio_status = 0;
+static int mmc_wimax_netlog_status = 0;
+static int mmc_wimax_sdio_interrupt_log_status = 0;
+static int mmc_wimax_netlog_withraw_status = 0;
+static int mmc_wimax_cliam_host_status = 0;
+static int mmc_wimax_busclk_pwrsave = 1; // Default is dynamic CLK OFF
+static int mmc_wimax_CMD53_timeout_trigger_counter = 0;
static int mmc_wimax_hostwakeup_gpio = 40; // GPIO40
+static int mmc_wimax_thp_log_status = 0;
+static int mmc_wimax_sdio_hw_reset = 0; // Rollback to default disabled HW RESET
+static int mmc_wimax_packet_filter = 0;
static int supersonic_wimax_status_register(void (*callback)(int card_present, void *dev_id), void *dev_id)
{
@@ -345,10 +354,12 @@ XB : GPIO33 = 0 -> USB
GPIO33 = 1 , GPIO160 = 0 -> CPU UART
GPIO33 = 1 , GPIO160 = 1 -> Wimax UART
*/
+int wimax_uart_switch = 0;
int mmc_wimax_uart_switch(int uart)
{
printk("%s uart:%d\n", __func__, uart);
-
+ wimax_uart_switch = uart;
+
gpio_set_value(SUPERSONIC_USB_UARTz_SW, uart?1:0);
if(system_rev && uart)
gpio_set_value(SUPERSONIC_WIMAX_CPU_UARTz_SW, uart==2?1:0);
@@ -356,6 +367,13 @@ int mmc_wimax_uart_switch(int uart)
}
EXPORT_SYMBOL(mmc_wimax_uart_switch);
+int mmc_wimax_get_uart_switch(void)
+{
+ printk("%s uart:%d\n", __func__, wimax_uart_switch);
+ return wimax_uart_switch?1:0;
+}
+EXPORT_SYMBOL(mmc_wimax_get_uart_switch);
+
int mmc_wimax_power(int on)
{
printk("%s\n", __func__);
@@ -364,10 +382,10 @@ int mmc_wimax_power(int on)
/*Power ON sequence*/
gpio_set_value(154, 1);
gpio_set_value(48, 1);
- mdelay(5);
+ mdelay(5);
gpio_set_value(106, 0);
- gpio_set_value(156, 1);
- gpio_set_value(155, 1);
+ gpio_set_value(156, 1);
+ gpio_set_value(155, 1);
mdelay(5);
gpio_set_value(106, 1);
mdelay(1150);
@@ -410,12 +428,190 @@ int mmc_wimax_get_status(void)
}
EXPORT_SYMBOL(mmc_wimax_get_status);
+int mmc_wimax_set_cliam_host_status(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_cliam_host_status = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_cliam_host_status);
+
+int mmc_wimax_get_cliam_host_status(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_sdio_status);
+ return mmc_wimax_cliam_host_status;
+}
+EXPORT_SYMBOL(mmc_wimax_get_cliam_host_status);
+
+int mmc_wimax_set_netlog_status(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_netlog_status = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_netlog_status);
+
+int mmc_wimax_get_netlog_status(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_sdio_status);
+ return mmc_wimax_netlog_status;
+}
+EXPORT_SYMBOL(mmc_wimax_get_netlog_status);
+
+int mmc_wimax_set_netlog_withraw_status(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_netlog_withraw_status = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_netlog_withraw_status);
+
+int mmc_wimax_get_netlog_withraw_status(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_netlog_withraw_status);
+ return mmc_wimax_netlog_withraw_status;
+}
+EXPORT_SYMBOL(mmc_wimax_get_netlog_withraw_status);
+
+int mmc_wimax_set_sdio_interrupt_log(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_sdio_interrupt_log_status = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_sdio_interrupt_log);
+
+int mmc_wimax_get_sdio_interrupt_log(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_sdio_interrupt_log_status);
+ return mmc_wimax_sdio_interrupt_log_status;
+}
+EXPORT_SYMBOL(mmc_wimax_get_sdio_interrupt_log);
+
+int mmc_wimax_set_packet_filter(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_packet_filter = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_packet_filter);
+
+int mmc_wimax_get_packet_filter(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_packet_filter);
+ return mmc_wimax_packet_filter;
+}
+EXPORT_SYMBOL(mmc_wimax_get_packet_filter);
+
+int mmc_wimax_set_thp_log(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_thp_log_status = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_thp_log);
+
+int mmc_wimax_get_thp_log(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_thp_log_status);
+ return mmc_wimax_thp_log_status;
+}
+EXPORT_SYMBOL(mmc_wimax_get_thp_log);
+
+int mmc_wimax_set_busclk_pwrsave(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_busclk_pwrsave = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_busclk_pwrsave);
+
+int mmc_wimax_get_busclk_pwrsave(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_busclk_pwrsave);
+ return mmc_wimax_busclk_pwrsave;
+}
+EXPORT_SYMBOL(mmc_wimax_get_busclk_pwrsave);
+
+int mmc_wimax_set_sdio_hw_reset(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_sdio_hw_reset = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_sdio_hw_reset);
+
+int mmc_wimax_get_sdio_hw_reset(void)
+{
+ //printk(KERN_INFO "%s status:%d\n", __func__, mmc_wimax_sdio_hw_reset);
+ return mmc_wimax_sdio_hw_reset;
+}
+EXPORT_SYMBOL(mmc_wimax_get_sdio_hw_reset);
+
+int mmc_wimax_set_CMD53_timeout_trigger_counter(int counter)
+{
+ printk(KERN_INFO "%s counter:%d\n", __func__, counter);
+ mmc_wimax_CMD53_timeout_trigger_counter = counter;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_CMD53_timeout_trigger_counter);
+
+int mmc_wimax_get_CMD53_timeout_trigger_counter(void)
+{
+ //printk(KERN_INFO "%s counter:%d\n", __func__, mmc_wimax_CMD53_timeout_trigger_counter);
+ return mmc_wimax_CMD53_timeout_trigger_counter;
+}
+EXPORT_SYMBOL(mmc_wimax_get_CMD53_timeout_trigger_counter);
+
int mmc_wimax_get_hostwakeup_gpio(void)
{
return mmc_wimax_hostwakeup_gpio;
}
EXPORT_SYMBOL(mmc_wimax_get_hostwakeup_gpio);
+static int mmc_wimax_is_gpio_irq_enabled = 0;
+
+int mmc_wimax_set_gpio_irq_enabled(int on)
+{
+ printk(KERN_INFO "%s on:%d\n", __func__, on);
+ mmc_wimax_is_gpio_irq_enabled = on;
+ return 0;
+}
+EXPORT_SYMBOL(mmc_wimax_set_gpio_irq_enabled);
+
+int mmc_wimax_get_gpio_irq_enabled(void)
+{
+ return mmc_wimax_is_gpio_irq_enabled;
+}
+EXPORT_SYMBOL(mmc_wimax_get_gpio_irq_enabled);
+
+void mmc_wimax_enable_host_wakeup(int on)
+{
+ if (mmc_wimax_sdio_status)
+ {
+ if (on) {
+ if (!mmc_wimax_is_gpio_irq_enabled) {
+ printk("set GPIO%d as waketup source\n", mmc_wimax_get_hostwakeup_gpio());
+ enable_irq(MSM_GPIO_TO_INT(mmc_wimax_get_hostwakeup_gpio()));
+ enable_irq_wake(MSM_GPIO_TO_INT(mmc_wimax_get_hostwakeup_gpio()));
+ mmc_wimax_is_gpio_irq_enabled = 1;
+ }
+ }
+ else {
+ if (mmc_wimax_is_gpio_irq_enabled) {
+ printk("disable GPIO%d wakeup source\n", mmc_wimax_get_hostwakeup_gpio());
+ disable_irq_wake(MSM_GPIO_TO_INT(mmc_wimax_get_hostwakeup_gpio()));
+ disable_irq_nosync(MSM_GPIO_TO_INT(mmc_wimax_get_hostwakeup_gpio()));
+ mmc_wimax_is_gpio_irq_enabled = 0;
+ }
+ }
+ }
+ else {
+ printk("%s mmc_wimax_sdio_status is OFF\n", __func__);
+ }
+}
+EXPORT_SYMBOL(mmc_wimax_enable_host_wakeup);
+
int __init supersonic_init_mmc(unsigned int sys_rev)
{
uint32_t id;
file:c447a21de9639593ef9b9808ed69ee3d030c48c7 -> file:f22b4a26a775b98fe6a53874b962e145debcda17
--- a/arch/arm/mach-msm/board-supersonic.c
+++ b/arch/arm/mach-msm/board-supersonic.c
@@ -91,6 +91,8 @@ static struct htc_battery_platform_data
.guage_driver = GUAGE_MODEM,
.m2a_cable_detect = 1,
.charger = SWITCH_CHARGER,
+ /* After the state of SUC XA, MCHG_EN is chanage to CHG_INT*/
+ .int_data.chg_int = MSM_GPIO_TO_INT(SUPERSONIC_GPIO_MCHG_EN_N),
};
static struct platform_device htc_battery_pdev = {
@@ -1063,7 +1065,12 @@ static struct i2c_board_info i2c_devices
.platform_data = &compass_platform_data,
.irq = MSM_GPIO_TO_INT(SUPERSONIC_GPIO_COMPASS_INT_N),
},
-
+ {
+ I2C_BOARD_INFO("s5k3h1gx", 0x20 >> 1),
+ },/*samsung for 2nd source main camera*/
+ {
+ I2C_BOARD_INFO("s5k6aafx", 0x78 >> 1),
+ },/*samsung 2nd camera 2nd source*/
{
I2C_BOARD_INFO("ov8810", 0x6C >> 1),
},
@@ -1123,8 +1130,6 @@ static uint32_t camera_off_gpio_table[]
PCOM_GPIO_CFG(13, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* HSYNC */
PCOM_GPIO_CFG(14, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* VSYNC */
PCOM_GPIO_CFG(15, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* MCLK */
- PCOM_GPIO_CFG(99, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), /* CAM1_RST */
- PCOM_GPIO_CFG(100, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), /* CAM1_PWD */
};
static uint32_t camera_on_gpio_table[] = {
@@ -1182,10 +1187,10 @@ static struct msm_camera_device_platform
.ioext.appsz = MSM_CLK_CTL_SIZE,
};
-static void supersonic_ov8810_clk_switch(void){
+static void supersonic_maincam_clk_switch(void){
int rc = 0;
- pr_info("SuperSoinc: clk switch (supersonic)(ov8810)\n");
- rc = gpio_request(SUPERSONIC_CLK_SWITCH, "ov8810");
+ pr_info("SuperSoinc: clk switch (supersonic)(maincam)\n");
+ rc = gpio_request(SUPERSONIC_CLK_SWITCH, "maincam");
if (rc < 0)
pr_err("GPIO (%d) request fail\n", SUPERSONIC_CLK_SWITCH);
else
@@ -1195,10 +1200,10 @@ static void supersonic_ov8810_clk_switch
return;
}
-static void supersonic_ov9665_clk_switch(void){
+static void supersonic_seccam_clk_switch(void){
int rc = 0;
- pr_info("SuperSoinc: Doing clk switch (supersonic)(ov9665)\n");
- rc = gpio_request(SUPERSONIC_CLK_SWITCH, "ov9665");
+ pr_info("SuperSoinc: Doing clk switch (supersonic)(2ndcam)\n");
+ rc = gpio_request(SUPERSONIC_CLK_SWITCH, "seccam");
if (rc < 0)
pr_err("GPIO (%d) request fail\n", SUPERSONIC_CLK_SWITCH);
else
@@ -1213,18 +1218,95 @@ static int flashlight_control(int mode)
return aat1271_flashlight_control(mode);
}
+enum msm_camera_source camera_source;
+static void supersonic_set_source(enum msm_camera_source source)
+{
+ camera_source = source;
+}
+
+enum msm_camera_source supersonic_get_source(void){
+ return camera_source;
+}
+
+static int camera_main_probed = 0;
+static int supersonic_camera_main_get_probe(void)
+{
+ return camera_main_probed;
+}
+static void supersonic_camera_main_set_probe(int probed)
+{
+ camera_main_probed = probed;
+}
+
+static int camera_sec_probed = 0;
+static int supersonic_camera_sec_get_probe(void)
+{
+ return camera_sec_probed;
+}
+static void supersonic_camera_sec_set_probe(int probed)
+{
+ camera_sec_probed = probed;
+}
+
+
static struct camera_flash_cfg msm_camera_sensor_flash_cfg = {
.camera_flash = flashlight_control,
.num_flash_levels = FLASHLIGHT_NUM,
.low_temp_limit = 10,
.low_cap_limit = 15,
};
+/*2nd source for 2nd camera*/
+static struct msm_camera_sensor_info msm_camera_sensor_s5k6aafx_data = {
+ .sensor_name = "s5k6aafx",
+ .sensor_reset = SUPERSONIC_MAINCAM_RST,
+ .sensor_pwd = SUPERSONIC_2NDCAM_PWD,
+ .camera_clk_switch = supersonic_seccam_clk_switch,
+ .camera_main_get_probe = supersonic_camera_sec_get_probe,
+ .camera_main_set_probe = supersonic_camera_sec_set_probe,
+ .pdata = &msm_camera_device_data,
+ .resource = msm_camera_resources,
+ .num_resources = ARRAY_SIZE(msm_camera_resources),
+ .waked_up = 0,
+ .need_suspend = 0,
+};
+
+static struct platform_device msm_camera_sensor_s5k6aafx = {
+ .name = "msm_camera_s5k6aafx",
+ .dev = {
+ .platform_data = &msm_camera_sensor_s5k6aafx_data,
+ },
+};
+
+/*samsung for 2nd source main camera*/
+static struct msm_camera_sensor_info msm_camera_sensor_s5k3h1_data = {
+ .sensor_name = "s5k3h1gx",
+ .sensor_reset = SUPERSONIC_MAINCAM_RST,
+ .sensor_pwd = SUPERSONIC_MAINCAM_PWD,
+ .camera_clk_switch = supersonic_maincam_clk_switch,
+ .camera_set_source = supersonic_set_source,
+ .camera_main_get_probe = supersonic_camera_main_get_probe,
+ .camera_main_set_probe = supersonic_camera_main_set_probe,
+ .pdata = &msm_camera_device_data,
+ .resource = msm_camera_resources,
+ .num_resources = ARRAY_SIZE(msm_camera_resources),
+ .flash_cfg = &msm_camera_sensor_flash_cfg,
+};
+
+static struct platform_device msm_camera_sensor_s5k3h1 = {
+ .name = "msm_camera_s5k3h1gx",
+ .dev = {
+ .platform_data = &msm_camera_sensor_s5k3h1_data,
+ },
+};
static struct msm_camera_sensor_info msm_camera_sensor_ov8810_data = {
.sensor_name = "ov8810",
- .sensor_reset = SUPERSONIC_MAINCAM_RST, /* CAM1_RST */
- .sensor_pwd = SUPERSONIC_MAINCAM_PWD, /* CAM1_PWDN, enabled in a9 */
- .camera_clk_switch = supersonic_ov8810_clk_switch,
+ .sensor_reset = SUPERSONIC_MAINCAM_RST,
+ .sensor_pwd = SUPERSONIC_MAINCAM_PWD,
+ .camera_clk_switch = supersonic_maincam_clk_switch,
+ .camera_set_source = supersonic_set_source,
+ .camera_main_get_probe = supersonic_camera_main_get_probe,
+ .camera_main_set_probe = supersonic_camera_main_set_probe,
.pdata = &msm_camera_device_data,
.resource = msm_camera_resources,
.num_resources = ARRAY_SIZE(msm_camera_resources),
@@ -1244,7 +1326,10 @@ static struct msm_camera_sensor_info msm
.sensor_name = "ov9665",
.sensor_reset = SUPERSONIC_MAINCAM_RST,
.sensor_pwd = SUPERSONIC_2NDCAM_PWD,
- .camera_clk_switch = supersonic_ov9665_clk_switch,
+ .camera_clk_switch = supersonic_seccam_clk_switch,
+ .camera_get_source = supersonic_get_source,
+ .camera_main_get_probe = supersonic_camera_sec_get_probe,
+ .camera_main_get_probe = supersonic_camera_sec_get_probe,
.pdata = &msm_camera_device_data,
.resource = msm_camera_resources,
.num_resources = ARRAY_SIZE(msm_camera_resources),
@@ -1316,7 +1401,9 @@ static struct platform_device *devices[]
&android_pmem_ciq2_device,
&android_pmem_ciq3_device,
#endif
+ &msm_camera_sensor_s5k3h1,
&msm_camera_sensor_ov8810,
+ &msm_camera_sensor_s5k6aafx,
&msm_kgsl_device,
&msm_device_i2c,
&msm_camera_sensor_ov9665,
file:81d2e296a2cc66eff272cf3405bd934878d38de0 -> file:bf3af90bbffaebe4af3f016651bde85a47212813
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -406,7 +406,7 @@ int clks_allow_tcxo_locked_debug(void)
hlist_for_each_entry(clk, pos, &clocks, list) {
if (clk->count) {
- pr_info("%s: '%s' not off.\n", __func__, clk->name);
+ pr_info("%s: '%s(%d)' not off.\n", __func__, clk->name, clk->id);
clk_on_count++;
}
}
file:4010ef8593a8cf013ce88f32b279532706f1ded6 -> file:be18cf157afdd87f1cd2fd287161c90511026cda
--- a/arch/arm/mach-msm/htc_battery.c
+++ b/arch/arm/mach-msm/htc_battery.c
@@ -30,6 +30,8 @@
#include <mach/msm_fb.h> /* Jay, to register display notifier */
#include <mach/htc_battery.h>
#include <linux/rtc.h>
+#include <linux/workqueue.h>
+#include <linux/tps65200.h>
#ifdef CONFIG_HTC_BATTCHG_SMEM
#include "smd_private.h"
#endif
@@ -1176,7 +1178,7 @@ static ssize_t htc_battery_charger_switc
enable = simple_strtoul(buf, NULL, 10);
- if (enable > 1 || enable < 0)
+ if (enable > 1)
return -EINVAL;
mutex_lock(&htc_batt_info.rpc_lock);
@@ -1257,7 +1259,7 @@ htc_attrs_failed:
device_remove_file(dev, &htc_battery_attrs[i]);
htc_delta_attrs_failed:
while (j--)
- device_remove_file(dev, &htc_set_delta_attrs[i]);
+ device_remove_file(dev, &htc_set_delta_attrs[j]);
succeed:
return rc;
}
@@ -1378,6 +1380,89 @@ dont_need_update:
return i;
}
+static irqreturn_t tps65200_int_detection(int irq, void *data)
+{
+ struct htc_battery_tps65200_int *ip = data;
+
+ BATT_LOG("%s: over voltage is detected.", __func__);
+
+ disable_irq_nosync(ip->chg_int);
+
+ ip->tps65200_reg = 0;
+
+ schedule_delayed_work(&ip->int_work, msecs_to_jiffies(200));
+
+ return IRQ_HANDLED;
+}
+
+static void htc_battery_tps65200_int_func(struct work_struct *work)
+{
+ struct htc_battery_tps65200_int *ip;
+ int fault_bit;
+ ip = container_of(work, struct htc_battery_tps65200_int,
+ int_work.work);
+
+ switch (ip->tps65200_reg) {
+ case CHECK_INT1:
+ /* read twice. First read to trigger TPS65200 clear fault bit
+ on INT1. Second read to make sure that fault bit is cleared
+ and call off ovp function.*/
+ fault_bit = tps_set_charger_ctrl(CHECK_INT1);
+ BATT_LOG("INT1 value: %d", fault_bit);
+ fault_bit = tps_set_charger_ctrl(CHECK_INT1);
+
+ if (fault_bit) {
+#ifdef CONFIG_HTC_BATTCHG_SMEM
+ smem_batt_info->over_vchg = 1;
+#else
+ htc_batt_info.rep.over_vchg = 1;
+#endif
+ power_supply_changed(&htc_power_supplies[CHARGER_BATTERY]);
+ schedule_delayed_work(&ip->int_work,
+ msecs_to_jiffies(5000));
+ BATT_LOG("OVER_VOLTAGE: "
+ "over voltage fault bit on TPS65200 is raised:"
+ " %d", fault_bit);
+ } else {
+#ifdef CONFIG_HTC_BATTCHG_SMEM
+ smem_batt_info->over_vchg = 0;
+#else
+ htc_batt_info.rep.over_vchg = 0;
+#endif
+ cancel_delayed_work(&ip->int_work);
+ enable_irq(ip->chg_int);
+ }
+ break;
+ default:
+ fault_bit = tps_set_charger_ctrl(CHECK_INT2);
+ BATT_LOG("Read TPS65200 INT2 register value: %x", fault_bit);
+ if (fault_bit) {
+ fault_bit = tps_set_charger_ctrl(CHECK_INT2);
+ BATT_LOG("Read TPS65200 INT2 register value: %x"
+ , fault_bit);
+ fault_bit = tps_set_charger_ctrl(CHECK_INT2);
+ BATT_LOG("Read TPS65200 INT2 register value: %x"
+ , fault_bit);
+ fault_bit = tps_set_charger_ctrl(CHECK_CONTROL);
+#ifdef CONFIG_HTC_BATTCHG_SMEM
+ smem_batt_info->reserve4 = 1;
+#endif
+ cancel_delayed_work(&ip->int_work);
+ enable_irq(ip->chg_int);
+ } else {
+ fault_bit = tps_set_charger_ctrl(CHECK_INT1);
+ BATT_LOG("Read TPS65200 INT1 register value: %x"
+ , fault_bit);
+ if (fault_bit) {
+ ip->tps65200_reg = CHECK_INT1;
+ schedule_delayed_work(&ip->int_work,
+ msecs_to_jiffies(200));
+ }
+ }
+ break;
+ }
+}
+
static int htc_battery_core_probe(struct platform_device *pdev)
{
int i, rc;
@@ -1560,6 +1645,7 @@ static struct notifier_block ds2784_noti
static int htc_battery_probe(struct platform_device *pdev)
{
+ int rc = 0;
struct htc_battery_platform_data *pdata = pdev->dev.platform_data;
htc_batt_info.device_id = pdev->id;
@@ -1587,6 +1673,25 @@ static int htc_battery_probe(struct plat
ds2746_register_notifier(&ds2784_notifier);
#endif
+ if (system_rev >= 1) {
+ if (pdata->int_data.chg_int) {
+ BATT_LOG("init over voltage interrupt detection.");
+ INIT_DELAYED_WORK(&pdata->int_data.int_work,
+ htc_battery_tps65200_int_func);
+
+ rc = request_irq(pdata->int_data.chg_int,
+ tps65200_int_detection,
+ IRQF_TRIGGER_LOW,
+ "over_voltage_interrupt",
+ &pdata->int_data);
+
+ if (rc) {
+ BATT_LOG("request irq failed");
+ return rc;
+ }
+ }
+ }
+
return 0;
}
file:91016443b5dafde00dba833d0c6fb0bfb071bb75 -> file:985da5ce7473919f5b8506d63f1cb578f2070ed4
--- a/arch/arm/mach-msm/include/mach/board.h
+++ b/arch/arm/mach-msm/include/mach/board.h
@@ -128,6 +128,11 @@ struct camera_flash_cfg {
uint8_t postpone_led_mode;
};
+enum msm_camera_source{
+ MAIN_SOURCE,
+ SECOND_SOURCE,
+};
+
struct msm_camera_sensor_info {
const char *sensor_name;
int sensor_reset;
@@ -142,6 +147,10 @@ struct msm_camera_sensor_info {
int analog_pwd1_gpio;
int (*camera_power_on)(void);
int (*camera_power_off)(void);
+ void(*camera_set_source)(enum msm_camera_source);
+ enum msm_camera_source(*camera_get_source)(void);
+ int (*camera_main_get_probe)(void);
+ void (*camera_main_set_probe)(int);
int mclk;
int flash_type; /* for back support */
uint8_t led_high_enabled;
file:9b1b4d0ea73bc3ab8c3f85514d69cbe27f7577a7 -> file:fa9f6fd37bc7029d71732b97922e7c4477d440d9
--- a/arch/arm/mach-msm/include/mach/htc_battery.h
+++ b/arch/arm/mach-msm/include/mach/htc_battery.h
@@ -22,7 +22,10 @@
#define SET_ICL500 0X65
#define SET_ICL100 0X66
#define CHECK_INT2 0X67
-
+#define OVERTEMP_VREG_4060 0XC8
+#define NORMALTEMP_VREG_4200 0XC9
+#define CHECK_INT1 0XCA
+#define CHECK_CONTROL 0xCB
/* information about the system we're running on */
extern unsigned int system_rev;
@@ -67,6 +70,13 @@ struct battery_info_reply {
u32 over_vchg; /* 0:normal, 1:over voltage charger */
s32 eval_current; /* System loading current from ADC */
};
+
+struct htc_battery_tps65200_int {
+ int chg_int;
+ int tps65200_reg;
+ struct delayed_work int_work;
+};
+
struct htc_battery_platform_data {
int (*func_show_batt_attr)(struct device_attribute *attr,
char *buf);
@@ -77,6 +87,7 @@ struct htc_battery_platform_data {
int guage_driver;
int m2a_cable_detect;
int charger;
+ struct htc_battery_tps65200_int int_data;
};
#if CONFIG_HTC_BATTCHG
file:9bcabce171c2a3396ee12354aa2606b55d3837e9 -> file:c0ecf0d9ccd49740747b93f8b73c09a652e723de
--- a/arch/arm/mach-msm/include/mach/htc_usb.h
+++ b/arch/arm/mach-msm/include/mach/htc_usb.h
@@ -108,6 +108,17 @@ static char *usb_functions_diag_serial[]
#endif
#endif
+#ifdef CONFIG_USB_ANDROID_ACM
+static char *usb_functions_adb_acm[] = {
+ "usb_mass_storage",
+ "adb",
+ "acm",
+};
+static char *usb_functions_acm[] = {
+ "acm",
+};
+#endif
+
static char *usb_functions_all[] = {
#ifdef CONFIG_USB_ANDROID_RNDIS
"ether",
@@ -126,6 +137,9 @@ static char *usb_functions_all[] = {
#ifdef CONFIG_USB_ANDROID_PROJECTOR
"projector",
#endif
+#ifdef CONFIG_USB_ANDROID_ACM
+ "acm",
+#endif
};
static struct android_usb_product usb_products[] = {
@@ -139,6 +153,18 @@ static struct android_usb_product usb_pr
.num_functions = ARRAY_SIZE(usb_functions_ums),
.functions = usb_functions_ums,
},
+#ifdef CONFIG_USB_ANDROID_ACM
+ {
+ .product_id = 0x0ff4,
+ .num_functions = ARRAY_SIZE(usb_functions_acm),
+ .functions = usb_functions_acm,
+ },
+ {
+ .product_id = 0x0ff5,
+ .num_functions = ARRAY_SIZE(usb_functions_adb_acm),
+ .functions = usb_functions_adb_acm,
+ },
+#endif
#ifdef CONFIG_USB_ANDROID_SERIAL
{
.product_id = 0x0c03,
file:40281ac27e91f260137f0a8028613719ab5c078e -> file:eb9bf357c45ce2adb6c29bf2f57b63fb4e7c8b92
--- a/drivers/i2c/chips/a1026.c
+++ b/drivers/i2c/chips/a1026.c
@@ -27,7 +27,7 @@
#include <linux/a1026.h>
#define DEBUG (0)
-#define ENABLE_DIAG_IOCTLS (1)
+#define ENABLE_DIAG_IOCTLS (0)
static struct i2c_client *this_client;
static struct a1026_platform_data *pdata;
@@ -41,8 +41,6 @@ static int control_a1026_clk;
static unsigned int a1026_NS_state = A1026_NS_STATE_AUTO;
static int a1026_current_config = A1026_PATH_SUSPEND;
static int a1026_param_ID;
-static char *config_data;
-static int a1026_cmds_len;
struct vp_ctxt {
unsigned char *data;
@@ -293,31 +291,33 @@ unsigned char phonecall_receiver[] = {
0x80,0x17,0x00,0x04, /* SetAlgorithmParmID, 0x0004:Use AGC */
0x80,0x18,0x00,0x00, /* SetAlgorithmParm, 0x0000:No */
0x80,0x17,0x00,0x00, /* SetAlgorithmParmID, 0x0000:Suppression Strength */
- 0x80,0x18,0x00,0x00, /* SetAlgorithmParm, 0x0000:0dB Max Suppression */
+ 0x80,0x18,0x00,0x05, /* SetAlgorithmParm, 0x0005:25dB Max Suppression */
+ 0x80,0x17,0x00,0x20, /* SetAlgorithmParmID, 0x0020:Tx PostEq Mode */
+ 0x80,0x18,0x00,0x02, /* SetAlgorithmParm, 0x0002:On always */
0x80,0x1B,0x00,0x0C, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x0C:(12 dB) */
0x80,0x1B,0x01,0x0C, /* SetDigitalInputGain, 0x01:Secondary Mic (Tx), 0x0C:(12 dB) */
- 0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
+ 0x80,0x15,0x00,0xFA, /* SetDigitalOutputGain, 0x00:Tx, 0xFA:(-6 dB) */
};
unsigned char phonecall_headset[] = {
0x80,0x26,0x00,0x15, /* SelectRouting, 0x0015:Snk,Pri,Snk,Snk - Csp,Zro,Zro (none) */
0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
0x80,0x1B,0x00,0x12, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x12:(18 dB) */
- 0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
+ 0x80,0x15,0x00,0xF8, /* SetDigitalOutputGain, 0x00:Tx, 0xF8:(-8 dB) */
};
unsigned char phonecall_speaker[] = {
0x80,0x17,0x00,0x02, /* SetAlgorithmParmID, 0x0002:Microphone Configuration */
0x80,0x18,0x00,0x02, /* SetAlgorithmParm, 0x0002:1-mic Desktop/Vehicle (DV) */
- 0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
+ 0x80,0x1C,0x00,0x01, /* VoiceProcessingOn, 0x0001:Yes */
0x80,0x17,0x00,0x00, /* SetAlgorithmParmID, 0x0000:Suppression Strength */
- 0x80,0x18,0x00,0x04, /* SetAlgorithmParm, 0x0004:20dB Max Suppression */
+ 0x80,0x18,0x00,0x02, /* SetAlgorithmParm, 0x0002 */
0x80,0x17,0x00,0x04, /* SetAlgorithmParmID, 0x0004:Use AGC */
0x80,0x18,0x00,0x00, /* SetAlgorithmParm, 0x0000:No */
0x80,0x17,0x00,0x1A, /* SetAlgorithmParmID, 0x001A:Use ComfortNoise */
0x80,0x18,0x00,0x00, /* SetAlgorithmParm, 0x0000:No */
- 0x80,0x1B,0x00,0x0C, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x0C:(12 dB) */
- 0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
+ 0x80,0x1B,0x00,0x12, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x12:(18 dB) */
+ 0x80,0x15,0x00,0xFD, /* SetDigitalOutputGain, 0x00:Tx, 0xFD:(-3 dB) */
};
unsigned char phonecall_bt[] = {
@@ -329,6 +329,13 @@ unsigned char phonecall_bt[] = {
0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
};
+unsigned char phonecall_tty[] = {
+ 0x80,0x26,0x00,0x15, /* SelectRouting, 0x0015:Snk,Pri,Snk,Snk - Csp,Zro,Zro (none) */
+ 0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
+ 0x80,0x1B,0x00,0x00, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x00:(0 dB) */
+ 0x80,0x15,0x00,0xFB, /* SetDigitalOutputGain, 0x00:Tx, 0xFB:(-5 dB) */
+};
+
unsigned char INT_MIC_recording_receiver[] = {
0x80,0x26,0x00,0x07, /* SelectRouting, 0x0007:Pri,Snk,Snk,Snk - Csp,Zro,Zro (none) */
0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
@@ -363,15 +370,15 @@ unsigned char BACK_MIC_recording[] = {
0x80,0x17,0x00,0x00, /* SetAlgorithmParmID, 0x0000:Suppression Strength */
0x80,0x18,0x00,0x00, /* SetAlgorithmParm, 0x0000:No Suppression */
0x80,0x1B,0x00,0x12, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x12:(18 dB) */
- 0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
+ 0x80,0x15,0x00,0x06, /* SetDigitalOutputGain, 0x00:Tx, 0x06:(6 dB) */
};
unsigned char vr_no_ns_receiver[] = {
0x80,0x17,0x00,0x02, /* SetAlgorithmParmID, 0x0002:Microphone Configuration */
0x80,0x18,0x00,0x00, /* SetAlgorithmParm, 0x0000:2-mic Close Talk (CT) */
0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
- 0x80,0x1B,0x00,0x00, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x00:(0 dB) */
- 0x80,0x1B,0x01,0x00, /* SetDigitalInputGain, 0x01:Secondary Mic (Tx), 0x00:(0 dB) */
+ 0x80,0x1B,0x00,0x0C, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x0C:(12 dB) */
+ 0x80,0x1B,0x01,0x0C, /* SetDigitalInputGain, 0x01:Secondary Mic (Tx), 0x09:(12 dB) */
0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
};
@@ -380,7 +387,7 @@ unsigned char vr_no_ns_headset[] = {
0x80,0x18,0x00,0x03, /* SetAlgorithmParm, 0x0003:1M-DG (1-mic digital input) */
0x80,0x26,0x00,0x15, /* SelectRouting, 0x0015:Snk,Pri,Snk,Snk - Csp,Zro,Zro (none) */
0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
- 0x80,0x1B,0x00,0x00, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x00:(0 dB) */
+ 0x80,0x1B,0x00,0x12, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x12:(18 dB) */
0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
};
@@ -388,7 +395,7 @@ unsigned char vr_no_ns_speaker[] = {
0x80,0x17,0x00,0x02, /* SetAlgorithmParmID, 0x0002:Microphone Configuration */
0x80,0x18,0x00,0x02, /* SetAlgorithmParm, 0x0002:1-mic Desktop/Vehicle (DV) */
0x80,0x1C,0x00,0x00, /* VoiceProcessingOn, 0x0000:No */
- 0x80,0x1B,0x00,0x00, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x00:(0 dB) */
+ 0x80,0x1B,0x00,0x0C, /* SetDigitalInputGain, 0x00:Primay Mic (Tx), 0x0C:(12 dB) */
0x80,0x15,0x00,0x00, /* SetDigitalOutputGain, 0x00:Tx, 0x00:(0 dB) */
};
@@ -534,24 +541,7 @@ int a1026_filter_vp_cmd(int cmd, int mod
return filtered_cmd;
}
-int build_cmds(char* cmds, int newid)
-{
- int i = 0;
- int offset = 0;
- for ( i = 0; i < a1026_cmds_len; i += 6)
- if (config_data[i] == newid) {
- cmds[offset++] = config_data[i + 2];
- cmds[offset++] = config_data[i + 3];
- cmds[offset++] = config_data[i + 4];
- cmds[offset++] = config_data[i + 5];
- }
- if (offset > 128)
- {
- pr_err("Wrong i2c commands\n");
- return 0;
- }
- return offset;
-}
+
int a1026_set_config(char newid, int mode)
{
int rc = 0, size = 0;
@@ -561,7 +551,6 @@ int a1026_set_config(char newid, int mod
unsigned char *index = 0;
unsigned char ack_buf[A1026_CMD_FIFO_DEPTH * 4];
unsigned char rdbuf[4];
- unsigned char custom_cmds[128] = {0};
if ((a1026_suspended) && (newid == A1026_PATH_SUSPEND))
return rc;
@@ -593,6 +582,11 @@ int a1026_set_config(char newid, int mod
i2c_cmds = phonecall_bt;
size = sizeof(phonecall_bt);
break;
+ case A1026_PATH_INCALL_TTY:
+ gpio_set_value(pdata->gpio_a1026_micsel, 1);
+ i2c_cmds = phonecall_tty;
+ size = sizeof(phonecall_tty);
+ break;
case A1026_PATH_VR_NO_NS_RECEIVER:
gpio_set_value(pdata->gpio_a1026_micsel, 0);
i2c_cmds = vr_no_ns_receiver;
@@ -671,29 +665,15 @@ int a1026_set_config(char newid, int mod
}
a1026_current_config = newid;
-
- if (a1026_cmds_len > 0 )
- {
- int cmd_size = 0;
- if ((cmd_size = build_cmds(custom_cmds, newid)) > 0 )
- i2c_cmds = custom_cmds;
- size = cmd_size;
- pr_err("use customize command\n");
- }
-
pr_info("%s: change to mode %d\n", __func__, newid);
pr_info("%s: block write start (size = %d)\n", __func__, size);
-
#if DEBUG
- {
- int i = 0;
- for (i = 1; i <= size; i++) {
- pr_info("%x ", *(i2c_cmds + i - 1));
- if ( !(i % 4))
- pr_info("\n");
- }
- }
+ for (i = 1; i <= size; i++) {
+ pr_info("%x ", *(i2c_cmds + i - 1));
+ if ( !(i % 4))
+ pr_info("\n");
+ }
#endif
rc = a1026_i2c_write(i2c_cmds, size);
@@ -726,14 +706,11 @@ int a1026_set_config(char newid, int mod
} else {
pr_info("%s: CMD ACK block read end\n", __func__);
#if DEBUG
- {
- int i = 0;
for (i = 1; i <= size; i++) {
pr_info("%x ", ack_buf[i-1]);
if ( !(i % 4))
pr_info("\n");
}
- }
#endif
index = ack_buf;
number_of_cmd_sets = size / 4;
@@ -747,13 +724,10 @@ rd_retry:
if (rc < 0)
return rc;
#if DEBUG
- {
- int i = 0;
- for (i = 0; i < sizeof(rdbuf); i++) {
- pr_info("0x%x\n", rdbuf[i]);
- }
- pr_info("-----------------\n");
+ for (i = 0; i < sizeof(rdbuf); i++) {
+ pr_info("0x%x\n", rdbuf[i]);
}
+ pr_info("-----------------\n");
#endif
if (rdbuf[0] == 0x00) {
msleep(20);
@@ -903,7 +877,6 @@ a1026_ioctl(struct inode *inode, struct
{
void __user *argp = (void __user *)arg;
struct a1026img img;
- struct A1026_config_data cfg;
int rc = 0;
#if ENABLE_DIAG_IOCTLS
char msg[4];
@@ -940,33 +913,6 @@ a1026_ioctl(struct inode *inode, struct
a1026_set_config(a1026_current_config,
A1026_CONFIG_VP);
break;
- case A1026_SET_PARAM:
- a1026_cmds_len = 0;
- cfg.cmd_data = 0;
- if (copy_from_user(&cfg, argp, sizeof(cfg))) {
- pr_err("%s: copy from user failed.\n", __func__);
- return -EFAULT;
- }
-
- if (cfg.data_len <= 0) {
- pr_err("%s: invalid data length %d\n", __func__, cfg.data_len);
- return -EINVAL;
- }
-
- config_data = kmalloc(cfg.data_len, GFP_KERNEL);
- if (!config_data) {
- pr_err("%s: out of memory\n", __func__);
- return -ENOMEM;
- }
- if (copy_from_user(config_data, cfg.cmd_data, cfg.data_len)) {
- pr_err("%s: copy data from user failed.\n", __func__);
- kfree(config_data);
- return -EFAULT;
- }
- a1026_cmds_len = cfg.data_len;
- pr_info("%s: update a1026 i2c commands success. \n", __func__);
- rc = 0;
- break;
#if ENABLE_DIAG_IOCTLS
case A1026_SET_MIC_ONOFF:
rc = chk_wakeup_a1026();
file:a7e6ccbc8eb6dd51c0bac7695eb99d36a5aa0089 -> file:441ecf2fa77bd833e0218919def93e0968dea4ad
--- a/drivers/i2c/chips/akm8973.c
+++ b/drivers/i2c/chips/akm8973.c
@@ -427,7 +427,6 @@ akmd_ioctl(struct inode *inode, struct f
char msg[RBUFF_SIZE + 1], rwbuf[5];
int ret = -1, status;
short mode, value[12], delay;
- char project_name[64];
short layouts[4][3][3];
int i, j, k;
@@ -490,9 +489,6 @@ akmd_ioctl(struct inode *inode, struct f
case ECS_IOCTL_GET_DELAY:
delay = akmd_delay;
break;
- case ECS_IOCTL_GET_PROJECT_NAME:
- strncpy(project_name, pdata->project_name, 64);
- break;
case ECS_IOCTL_GET_MATRIX:
for (i = 0; i < 4; i++)
for (j = 0; j < 3; j++)
@@ -522,10 +518,6 @@ akmd_ioctl(struct inode *inode, struct f
if (copy_to_user(argp, &delay, sizeof(delay)))
return -EFAULT;
break;
- case ECS_IOCTL_GET_PROJECT_NAME:
- if (copy_to_user(argp, project_name, sizeof(project_name)))
- return -EFAULT;
- break;
case ECS_IOCTL_GET_MATRIX:
if (copy_to_user(argp, layouts, sizeof(layouts)))
return -EFAULT;
file:ca98922def9b25cf4932f8c0a0a7187d2ea1a94b -> file:f8df1489724fc6236cf46d4c4ccf1e63926436db
--- a/drivers/i2c/chips/tpa6130.c
+++ b/drivers/i2c/chips/tpa6130.c
@@ -35,7 +35,7 @@ struct mutex amp_mutex;
static struct tpa6130_platform_data *pdata;
static int i2c_on;
-char buffer[2];
+char buffer[3];
static int I2C_TxData(char *txData, int length)
{
@@ -81,6 +81,7 @@ static int handle_headset_call(struct ms
struct rpc_request_hdr *req, unsigned len)
{
struct rpc_headset_amp_ctl_args *args;
+
if (!pdata->enable_rpc_server)
return 0;
file:f21cb3f1abf2d637a982397971a349edf787a26e -> file:f2d5b07bdc834e7e1f203c046a0233c6f3a92439
--- a/drivers/i2c/chips/tps65200.c
+++ b/drivers/i2c/chips/tps65200.c
@@ -22,7 +22,7 @@
#include <asm/mach-types.h>
static const unsigned short normal_i2c[] = { I2C_CLIENT_END };
-
+static int tps65200_initial = -1;
/**
* Insmod parameters
*/
@@ -174,19 +174,21 @@ int tps_set_charger_ctrl(u32 ctl)
u8 status;
u8 regh;
+ if (tps65200_initial < 0)
+ return 0;
+
switch (ctl) {
case DISABLE:
pr_info("Switch charger OFF\n");
tps65200_i2c_write_byte(0x29, 0x01);
tps65200_i2c_write_byte(0x28, 0x00);
- tps65200_i2c_read_byte(&status, 0x09);
- pr_info("TPS65200 INT2 %x\n", status);
break;
case ENABLE_SLOW_CHG:
pr_info("Switch charger ON (SLOW)\n");
tps65200_i2c_write_byte(0x29, 0x01);
tps65200_i2c_write_byte(0x2A, 0x00);
tps65200_i2c_write_byte(0x86, 0x03);
+ tps65200_i2c_write_byte(0x63, 0x02);
break;
case ENABLE_FAST_CHG:
pr_info("Switch charger ON (FAST)\n");
@@ -206,7 +208,8 @@ int tps_set_charger_ctrl(u32 ctl)
case CHECK_CHG:
pr_info("Switch charger CHECK \n");
tps65200_i2c_read_byte(&status, 0x06);
- pr_info("TPS65200 STATUS_A%x\n", status);
+ tps65200_i2c_read_byte(&regh, 0x09);
+ pr_info("TPS65200 STATUS_A%x, INT2:%x\n", status, regh);
break;
case SET_ICL500:
pr_info("Switch charger SET_ICL500 \n");
@@ -216,10 +219,38 @@ int tps_set_charger_ctrl(u32 ctl)
pr_info("Switch charger SET_ICL100 \n");
tps65200_i2c_write_byte(0x23, 0x02);
break;
+ case CHECK_INT1:
+ pr_info("Switch charger CHECK_INT1 \n");
+ tps65200_i2c_read_byte(&status, 0x08);
+ pr_info("Switch charger CHECK_INT1: regh 0x08h=%x\n", status);
+ result = (int)status;
+ break;
case CHECK_INT2:
pr_info("Switch charger CHECK_INT2 \n");
tps65200_i2c_read_byte(&status, 0x09);
pr_info("TPS65200 INT2 %x\n", status);
+ result = (int)status;
+ break;
+ case CHECK_CONTROL:
+ pr_info("Switch charger CHECK_CONTROL \n");
+ tps65200_i2c_read_byte(&status, 0x00);
+ pr_info("TPS65200 regh 0x00=%x\n", regh);
+ break;
+ case OVERTEMP_VREG_4060:
+ pr_info("Switch charger OVERTEMP_VREG_4060 \n");
+ tps65200_i2c_read_byte(&regh, 0x02);
+ regh = (regh & 0xC0) | 0x1C;
+ tps65200_i2c_write_byte(regh, 0x02);
+ tps65200_i2c_read_byte(&regh, 0x02);
+ pr_info("Switch charger OVERTEMP_VREG_4060: regh 0x02=%x\n", regh);
+ break;
+ case NORMALTEMP_VREG_4200:
+ pr_info("Switch charger NORMALTEMP_VREG_4200 \n");
+ tps65200_i2c_read_byte(&regh, 0x02);
+ regh = (regh & 0xC0) | 0X23;
+ tps65200_i2c_write_byte(regh, 0x02);
+ tps65200_i2c_read_byte(&regh, 0x02);
+ pr_info("Switch charger NORMALTEMP_VREG_4200: regh 0x02=%x\n", regh);
break;
default:
pr_info("%s: Not supported battery ctr called.!", __func__);
@@ -259,6 +290,7 @@ static int tps65200_probe(struct i2c_cli
data->address = client->addr;
data->client = client;
mutex_init(&data->xfer_lock);
+ tps65200_initial = 1;
pr_info("[TPS65200]: Driver registration done\n");
return 0;
}
file:4905692a54f7735e2d07c67b72a2808bcb9b8f12 -> file:977aa58ad6d91bf046480943bc3a98cd890e8a2b
--- a/drivers/input/keyreset.c
+++ b/drivers/input/keyreset.c
@@ -21,7 +21,7 @@
#include <linux/sched.h>
#include <linux/syscalls.h>
-
+#define KEYRESET_DELAY 3*HZ
struct keyreset_state {
struct input_handler input_handler;
unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
@@ -34,15 +34,16 @@ struct keyreset_state {
int restart_disabled;
};
-int restart_requested;
+static int restart_requested;
static void deferred_restart(struct work_struct *dummy)
{
+ pr_info("keyreset::%s in\n", __func__);
restart_requested = 2;
sys_sync();
restart_requested = 3;
kernel_restart(NULL);
}
-static DECLARE_WORK(restart_work, deferred_restart);
+static DECLARE_DELAYED_WORK(restart_work, deferred_restart);
static void keyreset_event(struct input_handle *handle, unsigned int type,
unsigned int code, int value)
@@ -87,8 +88,14 @@ static void keyreset_event(struct input_
if (restart_requested)
panic("keyboard reset failed, %d", restart_requested);
pr_info("keyboard reset\n");
- schedule_work(&restart_work);
+ schedule_delayed_work(&restart_work, KEYRESET_DELAY);
restart_requested = 1;
+ } else if (restart_requested == 1) {
+ if (cancel_delayed_work(&restart_work)) {
+ pr_info("%s: cancel restart work\n", __func__);
+ restart_requested = 0;
+ } else
+ pr_info("%s: cancel failed\n", __func__);
}
done:
spin_unlock_irqrestore(&state->lock, flags);
file:ca23905f30467ad4f1f2bd38db708f4fa0f9ad51 -> file:5e5d78534f3d568a44727ca5e34a8b9aa6a74a52
--- a/drivers/input/misc/keychord.c
+++ b/drivers/input/misc/keychord.c
@@ -27,6 +27,8 @@
#define KEYCHORD_NAME "keychord"
#define BUFFER_SIZE 16
+#define MATCH_COUNT 3
+#define KEYCHORD_TIMEOUT 5*HZ
MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
MODULE_DESCRIPTION("Key chord input driver");
@@ -60,8 +62,20 @@ struct keychord_device {
unsigned char head;
unsigned char tail;
__u16 buff[BUFFER_SIZE];
+ struct delayed_work keychord_work;
+ int8_t keychord_match_count;
};
+static void keychord_timeout(struct work_struct *work)
+{
+ struct keychord_device *kdev =
+ container_of(work, struct keychord_device, keychord_work.work);
+
+ pr_info("%s: match_count=%d\n", __func__, kdev->keychord_match_count);
+ if (kdev->keychord_match_count)
+ kdev->keychord_match_count = 0;
+}
+
static int check_keychord(struct keychord_device *kdev,
struct input_keychord *keychord)
{
@@ -75,8 +89,18 @@ static int check_keychord(struct keychor
return 0;
}
- /* we have a match */
- return 1;
+ if (kdev->keychord_match_count++ == 0)
+ schedule_delayed_work(&kdev->keychord_work, KEYCHORD_TIMEOUT);
+
+ if (kdev->keychord_match_count == MATCH_COUNT) {
+ if (cancel_delayed_work(&kdev->keychord_work)) {
+ kdev->keychord_match_count = 0;
+ return 1;
+ } else
+ pr_info("%s: timeout already started\n", __func__);
+ }
+
+ return 0;
}
static void keychord_event(struct input_handle *handle, unsigned int type,
@@ -344,6 +368,7 @@ static int keychord_open(struct inode *i
file->private_data = kdev;
+ INIT_DELAYED_WORK(&kdev->keychord_work, keychord_timeout);
return 0;
}
file:7783f258c22e00c4c7f5b647a9aa508d38a16cf0 -> file:c60b319fd59b6a25d3b2c9e8960ea791ee17667f
--- a/drivers/media/video/msm/Kconfig
+++ b/drivers/media/video/msm/Kconfig
@@ -60,6 +60,13 @@ config S5K4E1GX
---help---
Samsung 5M with Autofocus
+config S5K6AAFX
+ bool "Sensor s5k6aafx (Samsung 1.3M)"
+ depends on MSM_CAMERA
+ default n
+ ---help---
+ Samsung 1.3M without Autofocus
+
config OV8810
bool "Sensor ov8810"
depends on MSM_CAMERA
file:fd6383a7fd19a76c24788b16e956101e6354595f -> file:aecd1ec93029cb1acd7f3eb02394edaba888e39a
--- a/drivers/media/video/msm/Makefile
+++ b/drivers/media/video/msm/Makefile
@@ -7,10 +7,11 @@ obj-$(CONFIG_MSM_CAMERA_LEGACY) += msm_c
obj-$(CONFIG_MSM_CAMERA_7X30) += msm_camera-7x30.o msm_vfe31.o msm_io_vfe31.o msm_axi_qos.o
obj-$(CONFIG_S5K3E2FX) += s5k3e2fx.o
obj-$(CONFIG_S5K4E1GX) += s5k4e1gx.o s5k4e1gx_reg.o
+obj-$(CONFIG_S5K6AAFX) += s5k6aafx.o s5k6aafx_reg_mecha.o
obj-$(CONFIG_ARCH_MSM_ARM11) += msm_vfe7x.o msm_io7x.o
obj-$(CONFIG_ARCH_QSD8X50) += msm_vfe8x.o msm_vfe8x_proc.o msm_io8x.o
obj-$(CONFIG_VB6801) += vb6801.o
obj-$(CONFIG_OV8810) += ov8810.o
-obj-$(CONFIG_S5K3H1GX) += s5k3h1gx.o
+obj-$(CONFIG_S5K3H1GX) += s5k3h1gx.o s5k3h1gx_reg.o
obj-$(CONFIG_MT9V113) += mt9v113.o mt9v113_reg.o
obj-$(CONFIG_MSM_GEMINI) += msm_gemini_dev.o msm_gemini_sync.o msm_gemini_core.o msm_gemini_hw.o msm_gemini_platform.o
file:869abe5c99ebf4e5c1808a3c5b85e47eb4255a8b -> file:7d6f83d95e99a7acfa92526f8879817fb431cbda
--- a/drivers/media/video/msm/msm_vfe8x_proc.c
+++ b/drivers/media/video/msm/msm_vfe8x_proc.c
@@ -366,7 +366,8 @@ static void vfe_write_lens_roll_off_tabl
writel(data, ctrl->vfebase + VFE_DMI_DATA_LO);
data = (((uint32_t) (*initB)) & 0x0000FFFF) |
- (((uint32_t) (*initGr)) << 16);
+ /* 20101011: fix mesh LSC */
+ (((uint32_t) (*initGb)) << 16);
initB++;
initGb++;
@@ -379,13 +380,17 @@ static void vfe_write_lens_roll_off_tabl
/* pack and write delta table */
for (i = 0; i < VFE_ROLL_OFF_DELTA_TABLE_SIZE; i++) {
- data = *pDeltaR | (*pDeltaGr << 16);
+ /* 20101011: fix mesh LSC */
+ data = (((int32_t)(*pDeltaR)) & 0x0000FFFF) |
+ (((int32_t)(*pDeltaGr))<<16);
pDeltaR++;
pDeltaGr++;
writel(data, ctrl->vfebase + VFE_DMI_DATA_LO);
+ /* 20101011: fix mesh LSC */
+ data = (((int32_t)(*pDeltaB)) & 0x0000FFFF) |
+ (((int32_t)(*pDeltaGb))<<16);
- data = *pDeltaB | (*pDeltaGb << 16);
pDeltaB++;
pDeltaGb++;
@@ -1790,6 +1795,8 @@ static void vfe_process_output_path_irq(
}
}
+static int preview_skipframe;
+#define FRAME_SKIP 2
static void __vfe_do_tasklet(struct isr_queue_cmd *qcmd)
{
if (qcmd->vfeInterruptStatus.regUpdateIrq) {
@@ -1799,6 +1806,7 @@ static void __vfe_do_tasklet(struct isr_
if (qcmd->vfeInterruptStatus.resetAckIrq) {
CDBG("%s: process resetAckIrq\n", __func__);
+ preview_skipframe = 0;
vfe_process_reset_irq();
}
@@ -1817,7 +1825,11 @@ static void __vfe_do_tasklet(struct isr_
/* next, check output path related interrupts. */
if (qcmd->vfeInterruptStatus.anyOutputPathIrqs) {
CDBG("irq: anyOutputPathIrqs\n");
- vfe_process_output_path_irq(&qcmd->vfeInterruptStatus);
+ if(preview_skipframe > FRAME_SKIP ||
+ ctrl->vfeOperationMode == VFE_START_OPERATION_MODE_SNAPSHOT)
+ vfe_process_output_path_irq(&qcmd->vfeInterruptStatus);
+ else
+ preview_skipframe ++;
}
if (qcmd->vfeInterruptStatus.afPingpongIrq)
file:f5503d60a6c920e6f7ab9dd4df02808232de076b -> file:164be2e73edf8f79846ba2e5a7a1af0984ff6884
--- a/drivers/media/video/msm/ov8810.c
+++ b/drivers/media/video/msm/ov8810.c
@@ -1984,6 +1984,7 @@ static int ov8810_probe_read_id(const st
if (IS_ERR(vreg_af_actuator))
return PTR_ERR(vreg_af_actuator);
+ data->camera_set_source(MAIN_SOURCE);
pr_info(" ov8810_probe_init_sensor finishes\n");
return rc;
}
@@ -2038,15 +2039,8 @@ static int ov8810_sensor_open_init(struc
pr_info("doing clk switch (ov8810)\n");
if(data->camera_clk_switch != NULL)
data->camera_clk_switch();
-
- /* enable mclk first */
- msm_camio_clk_rate_set(OV8810_DEFAULT_CLOCK_RATE);
- msleep(20);
- msm_camio_camif_pad_reg_reset();
- msleep(20);
-
- /*PWD and RST config*/
+ /*PWD config*/
pr_info("%s, GPIO(%d) sensor_pwd 0\n", __func__, data->sensor_pwd);
rc = gpio_request(data->sensor_pwd, "ov8810");
if (!rc)
@@ -2054,15 +2048,20 @@ static int ov8810_sensor_open_init(struc
else
pr_err("GPIO (%d) request faile\n", data->sensor_pwd);
gpio_free(data->sensor_pwd);
- mdelay(5);
-
+ mdelay(3);
+
+ /* enable mclk first */
+ msm_camio_clk_rate_set(OV8810_DEFAULT_CLOCK_RATE);
+ msm_camio_camif_pad_reg_reset();
+ msleep(3);
+ /*Pull reset*/
rc = gpio_request(data->sensor_reset, "ov8810");
if (!rc)
gpio_direction_output(data->sensor_reset, 1);
else
pr_err("GPIO (%d) request faile\n", data->sensor_reset);
gpio_free(data->sensor_reset);
-
+ msleep(20);
/*read sensor id*/
rc = ov8810_probe_read_id(data);
@@ -2071,7 +2070,7 @@ static int ov8810_sensor_open_init(struc
pr_info("%s, initialize_ov8810_registers: %d\n", __func__, __LINE__);
if (rc < 0)
goto init_fail;
- #if 0 /*move to probe up sensor*/
+ #if 1 /*move to probe up sensor*/
/* Initialize Sensor registers */
rc = initialize_ov8810_registers();
if (rc < 0)
@@ -2198,6 +2197,9 @@ static int ov8810_probe_init_done(const
gpio_direction_output(data->sensor_pwd, 1);
gpio_free(data->sensor_pwd);
mdelay(1);
+ gpio_request(data->sensor_reset, "ov8810");
+ gpio_direction_output(data->sensor_reset, 0);
+ gpio_free(data->sensor_reset);
return 0;
}
@@ -2584,24 +2586,26 @@ static int ov8810_sensor_release(void)
int rc = -EBADF;
down(&ov8810_sem);
- msleep(35);
+ /*Pull hi PWD*/
gpio_request(ov8810_ctrl->sensordata->sensor_pwd, "ov8810");
gpio_direction_output(ov8810_ctrl->sensordata->sensor_pwd, 1);
gpio_free(ov8810_ctrl->sensordata->sensor_pwd);
+ /*Pull low RST*/
+ gpio_request(ov8810_ctrl->sensordata->sensor_reset, "ov8810");
+ gpio_direction_output(ov8810_ctrl->sensordata->sensor_reset, 0);
+ gpio_free(ov8810_ctrl->sensordata->sensor_reset);
pr_info("vreg_af_actuator vreg_disable\n");
vreg_disable(vreg_af_actuator);
-
msleep(20);
-
pr_info("%s, %d\n", __func__, __LINE__);
-
+ /*MCLK off*/
msm_camio_probe_off(ov8810_pdev);
if (ov8810_ctrl) {
kfree(ov8810_ctrl);
ov8810_ctrl = NULL;
}
-
+ mdelay(3);
allow_suspend();
pr_info("ov8810_release completed\n");
up(&ov8810_sem);
@@ -2658,6 +2662,8 @@ static int ov8810_sensor_probe(struct ms
if (rc < 0)
return rc;
+ if (info->camera_main_set_probe != NULL)
+ info->camera_main_set_probe(true);
init_suspend();
s->s_init = ov8810_sensor_open_init;
s->s_release = ov8810_sensor_release;
@@ -2682,29 +2688,17 @@ probe_done:
}
-static int ov8810_vreg_enable(struct platform_device *pdev)
-{
- struct msm_camera_sensor_info *sdata = pdev->dev.platform_data;
- int rc;
- pr_info("%s camera vreg on\n", __func__);
-
- if (sdata->camera_power_on == NULL) {
- pr_err("sensor platform_data didnt register\n");
- return -EIO;
- }
- rc = sdata->camera_power_on();
- return rc;
-}
-
static int __ov8810_probe(struct platform_device *pdev)
{
- int rc;
+ struct msm_camera_sensor_info *sdata = pdev->dev.platform_data;
printk("__ov8810_probe\n");
ov8810_pdev = pdev;
- rc = ov8810_vreg_enable(pdev);
- if (rc < 0)
- pr_err("__ov8810_probe fail sensor power on error\n");
-
+ if (sdata->camera_main_get_probe != NULL) {
+ if (sdata->camera_main_get_probe()) {
+ pr_info("__ov8810_probe camera main get probed already.\n");
+ return 0;
+ }
+ }
return msm_camera_drv_start(pdev, ov8810_sensor_probe);
}
file:962a9457dfa7acc75289f169da5d11a42980a218 -> file:65f449c4cd2d67b5877184449c2083899c8a098e
--- a/drivers/media/video/msm/ov9665.c
+++ b/drivers/media/video/msm/ov9665.c
@@ -54,6 +54,9 @@ DECLARE_MUTEX(ov9665_sem);
static int sensor_probe_node = 0;
+static enum wb_mode current_wb = CAMERA_AWB_AUTO;
+static int ov9665_set_wb(enum wb_mode wb_value);
+
#define MAX_I2C_RETRIES 20
static int i2c_transfer_retry(struct i2c_adapter *adap,
struct i2c_msg *msgs,
@@ -228,7 +231,14 @@ static int ov9665_pwd(const struct msm_c
else
pr_err("GPIO(%d) request faile",info->sensor_pwd);
gpio_free(info->sensor_pwd);
-
+ /*for 2nd camera 2nd source*/
+ /*main camera pwd pull down*/
+ rc = gpio_request(105, "ov9665");
+ if (!rc)
+ gpio_direction_output(105, 0);
+ else
+ pr_err("GPIO(105) request faile");
+ gpio_free(105);
return rc;
}
@@ -297,6 +307,7 @@ static int ov9665_set_sensor_mode(int mo
ov9665_i2c_write(ov9665_client->addr, 0x0d, 0x90, BYTE_LEN);
/*enable 3A*/
ov9665_i2c_write(ov9665_client->addr, 0x13, 0xe7, BYTE_LEN);
+ ov9665_set_wb(current_wb);
/*VGA 30fps*/
ov9665_i2c_write(ov9665_client->addr, 0x11, 0x80, BYTE_LEN);
//ov9665_i2c_write(ov9665_client->addr, 0x09, 0x01, BYTE_LEN);
@@ -563,6 +574,7 @@ static int ov9665_set_wb(enum wb_mode wb
default:
break;
}
+ current_wb = wb_value;
return 0;
}
@@ -789,14 +801,21 @@ int ov9665_sensor_open_init(struct msm_c
pr_info("GPIO(%d) request faile",data->sensor_pwd);
gpio_free(data->sensor_pwd);
mdelay(3);
-
/* Input MCLK = 24MHz */
msm_camio_clk_rate_set(24000000);
mdelay(5);
+ /* Config reset */
+ rc = gpio_request(data->sensor_reset, "ov9665");
+ if (!rc)
+ gpio_direction_output(data->sensor_reset, 1);
+ else
+ pr_info("GPIO(%d) request faile", data->sensor_reset);
+ gpio_free(data->sensor_reset);
+ mdelay(20);
msm_camio_camif_pad_reg_reset();
- rc = ov9665_i2c_write_table(&ov9665_regs.plltbl[0],
+ rc = ov9665_i2c_write_table(&ov9665_regs.plltbl[0],
ov9665_regs.plltbl_size);
/*read ID*/
@@ -815,10 +834,8 @@ init_done:
return rc;
init_fail:
- if (ov9665_ctrl) {
- kfree(ov9665_ctrl);
- ov9665_ctrl = NULL;
- }
+ /* remove free ov9665_ctrl to prevent kernel panic in sensor release */
+ pr_info("ov9665_sensor_open_init failed\n");
return rc;
}
@@ -894,6 +911,19 @@ int ov9665_sensor_release(void)
ov9665_ctrl->sensordata->sensor_pwd);
gpio_free(ov9665_ctrl->sensordata->sensor_pwd);
+ if (ov9665_ctrl->sensordata->camera_get_source() == SECOND_SOURCE) {
+ rc = gpio_request(
+ ov9665_ctrl->sensordata->sensor_reset, "ov9665");
+ if (!rc)
+ gpio_direction_output(
+ ov9665_ctrl->sensordata->sensor_reset, 0);
+ else
+ pr_info("GPIO(%d) request faile",
+ ov9665_ctrl->sensordata->sensor_reset);
+ gpio_free(ov9665_ctrl->sensordata->sensor_reset);
+ }
+
+
if (ov9665_ctrl) {
kfree(ov9665_ctrl);
ov9665_ctrl = NULL;
@@ -1058,9 +1088,9 @@ static int ov9665_sensor_probe(struct ms
pr_info("ov9665: ov9665_sensor_probe switch clk\n");
if(info->camera_clk_switch != NULL)
info->camera_clk_switch();
+
/* Config power down */
-
if(ov9665_pwd(info)<0)
goto probe_fail;
mdelay(3);
@@ -1086,7 +1116,9 @@ static int ov9665_sensor_probe(struct ms
rc = ov9665_reg_init();
if (rc < 0)
goto probe_fail;
-
+ if (info->camera_main_set_probe != NULL)
+ info->camera_main_set_probe(true);
+
s->s_init = ov9665_sensor_open_init;
s->s_release = ov9665_sensor_release;
s->s_config = ov9665_sensor_config;
@@ -1107,6 +1139,14 @@ probe_fail:
static int __ov9665_probe(struct platform_device *pdev)
{
+ struct msm_camera_sensor_info *sdata = pdev->dev.platform_data;
+
+ if (sdata->camera_main_get_probe != NULL) {
+ if (sdata->camera_main_get_probe()) {
+ pr_info("__s5k6aafx_probe camera main get probed already.\n");
+ return 0;
+ }
+ }
return msm_camera_drv_start(pdev, ov9665_sensor_probe);
}
file:e150f0da32c5d92a462eb6eb11f858d4671bb02a(new)
--- /dev/null
+++ b/drivers/media/video/msm/s5k3h1gx.c
@@ -0,0 +1,1755 @@
+/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Code Aurora Forum nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this software
+ * may be relicensed by the recipient under the terms of the GNU General Public
+ * License version 2 ("GPL") and only version 2, in which case the provisions of
+ * the GPL apply INSTEAD OF those given above. If the recipient relicenses the
+ * software under the GPL, then the identification text in the MODULE_LICENSE
+ * macro must be changed to reflect "GPLv2" instead of "Dual BSD/GPL". Once a
+ * recipient changes the license terms to the GPL, subsequent recipients shall
+ * not relicense under alternate licensing terms, including the BSD or dual
+ * BSD/GPL terms. In addition, the following license statement immediately
+ * below and between the words START and END shall also then apply when this
+ * software is relicensed under the GPL:
+ *
+ * START
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 and only version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * END
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <linux/delay.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <linux/uaccess.h>
+#include <linux/miscdevice.h>
+#include <linux/earlysuspend.h>
+#include <linux/wakelock.h>
+#include <media/msm_camera.h>
+#include <mach/gpio.h>
+#include <mach/camera.h>
+#include <mach/vreg.h>
+#include <asm/mach-types.h>
+#include "s5k3h1gx.h"
+
+/* CAMIF output resolutions */
+/* 816x612, 24MHz MCLK 96MHz PCLK */
+#define SENSOR_FULL_SIZE_WIDTH 3280
+#define SENSOR_FULL_SIZE_HEIGHT 2464
+
+#define SENSOR_QTR_SIZE_WIDTH 1640
+#define SENSOR_QTR_SIZE_HEIGHT 1232
+
+#define SENSOR_HRZ_FULL_BLK_PIXELS 190
+#define SENSOR_VER_FULL_BLK_LINES 16 /* 0 */
+#define SENSOR_HRZ_QTR_BLK_PIXELS 1830
+#define SENSOR_VER_QTR_BLK_LINES 16 /* 8 */
+#define SENSOR_VER_QTR_BLK_LINES_PARALLEL 611 /* 16 */ /* 8 */
+
+static int cam_mode_sel = 0; /* 0: photo, 1: video@30fps, 2: video@24fps */
+/* 611: 30fps, 1073: 24fps */
+const int s5k3h1gx_ver_qtr_blk_lines_array[] = {611,611,1073};
+
+#define S5K3H1GX_AF_I2C_ADDR 0x18
+#define S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR 42 /* 36 */
+#define S5K3H1GX_SW_DAMPING_STEP 10
+#define S5K3H1GX_MAX_FPS 30
+#define S5K3H1GX_MAX_FPS_PARALLEL 30 /* 22 */
+
+/*=============================================================
+ SENSOR REGISTER DEFINES
+==============================================================*/
+
+#define S5K3H1GX_REG_MODEL_ID 0x0000
+#define S5K3H1GX_MODEL_ID 0x3810
+
+/* Color bar pattern selection */
+#define S5K3H1GX_COLOR_BAR_PATTERN_SEL_REG 0x0601
+
+#define REG_FRAME_LENGTH_LINES_MSB 0x0340
+#define REG_FRAME_LENGTH_LINES_LSB 0x0341
+#define REG_LINE_LENGTH_PCK_MSB 0x0342
+#define REG_LINE_LENGTH_PCK_LSB 0x0343
+#define REG_ANALOGUE_GAIN_CODE_GLOBAL_MSB 0x0204
+#define REG_ANALOGUE_GAIN_CODE_GLOBAL_LSB 0x0205
+#define REG_COARSE_INTEGRATION_TIME_MSB 0x0202
+#define REG_COARSE_INTEGRATION_TIME_LSB 0x0203
+
+#define S5K3H1GX_REG_GROUP_PARAMETER_HOLD 0x0104
+#define S5K3H1GX_GROUP_PARAMETER_HOLD 0x01
+#define S5K3H1GX_GROUP_PARAMETER_UNHOLD 0x00
+
+////////////////////////////
+
+#define Q8 0x00000100
+#define SENSOR_DEFAULT_CLOCK_RATE 24000000
+
+////////////////////////////////////////////////////////////
+
+/*============================================================================
+ TYPE DECLARATIONS
+============================================================================*/
+
+/* 16bit address - 8 bit context register structure */
+#if 0
+typedef struct reg_addr_val_pair_struct {
+ uint16_t reg_addr;
+ uint8_t reg_val;
+} reg_struct_type;
+#endif
+
+struct awb_lsc_struct_type {
+ unsigned int caBuff[8]; /*awb_calibartion*/
+ struct reg_addr_val_pair_struct LSC_table[150]; /*lsc_calibration*/
+ uint32_t LSC_table_CRC;
+};
+
+enum s5k3h1gx_test_mode_t {
+ TEST_OFF,
+ TEST_1,
+ TEST_2,
+ TEST_3
+};
+
+enum s5k3h1gx_resolution_t {
+ QTR_SIZE,
+ FULL_SIZE,
+ INVALID_SIZE
+};
+
+enum s5k3h1gx_reg_update_t{
+ REG_INIT,
+ REG_PERIODIC
+};
+
+/*20101011 QCT mesh LSC calibration*/
+static int global_mode = 0;
+
+static int sensor_probe_node;
+static int preview_frame_count;
+
+static struct wake_lock s5k3h1gx_wake_lock;
+
+static inline void init_suspend(void)
+{
+ wake_lock_init(&s5k3h1gx_wake_lock, WAKE_LOCK_IDLE, "s5k3h1gx");
+}
+
+static inline void deinit_suspend(void)
+{
+ wake_lock_destroy(&s5k3h1gx_wake_lock);
+}
+
+static inline void prevent_suspend(void)
+{
+ wake_lock(&s5k3h1gx_wake_lock);
+}
+
+static inline void allow_suspend(void)
+{
+ wake_unlock(&s5k3h1gx_wake_lock);
+}
+
+/*============================================================================
+DATA DECLARATIONS
+============================================================================*/
+
+/* 96MHz PCLK @ 24MHz MCLK inc*/
+
+
+/* FIXME: Changes from here */
+struct s5k3h1gx_work {
+ struct work_struct work;
+};
+
+static struct s5k3h1gx_work *s5k3h1gx_sensorw;
+static struct i2c_client *s5k3h1gx_client;
+static uint16_t s5k3h1gx_pos_tbl[S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR + 1];
+
+struct s5k3h1gx_ctrl {
+ const struct msm_camera_sensor_info *sensordata;
+
+ uint32_t sensormode;
+ uint32_t fps_divider; /* init to 1 * 0x00000400 */
+ uint32_t pict_fps_divider; /* init to 1 * 0x00000400 */
+ uint16_t fps;
+
+ int16_t curr_lens_pos;
+ uint16_t curr_step_pos;
+ uint16_t init_curr_lens_pos;
+ uint16_t my_reg_gain;
+ uint32_t my_reg_line_count;
+ uint16_t total_lines_per_frame;
+
+ enum s5k3h1gx_resolution_t prev_res;
+ enum s5k3h1gx_resolution_t pict_res;
+ enum s5k3h1gx_resolution_t curr_res;
+ enum s5k3h1gx_test_mode_t set_test;
+ enum s5k3h1gx_reg_update_t reg_update;
+
+ unsigned short imgaddr;
+};
+
+static struct s5k3h1gx_ctrl *s5k3h1gx_ctrl;
+static struct platform_device *s5k3h1gx_pdev;
+
+struct s5k3h1gx_waitevent{
+ uint32_t waked_up;
+ wait_queue_head_t event_wait;
+};
+
+static DECLARE_WAIT_QUEUE_HEAD(s5k3h1gx_wait_queue);
+DECLARE_MUTEX(s5k3h1gx_sem);
+
+
+/*=============================================================*/
+
+static int s5k3h1gx_i2c_rxdata(unsigned short saddr,
+ unsigned char *rxdata, int length)
+{
+ struct i2c_msg msgs[] = {
+ {
+ .addr = saddr,
+ .flags = 0,
+ .len = 2,
+ .buf = rxdata,
+ },
+ {
+ .addr = saddr,
+ .flags = I2C_M_RD,
+ .len = length,
+ .buf = rxdata,
+ },
+ };
+
+ if (i2c_transfer(s5k3h1gx_client->adapter, msgs, 2) < 0) {
+ pr_err("s5k3h1gx_i2c_rxdata failed!\n");
+ return -EIO;
+ }
+ pr_info("%s: rxdata=0x%X\n", __func__, *rxdata);
+
+ return 0;
+}
+static int32_t s5k3h1gx_i2c_txdata(unsigned short saddr,
+ unsigned char *txdata, int length)
+{
+ struct i2c_msg msg[] = {
+ {
+ .addr = saddr,
+ .flags = 0,
+ .len = length,
+ .buf = txdata,
+ },
+ };
+ if (i2c_transfer(s5k3h1gx_client->adapter, msg, 1) < 0) {
+ pr_err("s5k3h1gx_i2c_txdata failed 0x%x\n", saddr);
+ return -EIO;
+ }
+
+ return 0;
+}
+
+static int32_t s5k3h1gx_i2c_read_b(unsigned short saddr, unsigned short raddr,
+ unsigned short *rdata)
+{
+ int32_t rc = 0;
+ unsigned char buf[4];
+
+ if (!rdata)
+ return -EIO;
+
+ memset(buf, 0, sizeof(buf));
+
+ buf[0] = (raddr & 0xFF00)>>8;
+ buf[1] = (raddr & 0x00FF);
+
+ rc = s5k3h1gx_i2c_rxdata(saddr, buf, 1);
+ if (rc < 0)
+ return rc;
+
+ *rdata = buf[0];
+
+ if (rc < 0)
+ pr_info("s5k3h1gx_i2c_read failed!\n");
+
+ return rc;
+}
+
+
+static int32_t s5k3h1gx_i2c_read(unsigned short raddr,
+ unsigned short *rdata, int rlen)
+{
+ int32_t rc = 0;
+ unsigned char buf[2];
+ int count = 0;
+ if (!rdata)
+ return -EIO;
+
+ memset(buf, 0, sizeof(buf));
+
+ buf[0] = (raddr & 0xFF00) >> 8;
+ buf[1] = (raddr & 0x00FF);
+retry:
+ rc = s5k3h1gx_i2c_rxdata(s5k3h1gx_client->addr, buf, rlen);
+
+ if (rc < 0) {
+ pr_err("s5k3h1gx_i2c_read 0x%x failed!\n", raddr);
+ printk(KERN_ERR "starting read retry policy count:%d\n", count);
+ udelay(10);
+ count++;
+ if (count < 20) {
+ if (count > 10)
+ udelay(100);
+ } else
+ return rc;
+ goto retry;
+ }
+
+ *rdata = (rlen == 2 ? buf[0] << 8 | buf[1] : buf[0]);
+ return rc;
+}
+
+
+static int32_t s5k3h1gx_i2c_write_b(unsigned short saddr,
+ unsigned short waddr, uint8_t bdata)
+{
+ int32_t rc = -EFAULT;
+ unsigned char buf[3];
+ int count = 0;
+
+ memset(buf, 0, sizeof(buf));
+ buf[0] = (waddr & 0xFF00) >> 8;
+ buf[1] = (waddr & 0x00FF);
+ buf[2] = bdata;
+
+retry:
+ rc = s5k3h1gx_i2c_txdata(saddr, buf, 3);
+
+ if (rc < 0) {
+ pr_err("i2c_write_b failed, addr = 0x%x, val = 0x%x\n",
+ waddr, bdata);
+ pr_err(KERN_ERR "starting read retry policy count:%d\n", count);
+ udelay(10);
+ count++;
+ if (count < 20) {
+ if (count > 10)
+ udelay(100);
+ } else
+ return rc;
+ goto retry;
+ }
+
+ return rc;
+}
+
+static void s5k3h1gx_get_pict_fps(uint16_t fps, uint16_t *pfps)
+{
+ /* input fps is preview fps in Q8 format */
+ uint32_t divider, d1, d2;
+ uint16_t snapshot_height, preview_height, preview_width, snapshot_width;
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ if (s5k3h1gx_ctrl->prev_res == QTR_SIZE) {
+ preview_width =
+ SENSOR_QTR_SIZE_WIDTH + SENSOR_HRZ_QTR_BLK_PIXELS;
+
+ if (sinfo->csi_if)
+ preview_height =
+ SENSOR_QTR_SIZE_HEIGHT +
+ SENSOR_VER_QTR_BLK_LINES;
+ else
+ preview_height =
+ SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel] ;
+ } else {
+ /* full size resolution used for preview. */
+ preview_width =
+ SENSOR_FULL_SIZE_WIDTH + SENSOR_HRZ_FULL_BLK_PIXELS;
+ preview_height =
+ SENSOR_FULL_SIZE_HEIGHT + SENSOR_VER_FULL_BLK_LINES;
+ }
+
+ if (s5k3h1gx_ctrl->pict_res == QTR_SIZE) {
+ snapshot_width =
+ SENSOR_QTR_SIZE_WIDTH + SENSOR_HRZ_QTR_BLK_PIXELS;
+
+ if (sinfo->csi_if)
+ snapshot_height =
+ SENSOR_QTR_SIZE_HEIGHT +
+ SENSOR_VER_QTR_BLK_LINES;
+ else
+ snapshot_height =
+ SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel] ;
+ } else {
+ snapshot_width =
+ SENSOR_FULL_SIZE_WIDTH +
+ SENSOR_HRZ_FULL_BLK_PIXELS;
+ snapshot_height =
+ SENSOR_FULL_SIZE_HEIGHT +
+ SENSOR_VER_FULL_BLK_LINES;
+ }
+
+ d1 = preview_height * 0x00000400 / snapshot_height;
+ d2 = preview_width * 0x00000400 / snapshot_width;
+
+ divider = (uint32_t) (d1 * d2) / 0x00000400;
+ *pfps = (uint16_t)(fps * divider / 0x00000400);
+
+} /* endof s5k3h1gx_get_pict_fps */
+
+static uint16_t s5k3h1gx_get_prev_lines_pf(void)
+{
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ if (s5k3h1gx_ctrl->prev_res == QTR_SIZE) {
+ if (sinfo->csi_if)
+ return (SENSOR_QTR_SIZE_HEIGHT +
+ SENSOR_VER_QTR_BLK_LINES);
+ else
+ return (SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel]);
+ } else {
+ return (SENSOR_FULL_SIZE_HEIGHT +
+ SENSOR_VER_FULL_BLK_LINES);
+ }
+}
+
+static uint16_t s5k3h1gx_get_prev_pixels_pl(void)
+{
+ if (s5k3h1gx_ctrl->prev_res == QTR_SIZE) {
+ return (SENSOR_QTR_SIZE_WIDTH +
+ SENSOR_HRZ_QTR_BLK_PIXELS);
+ } else {
+ return (SENSOR_FULL_SIZE_WIDTH +
+ SENSOR_HRZ_FULL_BLK_PIXELS);
+}
+}
+
+static uint16_t s5k3h1gx_get_pict_lines_pf(void)
+{
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ if (s5k3h1gx_ctrl->pict_res == QTR_SIZE) {
+ if (sinfo->csi_if)
+ return (SENSOR_QTR_SIZE_HEIGHT +
+ SENSOR_VER_QTR_BLK_LINES);
+ else
+ return (SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel]);
+ } else {
+ return (SENSOR_FULL_SIZE_HEIGHT +
+ SENSOR_VER_FULL_BLK_LINES);
+ }
+}
+
+static uint16_t s5k3h1gx_get_pict_pixels_pl(void)
+{
+ if (s5k3h1gx_ctrl->pict_res == QTR_SIZE) {
+ return (SENSOR_QTR_SIZE_WIDTH +
+ SENSOR_HRZ_QTR_BLK_PIXELS);
+ } else {
+ return (SENSOR_FULL_SIZE_WIDTH +
+ SENSOR_HRZ_FULL_BLK_PIXELS);
+ }
+}
+
+static uint32_t s5k3h1gx_get_pict_max_exp_lc(void)
+{
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ if (s5k3h1gx_ctrl->pict_res == QTR_SIZE) {
+ if (sinfo->csi_if)
+ return (SENSOR_QTR_SIZE_HEIGHT +
+ SENSOR_VER_QTR_BLK_LINES);
+ else
+ return (SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel]);
+ } else {
+ return (SENSOR_FULL_SIZE_HEIGHT +
+ SENSOR_VER_FULL_BLK_LINES);
+ }
+}
+
+static int32_t s5k3h1gx_set_fps(struct fps_cfg *fps)
+{
+ int32_t rc = 0;
+ s5k3h1gx_ctrl->fps_divider = fps->fps_div;
+ s5k3h1gx_ctrl->pict_fps_divider = fps->pict_fps_div;
+ s5k3h1gx_ctrl->fps = fps->f_mult;
+ return rc;
+}
+
+static int32_t s5k3h1gx_i2c_write_table(
+ struct s5k3h1gx_i2c_reg_conf *reg_cfg_tbl, int num)
+{
+ int i;
+ int32_t rc = -EIO;
+ for (i = 0; i < num; i++) {
+ rc = s5k3h1gx_i2c_write_b(s5k3h1gx_client->addr,
+ reg_cfg_tbl->waddr, reg_cfg_tbl->bdata);
+ if (rc < 0)
+ break;
+ reg_cfg_tbl++;
+ }
+
+ return rc;
+}
+
+static int32_t s5k3h1gx_write_exp_gain
+ (uint16_t gain, uint32_t line)
+{
+ int32_t rc = 0;
+
+ uint16_t max_legal_gain = 0x0200;
+ uint32_t ll_ratio; /* Q10 */
+ uint32_t ll_pck, fl_lines;
+ uint16_t offset = 8; /* 4; */ /* kipper */
+ uint32_t gain_msb, gain_lsb;
+ uint32_t intg_t_msb, intg_t_lsb;
+ uint32_t ll_pck_msb, ll_pck_lsb;
+ struct s5k3h1gx_i2c_reg_conf tbl[3];
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ CDBG("Line:%d s5k3h1gx_write_exp_gain , gain=%d, line=%d\n",
+ __LINE__, gain, line);
+
+ if (s5k3h1gx_ctrl->sensormode == SENSOR_PREVIEW_MODE) {
+
+ s5k3h1gx_ctrl->my_reg_gain = gain;
+ s5k3h1gx_ctrl->my_reg_line_count = (uint16_t)line;
+
+ if (sinfo->csi_if)
+ fl_lines = SENSOR_QTR_SIZE_HEIGHT +
+ SENSOR_VER_QTR_BLK_LINES;
+ else
+ fl_lines = SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel] ;
+
+ ll_pck = SENSOR_QTR_SIZE_WIDTH +
+ SENSOR_HRZ_QTR_BLK_PIXELS;
+
+ } else {
+
+ fl_lines = SENSOR_FULL_SIZE_HEIGHT +
+ SENSOR_VER_FULL_BLK_LINES;
+
+ ll_pck = SENSOR_FULL_SIZE_WIDTH +
+ SENSOR_HRZ_FULL_BLK_PIXELS;
+ }
+
+ if (gain > max_legal_gain)
+ gain = max_legal_gain;
+
+ /* in Q10 */
+ line = (line * s5k3h1gx_ctrl->fps_divider);
+
+ CDBG("s5k3h1gx_ctrl->fps_divider = %d\n",
+ s5k3h1gx_ctrl->fps_divider);
+ CDBG("fl_lines = %d\n", fl_lines);
+ CDBG("line = %d\n", line);
+ if ((fl_lines-offset) < (line / 0x400))
+ ll_ratio = (line / (fl_lines - offset));
+ else
+ ll_ratio = 0x400;
+ CDBG("ll_ratio = %d\n", ll_ratio);
+
+ /* update gain registers */
+ CDBG("gain = %d\n", gain);
+ gain_msb = (gain & 0xFF00) >> 8;
+ gain_lsb = gain & 0x00FF;
+ tbl[0].waddr = S5K3H1GX_REG_GROUP_PARAMETER_HOLD;
+ tbl[0].bdata = S5K3H1GX_GROUP_PARAMETER_HOLD;
+ tbl[1].waddr = REG_ANALOGUE_GAIN_CODE_GLOBAL_MSB;
+ tbl[1].bdata = gain_msb;
+ tbl[2].waddr = REG_ANALOGUE_GAIN_CODE_GLOBAL_LSB;
+ tbl[2].bdata = gain_lsb;
+ rc = s5k3h1gx_i2c_write_table(&tbl[0], ARRAY_SIZE(tbl));
+ if (rc < 0)
+ goto write_gain_done;
+
+ ll_pck = ll_pck * ll_ratio;
+ CDBG("ll_pck/0x400 = %d\n", ll_pck / 0x400);
+ ll_pck_msb = ((ll_pck / 0x400) & 0xFF00) >> 8;
+ ll_pck_lsb = (ll_pck / 0x400) & 0x00FF;
+ tbl[0].waddr = REG_LINE_LENGTH_PCK_MSB;
+ tbl[0].bdata = ll_pck_msb;
+ tbl[1].waddr = REG_LINE_LENGTH_PCK_LSB;
+ tbl[1].bdata = ll_pck_lsb;
+ rc = s5k3h1gx_i2c_write_table(&tbl[0], ARRAY_SIZE(tbl)-1);
+ if (rc < 0)
+ goto write_gain_done;
+
+ line = line / ll_ratio;
+ CDBG("line = %d\n", line);
+ intg_t_msb = (line & 0xFF00) >> 8;
+ intg_t_lsb = (line & 0x00FF);
+ tbl[0].waddr = REG_COARSE_INTEGRATION_TIME_MSB;
+ tbl[0].bdata = intg_t_msb;
+ tbl[1].waddr = REG_COARSE_INTEGRATION_TIME_LSB;
+ tbl[1].bdata = intg_t_lsb;
+ tbl[2].waddr = S5K3H1GX_REG_GROUP_PARAMETER_HOLD;
+ tbl[2].bdata = S5K3H1GX_GROUP_PARAMETER_UNHOLD;
+ rc = s5k3h1gx_i2c_write_table(&tbl[0], ARRAY_SIZE(tbl));
+
+write_gain_done:
+ return rc;
+}
+
+/* ### this function is not called for userspace ### */
+static int32_t s5k3h1gx_set_pict_exp_gain(uint16_t gain, uint32_t line)
+{
+ int32_t rc = 0;
+ rc = s5k3h1gx_write_exp_gain(gain, line);
+
+ return rc;
+} /* endof s5k3h1gx_set_pict_exp_gain*/
+
+static int32_t initialize_s5k3h1gx_registers(void)
+{
+ int32_t rc = 0;
+ struct msm_camera_sensor_info *sinfo =
+ s5k3h1gx_pdev->dev.platform_data;
+
+ mdelay(5);
+
+ if (sinfo->csi_if) {
+ if (s5k3h1gx_regs.init_mipi_size > 0)
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.init_mipi,
+ s5k3h1gx_regs.init_mipi_size);
+ } else {
+ if (s5k3h1gx_regs.init_parallel_size > 0)
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.init_parallel,
+ s5k3h1gx_regs.init_parallel_size);
+ }
+
+ return rc;
+} /* end of initialize_s5k3h1gx_ov8m0vc_registers. */
+
+static int32_t s5k3h1gx_setting(int rt)
+{
+ int32_t rc = 0;
+ /* reconfigure the qtr height to adjust frame rate */
+ uint16_t fl_line = 0;
+ struct msm_camera_sensor_info *sinfo =
+ s5k3h1gx_pdev->dev.platform_data;
+
+ switch (rt) {
+ case QTR_SIZE:
+ pr_err("s5k3h1gx_setting(QTR_SIZE)\n");
+ rc = s5k3h1gx_i2c_write_b(
+ s5k3h1gx_client->addr, 0x0100, 0x00);
+
+ if (sinfo->csi_if) {
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.qtr_mipi,
+ s5k3h1gx_regs.qtr_mipi_size);
+ } else {
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.qtr_parallel,
+ s5k3h1gx_regs.qtr_parallel_size);
+ if (rc < 0)
+ return rc;
+ fl_line = SENSOR_QTR_SIZE_HEIGHT +
+ s5k3h1gx_ver_qtr_blk_lines_array[cam_mode_sel];
+ rc = s5k3h1gx_i2c_write_b(s5k3h1gx_client->addr,
+ REG_FRAME_LENGTH_LINES_MSB,
+ (fl_line & 0xFF00) >> 8);
+ if (rc < 0)
+ return rc;
+ rc = s5k3h1gx_i2c_write_b(s5k3h1gx_client->addr,
+ REG_FRAME_LENGTH_LINES_LSB,
+ fl_line & 0x00FF);
+ if (rc < 0)
+ return rc;
+ }
+ msleep(200);
+ rc = s5k3h1gx_i2c_write_b(
+ s5k3h1gx_client->addr, 0x0100, 0x01);
+ if (rc < 0)
+ return rc;
+
+ s5k3h1gx_ctrl->curr_res = QTR_SIZE;
+ break;
+
+ case FULL_SIZE:
+ pr_err("s5k3h1gx_setting(FULL_SIZE)\n");
+ rc = s5k3h1gx_i2c_write_b(
+ s5k3h1gx_client->addr, 0x0100, 0x00);
+
+ if (sinfo->csi_if) {
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.full_mipi,
+ s5k3h1gx_regs.full_mipi_size);
+ } else {
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.full_parallel,
+ s5k3h1gx_regs.full_parallel_size);
+ }
+ if (rc < 0)
+ return rc;
+
+ msleep(100);
+ rc = s5k3h1gx_i2c_write_b(
+ s5k3h1gx_client->addr, 0x0100, 0x01);
+
+ if (rc < 0)
+ return rc;
+
+ s5k3h1gx_ctrl->curr_res = FULL_SIZE;
+ break;
+
+ default:
+ rc = -EFAULT;
+ return rc;
+ }
+
+ /* sync OV8810 method to set gain and line */
+#if 1
+ /*take raw picture for LSC calibration*/
+ if (global_mode) {
+ pr_info("[LSC calibration] set gain and line !!!!\n");
+ s5k3h1gx_write_exp_gain(32, 300);
+ global_mode = 0;
+ }
+#endif
+
+ return rc;
+} /* end of s5k3h1gx_setting */
+
+static int32_t s5k3h1gx_video_config(int mode)
+{
+ int32_t rc = 0;
+ static int pre_sel = 0;
+ int cur_sel = (cam_mode_sel > 1)?1:0;
+ s5k3h1gx_ctrl->sensormode = mode;
+
+ CDBG("cam_mode_sel %d cur_sel = %d, pre_sel = %d\n",
+ cam_mode_sel, cur_sel, pre_sel);
+
+ if (s5k3h1gx_ctrl->curr_res != s5k3h1gx_ctrl->prev_res
+ || pre_sel != cur_sel
+ ) {
+ rc = s5k3h1gx_setting(s5k3h1gx_ctrl->prev_res);
+ if (rc < 0)
+ return rc;
+ } else {
+ s5k3h1gx_ctrl->curr_res = s5k3h1gx_ctrl->prev_res;
+ }
+ s5k3h1gx_ctrl->sensormode = mode;
+
+ pre_sel = cur_sel;
+
+ preview_frame_count = 0;
+ rc =
+ s5k3h1gx_write_exp_gain(s5k3h1gx_ctrl->my_reg_gain,
+ s5k3h1gx_ctrl->my_reg_line_count);
+
+ return rc;
+
+} /* end of s5k3h1gx_video_config */
+
+static int32_t s5k3h1gx_snapshot_config(int mode)
+{
+ int32_t rc = 0;
+ s5k3h1gx_ctrl->sensormode = mode;
+
+ if (s5k3h1gx_ctrl->curr_res != s5k3h1gx_ctrl->pict_res) {
+ rc = s5k3h1gx_setting(s5k3h1gx_ctrl->pict_res);
+ if (rc < 0)
+ return rc;
+ } else {
+ s5k3h1gx_ctrl->curr_res = s5k3h1gx_ctrl->pict_res;
+ }
+ s5k3h1gx_ctrl->sensormode = mode;
+
+ return rc;
+
+} /*end of s5k3h1gx_snapshot_config*/
+
+static int32_t s5k3h1gx_raw_snapshot_config(int mode)
+{
+ int32_t rc = 0;
+ s5k3h1gx_ctrl->sensormode = mode;
+ if (s5k3h1gx_ctrl->curr_res != s5k3h1gx_ctrl->pict_res) {
+ rc = s5k3h1gx_setting(s5k3h1gx_ctrl->pict_res);
+ if (rc < 0)
+ return rc;
+ } else {
+ s5k3h1gx_ctrl->curr_res = s5k3h1gx_ctrl->pict_res;
+ } /* Update sensor resolution */
+
+ s5k3h1gx_ctrl->sensormode = mode;
+
+ return rc;
+
+} /*end of s5k3h1gx_raw_snapshot_config*/
+
+static int32_t s5k3h1gx_set_sensor_mode(int mode,
+ int res)
+{
+ int32_t rc = 0;
+
+ switch (mode) {
+ case SENSOR_PREVIEW_MODE:
+ rc = s5k3h1gx_video_config(mode);
+ break;
+
+ case SENSOR_SNAPSHOT_MODE:
+ rc = s5k3h1gx_snapshot_config(mode);
+ break;
+
+ case SENSOR_RAW_SNAPSHOT_MODE:
+ rc = s5k3h1gx_raw_snapshot_config(mode);
+ break;
+
+ default:
+ rc = -EINVAL;
+ break;
+ }
+
+ return rc;
+}
+
+static int s5k3h1gx_probe_init_done(const struct msm_camera_sensor_info *data)
+{
+ int32_t rc = 0;
+
+ pr_info("[Camera] gpio_request(%d, \"s5k3h1gx\")\n", data->sensor_pwd);
+ rc = gpio_request(data->sensor_pwd, "s5k3h1gx");
+ if (!rc)
+ gpio_direction_output(data->sensor_pwd, 0);
+ else
+ pr_err("GPIO (%d) request failed\n", data->sensor_pwd);
+
+ gpio_free(data->sensor_pwd);
+
+ if (data->sensor_reset) {
+ msleep(5);
+ rc = gpio_request(data->sensor_reset, "s5k3h1gx");
+ if (!rc)
+ gpio_direction_output(data->sensor_reset, 0);
+ else
+ pr_err("GPIO (%d) request faile\n", data->sensor_reset);
+ gpio_free(data->sensor_reset);
+ }
+
+
+ return 0;
+}
+
+static int32_t s5k3h1gx_power_down(void)
+{
+ return 0;
+}
+
+static int s5k3h1gx_probe_init_sensor(const struct msm_camera_sensor_info *data)
+{
+ int32_t rc = 0;
+ uint16_t chipid = 0;
+
+ pr_info("%s\n", __func__);
+
+ /* Read sensor Model ID: */
+ rc = s5k3h1gx_i2c_read(S5K3H1GX_REG_MODEL_ID, &chipid, 2);
+ if (rc < 0) {
+ pr_err("read sensor id fail\n");
+ goto init_probe_fail;
+ } else
+ data->camera_set_source(SECOND_SOURCE);
+
+ /* Compare sensor ID to S5K3H1GX ID: */
+ pr_info("%s, Expected id=0x%x\n", __func__, S5K3H1GX_MODEL_ID);
+ pr_info("%s, Read id=0x%x\n", __func__, chipid);
+
+ if (chipid != S5K3H1GX_MODEL_ID) {
+ pr_err("sensor model id is incorrect\n");
+ rc = -ENODEV;
+ goto init_probe_fail;
+ }
+
+ pr_info("s5k3h1gx_probe_init_sensor finishes\n");
+ goto init_probe_done;
+
+init_probe_fail:
+ s5k3h1gx_probe_init_done(data);
+init_probe_done:
+ return rc;
+}
+
+static void s5k3h1gx_setup_af_tbl(void)
+{
+ int i;
+ uint16_t s5k3h1gx_nl_region_boundary1 = 3;
+ uint16_t s5k3h1gx_nl_region_boundary2 = 5;
+ uint16_t s5k3h1gx_nl_region_code_per_step1 = 40;
+ uint16_t s5k3h1gx_nl_region_code_per_step2 = 20;
+ uint16_t s5k3h1gx_l_region_code_per_step = 16;
+
+ s5k3h1gx_pos_tbl[0] = 0;
+
+ for (i = 1; i <= S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR; i++) {
+ if (i <= s5k3h1gx_nl_region_boundary1)
+ s5k3h1gx_pos_tbl[i] = s5k3h1gx_pos_tbl[i-1] +
+ s5k3h1gx_nl_region_code_per_step1;
+ else if (i <= s5k3h1gx_nl_region_boundary2)
+ s5k3h1gx_pos_tbl[i] = s5k3h1gx_pos_tbl[i-1] +
+ s5k3h1gx_nl_region_code_per_step2;
+ else
+ s5k3h1gx_pos_tbl[i] = s5k3h1gx_pos_tbl[i-1] +
+ s5k3h1gx_l_region_code_per_step;
+ }
+}
+
+static int32_t
+s5k3h1gx_go_to_position(uint32_t lens_pos, uint8_t mask)
+{
+ int32_t rc = 0;
+ unsigned char buf[2];
+ uint8_t code_val_msb, code_val_lsb;
+
+ code_val_msb = lens_pos >> 4;
+ code_val_lsb = (lens_pos & 0x000F) << 4;
+ code_val_lsb |= mask;
+
+ buf[0] = code_val_msb;
+ buf[1] = code_val_lsb;
+ rc = s5k3h1gx_i2c_txdata(S5K3H1GX_AF_I2C_ADDR >> 1, buf, 2);
+ if (rc < 0)
+ pr_err("i2c_write failed, saddr = 0x%x addr = 0x%x, val =0x%x!\n",
+ S5K3H1GX_AF_I2C_ADDR >> 1, buf[0], buf[1]);
+
+ return rc;
+}
+
+/*20101011 for LSC calibration*/
+static int s5k3h1gx_QCT_LSC_calibration_set_rawflag(void)
+{
+ global_mode = 1;
+ return 1;
+}
+
+static int s5k3h1gx_i2c_read_fuseid(struct sensor_cfg_data *cdata)
+{
+
+ int32_t rc;
+ unsigned short i, R1, R2, R3;
+ unsigned short OTP[10];
+
+ pr_info("%s: sensor OTP information:\n", __func__);
+
+ for (i = 0; i < 10; i++)
+ OTP[i] = 5;
+
+ rc = s5k3h1gx_i2c_write_b(s5k3h1gx_client->addr, 0x3124, 0x10);
+ if (rc < 0)
+ pr_info("%s: i2c_write_b 0x30FB fail\n", __func__);
+
+ rc = s5k3h1gx_i2c_write_b(s5k3h1gx_client->addr, 0x3127, 0xF1);
+ if (rc < 0)
+ pr_info("%s: i2c_write_b 0x30FB fail\n", __func__);
+
+ mdelay(4);
+
+ for (i = 0; i < 10; i++) {
+ rc = s5k3h1gx_i2c_write_b(s5k3h1gx_client->addr, 0x312B, i);
+ if (rc < 0)
+ pr_info("%s: i2c_write_b 0x310C fail\n", __func__);
+ rc = s5k3h1gx_i2c_read_b(s5k3h1gx_client->addr, 0x312C, &R1);
+ if (rc < 0)
+ pr_info("%s: i2c_read_b 0x310F fail\n", __func__);
+ rc = s5k3h1gx_i2c_read_b(s5k3h1gx_client->addr, 0x312D, &R2);
+ if (rc < 0)
+ pr_info("%s: i2c_read_b 0x310E fail\n", __func__);
+ rc = s5k3h1gx_i2c_read_b(s5k3h1gx_client->addr, 0x312E, &R3);
+ if (rc < 0)
+ pr_info("%s: i2c_read_b 0x310D fail\n", __func__);
+
+ if ((R3&0x0F) != 0)
+ OTP[i] = (short)(R3&0x0F);
+ else if ((R2&0x0F) != 0)
+ OTP[i] = (short)(R2&0x0F);
+ else if ((R2>>4) != 0)
+ OTP[i] = (short)(R2>>4);
+ else if ((R1&0x0F) != 0)
+ OTP[i] = (short)(R1&0x0F);
+ else
+ OTP[i] = (short)(R1>>4);
+
+ }
+ pr_info("%s: VenderID=%x,LensID=%x,SensorID=%x%x\n", __func__,
+ OTP[0], OTP[1], OTP[2], OTP[3]);
+ pr_info("%s: ModuleFuseID= %x%x%x%x%x%x\n", __func__,
+ OTP[4], OTP[5], OTP[6], OTP[7], OTP[8], OTP[9]);
+
+ cdata->cfg.fuse.fuse_id_word1 = 0;
+ cdata->cfg.fuse.fuse_id_word2 = 0;
+ cdata->cfg.fuse.fuse_id_word3 = (OTP[0]);
+ cdata->cfg.fuse.fuse_id_word4 =
+ (OTP[4]<<20) |
+ (OTP[5]<<16) |
+ (OTP[6]<<12) |
+ (OTP[7]<<8) |
+ (OTP[8]<<4) |
+ (OTP[9]);
+
+ pr_info("s5k3h1gx: fuse->fuse_id_word1:%d\n",
+ cdata->cfg.fuse.fuse_id_word1);
+ pr_info("s5k3h1gx: fuse->fuse_id_word2:%d\n",
+ cdata->cfg.fuse.fuse_id_word2);
+ pr_info("s5k3h1gx: fuse->fuse_id_word3:0x%08x\n",
+ cdata->cfg.fuse.fuse_id_word3);
+ pr_info("s5k3h1gx: fuse->fuse_id_word4:0x%08x\n",
+ cdata->cfg.fuse.fuse_id_word4);
+ return 0;
+}
+
+static int s5k3h1gx_sensor_open_init(struct msm_camera_sensor_info *data)
+{
+ int32_t rc = 0;
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ pr_info("Calling s5k3h1gx_sensor_open_init\n");
+
+ down(&s5k3h1gx_sem);
+
+ if (data == NULL) {
+ pr_info("data is a NULL pointer\n");
+ goto init_fail;
+ }
+
+ s5k3h1gx_ctrl = kzalloc(sizeof(struct s5k3h1gx_ctrl), GFP_KERNEL);
+
+ if (!s5k3h1gx_ctrl) {
+ rc = -ENOMEM;
+ goto init_fail;
+ }
+
+ s5k3h1gx_ctrl->curr_lens_pos = -1;
+ s5k3h1gx_ctrl->fps_divider = 1 * 0x00000400;
+ s5k3h1gx_ctrl->pict_fps_divider = 1 * 0x00000400;
+ s5k3h1gx_ctrl->set_test = TEST_OFF;
+ s5k3h1gx_ctrl->prev_res = QTR_SIZE;
+ s5k3h1gx_ctrl->pict_res = FULL_SIZE;
+ s5k3h1gx_ctrl->curr_res = INVALID_SIZE;
+ s5k3h1gx_ctrl->reg_update = REG_INIT;
+
+ if (data)
+ s5k3h1gx_ctrl->sensordata = data;
+
+ /* switch pclk and mclk between main cam and 2nd cam */
+ pr_info("doing clk switch (s5k3h1gx)\n");
+
+ if (data->camera_clk_switch != NULL)
+ data->camera_clk_switch();
+
+ msm_camio_probe_on(s5k3h1gx_pdev);
+
+ /* for parallel interface */
+ if (!sinfo->csi_if) {
+ mdelay(20);
+ msm_camio_camif_pad_reg_reset();
+ mdelay(20);
+ }
+ pr_info("[Camera] gpio_request(%d, \"s5k3h1gx\")\n", data->sensor_pwd);
+ rc = gpio_request(data->sensor_pwd, "s5k3h1gx");
+ if (!rc) {
+ gpio_direction_output(data->sensor_pwd, 1);
+ } else {
+ pr_err("GPIO (%d) request failed\n", data->sensor_pwd);
+ goto init_fail;
+ }
+ gpio_free(data->sensor_pwd);
+ msleep(5);
+ rc = gpio_request(data->sensor_reset, "s5k3h1gx");
+ if (!rc) {
+ gpio_direction_output(data->sensor_reset, 1);
+ } else {
+ pr_err("GPIO (%d) request failed\n", data->sensor_reset);
+ goto init_fail;
+ }
+ gpio_free(data->sensor_reset);
+ msleep(1);
+
+ /* read sensor id */
+ rc = s5k3h1gx_probe_init_sensor(data);
+
+ if (rc < 0)
+ goto init_fail;
+
+ if (!sinfo->csi_if) {
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.common_parallel,
+ s5k3h1gx_regs.common_parallel_size);
+ }
+ else
+ {
+ rc = s5k3h1gx_i2c_write_table(
+ s5k3h1gx_regs.common_mipi,
+ s5k3h1gx_regs.common_mipi_size);
+ }
+
+ if (rc < 0)
+ goto init_fail;
+
+ rc = s5k3h1gx_i2c_write_b(
+ s5k3h1gx_client->addr, 0x0100, 0x01);
+
+ /* set up lens position table */
+ s5k3h1gx_setup_af_tbl();
+ s5k3h1gx_go_to_position(0, 0);
+ s5k3h1gx_ctrl->curr_lens_pos = 0;
+ s5k3h1gx_ctrl->curr_step_pos = 0;
+
+ goto init_done;
+
+init_fail:
+ pr_err("%s: init_fail\n", __func__);
+
+init_done:
+ up(&s5k3h1gx_sem);
+ pr_info("%s: init_done\n", __func__);
+ return rc;
+
+} /* end of s5k3h1gx_sensor_open_init */
+
+static int s5k3h1gx_init_client(struct i2c_client *client)
+{
+ /* Initialize the MSM_CAMI2C Chip */
+ init_waitqueue_head(&s5k3h1gx_wait_queue);
+ return 0;
+}
+
+static const struct i2c_device_id s5k3h1gx_i2c_id[] = {
+ { "s5k3h1gx", 0},
+ { }
+};
+
+static int s5k3h1gx_i2c_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ int rc = 0;
+ pr_info("s5k3h1gx_probe called!\n");
+
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ pr_err("i2c_check_functionality failed\n");
+ goto probe_failure;
+ }
+
+ s5k3h1gx_sensorw = kzalloc(sizeof(struct s5k3h1gx_work), GFP_KERNEL);
+ if (!s5k3h1gx_sensorw) {
+ pr_err("kzalloc failed.\n");
+ rc = -ENOMEM;
+ goto probe_failure;
+ }
+
+ i2c_set_clientdata(client, s5k3h1gx_sensorw);
+ s5k3h1gx_init_client(client);
+ s5k3h1gx_client = client;
+
+ msleep(50);
+
+ pr_info("s5k3h1gx_probe successed! rc = %d\n", rc);
+ return 0;
+
+probe_failure:
+ pr_err("s5k3h1gx_probe failed! rc = %d\n", rc);
+ return rc;
+}
+
+static int __exit s5k3h1gx_i2c_remove(struct i2c_client *client)
+{
+ struct s5k3h1gx_work_t *sensorw = i2c_get_clientdata(client);
+ free_irq(client->irq, sensorw);
+ deinit_suspend();
+ s5k3h1gx_client = NULL;
+ kfree(sensorw);
+ return 0;
+}
+
+static struct i2c_driver s5k3h1gx_i2c_driver = {
+ .id_table = s5k3h1gx_i2c_id,
+ .probe = s5k3h1gx_i2c_probe,
+ .remove = __exit_p(s5k3h1gx_i2c_remove),
+ .driver = {
+ .name = "s5k3h1gx",
+ },
+};
+
+static const char *S5K3H1GXVendor = "samsung";
+static const char *S5K3H1GXNAME = "S5K3H1GX";
+static const char *S5K3H1GXSize = "8M";
+
+static ssize_t sensor_vendor_show( struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t ret = 0;
+
+ sprintf(buf, "%s %s %s\n", S5K3H1GXVendor, S5K3H1GXNAME, S5K3H1GXSize);
+ ret = strlen(buf) + 1;
+
+ return ret;
+}
+
+DEFINE_MUTEX(s5k3h1gx_cam_mode_lock);
+
+static ssize_t sensor_read_cam_mode(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t length;
+ mutex_lock(&s5k3h1gx_cam_mode_lock);
+ length = sprintf(buf, "%d\n", cam_mode_sel);
+ mutex_unlock(&s5k3h1gx_cam_mode_lock);
+ return length;
+}
+
+static ssize_t sensor_set_cam_mode(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ uint32_t tmp = 0;
+ mutex_lock(&s5k3h1gx_cam_mode_lock);
+ tmp = buf[0] - 0x30; /* only get the first char */
+ cam_mode_sel = tmp;
+ mutex_unlock(&s5k3h1gx_cam_mode_lock);
+ return count;
+}
+
+static ssize_t sensor_read_node( struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t length;
+ length = sprintf(buf, "%d\n", sensor_probe_node);
+ return length;
+}
+
+static DEVICE_ATTR(sensor, 0444, sensor_vendor_show, NULL);
+static DEVICE_ATTR(cam_mode, 0644, sensor_read_cam_mode, sensor_set_cam_mode);
+static DEVICE_ATTR(node, 0444, sensor_read_node, NULL);
+
+static struct kobject *android_s5k3h1gx = NULL;
+
+static int s5k3h1gx_sysfs_init(void)
+{
+ int ret = 0;
+ pr_info("s5k3h1gx:kobject creat and add\n");
+ android_s5k3h1gx = kobject_create_and_add("android_camera", NULL);
+ if (android_s5k3h1gx == NULL) {
+ pr_info("s5k3h1gx_sysfs_init: subsystem_register failed\n");
+ ret = -ENOMEM;
+ return ret ;
+ }
+ pr_info("s5k3h1gx:sysfs_create_file\n");
+ ret = sysfs_create_file(android_s5k3h1gx, &dev_attr_sensor.attr);
+ if (ret) {
+ pr_info("s5k3h1gx_sysfs_init: sysfs_create_file failed\n");
+ ret = -EFAULT;
+ goto error;
+ }
+
+ ret = sysfs_create_file(android_s5k3h1gx, &dev_attr_cam_mode.attr);
+ if (ret) {
+ pr_info("s5k3h1gx_sysfs_init: dev_attr_cam_mode failed\n");
+ ret = -EFAULT;
+ goto error;
+ }
+ ret = sysfs_create_file(android_s5k3h1gx, &dev_attr_node.attr);
+ if (ret) {
+ pr_info("s5k3h1gx_sysfs_init: dev_attr_node failed\n");
+ ret = -EFAULT;
+ goto error;
+ }
+
+ return ret;
+
+error:
+ kobject_del(android_s5k3h1gx);
+ return ret;
+}
+
+static int32_t
+s5k3h1gx_move_focus(int direction, int32_t num_steps)
+{
+ uint16_t s5k3h1gx_sw_damping_time_wait = 1;
+ uint16_t s5k3h1gx_damping_threshold = 10;
+ uint8_t s5k3h1gx_mode_mask = 0x02;
+ int16_t step_direction;
+ int16_t curr_lens_pos;
+ int16_t curr_step_pos;
+ int16_t dest_lens_pos;
+ int16_t dest_step_pos;
+ int16_t target_dist;
+ int16_t small_step;
+ int16_t next_lens_pos;
+ int16_t time_wait_per_step;
+ int32_t rc = 0, time_wait;
+ int8_t s5k3h1gx_sw_damping_required = 0;
+ uint16_t s5k3h1gx_max_fps_val;
+ struct msm_camera_sensor_info *sinfo = s5k3h1gx_pdev->dev.platform_data;
+
+ if (num_steps > S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR)
+ num_steps = S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR;
+ else if (num_steps == 0)
+ return -EINVAL;
+
+ if (direction == MOVE_NEAR)
+ step_direction = 1;
+ else if (direction == MOVE_FAR)
+ step_direction = -1;
+ else
+ return -EINVAL;
+
+ /* need to decide about default position and power supplied
+ * at start up and reset */
+ curr_lens_pos = s5k3h1gx_ctrl->curr_lens_pos;
+ curr_step_pos = s5k3h1gx_ctrl->curr_step_pos;
+
+ if (curr_lens_pos < s5k3h1gx_ctrl->init_curr_lens_pos)
+ curr_lens_pos = s5k3h1gx_ctrl->init_curr_lens_pos;
+
+ dest_step_pos = curr_step_pos + (step_direction * num_steps);
+
+ if (dest_step_pos < 0)
+ dest_step_pos = 0;
+ else if (dest_step_pos > S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR)
+ dest_step_pos = S5K3H1GX_TOTAL_STEPS_NEAR_TO_FAR;
+
+ if (dest_step_pos == s5k3h1gx_ctrl->curr_step_pos)
+ return rc;
+
+ dest_lens_pos = s5k3h1gx_pos_tbl[dest_step_pos];
+ target_dist = step_direction * (dest_lens_pos - curr_lens_pos);
+
+ if (sinfo->csi_if)
+ s5k3h1gx_max_fps_val = S5K3H1GX_MAX_FPS;
+ else
+ s5k3h1gx_max_fps_val = S5K3H1GX_MAX_FPS_PARALLEL;
+
+
+ /* HW damping */
+ if (step_direction < 0
+ && target_dist >= s5k3h1gx_pos_tbl[s5k3h1gx_damping_threshold]) {
+ s5k3h1gx_sw_damping_required = 1;
+ time_wait = 1000000
+ / s5k3h1gx_max_fps_val
+ - S5K3H1GX_SW_DAMPING_STEP * s5k3h1gx_sw_damping_time_wait * 1000;
+ } else
+ time_wait = 1000000 / s5k3h1gx_max_fps_val;
+
+ time_wait_per_step = (int16_t) (time_wait / target_dist);
+
+ if (time_wait_per_step >= 800)
+ /* ~800 */
+ s5k3h1gx_mode_mask = 0x5;
+ else if (time_wait_per_step >= 400)
+ /* ~400 */
+ s5k3h1gx_mode_mask = 0x4;
+ else if (time_wait_per_step >= 200)
+ /* 200~400 */
+ s5k3h1gx_mode_mask = 0x3;
+ else if (time_wait_per_step >= 100)
+ /* 100~200 */
+ s5k3h1gx_mode_mask = 0x2;
+ else if (time_wait_per_step >= 50)
+ /* 50~100 */
+ s5k3h1gx_mode_mask = 0x1;
+ else {
+ if (time_wait >= 17600)
+ s5k3h1gx_mode_mask = 0x0D;
+ else if (time_wait >= 8800)
+ s5k3h1gx_mode_mask = 0x0C;
+ else if (time_wait >= 4400)
+ s5k3h1gx_mode_mask = 0x0B;
+ else if (time_wait >= 2200)
+ s5k3h1gx_mode_mask = 0x0A;
+ else
+ s5k3h1gx_mode_mask = 0x09;
+ }
+
+ if (s5k3h1gx_sw_damping_required) {
+ small_step = (uint16_t) target_dist / S5K3H1GX_SW_DAMPING_STEP;
+ if ((target_dist % S5K3H1GX_SW_DAMPING_STEP) != 0)
+ small_step = small_step + 1;
+
+ for (next_lens_pos = curr_lens_pos + (step_direction*small_step);
+ (step_direction*next_lens_pos) <= (step_direction*dest_lens_pos);
+ next_lens_pos += (step_direction*small_step)) {
+ rc = s5k3h1gx_go_to_position(next_lens_pos, s5k3h1gx_mode_mask);
+ if (rc < 0) {
+ CDBG("s5k3h1gx_go_to_position Failed in Move Focus!!!\n");
+ return rc;
+ }
+ curr_lens_pos = next_lens_pos;
+ mdelay(s5k3h1gx_sw_damping_time_wait);
+ }
+
+ if (curr_lens_pos != dest_lens_pos) {
+ rc = s5k3h1gx_go_to_position(dest_lens_pos, s5k3h1gx_mode_mask);
+ if (rc < 0) {
+ pr_err("s5k3h1gx_go_to_position Failed in Move Focus!!!\n");
+ return rc;
+ }
+ mdelay(s5k3h1gx_sw_damping_time_wait);
+ }
+ } else {
+ rc = s5k3h1gx_go_to_position(dest_lens_pos, s5k3h1gx_mode_mask);
+ if (rc < 0) {
+ pr_err("s5k3h1gx_go_to_position Failed in Move Focus!!!\n");
+ return rc;
+ }
+ }
+
+ s5k3h1gx_ctrl->curr_lens_pos = dest_lens_pos;
+ s5k3h1gx_ctrl->curr_step_pos = dest_step_pos;
+
+ return rc;
+}
+
+static int32_t
+s5k3h1gx_set_default_focus(void)
+{
+ int32_t rc = 0;
+ if (s5k3h1gx_ctrl->curr_step_pos != 0) {
+ rc = s5k3h1gx_move_focus(MOVE_FAR, s5k3h1gx_ctrl->curr_step_pos);
+ if (rc < 0) {
+ pr_err("s5k3h1gx_set_default_focus Failed!!!\n");
+ return rc;
+ }
+ } else {
+ rc = s5k3h1gx_go_to_position(0, 0x02);
+ if (rc < 0) {
+ pr_err("s5k3h1gx_go_to_position Failed!!!\n");
+ return rc;
+ }
+ }
+
+ s5k3h1gx_ctrl->curr_lens_pos = 0;
+ s5k3h1gx_ctrl->init_curr_lens_pos = 0;
+ s5k3h1gx_ctrl->curr_step_pos = 0;
+
+ return rc;
+}
+
+uint8_t s5k3h1gx_preview_skip_frame(void)
+{
+ if (s5k3h1gx_ctrl->sensormode == SENSOR_PREVIEW_MODE
+ && preview_frame_count < 2) {
+ preview_frame_count++;
+ return 1;
+ }
+ return 0;
+}
+
+int s5k3h1gx_sensor_config(void __user *argp)
+{
+ struct sensor_cfg_data cdata;
+ long rc = 0;
+
+ if (copy_from_user(&cdata,
+ (void *)argp,
+ sizeof(struct sensor_cfg_data)))
+ return -EFAULT;
+
+ down(&s5k3h1gx_sem);
+
+ CDBG("s5k3h1gx_sensor_config: cfgtype = %d\n",
+ cdata.cfgtype);
+ switch (cdata.cfgtype) {
+ case CFG_GET_PICT_FPS:
+ s5k3h1gx_get_pict_fps(
+ cdata.cfg.gfps.prevfps,
+ &(cdata.cfg.gfps.pictfps));
+
+ if (copy_to_user((void *)argp,
+ &cdata,
+ sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ break;
+
+ case CFG_GET_PREV_L_PF:
+ cdata.cfg.prevl_pf =
+ s5k3h1gx_get_prev_lines_pf();
+
+ if (copy_to_user((void *)argp,
+ &cdata,
+ sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ break;
+
+ case CFG_GET_PREV_P_PL:
+ cdata.cfg.prevp_pl =
+ s5k3h1gx_get_prev_pixels_pl();
+
+ if (copy_to_user((void *)argp,
+ &cdata,
+ sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ break;
+
+ case CFG_GET_PICT_L_PF:
+ cdata.cfg.pictl_pf =
+ s5k3h1gx_get_pict_lines_pf();
+
+ if (copy_to_user((void *)argp,
+ &cdata,
+ sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ break;
+
+ case CFG_GET_PICT_P_PL:
+ cdata.cfg.pictp_pl =
+ s5k3h1gx_get_pict_pixels_pl();
+
+ if (copy_to_user((void *)argp,
+ &cdata,
+ sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ break;
+
+ case CFG_GET_PICT_MAX_EXP_LC:
+ cdata.cfg.pict_max_exp_lc =
+ s5k3h1gx_get_pict_max_exp_lc();
+
+ if (copy_to_user((void *)argp,
+ &cdata,
+ sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ break;
+
+ case CFG_SET_FPS:
+ case CFG_SET_PICT_FPS:
+ rc = s5k3h1gx_set_fps(&(cdata.cfg.fps));
+ break;
+
+ case CFG_SET_EXP_GAIN:
+ rc = s5k3h1gx_write_exp_gain(
+ cdata.cfg.exp_gain.gain,
+ cdata.cfg.exp_gain.line);
+ break;
+
+ case CFG_SET_PICT_EXP_GAIN:
+ rc = s5k3h1gx_set_pict_exp_gain(
+ cdata.cfg.exp_gain.gain,
+ cdata.cfg.exp_gain.line);
+ break;
+
+ case CFG_SET_MODE:
+ rc = s5k3h1gx_set_sensor_mode(cdata.mode,
+ cdata.rs);
+ break;
+
+ case CFG_PWR_DOWN:
+ rc = s5k3h1gx_power_down();
+ break;
+
+ case CFG_MOVE_FOCUS:
+ rc =
+ s5k3h1gx_move_focus(
+ cdata.cfg.focus.dir,
+ cdata.cfg.focus.steps);
+ break;
+
+ case CFG_SET_DEFAULT_FOCUS:
+ rc =
+ s5k3h1gx_set_default_focus();
+ break;
+
+ case CFG_I2C_IOCTL_R_OTP:{
+ pr_info("Line:%d CFG_I2C_IOCTL_R_OTP \n", __LINE__);
+ rc = s5k3h1gx_i2c_read_fuseid(&cdata);
+ if (copy_to_user(argp, &cdata, sizeof(struct sensor_cfg_data)))
+ rc = -EFAULT;
+ }
+ break;
+
+ /*20101011 for QCT mesh LSC calibration*/
+ case CFG_SET_QCT_LSC_RAW_CAPTURE:
+ pr_info("Line:%d : CFG_SET_QCT_LSC_RAW_CAPTURE \n", __LINE__);
+ rc = s5k3h1gx_QCT_LSC_calibration_set_rawflag();
+ break;
+
+ default:
+ rc = -EFAULT;
+ break;
+ }
+
+ prevent_suspend();
+ up(&s5k3h1gx_sem);
+
+ return rc;
+}
+
+static int s5k3h1gx_sensor_release(void)
+{
+ int rc = -EBADF;
+
+ down(&s5k3h1gx_sem);
+ pr_info("%s, %d\n", __func__, __LINE__);
+
+ if (s5k3h1gx_ctrl) {
+ rc = gpio_request(
+ s5k3h1gx_ctrl->sensordata->sensor_pwd, "s5k3h1gx");
+ if (!rc)
+ gpio_direction_output(
+ s5k3h1gx_ctrl->sensordata->sensor_pwd, 0);
+ else
+ pr_err("GPIO (%d) request failed\n",
+ s5k3h1gx_ctrl->sensordata->sensor_pwd);
+ gpio_free(s5k3h1gx_ctrl->sensordata->sensor_pwd);
+ }
+
+ msleep(5);
+ rc = gpio_request(
+ s5k3h1gx_ctrl->sensordata->sensor_reset, "s5k3h1gx");
+ if (!rc)
+ gpio_direction_output(
+ s5k3h1gx_ctrl->sensordata->sensor_reset, 0);
+ else
+ pr_err("GPIO (%d) request faile\n",
+ s5k3h1gx_ctrl->sensordata->sensor_reset);
+ gpio_free(s5k3h1gx_ctrl->sensordata->sensor_reset);
+
+
+ msm_camio_probe_off(s5k3h1gx_pdev);
+
+ if (s5k3h1gx_ctrl != NULL) {
+ kfree(s5k3h1gx_ctrl);
+ s5k3h1gx_ctrl = NULL;
+ }
+
+ allow_suspend();
+ pr_info("s5k3h1gx_release completed\n");
+ up(&s5k3h1gx_sem);
+
+ return rc;
+}
+
+static int s5k3h1gx_sensor_probe(struct msm_camera_sensor_info *info,
+ struct msm_sensor_ctrl *s)
+{
+ int rc = 0;
+ pr_info("s5k3h1gx_sensor_probe()\n");
+
+ rc = i2c_add_driver(&s5k3h1gx_i2c_driver);
+ if (rc < 0 || s5k3h1gx_client == NULL) {
+ rc = -ENOTSUPP;
+ goto probe_fail;
+ }
+
+ pr_info("s5k3h1 s->node %d\n", s->node);
+ sensor_probe_node = s->node;
+
+ /* switch PCLK and MCLK to Main cam */
+ pr_info("s5k3h1gx: s5k3h1gx_sensor_probe: switch clk\n");
+ if (info->camera_clk_switch != NULL)
+ info->camera_clk_switch();
+
+ mdelay(20);
+
+ pr_info("[Camera] gpio_request(%d, \"s5k3h1gx\")\n", info->sensor_pwd);
+ rc = gpio_request(info->sensor_pwd, "s5k3h1gx");
+ if (!rc)
+ gpio_direction_output(info->sensor_pwd, 1);
+ else
+ pr_err("GPIO (%d) request failed\n", info->sensor_pwd);
+ gpio_free(info->sensor_pwd);
+
+ msleep(100);
+
+ /* read sensor id */
+ rc = s5k3h1gx_probe_init_sensor(info);
+
+ if (rc < 0)
+ goto probe_fail;
+
+ /* Initialize Sensor registers */
+ rc = initialize_s5k3h1gx_registers();
+ if (rc < 0)
+ return rc;
+
+ if (info->camera_main_set_probe != NULL)
+ info->camera_main_set_probe(true);
+
+ init_suspend();
+ s->s_init = s5k3h1gx_sensor_open_init;
+ s->s_release = s5k3h1gx_sensor_release;
+ s->s_config = s5k3h1gx_sensor_config;
+ s5k3h1gx_probe_init_done(info);
+ s5k3h1gx_sysfs_init();
+
+ pr_info("%s: s5k3h1gx_probe_init_done %d\n", __func__, __LINE__);
+ goto probe_done;
+
+probe_fail:
+ pr_err("SENSOR PROBE FAILS!\n");
+probe_done:
+ return rc;
+
+}
+
+static int __s5k3h1gx_probe(struct platform_device *pdev)
+{
+ struct msm_camera_sensor_info *sdata = pdev->dev.platform_data;
+ pr_info("s5k3h1gx_probe\n");
+ s5k3h1gx_pdev = pdev;
+ if (sdata->camera_main_get_probe != NULL) {
+ if (sdata->camera_main_get_probe()) {
+ pr_info("__s5k3h1gx_probe camera main get probed already.\n");
+ return 0;
+ }
+ }
+ return msm_camera_drv_start(pdev, s5k3h1gx_sensor_probe);
+}
+
+static struct platform_driver msm_camera_driver = {
+ .probe = __s5k3h1gx_probe,
+ .driver = {
+ .name = "msm_camera_s5k3h1gx",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init s5k3h1gx_init(void)
+{
+ return platform_driver_register(&msm_camera_driver);
+}
+
+module_init(s5k3h1gx_init);
file:cfd75832684e43821e78854497096bb1b867a3f7(new)
--- /dev/null
+++ b/drivers/media/video/msm/s5k3h1gx.h
@@ -0,0 +1,93 @@
+/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Code Aurora Forum nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this software
+ * may be relicensed by the recipient under the terms of the GNU General Public
+ * License version 2 ("GPL") and only version 2, in which case the provisions of
+ * the GPL apply INSTEAD OF those given above. If the recipient relicenses the
+ * software under the GPL, then the identification text in the MODULE_LICENSE
+ * macro must be changed to reflect "GPLv2" instead of "Dual BSD/GPL". Once a
+ * recipient changes the license terms to the GPL, subsequent recipients shall
+ * not relicense under alternate licensing terms, including the BSD or dual
+ * BSD/GPL terms. In addition, the following license statement immediately
+ * below and between the words START and END shall also then apply when this
+ * software is relicensed under the GPL:
+ *
+ * START
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 and only version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * END
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#ifndef S5K3H1GX_H
+#define S5K3H1GX_H
+
+#include <linux/types.h>
+#include <mach/camera.h>
+
+struct s5k3h1gx_i2c_reg_conf {
+ unsigned short waddr;
+ unsigned char bdata;
+};
+
+struct s5k3h1gx_reg_t {
+ struct s5k3h1gx_i2c_reg_conf *init_mipi;
+ uint16_t init_mipi_size;
+ struct s5k3h1gx_i2c_reg_conf *init_parallel;
+ uint16_t init_parallel_size;
+
+ struct s5k3h1gx_i2c_reg_conf *common_mipi;
+ uint16_t common_mipi_size;
+ struct s5k3h1gx_i2c_reg_conf *common_parallel;
+ uint16_t common_parallel_size;
+
+ struct s5k3h1gx_i2c_reg_conf *qtr_mipi;
+ uint16_t qtr_mipi_size;
+ struct s5k3h1gx_i2c_reg_conf *qtr_parallel;
+ uint16_t qtr_parallel_size;
+
+ struct s5k3h1gx_i2c_reg_conf *full_mipi;
+ uint16_t full_mipi_size;
+ struct s5k3h1gx_i2c_reg_conf *full_parallel;
+ uint16_t full_parallel_size;
+};
+
+extern struct s5k3h1gx_reg_t s5k3h1gx_regs;
+
+#endif
+
file:3854828c6ba8e53afd0d0a2df0a2ee60f4a8d5f9(new)
--- /dev/null
+++ b/drivers/media/video/msm/s5k3h1gx_reg.c
@@ -0,0 +1,420 @@
+/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#include "s5k3h1gx.h"
+
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_init_settings_array_mipi[] =
+{
+ /* Because we will turn off power source after probe, there is no need to set register here */
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_init_settings_array_parallel[] =
+{
+ /* Because we will turn off power source after probe, there is no need to set register here */
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_common_settings_array_mipi[] =
+{
+ { 0x0100 , 0x00 },
+ { 0x3091 , 0x00 },
+ { 0x310E , 0x00 },
+ { 0x0111 , 0x01 },
+ { 0x3098 , 0xAB },
+ { 0x309A , 0x01 },
+ { 0x310D , 0xC6 },
+ { 0x30C3 , 0x40 },
+ { 0x308E , 0x05 },
+ { 0x308F , 0x88 },
+ { 0x30BB , 0x02 },
+ { 0x30C7 , 0x1A },
+ { 0x30BC , 0x38 },
+ { 0x30BD , 0x40 },
+ { 0x3110 , 0x70 },
+ { 0x3111 , 0x80 },
+ { 0x3112 , 0x7B },
+ { 0x3113 , 0xC0 },
+ { 0x3000 , 0x08 },
+ { 0x3001 , 0x05 },
+ { 0x3002 , 0x0D },
+ { 0x3003 , 0x21 },
+ { 0x3004 , 0x62 },
+ { 0x3005 , 0x0B },
+ { 0x3006 , 0x6D },
+ { 0x3007 , 0x02 },
+ { 0x3008 , 0x62 },
+ { 0x3009 , 0x62 },
+ { 0x300A , 0x41 },
+ { 0x300B , 0x10 },
+ { 0x300C , 0x21 },
+ { 0x300D , 0x04 },
+ { 0x307E , 0x03 },
+ { 0x307F , 0xA5 },
+ { 0x3080 , 0x04 },
+ { 0x3081 , 0x29 },
+ { 0x3082 , 0x03 },
+ { 0x3083 , 0x21 },
+ { 0x3011 , 0x5F },
+ { 0x3156 , 0xE2 },
+ { 0x3027 , 0x0E },
+ { 0x300f , 0x02 },
+ { 0x3072 , 0x13 },
+ { 0x3073 , 0x61 },
+ { 0x3074 , 0x92 },
+ { 0x3075 , 0x10 },
+ { 0x3076 , 0xA2 },
+ { 0x3077 , 0x02 },
+ { 0x3078 , 0x91 },
+ { 0x3079 , 0x91 },
+ { 0x307A , 0x61 },
+ { 0x307B , 0x18 },
+ { 0x307C , 0x61 },
+ { 0x3010 , 0x10 },
+ { 0x3017 , 0x74 },
+ { 0x3018 , 0x00 },
+ { 0x3020 , 0x02 },
+ { 0x3021 , 0x24 },
+ { 0x3023 , 0x40 },
+ { 0x3024 , 0x08 },
+ { 0x3025 , 0x08 },
+ { 0x301C , 0xD4 },
+ { 0x315D , 0x00 },
+ { 0x3053 , 0xCF },
+ { 0x3054 , 0x00 },
+ { 0x3055 , 0x35 },
+ { 0x3062 , 0x04 },
+ { 0x3063 , 0x38 },
+ { 0x3016 , 0x2c },
+ { 0x3157 , 0x02 },
+ { 0x3158 , 0x00 },
+ { 0x315B , 0x02 },
+ { 0x315C , 0x00 },
+ { 0x301B , 0x04 },
+ { 0x301A , 0xC4 },
+ { 0x302d , 0x19 },
+ { 0x302b , 0x04 },
+ { 0x0305 , 0x04 }, /* pre_pll_clk_div = 4 */
+ { 0x0306 , 0x00 }, /* pll_multiplier */
+ { 0x0307 , 0x66 }, /* pll_multiplier = 102 */
+ { 0x0303 , 0x01 }, /* vt_sys_clk_div = 1 */
+ { 0x0301 , 0x05 }, /* vt_pix_clk_div = 5 */
+ { 0x030B , 0x01 }, /* op_sys_clk_div = 1 */
+ { 0x0309 , 0x05 }, /* op_pix_clk_div = 5 */
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_common_settings_array_parallel[] =
+{
+ { 0x0100 , 0x00 },
+ /* MIPI/CCP/Parallel Setting */
+ { 0x3091 , 0x00 },
+ { 0x3065 , 0x15 }, /* sync mode */
+ { 0x310E , 0x08 }, /* reg_sel 08h:parallel / 04h: CCP / 00h : MIPI */
+ { 0x0111 , 0x01 }, /* CCP2_signalling_mode */
+ { 0x308E , 0x05 },
+ { 0x308F , 0x88 },
+ /* Manufacture Setting */
+ { 0x3000 , 0x08 },
+ { 0x3001 , 0x05 },
+ { 0x3002 , 0x0D },
+ { 0x3003 , 0x21 },
+ { 0x3004 , 0x62 },
+ { 0x3005 , 0x0B },
+ { 0x3006 , 0x6D },
+ { 0x3007 , 0x02 },
+ { 0x3008 , 0x62 },
+ { 0x3009 , 0x62 },
+ { 0x300A , 0x41 },
+ { 0x300B , 0x10 },
+ { 0x300C , 0x21 },
+ { 0x300D , 0x04 },
+ { 0x307E , 0x03 },
+ { 0x307F , 0xA5 },
+ { 0x3080 , 0x04 },
+ { 0x3081 , 0x29 },
+ { 0x3082 , 0x03 },
+ { 0x3083 , 0x21 },
+ { 0x3011 , 0x5F },
+ { 0x3156 , 0xE2 },
+ /* { 0x3027 , 0x0E }, */
+ { 0x300f , 0x02 },
+ { 0x3072 , 0x13 },
+ { 0x3073 , 0x61 },
+ { 0x3074 , 0x92 },
+ { 0x3075 , 0x10 },
+ { 0x3076 , 0xA2 },
+ { 0x3077 , 0x02 },
+ { 0x3078 , 0x91 },
+ { 0x3079 , 0x91 },
+ { 0x307A , 0x61 },
+ { 0x307B , 0x18 },
+ { 0x307C , 0x61 },
+ { 0x3010 , 0x10 },
+ { 0x3017 , 0x74 },
+ { 0x3018 , 0x00 },
+ { 0x3020 , 0x02 },
+ { 0x3021 , 0x24 },
+ { 0x3023 , 0x40 },
+ { 0x3024 , 0x08 },
+ { 0x3025 , 0x08 },
+ { 0x301C , 0xD4 },
+ { 0x315D , 0x00 },
+ { 0x3053 , 0xCF },
+ { 0x3054 , 0x00 },
+ { 0x3055 , 0x35 },
+ { 0x3062 , 0x04 },
+ { 0x3063 , 0x38 },
+ { 0x3016 , 0x2c },
+ { 0x3157 , 0x02 },
+ { 0x3158 , 0x00 },
+ { 0x315B , 0x02 },
+ { 0x315C , 0x00 },
+ { 0x301A , 0xC4 },
+ { 0x301B , 0x04 },
+ { 0x302d , 0x19 },
+ { 0x302b , 0x04 },
+ { 0x310d , 0xe6 },
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_qtr_settings_array_mipi[] =
+{
+ { 0x30CC , 0xA0 }, /* DPHY_band_ctrl 560 ~ 640Mbps */
+ { 0x0344 , 0x00 }, /* Xaddrstart 0d */
+ { 0x0345 , 0x00 },
+ { 0x0346 , 0x00 }, /* Yaddrstart 0d */
+ { 0x0347 , 0x00 },
+ { 0x0348 , 0x0C }, /* Xaddrend 3279d */
+ { 0x0349 , 0xCf },
+ { 0x034A , 0x09 }, /* Yaddrend 2463d */
+ { 0x034B , 0x9F },
+ { 0x0381 , 0x01 }, /* x_even_inc = 1 */
+ { 0x0383 , 0x01 }, /* x_odd_inc = 1 */
+ { 0x0385 , 0x01 }, /* y_even_inc = 1 */
+ { 0x0387 , 0x03 }, /* y_odd_inc = 3 */
+ { 0x034C , 0x06 }, /* x_output_size = 1640 */
+ { 0x034D , 0x68 },
+ { 0x034E , 0x04 }, /* y_output_size = 1232 */
+ { 0x034F , 0xD0 },
+ { 0x0200 , 0x02 }, /* fine integration time */
+ { 0x0201 , 0x50 },
+ { 0x0202 , 0x03 }, /* Coarse integration time */
+ { 0x0203 , 0xA0 },
+ { 0x0204 , 0x00 }, /* Analog gain */
+ { 0x0205 , 0x20 },
+ { 0x0342 , 0x0D }, /* Line_length_pck 3470d */
+ { 0x0343 , 0x8E },
+ { 0x0340 , 0x04 }, /* Frame_length_lines 1248d */
+ { 0x0341 , 0xE0 },
+ { 0x300E , 0xED }, /* Reserved */
+ { 0x3085 , 0x00 }, /* Reserved */
+ { 0x301D , 0x81 }, /* Reserved */
+ { 0x3086 , 0x03 }, /* Reserved */
+ { 0x3087 , 0x34 }, /* Reserved */
+ { 0x3065 , 0x15 }, /* Reserved */
+ { 0x3028 , 0x40 }, /* Reserved */
+ { 0x0100 , 0x01 },
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_qtr_settings_array_parallel[] =
+{
+ /* PLL settings MCLK:24MHz,vt_pix_clk_freq_mhz=130.2MHz,op_sys_clk_freq_mhz=65.1MHz */
+ { 0x0305 , 0x08 }, /* pre_pll_clk_div = 8 */
+ { 0x0306 , 0x01 }, /* pll_multiplier */
+ { 0x0307 , 0x40 }, /* pll_multiplier = 320 */
+ { 0x0303 , 0x01 }, /* vt_sys_clk_div = 1 */
+ { 0x0301 , 0x05 }, /* vt_pix_clk_div = 5 */
+ { 0x030B , 0x01 }, /* op_sys_clk_div = 1 */
+ { 0x0309 , 0x0A }, /* op_pix_clk_div = 10 */
+ /* DBLR Clock setting = 96Mhz = vt_pix_clk_freq_mhz/2 */
+ { 0x3027 , 0x7E },
+
+ /* Readout H:1/2 SubSampling binning, V:1/2 SubSampling binning */
+ { 0x0344 , 0x00 }, /* X addr start 0d */
+ { 0x0345 , 0x00 },
+ { 0x0346 , 0x00 }, /* Y addr start 0d */
+ { 0x0347 , 0x00 },
+ { 0x0348 , 0x0C }, /* X addr end 3279d */
+ { 0x0349 , 0xCF },
+ { 0x034A , 0x09 }, /* Y addr end 2463d */
+ { 0x034B , 0x9F },
+ { 0x0381 , 0x01 }, /* x_even_inc = 1 */
+ { 0x0383 , 0x01 }, /* x_odd_inc = 1 */
+ { 0x0385 , 0x01 }, /* y_even_inc = 1 */
+ { 0x0387 , 0x03 }, /* y_odd_inc = 3 */
+ /* ------------- */
+ { 0x0401 , 0x01 }, /* Derating_en = 1 (disable) */
+ { 0x0405 , 0x10 },
+ { 0x0700 , 0x05 }, /* fifo_threshold = 1328 */
+ { 0x0701 , 0x30 },
+ /* ------------- */
+ { 0x034C , 0x06 }, /* x_output_size = 1640 */
+ { 0x034D , 0x68 },
+ { 0x034E , 0x04 }, /* y_output_size = 1232 */
+ { 0x034F , 0xD0 },
+ { 0x0200 , 0x03 }, /* fine integration time */
+ { 0x0201 , 0x50 },
+ /* ------------- */
+ { 0x0202 , 0x03 }, /* Coarse integration time */
+ { 0x0203 , 0xA0 }, /* DB */
+ /* ------------- */
+ { 0x0204 , 0x00 }, /* Analog gain */
+ { 0x0205 , 0x20 },
+ { 0x0342 , 0x0D }, /* Line_length_pck 3470d */
+ { 0x0343 , 0x8E },
+ { 0x0340 , 0x07 }, /* Frame_length_lines 1843d */
+ { 0x0341 , 0x33 },
+ /* Manufacture Setting */
+ { 0x300E , 0xED },
+ { 0x3085 , 0x00 },
+ { 0x301D , 0x81 },
+ { 0x3028 , 0x40 },
+ { 0x3086 , 0x03 },
+ { 0x3087 , 0x34 },
+ { 0x3065 , 0x15 },
+ /* ------------- */
+ { 0x310C , 0x50 }, /* pclk invert */
+ { 0x3117 , 0x0F }, /* H/V sync driving strength 6mA */
+ { 0x3118 , 0xF0 }, /* parallel data driving strength 6mA */
+ /* ------------- */
+
+ /*{ 0x0100 , 0x01 },*/
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_full_settings_array_mipi[] =
+{
+ { 0x30CC , 0xA0 }, /* DPHY_band_ctrl 560 ~ 640Mbps */
+ { 0x0344 , 0x00 }, /* X addr start 0d */
+ { 0x0345 , 0x00 },
+ { 0x0346 , 0x00 }, /* Y addr start 0d */
+ { 0x0347 , 0x00 },
+ { 0x0348 , 0x0C }, /* X addr end 3279d */
+ { 0x0349 , 0xCf },
+ { 0x034A , 0x09 }, /* Y addr end 2463d */
+ { 0x034B , 0x9F },
+ { 0x0381 , 0x01 }, /* x_even_inc = 1 */
+ { 0x0383 , 0x01 }, /* x_odd_inc = 1 */
+ { 0x0385 , 0x01 }, /* y_even_inc = 1 */
+ { 0x0387 , 0x01 }, /* y_odd_inc = 1 */
+ { 0x034C , 0x0C }, /* x_output_size = 3280 */
+ { 0x034D , 0xD0 },
+ { 0x034E , 0x09 }, /* y_output_size = 2464 */
+ { 0x034F , 0xA0 },
+ { 0x0200 , 0x02 }, /* fine integration time */
+ { 0x0201 , 0x50 },
+ { 0x0202 , 0x04 }, /* Coarse integration time */
+ { 0x0203 , 0xE7 },
+ { 0x0204 , 0x00 }, /* Analog gain */
+ { 0x0205 , 0x20 },
+ { 0x0342 , 0x0D }, /* Line_length_pck */
+ { 0x0343 , 0x8E },
+ { 0x0340 , 0x09 }, /* Frame_length_lines */
+ { 0x0341 , 0xB0 },
+ { 0x300E , 0xE9 }, /* Reserved */
+ { 0x3085 , 0x01 }, /* Reserved */
+ { 0x301D , 0x01 }, /* Reserved */
+ { 0x3086 , 0x03 }, /* Reserved */
+ { 0x3087 , 0x34 }, /* Reserved */
+ { 0x3065 , 0x15 }, /* Reserved */
+ { 0x3028 , 0x41 }, /* Reserved */
+ { 0x0100 , 0x01 },
+};
+
+struct s5k3h1gx_i2c_reg_conf s5k3h1gx_full_settings_array_parallel[] =
+{
+ /* PLL settings MCLK:24MHz,vt_pix_clk_freq_mhz=96MHz,op_sys_clk_freq_mhz=96MHz */
+ { 0x0305 , 0x04 }, /* pre_pll_clk_div = 4 */
+ { 0x0306 , 0x00 }, /* pll_multiplier */
+ { 0x0307 , 0xA0 }, /* pll_multiplier = 160 */
+ { 0x0303 , 0x01 }, /* vt_sys_clk_div = 1 */
+ { 0x0301 , 0x0A }, /* vt_pix_clk_div = 10 */
+ { 0x030B , 0x01 }, /* op_sys_clk_div = 1 */
+ { 0x0309 , 0x0A }, /* op_pix_clk_div = 10 */
+ /* DBLR Clock setting = 96Mhz = vt_pix_clk_freq_mhz */
+ { 0x3027 , 0x3E },
+ /* Readout Full */
+ { 0x0344 , 0x00 }, /* X addr start 0d */
+ { 0x0345 , 0x00 },
+ { 0x0346 , 0x00 }, /* Y addr start 0d */
+ { 0x0347 , 0x00 },
+ { 0x0348 , 0x0C }, /* X addr end 3279d */
+ { 0x0349 , 0xCF },
+ { 0x034A , 0x09 }, /* Y addr end 2463d */
+ { 0x034B , 0x9F },
+ { 0x0381 , 0x01 }, /* x_even_inc = 1 */
+ { 0x0383 , 0x01 }, /* x_odd_inc = 1 */
+ { 0x0385 , 0x01 }, /* y_even_inc = 1 */
+ { 0x0387 , 0x01 }, /* y_odd_inc = 1 */
+ /* ------------- */
+ { 0x0401 , 0x00 }, /* Scaler OFF */
+ { 0x0405 , 0x10 }, /* Scaling ratio 16/16 */
+ { 0x0700 , 0x03 }, /* fifo_threshold = 818d */
+ { 0x0701 , 0x32 },
+ /* ------------- */
+ { 0x034C , 0x0C }, /* x_output_size = 3280 */
+ { 0x034D , 0xD0 },
+ { 0x034E , 0x09 }, /* y_output_size = 2464 */
+ { 0x034F , 0xA0 },
+ { 0x0200 , 0x03 }, /* fine integration time */
+ { 0x0201 , 0x50 },
+ { 0x0202 , 0x04 }, /* Coarse integration time */
+ { 0x0203 , 0xE7 },
+ { 0x0204 , 0x00 }, /* Analog gain */
+ { 0x0205 , 0x20 },
+ { 0x0342 , 0x0D }, /* Line_length_pck 3470d */
+ { 0x0343 , 0x8E },
+ { 0x0340 , 0x09 }, /* Frame_length_lines 2480d */
+ { 0x0341 , 0xB0 },
+ /* Manufacture Setting */
+ { 0x300E , 0xE9 },
+ { 0x3085 , 0x01 },
+ { 0x301D , 0x01 },
+ { 0x3086 , 0x03 },
+ { 0x3087 , 0x34 },
+ { 0x3028 , 0x41 },
+ { 0x3065 , 0x15 },
+ /* ------------- */
+ { 0x310C , 0x50 }, /* pclk invert */
+ { 0x3117 , 0x0F }, /* H/V sync driving strength 6mA */
+ { 0x3118 , 0xF0 }, /* parallel data driving strength 6mA */
+ /* ------------- */
+
+ /*{ 0x0100 , 0x01 },*/
+};
+
+
+
+struct s5k3h1gx_reg_t s5k3h1gx_regs = {
+ .init_mipi = &s5k3h1gx_init_settings_array_mipi[0],
+ .init_mipi_size = ARRAY_SIZE(s5k3h1gx_init_settings_array_mipi),
+ .init_parallel = &s5k3h1gx_init_settings_array_parallel[0],
+ .init_parallel_size = ARRAY_SIZE(s5k3h1gx_init_settings_array_parallel),
+
+ .common_mipi = &s5k3h1gx_common_settings_array_mipi[0],
+ .common_mipi_size = ARRAY_SIZE(s5k3h1gx_common_settings_array_mipi),
+ .common_parallel = &s5k3h1gx_common_settings_array_parallel[0],
+ .common_parallel_size = ARRAY_SIZE(s5k3h1gx_common_settings_array_parallel),
+
+ .qtr_mipi = &s5k3h1gx_qtr_settings_array_mipi[0],
+ .qtr_mipi_size = ARRAY_SIZE(s5k3h1gx_qtr_settings_array_mipi),
+ .qtr_parallel = &s5k3h1gx_qtr_settings_array_parallel[0],
+ .qtr_parallel_size = ARRAY_SIZE(s5k3h1gx_qtr_settings_array_parallel),
+
+ .full_mipi = &s5k3h1gx_full_settings_array_mipi[0],
+ .full_mipi_size = ARRAY_SIZE(s5k3h1gx_full_settings_array_mipi),
+ .full_parallel = &s5k3h1gx_full_settings_array_parallel[0],
+ .full_parallel_size = ARRAY_SIZE(s5k3h1gx_full_settings_array_parallel),
+};
file:c65a7813aba1263b45dd9f53a33ae5fa92c1999e(new)
--- /dev/null
+++ b/drivers/media/video/msm/s5k6aafx.c
@@ -0,0 +1,1021 @@
+/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#include <linux/delay.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <linux/uaccess.h>
+#include <linux/miscdevice.h>
+#include <media/msm_camera.h>
+#include <mach/gpio.h>
+#include "s5k6aafx.h"
+
+struct s5k6aafx_work {
+ struct work_struct work;
+};
+
+static struct s5k6aafx_work *s5k6aafx_sensorw;
+static struct i2c_client *s5k6aafx_client;
+
+struct s5k6aafx_ctrl {
+ const struct msm_camera_sensor_info *sensordata;
+};
+
+static struct s5k6aafx_ctrl *s5k6aafx_ctrl;
+static struct platform_device *s5k6aafx_pdev;
+
+static int op_mode;
+static DECLARE_WAIT_QUEUE_HEAD(s5k6aafx_wait_queue);
+DECLARE_MUTEX(s5k6aafx_sem);
+
+static int sensor_probe_node = 0;
+static enum frontcam_t previous_mirror_mode;
+
+static enum wb_mode current_wb = CAMERA_AWB_AUTO;
+static int s5k6aafx_set_wb(enum wb_mode wb_value);
+
+#define MAX_I2C_RETRIES 20
+static int i2c_transfer_retry(struct i2c_adapter *adap,
+ struct i2c_msg *msgs,
+ int len)
+{
+ int i2c_retry = 0;
+ int ns; /* number sent */
+
+ while (i2c_retry++ < MAX_I2C_RETRIES) {
+ ns = i2c_transfer(adap, msgs, len);
+ if (ns == len)
+ break;
+ pr_err("%s: try %d/%d: i2c_transfer sent: %d, len %d\n",
+ __func__,
+ i2c_retry, MAX_I2C_RETRIES, ns, len);
+ msleep(10);
+ }
+
+ return ns == len ? 0 : -EIO;
+}
+
+
+static int s5k6aafx_i2c_txdata(unsigned short saddr,
+ unsigned char *txdata, int length)
+{
+ struct i2c_msg msg[] = {
+ {
+ .addr = saddr,
+ .flags = 0,
+ .len = length,
+ .buf = txdata,
+ },
+ };
+
+ if (i2c_transfer_retry(s5k6aafx_client->adapter, msg, 1) < 0) {
+ pr_info("s5k6aafx_i2c_txdata failed\n");
+ return -EIO;
+ }
+
+ return 0;
+}
+
+static int s5k6aafx_i2c_write(unsigned short saddr,
+ unsigned short waddr, unsigned short wdata)
+{
+ int rc = -EIO;
+ unsigned char buf[4];
+ memset(buf, 0, sizeof(buf));
+
+ buf[0] = (waddr & 0xFF00) >> 8;
+ buf[1] = (waddr & 0x00FF);
+ buf[2] = (wdata & 0xFF00) >> 8;
+ buf[3] = (wdata & 0x00FF);
+ rc = s5k6aafx_i2c_txdata(saddr, buf, 4);
+ if (rc < 0)
+ pr_info("i2c_write failed, addr = 0x%x, val = 0x%x!\n",
+ waddr, wdata);
+
+ return rc;
+}
+
+static int s5k6aafx_i2c_write_table(struct s5k6aafx_i2c_reg_conf const
+ *reg_conf_tbl, int num_of_items_in_table)
+{
+ int i;
+ int rc = -EIO;
+
+ for (i = 0; i < num_of_items_in_table; i++) {
+ rc = s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ reg_conf_tbl->waddr, reg_conf_tbl->wdata);
+ if (rc < 0)
+ break;
+ reg_conf_tbl++;
+ }
+ return rc;
+}
+
+static int s5k6aafx_i2c_rxdata(unsigned short saddr,
+ unsigned char *rxdata, int length)
+{
+ struct i2c_msg msgs[] = {
+ {
+ .addr = saddr,
+ .flags = 0,
+ .len = 2,
+ .buf = rxdata,
+ },
+ {
+ .addr = saddr,
+ .flags = I2C_M_RD,
+ .len = length,
+ .buf = rxdata,
+ },
+ };
+
+ if (i2c_transfer_retry(s5k6aafx_client->adapter, msgs, 2) < 0) {
+ pr_info("s5k6aafx_i2c_rxdata failed!\n");
+ return -EIO;
+ }
+
+ return 0;
+}
+
+static int s5k6aafx_i2c_read(unsigned short saddr,
+ unsigned short raddr, unsigned short *rdata)
+{
+ int32_t rc = 0;
+ unsigned char buf[4];
+
+ if (!rdata)
+ return -EIO;
+
+ memset(buf, 0, sizeof(buf));
+
+ buf[0] = (raddr & 0xFF00)>>8;
+ buf[1] = (raddr & 0x00FF);
+
+ rc = s5k6aafx_i2c_rxdata(saddr, buf, 2);
+ if (rc < 0){
+ printk(KERN_ERR "s5k6aafx_i2c_read failed!\n");
+ return rc;
+ }
+
+ *rdata = buf[0] << 8 | buf[1];
+
+ return rc;
+}
+
+static int s5k6aafx_gpio_pull(int gpio_pin, int pull_mode)
+{
+ int rc = 0;
+ rc = gpio_request(gpio_pin, "s5k6aafx");
+ if (!rc)
+ gpio_direction_output(gpio_pin, pull_mode);
+ else
+ pr_err("GPIO(%d) request failed\n", gpio_pin);
+ gpio_free(gpio_pin);
+ return rc;
+}
+
+static int s5k6aafx_set_sensor_mode(int mode)
+{
+ switch (mode) {
+ case SENSOR_PREVIEW_MODE:
+ pr_info("s5k6aafx:sensor set mode: preview\n");
+ op_mode = SENSOR_PREVIEW_MODE;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_I2C_MODE_GENERAL);
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_W_ADDH, S5K6AAFX_ADDH_SW_REG_INT);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_W_ADDL, 0x01F4);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, 0x0000); /* REG_TC_GP_EnableCapture */
+ /* REG_TC_GP_EnableCaptureChanged */
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, 0x0001);
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_W_ADDL, 0x0400);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, 0x007F);
+ s5k6aafx_set_wb(current_wb);
+
+ break;
+
+ case SENSOR_SNAPSHOT_MODE:
+ pr_info("s5k6aafx:sensor set mode: snapshot\n");
+ op_mode = SENSOR_SNAPSHOT_MODE;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_I2C_MODE_GENERAL);
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_W_ADDH, S5K6AAFX_ADDH_SW_REG_INT);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_W_ADDL, 0x01F4);
+ /* REG_TC_GP_EnableCapture */
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, 0x0001);
+ /* REG_TC_GP_EnableCaptureChanged */
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, 0x0001);
+
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int s5k6aafx_set_effect(int effect)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (effect) {
+ case CAMERA_EFFECT_OFF:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EE, 0x0000);
+ break;
+ case CAMERA_EFFECT_MONO:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EE, 0x0001);
+ break;
+ case CAMERA_EFFECT_NEGATIVE:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EE, 0x0002);
+ break;
+ case CAMERA_EFFECT_SEPIA:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EE, 0x0003);
+ break;
+ case CAMERA_EFFECT_AQUA:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EE, 0x0004);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+
+static int s5k6aafx_set_antibanding(enum antibanding_mode antibanding_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (antibanding_value) {
+ case CAMERA_ANTI_BANDING_50HZ:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DC, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DE, 0x0001);
+ break;
+ case CAMERA_ANTI_BANDING_60HZ:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DC, 0x0002);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DE, 0x0001);
+ break;
+ case CAMERA_ANTI_BANDING_AUTO:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DC, 0x0002);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DE, 0x0001);
+ break;
+ }
+ return 0;
+}
+
+
+static int s5k6aafx_set_brightness(enum brightness_t brightness_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (brightness_value) {
+ case CAMERA_BRIGHTNESS_N4:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0xFF81);
+ break;
+ case CAMERA_BRIGHTNESS_N3:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0xFFA1);
+ break;
+ case CAMERA_BRIGHTNESS_N2:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0xFFC1);
+ break;
+ case CAMERA_BRIGHTNESS_N1:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0xFFE1);
+ break;
+ case CAMERA_BRIGHTNESS_D:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0x0000);
+ break;
+ case CAMERA_BRIGHTNESS_P1:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0x001F);
+ break;
+ case CAMERA_BRIGHTNESS_P2:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0x003F);
+ break;
+ case CAMERA_BRIGHTNESS_P3:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0x005F);
+ break;
+ case CAMERA_BRIGHTNESS_P4:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E4, 0x007F);
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static int s5k6aafx_set_wb(enum wb_mode wb_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (wb_value) {
+ case CAMERA_AWB_AUTO: /*auto*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x0400, 0x007F);
+ break;
+ case CAMERA_AWB_CLOUDY: /*cloudy*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x0400, 0x0077);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D0, 0x0147);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D2, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D4, 0x0100);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D6, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D8, 0x0138);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DA, 0x0001);
+ break;
+ case CAMERA_AWB_INDOOR_HOME: /*Fluorescent*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x0400, 0x0077);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D0, 0x00D9);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D2, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D4, 0x0100);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D6, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D8, 0x0200);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DA, 0x0001);
+ break;
+ case CAMERA_AWB_INDOOR_OFFICE: /*Incandescent*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x0400, 0x0077);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D0, 0x00D9);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D2, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D4, 0x0100);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D6, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D8, 0x0219);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DA, 0x0001);
+ break;
+ case CAMERA_AWB_SUNNY: /*outdoor*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x0400, 0x0077);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D0, 0x0133);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D2, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D4, 0x0100);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D6, 0x0001);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03D8, 0x0119);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x03DA, 0x0001);
+ break;
+ default:
+ break;
+ }
+ current_wb = wb_value;
+ return 0;
+}
+
+
+static int s5k6aafx_set_sharpness(enum sharpness_mode sharpness_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (sharpness_value) {
+ case CAMERA_SHARPNESS_X0:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EA, 0xFF81);
+ break;
+ case CAMERA_SHARPNESS_X1:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EA, 0xFFC1);
+ break;
+ case CAMERA_SHARPNESS_X2:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EA, 0x0000);
+ break;
+ case CAMERA_SHARPNESS_X3:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EA, 0x003F);
+ break;
+ case CAMERA_SHARPNESS_X4:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01EA, 0x007F);
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+
+static int s5k6aafx_set_saturation(enum saturation_mode saturation_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (saturation_value) {
+ case CAMERA_SATURATION_X0:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E8, 0xFF81);
+ break;
+ case CAMERA_SATURATION_X05:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E8, 0xFFC1);
+ break;
+ case CAMERA_SATURATION_X1:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E8, 0x0000);
+ break;
+ case CAMERA_SATURATION_X15:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E8, 0x003F);
+ break;
+ case CAMERA_SATURATION_X2:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E8, 0x007F);
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static int s5k6aafx_set_contrast(enum contrast_mode contrast_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (contrast_value) {
+ case CAMERA_CONTRAST_N2:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E6, 0xFF81);
+ break;
+ case CAMERA_CONTRAST_N1:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E6, 0xFFC1);
+ break;
+ case CAMERA_CONTRAST_D:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E6, 0x0000);
+ break;
+ case CAMERA_CONTRAST_P1:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E6, 0x003F);
+ break;
+ case CAMERA_CONTRAST_P2:
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x01E6, 0x007F);
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static int s5k6aafx_set_front_camera_mode(enum frontcam_t frontcam_value)
+{
+ if (op_mode == SENSOR_SNAPSHOT_MODE || previous_mirror_mode == frontcam_value)
+ return 0;
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_ADDH_SW_REG_INT);
+
+ switch (frontcam_value) {
+ case CAMERA_MIRROR:
+ /*mirror and flip*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x02D4, 0x0002);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x02D6, 0x0002);
+
+ break;
+ case CAMERA_REVERSE:
+ /*reverse mode*/
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x02D4, 0x0003);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x02D6, 0x0003);
+
+ break;
+
+ default:
+ break;
+ }
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x021E, 0x0001);
+
+ previous_mirror_mode = frontcam_value;
+
+ return 0;
+}
+
+#if 0
+static int s5k6aafx_set_metering_mode(enum aec_metering_mode metering_value)
+{
+ uint16_t weight_table[32];
+ uint8_t i;
+
+ if (op_mode == SENSOR_SNAPSHOT_MODE)
+ return 0;
+
+ for (i = 0; i < 32; i++)
+ weight_table[i] = 0x0101;
+
+ if (metering_value == CAMERA_METERING_CENTERING) {
+ weight_table[9] = 0x0303;
+ weight_table[10] = 0x0303;
+ weight_table[13] = 0x0303; /* 0x0305 */
+ weight_table[14] = 0x0303; /* 0x0503 */
+ weight_table[17] = 0x0303; /* 0x0305 */
+ weight_table[18] = 0x0303; /* 0x0503 */
+ weight_table[21] = 0x0303;
+ weight_table[22] = 0x0303;
+ } else if (metering_value == CAMERA_METERING_SPOT) {
+ weight_table[13] = 0x0501;
+ weight_table[14] = 0x0105;
+ weight_table[17] = 0x0501;
+ weight_table[18] = 0x0105;
+ } else if (metering_value >= CAMERA_METERING_ZONE1 &&
+ metering_value <= CAMERA_METERING_ZONE16) {
+ i = metering_value - CAMERA_METERING_ZONE1;
+ i += (i & 0xFC); /* i=i+((int)(i/4))*4 */
+ weight_table[i] = 0x0505;
+ weight_table[i+4] = 0x0505;
+ }
+
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_I2C_MODE_GENERAL);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_W_ADDH, S5K6AAFX_ADDH_SW_REG_INT);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr, S5K6AAFX_REG_W_ADDL, 0x100E);
+
+ for (i = 0; i < 32; i++) {
+ CDBG("write table[%d]=%x\n", i, weight_table[i]);
+ s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, weight_table[i]);
+ }
+
+ return 0;
+}
+#endif
+
+static int s5k6aafx_sensor_read_id(const struct msm_camera_sensor_info *data)
+{
+ uint16_t model_id;
+ int rc = 0;
+
+ pr_info("s5k6aafx_sensor_read_id\n");
+ /* Read the Model ID of the sensor */
+ rc = s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_I2C_MODE, S5K6AAFX_I2C_MODE_GENERAL);
+ if (rc < 0)
+ goto init_probe_fail;
+ rc = s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_R_ADDH, S5K6AAFX_ADDH_SW_REG_INT);
+ if (rc < 0)
+ goto init_probe_fail;
+ rc = s5k6aafx_i2c_write(s5k6aafx_client->addr,
+ S5K6AAFX_REG_R_ADDL, S5K6AAFX_REG_MODEL_ID);
+ if (rc < 0)
+ goto init_probe_fail;
+ rc = s5k6aafx_i2c_read(s5k6aafx_client->addr,
+ S5K6AAFX_REG_WR, &model_id);
+ if (rc < 0)
+ goto init_probe_fail;
+
+ pr_info("s5k6aafx: model_id = 0x%x\n", model_id);
+ /* Check if it matches it with the value in Datasheet */
+ if (model_id != S5K6AAFX_MODEL_ID) {
+ pr_info("invalid model id\n");
+ rc = -EINVAL;
+ goto init_probe_fail;
+ }
+
+init_probe_fail:
+ return rc;
+
+}
+
+int s5k6aafx_sensor_open_init(struct msm_camera_sensor_info *data)
+{
+ int rc = 0;
+ s5k6aafx_ctrl = kzalloc(sizeof(struct s5k6aafx_ctrl), GFP_KERNEL);
+ if (!s5k6aafx_ctrl) {
+ pr_info("s5k6aafx_init failed!\n");
+ rc = -ENOMEM;
+ goto init_done;
+ }
+
+ if (data == NULL) {
+ pr_err("%s sensor data is NULL\n", __func__);
+ return -EINVAL;
+ }
+ s5k6aafx_ctrl->sensordata = data;
+
+
+ if (s5k6aafx_gpio_pull(data->sensor_pwd, 1) < 0)
+ goto init_fail;
+ mdelay(1);
+
+ /*switch PCLK and MCLK to 2nd cam*/
+ pr_info("s5k6aafx: s5k6aafx_sensor_probe switch clk\n");
+ if(data->camera_clk_switch != NULL)
+ data->camera_clk_switch();
+
+ /*MCLK enable*/
+ pr_info("s5k6aafx: MCLK enable clk\n");
+ msm_camio_probe_on(s5k6aafx_pdev);
+ mdelay(3);
+
+ if (s5k6aafx_gpio_pull(data->sensor_reset, 1) < 0)
+ goto init_fail;
+ mdelay(10);
+ msm_camio_camif_pad_reg_reset();
+ /*reset sensor*/
+ rc = s5k6aafx_i2c_write_table(&s5k6aafx_regs.reset_init[0],
+ s5k6aafx_regs.reset_init_size);
+ if (rc < 0)
+ goto init_fail;
+ mdelay(100);
+
+ /*T&P setting*/
+ rc = s5k6aafx_i2c_write_table(&s5k6aafx_regs.TP_init[0],
+ s5k6aafx_regs.TP_init_size);
+ if (rc < 0)
+ goto init_fail;
+
+ /*analog setting*/
+ rc = s5k6aafx_i2c_write_table(&s5k6aafx_regs.analog_setting_init[0],
+ s5k6aafx_regs.analog_setting_init_size);
+ if (rc < 0)
+ goto init_fail;
+ mdelay(10);
+
+ /*set initial register*/
+ rc = s5k6aafx_i2c_write_table(&s5k6aafx_regs.register_init[0],
+ s5k6aafx_regs.register_init_size);
+ if (rc < 0)
+ goto init_fail;
+
+ /*set clock*/
+ rc = s5k6aafx_i2c_write_table(&s5k6aafx_regs.clk_init[0],
+ s5k6aafx_regs.clk_init_size);
+
+ if (rc < 0)
+ goto init_fail;
+ mdelay(100);
+
+ /* preview configuration */
+ rc = s5k6aafx_i2c_write_table(&s5k6aafx_regs.prev_snap_conf_init[0],
+ s5k6aafx_regs.prev_snap_conf_init_size);
+
+ if (rc < 0)
+ goto init_fail;
+
+ rc = s5k6aafx_sensor_read_id(data);
+ if (rc < 0)
+ goto init_fail;
+
+ previous_mirror_mode = -1;
+init_done:
+ return rc;
+
+init_fail:
+ kfree(s5k6aafx_ctrl);
+ return rc;
+}
+
+static int s5k6aafx_init_client(struct i2c_client *client)
+{
+ /* Initialize the MSM_CAMI2C Chip */
+ init_waitqueue_head(&s5k6aafx_wait_queue);
+ return 0;
+}
+
+int s5k6aafx_sensor_config(void __user *argp)
+{
+ struct sensor_cfg_data cfg_data;
+ long rc = 0;
+ if (copy_from_user(&cfg_data,
+ (void *)argp, sizeof(struct sensor_cfg_data)))
+ return -EFAULT;
+
+ switch (cfg_data.cfgtype) {
+ case CFG_SET_MODE:
+ rc = s5k6aafx_set_sensor_mode(cfg_data.mode);
+ break;
+ case CFG_SET_EFFECT:
+ rc = s5k6aafx_set_effect(cfg_data.cfg.effect);
+ break;
+ case CFG_SET_ANTIBANDING:
+ rc = s5k6aafx_set_antibanding
+ (cfg_data.cfg.antibanding_value);
+ break;
+ case CFG_SET_BRIGHTNESS:
+ rc = s5k6aafx_set_brightness
+ (cfg_data.cfg.brightness_value);
+ break;
+ case CFG_SET_WB:
+ rc = s5k6aafx_set_wb(cfg_data.cfg.wb_value);
+ break;
+ case CFG_SET_SHARPNESS:
+ rc = s5k6aafx_set_sharpness
+ (cfg_data.cfg.sharpness_value);
+ break;
+ case CFG_SET_SATURATION:
+ rc = s5k6aafx_set_saturation
+ (cfg_data.cfg.saturation_value);
+ break;
+ case CFG_SET_CONTRAST:
+ rc = s5k6aafx_set_contrast(cfg_data.cfg.contrast_value);
+ break;
+ case CFG_SET_FRONT_CAMERA_MODE:
+ rc = s5k6aafx_set_front_camera_mode(cfg_data.cfg.frontcam_value);
+ break;
+#if 0
+ case CFG_SET_EXPOSURE_MODE:
+ rc = s5k6aafx_set_metering_mode
+ (cfg_data.cfg.metering_value);
+ break;
+#endif
+ default:
+ rc = -EINVAL;
+ break;
+ }
+
+ return rc;
+}
+
+int s5k6aafx_sensor_release(void)
+{
+ int rc = 0;
+ down(&s5k6aafx_sem);
+ rc = s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x022e, 0x01);
+ rc = s5k6aafx_i2c_write(s5k6aafx_client->addr, 0x0230, 0x01);
+ mdelay(133);
+
+ if (s5k6aafx_ctrl)
+ s5k6aafx_gpio_pull(s5k6aafx_ctrl->sensordata->sensor_reset, 0);
+ mdelay(1);
+ msm_camio_probe_off(s5k6aafx_pdev);
+ mdelay(1);
+ if (s5k6aafx_ctrl)
+ s5k6aafx_gpio_pull(s5k6aafx_ctrl->sensordata->sensor_pwd, 0);
+
+ if (s5k6aafx_ctrl) {
+ kfree(s5k6aafx_ctrl);
+ s5k6aafx_ctrl = NULL;
+ }
+
+ up(&s5k6aafx_sem);
+
+ return rc;
+}
+
+static const char *S5K6AAFXVendor = "Samsung";
+static const char *S5K6AAFXNAME = "s5k6aafx";
+static const char *S5K6AAFXSize = "1M";
+static uint32_t htcwc_value;
+
+static ssize_t sensor_vendor_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t ret = 0;
+
+ sprintf(buf, "%s %s %s\n", S5K6AAFXVendor, S5K6AAFXNAME, S5K6AAFXSize);
+ ret = strlen(buf) + 1;
+
+ return ret;
+}
+
+static ssize_t htcwc_get(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t length;
+ length = sprintf(buf, "%d\n", htcwc_value);
+ return length;
+}
+
+static ssize_t htcwc_set(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ uint32_t tmp = 0;
+
+ tmp = buf[0] - 0x30; /* only get the first char */
+
+#if 0
+ if (strcmp(current->comm,"com.android.camera")!=0){
+ pr_info("No permission : not camera ap\n");
+ return -EINVAL;
+ }
+#endif
+
+ htcwc_value = tmp;
+ //pr_info("current_comm = %s\n", current->comm);
+ pr_info("htcwc_value = %d\n", htcwc_value);
+ return count;
+}
+
+static ssize_t sensor_read_node(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t length;
+ length = sprintf(buf, "%d\n", sensor_probe_node);
+ return length;
+}
+
+static DEVICE_ATTR(sensor, 0444, sensor_vendor_show, NULL);
+static DEVICE_ATTR(htcwc, 0777, htcwc_get, htcwc_set);
+static DEVICE_ATTR(node, 0444, sensor_read_node, NULL);
+
+static struct kobject *android_s5k6aafx;
+
+static int s5k6aafx_sysfs_init(void)
+{
+ int ret ;
+ pr_info("s5k6aafx:kobject creat and add\n");
+ android_s5k6aafx = kobject_create_and_add("android_camera2", NULL);
+ if (android_s5k6aafx == NULL) {
+ pr_info("s5k6aafx_sysfs_init: subsystem_register " \
+ "failed\n");
+ ret = -ENOMEM;
+ return ret ;
+ }
+ pr_info("s5k6aafx:sysfs_create_file\n");
+ ret = sysfs_create_file(android_s5k6aafx, &dev_attr_sensor.attr);
+ if (ret) {
+ pr_info("s5k6aafx_sysfs_init: sysfs_create_file " \
+ "failed\n");
+ kobject_del(android_s5k6aafx);
+ }
+
+ ret = sysfs_create_file(android_s5k6aafx, &dev_attr_htcwc.attr);
+ if (ret) {
+ pr_info("s5k6aafx_sysfs_init: sysfs_create_file htcwc failed\n");
+ kobject_del(android_s5k6aafx);
+ }
+
+ ret = sysfs_create_file(android_s5k6aafx, &dev_attr_node.attr);
+ if (ret) {
+ pr_info("s5k6aafx_sysfs_init: dev_attr_node failed\n");
+ kobject_del(android_s5k6aafx);
+ }
+
+ return 0 ;
+}
+
+
+static int s5k6aafx_i2c_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ int rc = 0;
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ rc = -ENOTSUPP;
+ goto probe_failure;
+ }
+
+ s5k6aafx_sensorw = kzalloc(sizeof(struct s5k6aafx_work), GFP_KERNEL);
+
+ if (!s5k6aafx_sensorw) {
+ rc = -ENOMEM;
+ goto probe_failure;
+ }
+
+ i2c_set_clientdata(client, s5k6aafx_sensorw);
+ s5k6aafx_init_client(client);
+ s5k6aafx_client = client;
+
+ pr_info("s5k6aafx_probe succeeded!\n");
+
+ return 0;
+
+probe_failure:
+ kfree(s5k6aafx_sensorw);
+ s5k6aafx_sensorw = NULL;
+ pr_info("s5k6aafx_probe failed!\n");
+ return rc;
+}
+
+static const struct i2c_device_id s5k6aafx_i2c_id[] = {
+ {"s5k6aafx", 0},
+ {},
+};
+
+static struct i2c_driver s5k6aafx_i2c_driver = {
+ .id_table = s5k6aafx_i2c_id,
+ .probe = s5k6aafx_i2c_probe,
+ .remove = __exit_p(s5k6aafx_i2c_remove),
+ .driver = {
+ .name = "s5k6aafx",
+ },
+};
+
+static int s5k6aafx_sensor_probe(struct msm_camera_sensor_info *info,
+ struct msm_sensor_ctrl *s)
+{
+ int rc = i2c_add_driver(&s5k6aafx_i2c_driver);
+ if (rc < 0 || s5k6aafx_client == NULL) {
+ rc = -ENOTSUPP;
+ goto probe_done;
+ }
+
+ pr_info("s5k6aafx s->node %d\n", s->node);
+ sensor_probe_node = s->node;
+ /*2nd camera pwd*/
+ if (s5k6aafx_gpio_pull(info->sensor_pwd, 1) < 0)
+ goto probe_fail;
+ /*main camera pwd*/
+ if (s5k6aafx_gpio_pull(105, 0) < 0)
+ goto probe_fail;
+ mdelay(5);
+
+ /*switch clk source*/
+ pr_info("s5k6aafx: s5k6aafx_sensor_probe switch clk\n");
+ if(info->camera_clk_switch != NULL)
+ info->camera_clk_switch();
+
+ /*MCLK enable*/
+ pr_info("s5k6aafx: MCLK enable clk\n");
+ msm_camio_probe_on(s5k6aafx_pdev);
+ mdelay(10);
+
+ if (s5k6aafx_gpio_pull(info->sensor_reset, 1) < 0)
+ goto probe_fail;
+ mdelay(10);
+
+ rc = s5k6aafx_sensor_read_id(info);
+ if (rc < 0)
+ goto probe_fail;
+ if (info->camera_main_set_probe != NULL)
+ info->camera_main_set_probe(true);
+ s->s_init = s5k6aafx_sensor_open_init;
+ s->s_release = s5k6aafx_sensor_release;
+ s->s_config = s5k6aafx_sensor_config;
+
+ /*init done*/
+ msm_camio_probe_off(s5k6aafx_pdev);
+
+ s5k6aafx_gpio_pull(info->sensor_pwd, 0);
+ mdelay(5);
+
+ s5k6aafx_sysfs_init();
+
+ mdelay(5);
+
+probe_done:
+ pr_info("%s %s:%d\n", __FILE__, __func__, __LINE__);
+ return rc;
+probe_fail:
+ msm_camio_probe_off(s5k6aafx_pdev);
+ pr_err("S5K6AAFX probe failed\n");
+ return rc;
+
+}
+
+static int __s5k6aafx_probe(struct platform_device *pdev)
+{
+ struct msm_camera_sensor_info *sdata = pdev->dev.platform_data;
+
+ s5k6aafx_pdev = pdev;
+ if (sdata->camera_main_get_probe != NULL) {
+ if (sdata->camera_main_get_probe()) {
+ pr_info("__s5k6aafx_probe camera main get probed already.\n");
+ return 0;
+ }
+ }
+ /*init reset /1 pwd/2pwd*/
+ s5k6aafx_gpio_pull(sdata->sensor_pwd, 0);
+ s5k6aafx_gpio_pull(105, 1);
+ mdelay(10);
+ s5k6aafx_gpio_pull(sdata->sensor_reset, 0);
+ return msm_camera_drv_start(pdev, s5k6aafx_sensor_probe);
+}
+
+static struct platform_driver msm_camera_driver = {
+ .probe = __s5k6aafx_probe,
+ .driver = {
+ .name = "msm_camera_s5k6aafx",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init s5k6aafx_init(void)
+{
+
+ return platform_driver_register(&msm_camera_driver);
+}
+
+module_init(s5k6aafx_init);
file:43d20b1d791b0dc27cd42c8d7a0b59df94b880c3(new)
--- /dev/null
+++ b/drivers/media/video/msm/s5k6aafx.h
@@ -0,0 +1,80 @@
+/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#ifndef S5K6AAFX_H
+#define S5K6AAFX_H
+
+#include <linux/types.h>
+#include <mach/camera.h>
+
+/* S5K6AAFX Registers and their values */
+/* Sensor Core Registers */
+#define S5K6AAFX_REG_I2C_MODE 0xFCFC
+#define S5K6AAFX_I2C_MODE_SENSOR 0x0000
+#define S5K6AAFX_I2C_MODE_GENERAL 0xD000
+
+#define S5K6AAFX_REG_MODEL_ID 0x0152
+#define S5K6AAFX_MODEL_ID 0x06AA
+
+/* Mode select register */
+#define S5K6AAFX_REG_MODE_SELECT 0x107E
+#define S5K6AAFX_MODE_SELECT_STREAM 0x0000
+#define S5K6AAFX_MODE_SELECT_SW_STANDBY 0x0001
+
+#define S5K6AAFX_ADDH_SW_REG_INT 0x7000
+#define S5K6AAFX_REG_W_ADDH 0x0028
+#define S5K6AAFX_REG_W_ADDL 0x002A
+#define S5K6AAFX_REG_R_ADDH 0x002C
+#define S5K6AAFX_REG_R_ADDL 0x002E
+#define S5K6AAFX_REG_WR 0x0F12
+
+#define S5K6AAFX_QTR_SIZE_WIDTH 0x0280
+#define S5K6AAFX_QTR_SIZE_HEIGHT 0x01E0
+#define S5K6AAFX_FULL_SIZE_WIDTH 0x0500
+#define S5K6AAFX_FULL_SIZE_HEIGHT 0x0400
+#define S5K6AAFX_ADJ_FULL_SIZE_WIDTH S5K6AAFX_QTR_SIZE_WIDTH*2
+#define S5K6AAFX_ADJ_FULL_SIZE_HEIGHT S5K6AAFX_QTR_SIZE_HEIGHT*2
+
+extern struct s5k6aafx_reg s5k6aafx_regs;
+
+struct s5k6aafx_i2c_reg_conf {
+ unsigned short waddr;
+ unsigned short wdata;
+};
+
+struct s5k6aafx_reg {
+ const struct s5k6aafx_i2c_reg_conf *reset_init;
+ uint16_t reset_init_size;
+ const struct s5k6aafx_i2c_reg_conf *TP_init;
+ uint16_t TP_init_size;
+ const struct s5k6aafx_i2c_reg_conf *analog_setting_init;
+ uint16_t analog_setting_init_size;
+ const struct s5k6aafx_i2c_reg_conf *register_init;
+ uint16_t register_init_size;
+ const struct s5k6aafx_i2c_reg_conf *clk_init;
+ uint16_t clk_init_size;
+ const struct s5k6aafx_i2c_reg_conf *prev_snap_conf_init;
+ uint16_t prev_snap_conf_init_size;
+ /* for full-size preview */
+ const struct s5k6aafx_i2c_reg_conf *clk_init_tb2;
+ uint16_t clk_init_tb2_size;
+ const struct s5k6aafx_i2c_reg_conf *prev_snap_conf_init_tb2;
+ uint16_t prev_snap_conf_init_tb2_size;
+};
+
+#endif /* S5K6AAFX_H */
file:fc54aa2035c62d7d09bc13a3913967fc6f730862(new)
--- /dev/null
+++ b/drivers/media/video/msm/s5k6aafx_reg_mecha.c
@@ -0,0 +1,2647 @@
+/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#include "s5k6aafx.h"
+
+static const struct s5k6aafx_i2c_reg_conf const reset_init_tbl[] = {
+ /* change to general mode */
+ {S5K6AAFX_REG_I2C_MODE, S5K6AAFX_I2C_MODE_GENERAL},
+ {0x0010, 0x0001}, /* Reset */
+ {0x1030, 0x0000}, /* Clear host interrupt so main will wait */
+ {0x0014, 0x0001}, /* ARM go */
+ /* delay 100ms */
+};
+
+static const struct s5k6aafx_i2c_reg_conf const TP_init_tbl[] = {
+
+ /* Start T&P part */
+ /* DO NOT DELETE T&P SECTION COMMENTS! They are required to debug T&P related issues. */
+ /* svn://transrdsrv/svn/svnroot/System/Software/tcevb/SDK+FW/ISP_Oscar/Firmware */
+ /* Rev: 33110-33110 */
+ /* Signature: */
+ /* md5 f0ba942df15b96de5c09e6cf13fed9c9 .btp */
+ /* md5 8bc59f72129cb36e6f6db4be5ddca1f6 .htp */
+ /* md5 954ec97efcabad291d89f63e29f32490 .RegsMap.h */
+ /* md5 5c29fe50b51e7e860313f5b3b6452bfd .RegsMap.bin */
+ /* md5 6211407baaa234b753431cde4ba32402 .base.RegsMap.h */
+ /* md5 90cc21d42cc5f02eb80b2586e5c46d9b .base.RegsMap.bin */
+
+ {S5K6AAFX_REG_W_ADDH, S5K6AAFX_ADDH_SW_REG_INT},
+ {S5K6AAFX_REG_W_ADDL, 0x1D60},
+ {S5K6AAFX_REG_WR, 0xB570},
+ {S5K6AAFX_REG_WR, 0x4936},
+ {S5K6AAFX_REG_WR, 0x4836},
+ {S5K6AAFX_REG_WR, 0x2205},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA4E},
+ {S5K6AAFX_REG_WR, 0x4935},
+ {S5K6AAFX_REG_WR, 0x2002},
+ {S5K6AAFX_REG_WR, 0x83C8},
+ {S5K6AAFX_REG_WR, 0x2001},
+ {S5K6AAFX_REG_WR, 0x3120},
+ {S5K6AAFX_REG_WR, 0x8088},
+ {S5K6AAFX_REG_WR, 0x4933},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0x8008},
+ {S5K6AAFX_REG_WR, 0x4933},
+ {S5K6AAFX_REG_WR, 0x8048},
+ {S5K6AAFX_REG_WR, 0x4933},
+ {S5K6AAFX_REG_WR, 0x4833},
+ {S5K6AAFX_REG_WR, 0x2204},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA3E},
+ {S5K6AAFX_REG_WR, 0x4932},
+ {S5K6AAFX_REG_WR, 0x4833},
+ {S5K6AAFX_REG_WR, 0x2206},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA39},
+ {S5K6AAFX_REG_WR, 0x4932},
+ {S5K6AAFX_REG_WR, 0x4832},
+ {S5K6AAFX_REG_WR, 0x2207},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA34},
+ {S5K6AAFX_REG_WR, 0x4931},
+ {S5K6AAFX_REG_WR, 0x4832},
+ {S5K6AAFX_REG_WR, 0x2208},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA2F},
+ {S5K6AAFX_REG_WR, 0x4931},
+ {S5K6AAFX_REG_WR, 0x4831},
+ {S5K6AAFX_REG_WR, 0x2209},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA2A},
+ {S5K6AAFX_REG_WR, 0x4930},
+ {S5K6AAFX_REG_WR, 0x4831},
+ {S5K6AAFX_REG_WR, 0x220A},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA25},
+ {S5K6AAFX_REG_WR, 0x4930},
+ {S5K6AAFX_REG_WR, 0x4830},
+ {S5K6AAFX_REG_WR, 0x220B},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA20},
+ {S5K6AAFX_REG_WR, 0x482F},
+ {S5K6AAFX_REG_WR, 0x4930},
+ {S5K6AAFX_REG_WR, 0x6108},
+ {S5K6AAFX_REG_WR, 0x4830},
+ {S5K6AAFX_REG_WR, 0x39FF},
+ {S5K6AAFX_REG_WR, 0x3901},
+ {S5K6AAFX_REG_WR, 0x6748},
+ {S5K6AAFX_REG_WR, 0x482F},
+ {S5K6AAFX_REG_WR, 0x1C0A},
+ {S5K6AAFX_REG_WR, 0x32C0},
+ {S5K6AAFX_REG_WR, 0x6390},
+ {S5K6AAFX_REG_WR, 0x482E},
+ {S5K6AAFX_REG_WR, 0x6708},
+ {S5K6AAFX_REG_WR, 0x491A},
+ {S5K6AAFX_REG_WR, 0x482D},
+ {S5K6AAFX_REG_WR, 0x3108},
+ {S5K6AAFX_REG_WR, 0x60C1},
+ {S5K6AAFX_REG_WR, 0x6882},
+ {S5K6AAFX_REG_WR, 0x1A51},
+ {S5K6AAFX_REG_WR, 0x8201},
+ {S5K6AAFX_REG_WR, 0x4C2B},
+ {S5K6AAFX_REG_WR, 0x2607},
+ {S5K6AAFX_REG_WR, 0x6821},
+ {S5K6AAFX_REG_WR, 0x0736},
+ {S5K6AAFX_REG_WR, 0x42B1},
+ {S5K6AAFX_REG_WR, 0xDA05},
+ {S5K6AAFX_REG_WR, 0x4829},
+ {S5K6AAFX_REG_WR, 0x22D8},
+ {S5K6AAFX_REG_WR, 0x1C05},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA09},
+ {S5K6AAFX_REG_WR, 0x6025},
+ {S5K6AAFX_REG_WR, 0x68A1},
+ {S5K6AAFX_REG_WR, 0x42B1},
+ {S5K6AAFX_REG_WR, 0xDA07},
+ {S5K6AAFX_REG_WR, 0x4825},
+ {S5K6AAFX_REG_WR, 0x2224},
+ {S5K6AAFX_REG_WR, 0x3824},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xFA00},
+ {S5K6AAFX_REG_WR, 0x4822},
+ {S5K6AAFX_REG_WR, 0x3824},
+ {S5K6AAFX_REG_WR, 0x60A0},
+ {S5K6AAFX_REG_WR, 0x4D22},
+ {S5K6AAFX_REG_WR, 0x6D29},
+ {S5K6AAFX_REG_WR, 0x42B1},
+ {S5K6AAFX_REG_WR, 0xDA07},
+ {S5K6AAFX_REG_WR, 0x481F},
+ {S5K6AAFX_REG_WR, 0x228F},
+ {S5K6AAFX_REG_WR, 0x00D2},
+ {S5K6AAFX_REG_WR, 0x30D8},
+ {S5K6AAFX_REG_WR, 0x1C04},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF9F2},
+ {S5K6AAFX_REG_WR, 0x652C},
+ {S5K6AAFX_REG_WR, 0xBC70},
+ {S5K6AAFX_REG_WR, 0xBC08},
+ {S5K6AAFX_REG_WR, 0x4718},
+ {S5K6AAFX_REG_WR, 0x218B},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x127B},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0398},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1376},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x2370},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1F0D},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x890D},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x1F2F},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x27A9},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x1FE1},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x27C5},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x2043},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x285F},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x2003},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x28FF},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x20CD},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x6181},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x20EF},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x6663},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x2123},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x0100},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1EC1},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1EAD},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1F79},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x04AC},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x06CC},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x23A4},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x0704},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0xB510},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF9B9},
+ {S5K6AAFX_REG_WR, 0x48C3},
+ {S5K6AAFX_REG_WR, 0x49C3},
+ {S5K6AAFX_REG_WR, 0x8800},
+ {S5K6AAFX_REG_WR, 0x8048},
+ {S5K6AAFX_REG_WR, 0xBC10},
+ {S5K6AAFX_REG_WR, 0xBC08},
+ {S5K6AAFX_REG_WR, 0x4718},
+ {S5K6AAFX_REG_WR, 0xB5F8},
+ {S5K6AAFX_REG_WR, 0x1C06},
+ {S5K6AAFX_REG_WR, 0x4DC0},
+ {S5K6AAFX_REG_WR, 0x68AC},
+ {S5K6AAFX_REG_WR, 0x1C30},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF9B3},
+ {S5K6AAFX_REG_WR, 0x68A9},
+ {S5K6AAFX_REG_WR, 0x4ABC},
+ {S5K6AAFX_REG_WR, 0x42A1},
+ {S5K6AAFX_REG_WR, 0xD003},
+ {S5K6AAFX_REG_WR, 0x4BBD},
+ {S5K6AAFX_REG_WR, 0x8A1B},
+ {S5K6AAFX_REG_WR, 0x3301},
+ {S5K6AAFX_REG_WR, 0x8013},
+ {S5K6AAFX_REG_WR, 0x8813},
+ {S5K6AAFX_REG_WR, 0x1C14},
+ {S5K6AAFX_REG_WR, 0x2B00},
+ {S5K6AAFX_REG_WR, 0xD00F},
+ {S5K6AAFX_REG_WR, 0x2201},
+ {S5K6AAFX_REG_WR, 0x4281},
+ {S5K6AAFX_REG_WR, 0xD003},
+ {S5K6AAFX_REG_WR, 0x8C2F},
+ {S5K6AAFX_REG_WR, 0x42B9},
+ {S5K6AAFX_REG_WR, 0xD300},
+ {S5K6AAFX_REG_WR, 0x2200},
+ {S5K6AAFX_REG_WR, 0x60AE},
+ {S5K6AAFX_REG_WR, 0x2A00},
+ {S5K6AAFX_REG_WR, 0xD003},
+ {S5K6AAFX_REG_WR, 0x8C28},
+ {S5K6AAFX_REG_WR, 0x42B0},
+ {S5K6AAFX_REG_WR, 0xD800},
+ {S5K6AAFX_REG_WR, 0x1C30},
+ {S5K6AAFX_REG_WR, 0x1E59},
+ {S5K6AAFX_REG_WR, 0x8021},
+ {S5K6AAFX_REG_WR, 0xBCF8},
+ {S5K6AAFX_REG_WR, 0xBC08},
+ {S5K6AAFX_REG_WR, 0x4718},
+ {S5K6AAFX_REG_WR, 0xB510},
+ {S5K6AAFX_REG_WR, 0x1C04},
+ {S5K6AAFX_REG_WR, 0x48AF},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF997},
+ {S5K6AAFX_REG_WR, 0x4AAD},
+ {S5K6AAFX_REG_WR, 0x4BAE},
+ {S5K6AAFX_REG_WR, 0x8811},
+ {S5K6AAFX_REG_WR, 0x885B},
+ {S5K6AAFX_REG_WR, 0x8852},
+ {S5K6AAFX_REG_WR, 0x4359},
+ {S5K6AAFX_REG_WR, 0x1889},
+ {S5K6AAFX_REG_WR, 0x4288},
+ {S5K6AAFX_REG_WR, 0xD800},
+ {S5K6AAFX_REG_WR, 0x1C08},
+ {S5K6AAFX_REG_WR, 0x6020},
+ {S5K6AAFX_REG_WR, 0xE7C5},
+ {S5K6AAFX_REG_WR, 0xB570},
+ {S5K6AAFX_REG_WR, 0x1C05},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF98F},
+ {S5K6AAFX_REG_WR, 0x49A5},
+ {S5K6AAFX_REG_WR, 0x8989},
+ {S5K6AAFX_REG_WR, 0x4348},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0x0C00},
+ {S5K6AAFX_REG_WR, 0x2101},
+ {S5K6AAFX_REG_WR, 0x0349},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF98E},
+ {S5K6AAFX_REG_WR, 0x1C04},
+ {S5K6AAFX_REG_WR, 0x489F},
+ {S5K6AAFX_REG_WR, 0x8F80},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF991},
+ {S5K6AAFX_REG_WR, 0x1C01},
+ {S5K6AAFX_REG_WR, 0x20FF},
+ {S5K6AAFX_REG_WR, 0x43C0},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF994},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF998},
+ {S5K6AAFX_REG_WR, 0x1C01},
+ {S5K6AAFX_REG_WR, 0x4898},
+ {S5K6AAFX_REG_WR, 0x8840},
+ {S5K6AAFX_REG_WR, 0x4360},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0x0C00},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF97A},
+ {S5K6AAFX_REG_WR, 0x6028},
+ {S5K6AAFX_REG_WR, 0xBC70},
+ {S5K6AAFX_REG_WR, 0xBC08},
+ {S5K6AAFX_REG_WR, 0x4718},
+ {S5K6AAFX_REG_WR, 0xB5F1},
+ {S5K6AAFX_REG_WR, 0xB082},
+ {S5K6AAFX_REG_WR, 0x4D96},
+ {S5K6AAFX_REG_WR, 0x4E91},
+ {S5K6AAFX_REG_WR, 0x88A8},
+ {S5K6AAFX_REG_WR, 0x1C2C},
+ {S5K6AAFX_REG_WR, 0x3420},
+ {S5K6AAFX_REG_WR, 0x4F90},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0xD018},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF988},
+ {S5K6AAFX_REG_WR, 0x9001},
+ {S5K6AAFX_REG_WR, 0x9802},
+ {S5K6AAFX_REG_WR, 0x6B39},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF974},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF978},
+ {S5K6AAFX_REG_WR, 0x9901},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF95F},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0x8871},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF96A},
+ {S5K6AAFX_REG_WR, 0x0400},
+ {S5K6AAFX_REG_WR, 0x0C00},
+ {S5K6AAFX_REG_WR, 0x21FF},
+ {S5K6AAFX_REG_WR, 0x3101},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF97A},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0x88E8},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0xD00A},
+ {S5K6AAFX_REG_WR, 0x4980},
+ {S5K6AAFX_REG_WR, 0x8820},
+ {S5K6AAFX_REG_WR, 0x3128},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF979},
+ {S5K6AAFX_REG_WR, 0x8D38},
+ {S5K6AAFX_REG_WR, 0x8871},
+ {S5K6AAFX_REG_WR, 0x4348},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0x0C00},
+ {S5K6AAFX_REG_WR, 0x8538},
+ {S5K6AAFX_REG_WR, 0xBCFE},
+ {S5K6AAFX_REG_WR, 0xBC08},
+ {S5K6AAFX_REG_WR, 0x4718},
+ {S5K6AAFX_REG_WR, 0xB510},
+ {S5K6AAFX_REG_WR, 0x1C04},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF974},
+ {S5K6AAFX_REG_WR, 0x6821},
+ {S5K6AAFX_REG_WR, 0x0409},
+ {S5K6AAFX_REG_WR, 0x0C09},
+ {S5K6AAFX_REG_WR, 0x1A40},
+ {S5K6AAFX_REG_WR, 0x4976},
+ {S5K6AAFX_REG_WR, 0x6849},
+ {S5K6AAFX_REG_WR, 0x4281},
+ {S5K6AAFX_REG_WR, 0xD800},
+ {S5K6AAFX_REG_WR, 0x1C08},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF971},
+ {S5K6AAFX_REG_WR, 0x6020},
+ {S5K6AAFX_REG_WR, 0xE75B},
+ {S5K6AAFX_REG_WR, 0xB570},
+ {S5K6AAFX_REG_WR, 0x6801},
+ {S5K6AAFX_REG_WR, 0x040D},
+ {S5K6AAFX_REG_WR, 0x0C2D},
+ {S5K6AAFX_REG_WR, 0x6844},
+ {S5K6AAFX_REG_WR, 0x486F},
+ {S5K6AAFX_REG_WR, 0x8981},
+ {S5K6AAFX_REG_WR, 0x1C28},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF927},
+ {S5K6AAFX_REG_WR, 0x8060},
+ {S5K6AAFX_REG_WR, 0x4970},
+ {S5K6AAFX_REG_WR, 0x69C9},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF968},
+ {S5K6AAFX_REG_WR, 0x1C01},
+ {S5K6AAFX_REG_WR, 0x80A0},
+ {S5K6AAFX_REG_WR, 0x0228},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF92D},
+ {S5K6AAFX_REG_WR, 0x0400},
+ {S5K6AAFX_REG_WR, 0x0C00},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0x496B},
+ {S5K6AAFX_REG_WR, 0x2300},
+ {S5K6AAFX_REG_WR, 0x5EC9},
+ {S5K6AAFX_REG_WR, 0x4288},
+ {S5K6AAFX_REG_WR, 0xDA02},
+ {S5K6AAFX_REG_WR, 0x20FF},
+ {S5K6AAFX_REG_WR, 0x3001},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xE797},
+ {S5K6AAFX_REG_WR, 0xB5F8},
+ {S5K6AAFX_REG_WR, 0x1C04},
+ {S5K6AAFX_REG_WR, 0x4867},
+ {S5K6AAFX_REG_WR, 0x4E65},
+ {S5K6AAFX_REG_WR, 0x7800},
+ {S5K6AAFX_REG_WR, 0x6AB7},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0xD100},
+ {S5K6AAFX_REG_WR, 0x6A37},
+ {S5K6AAFX_REG_WR, 0x495D},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0x688D},
+ {S5K6AAFX_REG_WR, 0xD100},
+ {S5K6AAFX_REG_WR, 0x684D},
+ {S5K6AAFX_REG_WR, 0x4859},
+ {S5K6AAFX_REG_WR, 0x8841},
+ {S5K6AAFX_REG_WR, 0x6820},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF94B},
+ {S5K6AAFX_REG_WR, 0x8DF1},
+ {S5K6AAFX_REG_WR, 0x434F},
+ {S5K6AAFX_REG_WR, 0x0A3A},
+ {S5K6AAFX_REG_WR, 0x4282},
+ {S5K6AAFX_REG_WR, 0xD30C},
+ {S5K6AAFX_REG_WR, 0x4D5C},
+ {S5K6AAFX_REG_WR, 0x26FF},
+ {S5K6AAFX_REG_WR, 0x8829},
+ {S5K6AAFX_REG_WR, 0x3601},
+ {S5K6AAFX_REG_WR, 0x43B1},
+ {S5K6AAFX_REG_WR, 0x8029},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF944},
+ {S5K6AAFX_REG_WR, 0x6020},
+ {S5K6AAFX_REG_WR, 0x8828},
+ {S5K6AAFX_REG_WR, 0x4330},
+ {S5K6AAFX_REG_WR, 0x8028},
+ {S5K6AAFX_REG_WR, 0xE73B},
+ {S5K6AAFX_REG_WR, 0x1C0A},
+ {S5K6AAFX_REG_WR, 0x436A},
+ {S5K6AAFX_REG_WR, 0x0A12},
+ {S5K6AAFX_REG_WR, 0x4282},
+ {S5K6AAFX_REG_WR, 0xD304},
+ {S5K6AAFX_REG_WR, 0x0200},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF8F3},
+ {S5K6AAFX_REG_WR, 0x6020},
+ {S5K6AAFX_REG_WR, 0xE7F4},
+ {S5K6AAFX_REG_WR, 0x6025},
+ {S5K6AAFX_REG_WR, 0xE7F2},
+ {S5K6AAFX_REG_WR, 0xB410},
+ {S5K6AAFX_REG_WR, 0x4848},
+ {S5K6AAFX_REG_WR, 0x4950},
+ {S5K6AAFX_REG_WR, 0x89C0},
+ {S5K6AAFX_REG_WR, 0x2316},
+ {S5K6AAFX_REG_WR, 0x5ECC},
+ {S5K6AAFX_REG_WR, 0x1C02},
+ {S5K6AAFX_REG_WR, 0x42A0},
+ {S5K6AAFX_REG_WR, 0xDC00},
+ {S5K6AAFX_REG_WR, 0x1C22},
+ {S5K6AAFX_REG_WR, 0x82CA},
+ {S5K6AAFX_REG_WR, 0x2318},
+ {S5K6AAFX_REG_WR, 0x5ECA},
+ {S5K6AAFX_REG_WR, 0x4290},
+ {S5K6AAFX_REG_WR, 0xDC00},
+ {S5K6AAFX_REG_WR, 0x1C10},
+ {S5K6AAFX_REG_WR, 0x8308},
+ {S5K6AAFX_REG_WR, 0xBC10},
+ {S5K6AAFX_REG_WR, 0x4770},
+ {S5K6AAFX_REG_WR, 0xB570},
+ {S5K6AAFX_REG_WR, 0x1C06},
+ {S5K6AAFX_REG_WR, 0x4C45},
+ {S5K6AAFX_REG_WR, 0x2501},
+ {S5K6AAFX_REG_WR, 0x8820},
+ {S5K6AAFX_REG_WR, 0x02AD},
+ {S5K6AAFX_REG_WR, 0x43A8},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF91E},
+ {S5K6AAFX_REG_WR, 0x6030},
+ {S5K6AAFX_REG_WR, 0xF7FF},
+ {S5K6AAFX_REG_WR, 0xFFE0},
+ {S5K6AAFX_REG_WR, 0x8820},
+ {S5K6AAFX_REG_WR, 0x4328},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xE741},
+ {S5K6AAFX_REG_WR, 0xB570},
+ {S5K6AAFX_REG_WR, 0x4C3D},
+ {S5K6AAFX_REG_WR, 0x2501},
+ {S5K6AAFX_REG_WR, 0x8820},
+ {S5K6AAFX_REG_WR, 0x02ED},
+ {S5K6AAFX_REG_WR, 0x43A8},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF916},
+ {S5K6AAFX_REG_WR, 0xF7FF},
+ {S5K6AAFX_REG_WR, 0xFFD1},
+ {S5K6AAFX_REG_WR, 0x8820},
+ {S5K6AAFX_REG_WR, 0x4328},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xE732},
+ {S5K6AAFX_REG_WR, 0x230D},
+ {S5K6AAFX_REG_WR, 0x071B},
+ {S5K6AAFX_REG_WR, 0x18C3},
+ {S5K6AAFX_REG_WR, 0x8818},
+ {S5K6AAFX_REG_WR, 0x2A00},
+ {S5K6AAFX_REG_WR, 0xD001},
+ {S5K6AAFX_REG_WR, 0x4308},
+ {S5K6AAFX_REG_WR, 0xE000},
+ {S5K6AAFX_REG_WR, 0x4388},
+ {S5K6AAFX_REG_WR, 0x8018},
+ {S5K6AAFX_REG_WR, 0x4770},
+ {S5K6AAFX_REG_WR, 0xB570},
+ {S5K6AAFX_REG_WR, 0x2402},
+ {S5K6AAFX_REG_WR, 0x4932},
+ {S5K6AAFX_REG_WR, 0x8809},
+ {S5K6AAFX_REG_WR, 0x078A},
+ {S5K6AAFX_REG_WR, 0xD500},
+ {S5K6AAFX_REG_WR, 0x2406},
+ {S5K6AAFX_REG_WR, 0x2900},
+ {S5K6AAFX_REG_WR, 0xD01F},
+ {S5K6AAFX_REG_WR, 0x1C02},
+ {S5K6AAFX_REG_WR, 0x207D},
+ {S5K6AAFX_REG_WR, 0x00C0},
+ {S5K6AAFX_REG_WR, 0x2600},
+ {S5K6AAFX_REG_WR, 0x4D2D},
+ {S5K6AAFX_REG_WR, 0x2A00},
+ {S5K6AAFX_REG_WR, 0xD019},
+ {S5K6AAFX_REG_WR, 0x2101},
+ {S5K6AAFX_REG_WR, 0x8229},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF8F9},
+ {S5K6AAFX_REG_WR, 0x2200},
+ {S5K6AAFX_REG_WR, 0x2101},
+ {S5K6AAFX_REG_WR, 0x482A},
+ {S5K6AAFX_REG_WR, 0x0309},
+ {S5K6AAFX_REG_WR, 0xF7FF},
+ {S5K6AAFX_REG_WR, 0xFFDB},
+ {S5K6AAFX_REG_WR, 0x2008},
+ {S5K6AAFX_REG_WR, 0x4304},
+ {S5K6AAFX_REG_WR, 0x1C21},
+ {S5K6AAFX_REG_WR, 0x4C26},
+ {S5K6AAFX_REG_WR, 0x2200},
+ {S5K6AAFX_REG_WR, 0x3C14},
+ {S5K6AAFX_REG_WR, 0x1C20},
+ {S5K6AAFX_REG_WR, 0xF7FF},
+ {S5K6AAFX_REG_WR, 0xFFD2},
+ {S5K6AAFX_REG_WR, 0x2200},
+ {S5K6AAFX_REG_WR, 0x2121},
+ {S5K6AAFX_REG_WR, 0x1C20},
+ {S5K6AAFX_REG_WR, 0xF7FF},
+ {S5K6AAFX_REG_WR, 0xFFCD},
+ {S5K6AAFX_REG_WR, 0x802E},
+ {S5K6AAFX_REG_WR, 0xE6FD},
+ {S5K6AAFX_REG_WR, 0x822E},
+ {S5K6AAFX_REG_WR, 0x0789},
+ {S5K6AAFX_REG_WR, 0x0FC9},
+ {S5K6AAFX_REG_WR, 0x0089},
+ {S5K6AAFX_REG_WR, 0x223B},
+ {S5K6AAFX_REG_WR, 0x4311},
+ {S5K6AAFX_REG_WR, 0x8029},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF8DA},
+ {S5K6AAFX_REG_WR, 0xE7F4},
+ {S5K6AAFX_REG_WR, 0xB510},
+ {S5K6AAFX_REG_WR, 0x491B},
+ {S5K6AAFX_REG_WR, 0x8FC8},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0xD007},
+ {S5K6AAFX_REG_WR, 0x2000},
+ {S5K6AAFX_REG_WR, 0x87C8},
+ {S5K6AAFX_REG_WR, 0x8F88},
+ {S5K6AAFX_REG_WR, 0x4C19},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0xD002},
+ {S5K6AAFX_REG_WR, 0x2008},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xE689},
+ {S5K6AAFX_REG_WR, 0x4815},
+ {S5K6AAFX_REG_WR, 0x3060},
+ {S5K6AAFX_REG_WR, 0x8900},
+ {S5K6AAFX_REG_WR, 0x2800},
+ {S5K6AAFX_REG_WR, 0xD103},
+ {S5K6AAFX_REG_WR, 0x4814},
+ {S5K6AAFX_REG_WR, 0x2101},
+ {S5K6AAFX_REG_WR, 0xF000},
+ {S5K6AAFX_REG_WR, 0xF8CA},
+ {S5K6AAFX_REG_WR, 0x2010},
+ {S5K6AAFX_REG_WR, 0x8020},
+ {S5K6AAFX_REG_WR, 0xE7F2},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x1376},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x2370},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x14D8},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x235C},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0xF4B0},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x1554},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1AB8},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x0080},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x046C},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x0468},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x1100},
+ {S5K6AAFX_REG_WR, 0xD000},
+ {S5K6AAFX_REG_WR, 0x198C},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x0AC4},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0xB0A0},
+ {S5K6AAFX_REG_WR, 0xD000},
+ {S5K6AAFX_REG_WR, 0xB0B4},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x01B8},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x044E},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x0450},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x9CE7},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xF004},
+ {S5K6AAFX_REG_WR, 0xE51F},
+ {S5K6AAFX_REG_WR, 0x9FB8},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x14C1},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x27E1},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x88DF},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x275D},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x1ED3},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x27C5},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xF004},
+ {S5K6AAFX_REG_WR, 0xE51F},
+ {S5K6AAFX_REG_WR, 0xA144},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x1F87},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x27A9},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x1ECB},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x28FF},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x26F9},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x4027},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x9F03},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xF004},
+ {S5K6AAFX_REG_WR, 0xE51F},
+ {S5K6AAFX_REG_WR, 0x9D9C},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x285F},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x6181},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x6663},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x85D9},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x4778},
+ {S5K6AAFX_REG_WR, 0x46C0},
+ {S5K6AAFX_REG_WR, 0xC000},
+ {S5K6AAFX_REG_WR, 0xE59F},
+ {S5K6AAFX_REG_WR, 0xFF1C},
+ {S5K6AAFX_REG_WR, 0xE12F},
+ {S5K6AAFX_REG_WR, 0x2001},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xE848},
+ {S5K6AAFX_REG_WR, 0x0001},
+ {S5K6AAFX_REG_WR, 0xE848},
+ {S5K6AAFX_REG_WR, 0x0001},
+ {S5K6AAFX_REG_WR, 0x0500},
+ {S5K6AAFX_REG_WR, 0x0064},
+ {S5K6AAFX_REG_WR, 0x0002},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ /* End T&P part */
+};
+
+static const struct s5k6aafx_i2c_reg_conf const analog_setting_init_tbl[] = {
+ /* Start tuning part */
+
+ /* Analog Settings */
+ {S5K6AAFX_REG_W_ADDL, 0x1102},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x1108},
+ {S5K6AAFX_REG_WR, 0x0090},
+
+ {0xF40C, 0x0060},
+
+ {S5K6AAFX_REG_W_ADDL, 0x11B6},
+ {S5K6AAFX_REG_WR, 0x0020},
+ {S5K6AAFX_REG_WR, 0x0010},
+ {S5K6AAFX_REG_WR, 0x0008},
+ {S5K6AAFX_REG_WR, 0x0004},
+
+ {S5K6AAFX_REG_W_ADDL, 0x119C},
+ {S5K6AAFX_REG_WR, 0x0040},
+
+ {S5K6AAFX_REG_W_ADDL, 0x07B6},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0002},
+ {S5K6AAFX_REG_WR, 0x0003},
+ {S5K6AAFX_REG_WR, 0x0006},
+ {S5K6AAFX_REG_WR, 0x000C},
+ {S5K6AAFX_REG_WR, 0x0018},
+
+ {0x1000, 0x0001}, /* Set host interrupt so main start run */
+
+ /* delay 10ms */
+
+};
+
+static const struct s5k6aafx_i2c_reg_conf const register_init_tbl[] = {
+// Start user init script
+
+// End user init script
+
+ /* param_start - TVAR_ash_GASAlpha */
+ /* parawrite _start - TVAR_ash_GASAlpha */
+ {S5K6AAFX_REG_W_ADDL, 0x0712},
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[0] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[1] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[2] */
+ {S5K6AAFX_REG_WR, 0x00B0}, /* TVAR_ash_GASAlpha[3] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[4] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[5] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[6] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[7] */
+ {S5K6AAFX_REG_WR, 0x00C8}, /* TVAR_ash_GASAlpha[8] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[9] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[10] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[11] */
+ {S5K6AAFX_REG_WR, 0x00D8}, /* TVAR_ash_GASAlpha[12] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[13] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[14] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[15] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[16] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[17] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[18] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[19] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[20] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[21] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[22] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[23] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[24] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[25] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[26] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_GASAlpha[27] */
+ /* parawrite _end - TVAR_ash_GASAlpha */
+
+ /* parawrite _start - TVAR_ash_GASOutdoorAlpha */
+ {S5K6AAFX_REG_W_ADDL, 0x074A},
+ {S5K6AAFX_REG_WR, 0x00FB}, //TVAR_ash_GASOutdoorAlpha[0]
+ {S5K6AAFX_REG_WR, 0x00FF}, //TVAR_ash_GASOutdoorAlpha[1]
+ {S5K6AAFX_REG_WR, 0x00F9}, //TVAR_ash_GASOutdoorAlpha[2]
+ {S5K6AAFX_REG_WR, 0x0104}, //TVAR_ash_GASOutdoorAlpha[3]
+ /* parawrite _end - TVAR_ash_GASOutdoorAlpha */
+
+ {S5K6AAFX_REG_W_ADDL, 0x075A},
+ {S5K6AAFX_REG_WR, 0x0001}, /* ash_bParabolicEstiwrite ation */
+ {S5K6AAFX_REG_WR, 0x0282}, /* ash_uParabolicCenterX */
+ {S5K6AAFX_REG_WR, 0x0216}, /* ash_uParabolicCenterY */
+ {S5K6AAFX_REG_WR, 0x000B}, /* ash_uParabolicScalingA */
+ {S5K6AAFX_REG_WR, 0x000E}, /* ash_uParabolicScalingB */
+
+ /* parawrite _start - TVAR_ash_pGAS */
+ {S5K6AAFX_REG_W_ADDL, 0x247C},
+ {S5K6AAFX_REG_WR, 0x02B2}, /* TVAR_ash_pGAS[0] */
+ {S5K6AAFX_REG_WR, 0x01C3}, /* TVAR_ash_pGAS[1] */
+ {S5K6AAFX_REG_WR, 0x0138}, /* TVAR_ash_pGAS[2] */
+ {S5K6AAFX_REG_WR, 0x0100}, /* TVAR_ash_pGAS[3] */
+ {S5K6AAFX_REG_WR, 0x00E5}, /* TVAR_ash_pGAS[4] */
+ {S5K6AAFX_REG_WR, 0x00D1}, /* TVAR_ash_pGAS[5] */
+ {S5K6AAFX_REG_WR, 0x00C6}, /* TVAR_ash_pGAS[6] */
+ {S5K6AAFX_REG_WR, 0x00CA}, /* TVAR_ash_pGAS[7] */
+ {S5K6AAFX_REG_WR, 0x00DA}, /* TVAR_ash_pGAS[8] */
+ {S5K6AAFX_REG_WR, 0x00EE}, /* TVAR_ash_pGAS[9] */
+ {S5K6AAFX_REG_WR, 0x0110}, /* TVAR_ash_pGAS[10] */
+ {S5K6AAFX_REG_WR, 0x0179}, /* TVAR_ash_pGAS[11] */
+ {S5K6AAFX_REG_WR, 0x0232}, /* TVAR_ash_pGAS[12] */
+ {S5K6AAFX_REG_WR, 0x01EC}, /* TVAR_ash_pGAS[13] */
+ {S5K6AAFX_REG_WR, 0x0148}, /* TVAR_ash_pGAS[14] */
+ {S5K6AAFX_REG_WR, 0x00F3}, /* TVAR_ash_pGAS[15] */
+ {S5K6AAFX_REG_WR, 0x00C7}, /* TVAR_ash_pGAS[16] */
+ {S5K6AAFX_REG_WR, 0x00A3}, /* TVAR_ash_pGAS[17] */
+ {S5K6AAFX_REG_WR, 0x0089}, /* TVAR_ash_pGAS[18] */
+ {S5K6AAFX_REG_WR, 0x007A}, /* TVAR_ash_pGAS[19] */
+ {S5K6AAFX_REG_WR, 0x0081}, /* TVAR_ash_pGAS[20] */
+ {S5K6AAFX_REG_WR, 0x0093}, /* TVAR_ash_pGAS[21] */
+ {S5K6AAFX_REG_WR, 0x00AF}, /* TVAR_ash_pGAS[22] */
+ {S5K6AAFX_REG_WR, 0x00CF}, /* TVAR_ash_pGAS[23] */
+ {S5K6AAFX_REG_WR, 0x010A}, /* TVAR_ash_pGAS[24] */
+ {S5K6AAFX_REG_WR, 0x0181}, /* TVAR_ash_pGAS[25] */
+ {S5K6AAFX_REG_WR, 0x015D}, /* TVAR_ash_pGAS[26] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[27] */
+ {S5K6AAFX_REG_WR, 0x00B5}, /* TVAR_ash_pGAS[28] */
+ {S5K6AAFX_REG_WR, 0x0083}, /* TVAR_ash_pGAS[29] */
+ {S5K6AAFX_REG_WR, 0x0058}, /* TVAR_ash_pGAS[30] */
+ {S5K6AAFX_REG_WR, 0x003F}, /* TVAR_ash_pGAS[31] */
+ {S5K6AAFX_REG_WR, 0x0036}, /* TVAR_ash_pGAS[32] */
+ {S5K6AAFX_REG_WR, 0x0038}, /* TVAR_ash_pGAS[33] */
+ {S5K6AAFX_REG_WR, 0x0048}, /* TVAR_ash_pGAS[34] */
+ {S5K6AAFX_REG_WR, 0x0065}, /* TVAR_ash_pGAS[35] */
+ {S5K6AAFX_REG_WR, 0x008E}, /* TVAR_ash_pGAS[36] */
+ {S5K6AAFX_REG_WR, 0x00C0}, /* TVAR_ash_pGAS[37] */
+ {S5K6AAFX_REG_WR, 0x010A}, /* TVAR_ash_pGAS[38] */
+ {S5K6AAFX_REG_WR, 0x0119}, /* TVAR_ash_pGAS[39] */
+ {S5K6AAFX_REG_WR, 0x00C7}, /* TVAR_ash_pGAS[40] */
+ {S5K6AAFX_REG_WR, 0x008A}, /* TVAR_ash_pGAS[41] */
+ {S5K6AAFX_REG_WR, 0x0056}, /* TVAR_ash_pGAS[42] */
+ {S5K6AAFX_REG_WR, 0x0030}, /* TVAR_ash_pGAS[43] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[44] */
+ {S5K6AAFX_REG_WR, 0x0012}, /* TVAR_ash_pGAS[45] */
+ {S5K6AAFX_REG_WR, 0x0011}, /* TVAR_ash_pGAS[46] */
+ {S5K6AAFX_REG_WR, 0x001C}, /* TVAR_ash_pGAS[47] */
+ {S5K6AAFX_REG_WR, 0x0036}, /* TVAR_ash_pGAS[48] */
+ {S5K6AAFX_REG_WR, 0x005F}, /* TVAR_ash_pGAS[49] */
+ {S5K6AAFX_REG_WR, 0x0096}, /* TVAR_ash_pGAS[50] */
+ {S5K6AAFX_REG_WR, 0x00D2}, /* TVAR_ash_pGAS[51] */
+ {S5K6AAFX_REG_WR, 0x00FA}, /* TVAR_ash_pGAS[52] */
+ {S5K6AAFX_REG_WR, 0x00B7}, /* TVAR_ash_pGAS[53] */
+ {S5K6AAFX_REG_WR, 0x0073}, /* TVAR_ash_pGAS[54] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[55] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[56] */
+ {S5K6AAFX_REG_WR, 0x000C}, /* TVAR_ash_pGAS[57] */
+ {S5K6AAFX_REG_WR, 0x0004}, /* TVAR_ash_pGAS[58] */
+ {S5K6AAFX_REG_WR, 0x0004}, /* TVAR_ash_pGAS[59] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[60] */
+ {S5K6AAFX_REG_WR, 0x001C}, /* TVAR_ash_pGAS[61] */
+ {S5K6AAFX_REG_WR, 0x0045}, /* TVAR_ash_pGAS[62] */
+ {S5K6AAFX_REG_WR, 0x0083}, /* TVAR_ash_pGAS[63] */
+ {S5K6AAFX_REG_WR, 0x00BA}, /* TVAR_ash_pGAS[64] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[65] */
+ {S5K6AAFX_REG_WR, 0x00B2}, /* TVAR_ash_pGAS[66] */
+ {S5K6AAFX_REG_WR, 0x006B}, /* TVAR_ash_pGAS[67] */
+ {S5K6AAFX_REG_WR, 0x0034}, /* TVAR_ash_pGAS[68] */
+ {S5K6AAFX_REG_WR, 0x0016}, /* TVAR_ash_pGAS[69] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[70] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* TVAR_ash_pGAS[71] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* TVAR_ash_pGAS[72] */
+ {S5K6AAFX_REG_WR, 0x0006}, /* TVAR_ash_pGAS[73] */
+ {S5K6AAFX_REG_WR, 0x0018}, /* TVAR_ash_pGAS[74] */
+ {S5K6AAFX_REG_WR, 0x003F}, /* TVAR_ash_pGAS[75] */
+ {S5K6AAFX_REG_WR, 0x0080}, /* TVAR_ash_pGAS[76] */
+ {S5K6AAFX_REG_WR, 0x00BA}, /* TVAR_ash_pGAS[77] */
+ {S5K6AAFX_REG_WR, 0x00FD}, /* TVAR_ash_pGAS[78] */
+ {S5K6AAFX_REG_WR, 0x00BE}, /* TVAR_ash_pGAS[79] */
+ {S5K6AAFX_REG_WR, 0x0075}, /* TVAR_ash_pGAS[80] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[81] */
+ {S5K6AAFX_REG_WR, 0x001A}, /* TVAR_ash_pGAS[82] */
+ {S5K6AAFX_REG_WR, 0x000B}, /* TVAR_ash_pGAS[83] */
+ {S5K6AAFX_REG_WR, 0x0003}, /* TVAR_ash_pGAS[84] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* TVAR_ash_pGAS[85] */
+ {S5K6AAFX_REG_WR, 0x000D}, /* TVAR_ash_pGAS[86] */
+ {S5K6AAFX_REG_WR, 0x0022}, /* TVAR_ash_pGAS[87] */
+ {S5K6AAFX_REG_WR, 0x004C}, /* TVAR_ash_pGAS[88] */
+ {S5K6AAFX_REG_WR, 0x008E}, /* TVAR_ash_pGAS[89] */
+ {S5K6AAFX_REG_WR, 0x00CB}, /* TVAR_ash_pGAS[90] */
+ {S5K6AAFX_REG_WR, 0x0121}, /* TVAR_ash_pGAS[91] */
+ {S5K6AAFX_REG_WR, 0x00DB}, /* TVAR_ash_pGAS[92] */
+ {S5K6AAFX_REG_WR, 0x0096}, /* TVAR_ash_pGAS[93] */
+ {S5K6AAFX_REG_WR, 0x0057}, /* TVAR_ash_pGAS[94] */
+ {S5K6AAFX_REG_WR, 0x002C}, /* TVAR_ash_pGAS[95] */
+ {S5K6AAFX_REG_WR, 0x0016}, /* TVAR_ash_pGAS[96] */
+ {S5K6AAFX_REG_WR, 0x000F}, /* TVAR_ash_pGAS[97] */
+ {S5K6AAFX_REG_WR, 0x0011}, /* TVAR_ash_pGAS[98] */
+ {S5K6AAFX_REG_WR, 0x001E}, /* TVAR_ash_pGAS[99] */
+ {S5K6AAFX_REG_WR, 0x003B}, /* TVAR_ash_pGAS[100] */
+ {S5K6AAFX_REG_WR, 0x006D}, /* TVAR_ash_pGAS[101] */
+ {S5K6AAFX_REG_WR, 0x00AE}, /* TVAR_ash_pGAS[102] */
+ {S5K6AAFX_REG_WR, 0x00F0}, /* TVAR_ash_pGAS[103] */
+ {S5K6AAFX_REG_WR, 0x0163}, /* TVAR_ash_pGAS[104] */
+ {S5K6AAFX_REG_WR, 0x0107}, /* TVAR_ash_pGAS[105] */
+ {S5K6AAFX_REG_WR, 0x00C6}, /* TVAR_ash_pGAS[106] */
+ {S5K6AAFX_REG_WR, 0x0085}, /* TVAR_ash_pGAS[107] */
+ {S5K6AAFX_REG_WR, 0x0053}, /* TVAR_ash_pGAS[108] */
+ {S5K6AAFX_REG_WR, 0x0034}, /* TVAR_ash_pGAS[109] */
+ {S5K6AAFX_REG_WR, 0x0029}, /* TVAR_ash_pGAS[110] */
+ {S5K6AAFX_REG_WR, 0x002F}, /* TVAR_ash_pGAS[111] */
+ {S5K6AAFX_REG_WR, 0x0042}, /* TVAR_ash_pGAS[112] */
+ {S5K6AAFX_REG_WR, 0x0066}, /* TVAR_ash_pGAS[113] */
+ {S5K6AAFX_REG_WR, 0x009E}, /* TVAR_ash_pGAS[114] */
+ {S5K6AAFX_REG_WR, 0x00DC}, /* TVAR_ash_pGAS[115] */
+ {S5K6AAFX_REG_WR, 0x012D}, /* TVAR_ash_pGAS[116] */
+ {S5K6AAFX_REG_WR, 0x01E1}, /* TVAR_ash_pGAS[117] */
+ {S5K6AAFX_REG_WR, 0x014C}, /* TVAR_ash_pGAS[118] */
+ {S5K6AAFX_REG_WR, 0x0102}, /* TVAR_ash_pGAS[119] */
+ {S5K6AAFX_REG_WR, 0x00CA}, /* TVAR_ash_pGAS[120] */
+ {S5K6AAFX_REG_WR, 0x0096}, /* TVAR_ash_pGAS[121] */
+ {S5K6AAFX_REG_WR, 0x0072}, /* TVAR_ash_pGAS[122] */
+ {S5K6AAFX_REG_WR, 0x0062}, /* TVAR_ash_pGAS[123] */
+ {S5K6AAFX_REG_WR, 0x0068}, /* TVAR_ash_pGAS[124] */
+ {S5K6AAFX_REG_WR, 0x007F}, /* TVAR_ash_pGAS[125] */
+ {S5K6AAFX_REG_WR, 0x00A9}, /* TVAR_ash_pGAS[126] */
+ {S5K6AAFX_REG_WR, 0x00D7}, /* TVAR_ash_pGAS[127] */
+ {S5K6AAFX_REG_WR, 0x011B}, /* TVAR_ash_pGAS[128] */
+ {S5K6AAFX_REG_WR, 0x0196}, /* TVAR_ash_pGAS[129] */
+ {S5K6AAFX_REG_WR, 0x029C}, /* TVAR_ash_pGAS[130] */
+ {S5K6AAFX_REG_WR, 0x01C0}, /* TVAR_ash_pGAS[131] */
+ {S5K6AAFX_REG_WR, 0x0144}, /* TVAR_ash_pGAS[132] */
+ {S5K6AAFX_REG_WR, 0x0108}, /* TVAR_ash_pGAS[133] */
+ {S5K6AAFX_REG_WR, 0x00DE}, /* TVAR_ash_pGAS[134] */
+ {S5K6AAFX_REG_WR, 0x00BB}, /* TVAR_ash_pGAS[135] */
+ {S5K6AAFX_REG_WR, 0x00AB}, /* TVAR_ash_pGAS[136] */
+ {S5K6AAFX_REG_WR, 0x00AC}, /* TVAR_ash_pGAS[137] */
+ {S5K6AAFX_REG_WR, 0x00C7}, /* TVAR_ash_pGAS[138] */
+ {S5K6AAFX_REG_WR, 0x00E8}, /* TVAR_ash_pGAS[139] */
+ {S5K6AAFX_REG_WR, 0x011A}, /* TVAR_ash_pGAS[140] */
+ {S5K6AAFX_REG_WR, 0x017B}, /* TVAR_ash_pGAS[141] */
+ {S5K6AAFX_REG_WR, 0x0222}, /* TVAR_ash_pGAS[142] */
+ {S5K6AAFX_REG_WR, 0x0281}, /* TVAR_ash_pGAS[143] */
+ {S5K6AAFX_REG_WR, 0x019C}, /* TVAR_ash_pGAS[144] */
+ {S5K6AAFX_REG_WR, 0x011A}, /* TVAR_ash_pGAS[145] */
+ {S5K6AAFX_REG_WR, 0x00E7}, /* TVAR_ash_pGAS[146] */
+ {S5K6AAFX_REG_WR, 0x00CF}, /* TVAR_ash_pGAS[147] */
+ {S5K6AAFX_REG_WR, 0x00BE}, /* TVAR_ash_pGAS[148] */
+ {S5K6AAFX_REG_WR, 0x00B3}, /* TVAR_ash_pGAS[149] */
+ {S5K6AAFX_REG_WR, 0x00B2}, /* TVAR_ash_pGAS[150] */
+ {S5K6AAFX_REG_WR, 0x00BA}, /* TVAR_ash_pGAS[151] */
+ {S5K6AAFX_REG_WR, 0x00C7}, /* TVAR_ash_pGAS[152] */
+ {S5K6AAFX_REG_WR, 0x00E0}, /* TVAR_ash_pGAS[153] */
+ {S5K6AAFX_REG_WR, 0x0139}, /* TVAR_ash_pGAS[154] */
+ {S5K6AAFX_REG_WR, 0x01E4}, /* TVAR_ash_pGAS[155] */
+ {S5K6AAFX_REG_WR, 0x01B4}, /* TVAR_ash_pGAS[156] */
+ {S5K6AAFX_REG_WR, 0x011D}, /* TVAR_ash_pGAS[157] */
+ {S5K6AAFX_REG_WR, 0x00D8}, /* TVAR_ash_pGAS[158] */
+ {S5K6AAFX_REG_WR, 0x00B4}, /* TVAR_ash_pGAS[159] */
+ {S5K6AAFX_REG_WR, 0x0093}, /* TVAR_ash_pGAS[160] */
+ {S5K6AAFX_REG_WR, 0x007B}, /* TVAR_ash_pGAS[161] */
+ {S5K6AAFX_REG_WR, 0x0070}, /* TVAR_ash_pGAS[162] */
+ {S5K6AAFX_REG_WR, 0x0072}, /* TVAR_ash_pGAS[163] */
+ {S5K6AAFX_REG_WR, 0x007F}, /* TVAR_ash_pGAS[164] */
+ {S5K6AAFX_REG_WR, 0x0091}, /* TVAR_ash_pGAS[165] */
+ {S5K6AAFX_REG_WR, 0x00A9}, /* TVAR_ash_pGAS[166] */
+ {S5K6AAFX_REG_WR, 0x00D6}, /* TVAR_ash_pGAS[167] */
+ {S5K6AAFX_REG_WR, 0x0142}, /* TVAR_ash_pGAS[168] */
+ {S5K6AAFX_REG_WR, 0x013A}, /* TVAR_ash_pGAS[169] */
+ {S5K6AAFX_REG_WR, 0x00D3}, /* TVAR_ash_pGAS[170] */
+ {S5K6AAFX_REG_WR, 0x00AA}, /* TVAR_ash_pGAS[171] */
+ {S5K6AAFX_REG_WR, 0x007C}, /* TVAR_ash_pGAS[172] */
+ {S5K6AAFX_REG_WR, 0x0055}, /* TVAR_ash_pGAS[173] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[174] */
+ {S5K6AAFX_REG_WR, 0x0035}, /* TVAR_ash_pGAS[175] */
+ {S5K6AAFX_REG_WR, 0x0036}, /* TVAR_ash_pGAS[176] */
+ {S5K6AAFX_REG_WR, 0x0044}, /* TVAR_ash_pGAS[177] */
+ {S5K6AAFX_REG_WR, 0x005B}, /* TVAR_ash_pGAS[178] */
+ {S5K6AAFX_REG_WR, 0x007A}, /* TVAR_ash_pGAS[179] */
+ {S5K6AAFX_REG_WR, 0x009E}, /* TVAR_ash_pGAS[180] */
+ {S5K6AAFX_REG_WR, 0x00DF}, /* TVAR_ash_pGAS[181] */
+ {S5K6AAFX_REG_WR, 0x00F9}, /* TVAR_ash_pGAS[182] */
+ {S5K6AAFX_REG_WR, 0x00B5}, /* TVAR_ash_pGAS[183] */
+ {S5K6AAFX_REG_WR, 0x0083}, /* TVAR_ash_pGAS[184] */
+ {S5K6AAFX_REG_WR, 0x0052}, /* TVAR_ash_pGAS[185] */
+ {S5K6AAFX_REG_WR, 0x002D}, /* TVAR_ash_pGAS[186] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[187] */
+ {S5K6AAFX_REG_WR, 0x0013}, /* TVAR_ash_pGAS[188] */
+ {S5K6AAFX_REG_WR, 0x0012}, /* TVAR_ash_pGAS[189] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[190] */
+ {S5K6AAFX_REG_WR, 0x0031}, /* TVAR_ash_pGAS[191] */
+ {S5K6AAFX_REG_WR, 0x0055}, /* TVAR_ash_pGAS[192] */
+ {S5K6AAFX_REG_WR, 0x007F}, /* TVAR_ash_pGAS[193] */
+ {S5K6AAFX_REG_WR, 0x00AF}, /* TVAR_ash_pGAS[194] */
+ {S5K6AAFX_REG_WR, 0x00E0}, /* TVAR_ash_pGAS[195] */
+ {S5K6AAFX_REG_WR, 0x00A6}, /* TVAR_ash_pGAS[196] */
+ {S5K6AAFX_REG_WR, 0x006C}, /* TVAR_ash_pGAS[197] */
+ {S5K6AAFX_REG_WR, 0x0039}, /* TVAR_ash_pGAS[198] */
+ {S5K6AAFX_REG_WR, 0x001A}, /* TVAR_ash_pGAS[199] */
+ {S5K6AAFX_REG_WR, 0x000D}, /* TVAR_ash_pGAS[200] */
+ {S5K6AAFX_REG_WR, 0x0007}, /* TVAR_ash_pGAS[201] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* TVAR_ash_pGAS[202] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[203] */
+ {S5K6AAFX_REG_WR, 0x0018}, /* TVAR_ash_pGAS[204] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[205] */
+ {S5K6AAFX_REG_WR, 0x0070}, /* TVAR_ash_pGAS[206] */
+ {S5K6AAFX_REG_WR, 0x009C}, /* TVAR_ash_pGAS[207] */
+ {S5K6AAFX_REG_WR, 0x00DA}, /* TVAR_ash_pGAS[208] */
+ {S5K6AAFX_REG_WR, 0x00A2}, /* TVAR_ash_pGAS[209] */
+ {S5K6AAFX_REG_WR, 0x0065}, /* TVAR_ash_pGAS[210] */
+ {S5K6AAFX_REG_WR, 0x0031}, /* TVAR_ash_pGAS[211] */
+ {S5K6AAFX_REG_WR, 0x0015}, /* TVAR_ash_pGAS[212] */
+ {S5K6AAFX_REG_WR, 0x0009}, /* TVAR_ash_pGAS[213] */
+ {S5K6AAFX_REG_WR, 0x0003}, /* TVAR_ash_pGAS[214] */
+ {S5K6AAFX_REG_WR, 0x0002}, /* TVAR_ash_pGAS[215] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* TVAR_ash_pGAS[216] */
+ {S5K6AAFX_REG_WR, 0x0014}, /* TVAR_ash_pGAS[217] */
+ {S5K6AAFX_REG_WR, 0x0038}, /* TVAR_ash_pGAS[218] */
+ {S5K6AAFX_REG_WR, 0x006D}, /* TVAR_ash_pGAS[219] */
+ {S5K6AAFX_REG_WR, 0x009C}, /* TVAR_ash_pGAS[220] */
+ {S5K6AAFX_REG_WR, 0x00DF}, /* TVAR_ash_pGAS[221] */
+ {S5K6AAFX_REG_WR, 0x00A8}, /* TVAR_ash_pGAS[222] */
+ {S5K6AAFX_REG_WR, 0x006B}, /* TVAR_ash_pGAS[223] */
+ {S5K6AAFX_REG_WR, 0x0038}, /* TVAR_ash_pGAS[224] */
+ {S5K6AAFX_REG_WR, 0x0019}, /* TVAR_ash_pGAS[225] */
+ {S5K6AAFX_REG_WR, 0x000C}, /* TVAR_ash_pGAS[226] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* TVAR_ash_pGAS[227] */
+ {S5K6AAFX_REG_WR, 0x0006}, /* TVAR_ash_pGAS[228] */
+ {S5K6AAFX_REG_WR, 0x000B}, /* TVAR_ash_pGAS[229] */
+ {S5K6AAFX_REG_WR, 0x001D}, /* TVAR_ash_pGAS[230] */
+ {S5K6AAFX_REG_WR, 0x0043}, /* TVAR_ash_pGAS[231] */
+ {S5K6AAFX_REG_WR, 0x0075}, /* TVAR_ash_pGAS[232] */
+ {S5K6AAFX_REG_WR, 0x00A6}, /* TVAR_ash_pGAS[233] */
+ {S5K6AAFX_REG_WR, 0x00FA}, /* TVAR_ash_pGAS[234] */
+ {S5K6AAFX_REG_WR, 0x00BE}, /* TVAR_ash_pGAS[235] */
+ {S5K6AAFX_REG_WR, 0x0087}, /* TVAR_ash_pGAS[236] */
+ {S5K6AAFX_REG_WR, 0x004F}, /* TVAR_ash_pGAS[237] */
+ {S5K6AAFX_REG_WR, 0x0028}, /* TVAR_ash_pGAS[238] */
+ {S5K6AAFX_REG_WR, 0x0016}, /* TVAR_ash_pGAS[239] */
+ {S5K6AAFX_REG_WR, 0x000F}, /* TVAR_ash_pGAS[240] */
+ {S5K6AAFX_REG_WR, 0x0010}, /* TVAR_ash_pGAS[241] */
+ {S5K6AAFX_REG_WR, 0x001A}, /* TVAR_ash_pGAS[242] */
+ {S5K6AAFX_REG_WR, 0x0033}, /* TVAR_ash_pGAS[243] */
+ {S5K6AAFX_REG_WR, 0x005D}, /* TVAR_ash_pGAS[244] */
+ {S5K6AAFX_REG_WR, 0x008F}, /* TVAR_ash_pGAS[245] */
+ {S5K6AAFX_REG_WR, 0x00C2}, /* TVAR_ash_pGAS[246] */
+ {S5K6AAFX_REG_WR, 0x0132}, /* TVAR_ash_pGAS[247] */
+ {S5K6AAFX_REG_WR, 0x00DF}, /* TVAR_ash_pGAS[248] */
+ {S5K6AAFX_REG_WR, 0x00B0}, /* TVAR_ash_pGAS[249] */
+ {S5K6AAFX_REG_WR, 0x0077}, /* TVAR_ash_pGAS[250] */
+ {S5K6AAFX_REG_WR, 0x004A}, /* TVAR_ash_pGAS[251] */
+ {S5K6AAFX_REG_WR, 0x0031}, /* TVAR_ash_pGAS[252] */
+ {S5K6AAFX_REG_WR, 0x0027}, /* TVAR_ash_pGAS[253] */
+ {S5K6AAFX_REG_WR, 0x002B}, /* TVAR_ash_pGAS[254] */
+ {S5K6AAFX_REG_WR, 0x003A}, /* TVAR_ash_pGAS[255] */
+ {S5K6AAFX_REG_WR, 0x0057}, /* TVAR_ash_pGAS[256] */
+ {S5K6AAFX_REG_WR, 0x0083}, /* TVAR_ash_pGAS[257] */
+ {S5K6AAFX_REG_WR, 0x00B0}, /* TVAR_ash_pGAS[258] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[259] */
+ {S5K6AAFX_REG_WR, 0x019B}, /* TVAR_ash_pGAS[260] */
+ {S5K6AAFX_REG_WR, 0x0117}, /* TVAR_ash_pGAS[261] */
+ {S5K6AAFX_REG_WR, 0x00D9}, /* TVAR_ash_pGAS[262] */
+ {S5K6AAFX_REG_WR, 0x00B0}, /* TVAR_ash_pGAS[263] */
+ {S5K6AAFX_REG_WR, 0x0085}, /* TVAR_ash_pGAS[264] */
+ {S5K6AAFX_REG_WR, 0x0067}, /* TVAR_ash_pGAS[265] */
+ {S5K6AAFX_REG_WR, 0x0059}, /* TVAR_ash_pGAS[266] */
+ {S5K6AAFX_REG_WR, 0x005C}, /* TVAR_ash_pGAS[267] */
+ {S5K6AAFX_REG_WR, 0x006F}, /* TVAR_ash_pGAS[268] */
+ {S5K6AAFX_REG_WR, 0x008D}, /* TVAR_ash_pGAS[269] */
+ {S5K6AAFX_REG_WR, 0x00AE}, /* TVAR_ash_pGAS[270] */
+ {S5K6AAFX_REG_WR, 0x00DE}, /* TVAR_ash_pGAS[271] */
+ {S5K6AAFX_REG_WR, 0x0146}, /* TVAR_ash_pGAS[272] */
+ {S5K6AAFX_REG_WR, 0x0249}, /* TVAR_ash_pGAS[273] */
+ {S5K6AAFX_REG_WR, 0x017C}, /* TVAR_ash_pGAS[274] */
+ {S5K6AAFX_REG_WR, 0x010F}, /* TVAR_ash_pGAS[275] */
+ {S5K6AAFX_REG_WR, 0x00DF}, /* TVAR_ash_pGAS[276] */
+ {S5K6AAFX_REG_WR, 0x00C0}, /* TVAR_ash_pGAS[277] */
+ {S5K6AAFX_REG_WR, 0x00A6}, /* TVAR_ash_pGAS[278] */
+ {S5K6AAFX_REG_WR, 0x0095}, /* TVAR_ash_pGAS[279] */
+ {S5K6AAFX_REG_WR, 0x0096}, /* TVAR_ash_pGAS[280] */
+ {S5K6AAFX_REG_WR, 0x00A8}, /* TVAR_ash_pGAS[281] */
+ {S5K6AAFX_REG_WR, 0x00C0}, /* TVAR_ash_pGAS[282] */
+ {S5K6AAFX_REG_WR, 0x00E3}, /* TVAR_ash_pGAS[283] */
+ {S5K6AAFX_REG_WR, 0x012E}, /* TVAR_ash_pGAS[284] */
+ {S5K6AAFX_REG_WR, 0x01BF}, /* TVAR_ash_pGAS[285] */
+ {S5K6AAFX_REG_WR, 0x0289}, /* TVAR_ash_pGAS[286] */
+ {S5K6AAFX_REG_WR, 0x019B}, /* TVAR_ash_pGAS[287] */
+ {S5K6AAFX_REG_WR, 0x0116}, /* TVAR_ash_pGAS[288] */
+ {S5K6AAFX_REG_WR, 0x00DE}, /* TVAR_ash_pGAS[289] */
+ {S5K6AAFX_REG_WR, 0x00C0}, /* TVAR_ash_pGAS[290] */
+ {S5K6AAFX_REG_WR, 0x00A9}, /* TVAR_ash_pGAS[291] */
+ {S5K6AAFX_REG_WR, 0x009D}, /* TVAR_ash_pGAS[292] */
+ {S5K6AAFX_REG_WR, 0x00A4}, /* TVAR_ash_pGAS[293] */
+ {S5K6AAFX_REG_WR, 0x00B8}, /* TVAR_ash_pGAS[294] */
+ {S5K6AAFX_REG_WR, 0x00D8}, /* TVAR_ash_pGAS[295] */
+ {S5K6AAFX_REG_WR, 0x0106}, /* TVAR_ash_pGAS[296] */
+ {S5K6AAFX_REG_WR, 0x0175}, /* TVAR_ash_pGAS[297] */
+ {S5K6AAFX_REG_WR, 0x0239}, /* TVAR_ash_pGAS[298] */
+ {S5K6AAFX_REG_WR, 0x01C5}, /* TVAR_ash_pGAS[299] */
+ {S5K6AAFX_REG_WR, 0x0125}, /* TVAR_ash_pGAS[300] */
+ {S5K6AAFX_REG_WR, 0x00D9}, /* TVAR_ash_pGAS[301] */
+ {S5K6AAFX_REG_WR, 0x00B2}, /* TVAR_ash_pGAS[302] */
+ {S5K6AAFX_REG_WR, 0x008D}, /* TVAR_ash_pGAS[303] */
+ {S5K6AAFX_REG_WR, 0x006F}, /* TVAR_ash_pGAS[304] */
+ {S5K6AAFX_REG_WR, 0x0062}, /* TVAR_ash_pGAS[305] */
+ {S5K6AAFX_REG_WR, 0x006A}, /* TVAR_ash_pGAS[306] */
+ {S5K6AAFX_REG_WR, 0x0084}, /* TVAR_ash_pGAS[307] */
+ {S5K6AAFX_REG_WR, 0x00A8}, /* TVAR_ash_pGAS[308] */
+ {S5K6AAFX_REG_WR, 0x00CD}, /* TVAR_ash_pGAS[309] */
+ {S5K6AAFX_REG_WR, 0x010D}, /* TVAR_ash_pGAS[310] */
+ {S5K6AAFX_REG_WR, 0x0189}, /* TVAR_ash_pGAS[311] */
+ {S5K6AAFX_REG_WR, 0x0143}, /* TVAR_ash_pGAS[312] */
+ {S5K6AAFX_REG_WR, 0x00DF}, /* TVAR_ash_pGAS[313] */
+ {S5K6AAFX_REG_WR, 0x00AF}, /* TVAR_ash_pGAS[314] */
+ {S5K6AAFX_REG_WR, 0x007D}, /* TVAR_ash_pGAS[315] */
+ {S5K6AAFX_REG_WR, 0x0050}, /* TVAR_ash_pGAS[316] */
+ {S5K6AAFX_REG_WR, 0x0036}, /* TVAR_ash_pGAS[317] */
+ {S5K6AAFX_REG_WR, 0x002D}, /* TVAR_ash_pGAS[318] */
+ {S5K6AAFX_REG_WR, 0x0032}, /* TVAR_ash_pGAS[319] */
+ {S5K6AAFX_REG_WR, 0x0048}, /* TVAR_ash_pGAS[320] */
+ {S5K6AAFX_REG_WR, 0x006F}, /* TVAR_ash_pGAS[321] */
+ {S5K6AAFX_REG_WR, 0x009F}, /* TVAR_ash_pGAS[322] */
+ {S5K6AAFX_REG_WR, 0x00CF}, /* TVAR_ash_pGAS[323] */
+ {S5K6AAFX_REG_WR, 0x0118}, /* TVAR_ash_pGAS[324] */
+ {S5K6AAFX_REG_WR, 0x010C}, /* TVAR_ash_pGAS[325] */
+ {S5K6AAFX_REG_WR, 0x00C3}, /* TVAR_ash_pGAS[326] */
+ {S5K6AAFX_REG_WR, 0x008C}, /* TVAR_ash_pGAS[327] */
+ {S5K6AAFX_REG_WR, 0x0056}, /* TVAR_ash_pGAS[328] */
+ {S5K6AAFX_REG_WR, 0x002D}, /* TVAR_ash_pGAS[329] */
+ {S5K6AAFX_REG_WR, 0x0017}, /* TVAR_ash_pGAS[330] */
+ {S5K6AAFX_REG_WR, 0x000D}, /* TVAR_ash_pGAS[331] */
+ {S5K6AAFX_REG_WR, 0x0010}, /* TVAR_ash_pGAS[332] */
+ {S5K6AAFX_REG_WR, 0x001F}, /* TVAR_ash_pGAS[333] */
+ {S5K6AAFX_REG_WR, 0x0040}, /* TVAR_ash_pGAS[334] */
+ {S5K6AAFX_REG_WR, 0x0070}, /* TVAR_ash_pGAS[335] */
+ {S5K6AAFX_REG_WR, 0x00A6}, /* TVAR_ash_pGAS[336] */
+ {S5K6AAFX_REG_WR, 0x00DB}, /* TVAR_ash_pGAS[337] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[338] */
+ {S5K6AAFX_REG_WR, 0x00B6}, /* TVAR_ash_pGAS[339] */
+ {S5K6AAFX_REG_WR, 0x0078}, /* TVAR_ash_pGAS[340] */
+ {S5K6AAFX_REG_WR, 0x003E}, /* TVAR_ash_pGAS[341] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[342] */
+ {S5K6AAFX_REG_WR, 0x000B}, /* TVAR_ash_pGAS[343] */
+ {S5K6AAFX_REG_WR, 0x0004}, /* TVAR_ash_pGAS[344] */
+ {S5K6AAFX_REG_WR, 0x0003}, /* TVAR_ash_pGAS[345] */
+ {S5K6AAFX_REG_WR, 0x0009}, /* TVAR_ash_pGAS[346] */
+ {S5K6AAFX_REG_WR, 0x001F}, /* TVAR_ash_pGAS[347] */
+ {S5K6AAFX_REG_WR, 0x004B}, /* TVAR_ash_pGAS[348] */
+ {S5K6AAFX_REG_WR, 0x0088}, /* TVAR_ash_pGAS[349] */
+ {S5K6AAFX_REG_WR, 0x00B6}, /* TVAR_ash_pGAS[350] */
+ {S5K6AAFX_REG_WR, 0x00EA}, /* TVAR_ash_pGAS[351] */
+ {S5K6AAFX_REG_WR, 0x00B4}, /* TVAR_ash_pGAS[352] */
+ {S5K6AAFX_REG_WR, 0x0070}, /* TVAR_ash_pGAS[353] */
+ {S5K6AAFX_REG_WR, 0x0037}, /* TVAR_ash_pGAS[354] */
+ {S5K6AAFX_REG_WR, 0x0016}, /* TVAR_ash_pGAS[355] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[356] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* TVAR_ash_pGAS[357] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* TVAR_ash_pGAS[358] */
+ {S5K6AAFX_REG_WR, 0x0002}, /* TVAR_ash_pGAS[359] */
+ {S5K6AAFX_REG_WR, 0x0013}, /* TVAR_ash_pGAS[360] */
+ {S5K6AAFX_REG_WR, 0x0038}, /* TVAR_ash_pGAS[361] */
+ {S5K6AAFX_REG_WR, 0x0071}, /* TVAR_ash_pGAS[362] */
+ {S5K6AAFX_REG_WR, 0x00A0}, /* TVAR_ash_pGAS[363] */
+ {S5K6AAFX_REG_WR, 0x00F1}, /* TVAR_ash_pGAS[364] */
+ {S5K6AAFX_REG_WR, 0x00B8}, /* TVAR_ash_pGAS[365] */
+ {S5K6AAFX_REG_WR, 0x0076}, /* TVAR_ash_pGAS[366] */
+ {S5K6AAFX_REG_WR, 0x003E}, /* TVAR_ash_pGAS[367] */
+ {S5K6AAFX_REG_WR, 0x001C}, /* TVAR_ash_pGAS[368] */
+ {S5K6AAFX_REG_WR, 0x000B}, /* TVAR_ash_pGAS[369] */
+ {S5K6AAFX_REG_WR, 0x0002}, /* TVAR_ash_pGAS[370] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* TVAR_ash_pGAS[371] */
+ {S5K6AAFX_REG_WR, 0x0004}, /* TVAR_ash_pGAS[372] */
+ {S5K6AAFX_REG_WR, 0x0014}, /* TVAR_ash_pGAS[373] */
+ {S5K6AAFX_REG_WR, 0x0037}, /* TVAR_ash_pGAS[374] */
+ {S5K6AAFX_REG_WR, 0x0068}, /* TVAR_ash_pGAS[375] */
+ {S5K6AAFX_REG_WR, 0x0095}, /* TVAR_ash_pGAS[376] */
+ {S5K6AAFX_REG_WR, 0x010B}, /* TVAR_ash_pGAS[377] */
+ {S5K6AAFX_REG_WR, 0x00CC}, /* TVAR_ash_pGAS[378] */
+ {S5K6AAFX_REG_WR, 0x0093}, /* TVAR_ash_pGAS[379] */
+ {S5K6AAFX_REG_WR, 0x0056}, /* TVAR_ash_pGAS[380] */
+ {S5K6AAFX_REG_WR, 0x002B}, /* TVAR_ash_pGAS[381] */
+ {S5K6AAFX_REG_WR, 0x0015}, /* TVAR_ash_pGAS[382] */
+ {S5K6AAFX_REG_WR, 0x000B}, /* TVAR_ash_pGAS[383] */
+ {S5K6AAFX_REG_WR, 0x0009}, /* TVAR_ash_pGAS[384] */
+ {S5K6AAFX_REG_WR, 0x000E}, /* TVAR_ash_pGAS[385] */
+ {S5K6AAFX_REG_WR, 0x0021}, /* TVAR_ash_pGAS[386] */
+ {S5K6AAFX_REG_WR, 0x0043}, /* TVAR_ash_pGAS[387] */
+ {S5K6AAFX_REG_WR, 0x0070}, /* TVAR_ash_pGAS[388] */
+ {S5K6AAFX_REG_WR, 0x00A0}, /* TVAR_ash_pGAS[389] */
+ {S5K6AAFX_REG_WR, 0x0143}, /* TVAR_ash_pGAS[390] */
+ {S5K6AAFX_REG_WR, 0x00EB}, /* TVAR_ash_pGAS[391] */
+ {S5K6AAFX_REG_WR, 0x00B8}, /* TVAR_ash_pGAS[392] */
+ {S5K6AAFX_REG_WR, 0x007E}, /* TVAR_ash_pGAS[393] */
+ {S5K6AAFX_REG_WR, 0x004E}, /* TVAR_ash_pGAS[394] */
+ {S5K6AAFX_REG_WR, 0x002F}, /* TVAR_ash_pGAS[395] */
+ {S5K6AAFX_REG_WR, 0x0021}, /* TVAR_ash_pGAS[396] */
+ {S5K6AAFX_REG_WR, 0x0020}, /* TVAR_ash_pGAS[397] */
+ {S5K6AAFX_REG_WR, 0x0027}, /* TVAR_ash_pGAS[398] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[399] */
+ {S5K6AAFX_REG_WR, 0x005D}, /* TVAR_ash_pGAS[400] */
+ {S5K6AAFX_REG_WR, 0x0084}, /* TVAR_ash_pGAS[401] */
+ {S5K6AAFX_REG_WR, 0x00BD}, /* TVAR_ash_pGAS[402] */
+ {S5K6AAFX_REG_WR, 0x01AD}, /* TVAR_ash_pGAS[403] */
+ {S5K6AAFX_REG_WR, 0x0122}, /* TVAR_ash_pGAS[404] */
+ {S5K6AAFX_REG_WR, 0x00E3}, /* TVAR_ash_pGAS[405] */
+ {S5K6AAFX_REG_WR, 0x00B5}, /* TVAR_ash_pGAS[406] */
+ {S5K6AAFX_REG_WR, 0x0087}, /* TVAR_ash_pGAS[407] */
+ {S5K6AAFX_REG_WR, 0x0064}, /* TVAR_ash_pGAS[408] */
+ {S5K6AAFX_REG_WR, 0x0051}, /* TVAR_ash_pGAS[409] */
+ {S5K6AAFX_REG_WR, 0x004E}, /* TVAR_ash_pGAS[410] */
+ {S5K6AAFX_REG_WR, 0x0057}, /* TVAR_ash_pGAS[411] */
+ {S5K6AAFX_REG_WR, 0x006A}, /* TVAR_ash_pGAS[412] */
+ {S5K6AAFX_REG_WR, 0x007F}, /* TVAR_ash_pGAS[413] */
+ {S5K6AAFX_REG_WR, 0x00A8}, /* TVAR_ash_pGAS[414] */
+ {S5K6AAFX_REG_WR, 0x0101}, /* TVAR_ash_pGAS[415] */
+ {S5K6AAFX_REG_WR, 0x0267}, /* TVAR_ash_pGAS[416] */
+ {S5K6AAFX_REG_WR, 0x018C}, /* TVAR_ash_pGAS[417] */
+ {S5K6AAFX_REG_WR, 0x0119}, /* TVAR_ash_pGAS[418] */
+ {S5K6AAFX_REG_WR, 0x00E5}, /* TVAR_ash_pGAS[419] */
+ {S5K6AAFX_REG_WR, 0x00C2}, /* TVAR_ash_pGAS[420] */
+ {S5K6AAFX_REG_WR, 0x00A2}, /* TVAR_ash_pGAS[421] */
+ {S5K6AAFX_REG_WR, 0x008D}, /* TVAR_ash_pGAS[422] */
+ {S5K6AAFX_REG_WR, 0x0086}, /* TVAR_ash_pGAS[423] */
+ {S5K6AAFX_REG_WR, 0x008C}, /* TVAR_ash_pGAS[424] */
+ {S5K6AAFX_REG_WR, 0x0099}, /* TVAR_ash_pGAS[425] */
+ {S5K6AAFX_REG_WR, 0x00B0}, /* TVAR_ash_pGAS[426] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[427] */
+ {S5K6AAFX_REG_WR, 0x016C}, /* TVAR_ash_pGAS[428] */
+ {S5K6AAFX_REG_WR, 0x01F3}, /* TVAR_ash_pGAS[429] */
+ {S5K6AAFX_REG_WR, 0x0136}, /* TVAR_ash_pGAS[430] */
+ {S5K6AAFX_REG_WR, 0x00D6}, /* TVAR_ash_pGAS[431] */
+ {S5K6AAFX_REG_WR, 0x00B3}, /* TVAR_ash_pGAS[432] */
+ {S5K6AAFX_REG_WR, 0x00A1}, /* TVAR_ash_pGAS[433] */
+ {S5K6AAFX_REG_WR, 0x0095}, /* TVAR_ash_pGAS[434] */
+ {S5K6AAFX_REG_WR, 0x008E}, /* TVAR_ash_pGAS[435] */
+ {S5K6AAFX_REG_WR, 0x0098}, /* TVAR_ash_pGAS[436] */
+ {S5K6AAFX_REG_WR, 0x00AD}, /* TVAR_ash_pGAS[437] */
+ {S5K6AAFX_REG_WR, 0x00C5}, /* TVAR_ash_pGAS[438] */
+ {S5K6AAFX_REG_WR, 0x00ED}, /* TVAR_ash_pGAS[439] */
+ {S5K6AAFX_REG_WR, 0x014D}, /* TVAR_ash_pGAS[440] */
+ {S5K6AAFX_REG_WR, 0x0207}, /* TVAR_ash_pGAS[441] */
+ {S5K6AAFX_REG_WR, 0x014C}, /* TVAR_ash_pGAS[442] */
+ {S5K6AAFX_REG_WR, 0x00D1}, /* TVAR_ash_pGAS[443] */
+ {S5K6AAFX_REG_WR, 0x00A4}, /* TVAR_ash_pGAS[444] */
+ {S5K6AAFX_REG_WR, 0x0091}, /* TVAR_ash_pGAS[445] */
+ {S5K6AAFX_REG_WR, 0x0077}, /* TVAR_ash_pGAS[446] */
+ {S5K6AAFX_REG_WR, 0x0062}, /* TVAR_ash_pGAS[447] */
+ {S5K6AAFX_REG_WR, 0x005E}, /* TVAR_ash_pGAS[448] */
+ {S5K6AAFX_REG_WR, 0x006A}, /* TVAR_ash_pGAS[449] */
+ {S5K6AAFX_REG_WR, 0x0081}, /* TVAR_ash_pGAS[450] */
+ {S5K6AAFX_REG_WR, 0x009F}, /* TVAR_ash_pGAS[451] */
+ {S5K6AAFX_REG_WR, 0x00BE}, /* TVAR_ash_pGAS[452] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[453] */
+ {S5K6AAFX_REG_WR, 0x0162}, /* TVAR_ash_pGAS[454] */
+ {S5K6AAFX_REG_WR, 0x00DB}, /* TVAR_ash_pGAS[455] */
+ {S5K6AAFX_REG_WR, 0x008C}, /* TVAR_ash_pGAS[456] */
+ {S5K6AAFX_REG_WR, 0x0079}, /* TVAR_ash_pGAS[457] */
+ {S5K6AAFX_REG_WR, 0x005D}, /* TVAR_ash_pGAS[458] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[459] */
+ {S5K6AAFX_REG_WR, 0x002B}, /* TVAR_ash_pGAS[460] */
+ {S5K6AAFX_REG_WR, 0x002B}, /* TVAR_ash_pGAS[461] */
+ {S5K6AAFX_REG_WR, 0x0033}, /* TVAR_ash_pGAS[462] */
+ {S5K6AAFX_REG_WR, 0x004A}, /* TVAR_ash_pGAS[463] */
+ {S5K6AAFX_REG_WR, 0x006A}, /* TVAR_ash_pGAS[464] */
+ {S5K6AAFX_REG_WR, 0x0092}, /* TVAR_ash_pGAS[465] */
+ {S5K6AAFX_REG_WR, 0x00B2}, /* TVAR_ash_pGAS[466] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* TVAR_ash_pGAS[467] */
+ {S5K6AAFX_REG_WR, 0x00A2}, /* TVAR_ash_pGAS[468] */
+ {S5K6AAFX_REG_WR, 0x0072}, /* TVAR_ash_pGAS[469] */
+ {S5K6AAFX_REG_WR, 0x0059}, /* TVAR_ash_pGAS[470] */
+ {S5K6AAFX_REG_WR, 0x003A}, /* TVAR_ash_pGAS[471] */
+ {S5K6AAFX_REG_WR, 0x001E}, /* TVAR_ash_pGAS[472] */
+ {S5K6AAFX_REG_WR, 0x0011}, /* TVAR_ash_pGAS[473] */
+ {S5K6AAFX_REG_WR, 0x000F}, /* TVAR_ash_pGAS[474] */
+ {S5K6AAFX_REG_WR, 0x0012}, /* TVAR_ash_pGAS[475] */
+ {S5K6AAFX_REG_WR, 0x0020}, /* TVAR_ash_pGAS[476] */
+ {S5K6AAFX_REG_WR, 0x003B}, /* TVAR_ash_pGAS[477] */
+ {S5K6AAFX_REG_WR, 0x005E}, /* TVAR_ash_pGAS[478] */
+ {S5K6AAFX_REG_WR, 0x0084}, /* TVAR_ash_pGAS[479] */
+ {S5K6AAFX_REG_WR, 0x00AD}, /* TVAR_ash_pGAS[480] */
+ {S5K6AAFX_REG_WR, 0x008B}, /* TVAR_ash_pGAS[481] */
+ {S5K6AAFX_REG_WR, 0x0065}, /* TVAR_ash_pGAS[482] */
+ {S5K6AAFX_REG_WR, 0x0045}, /* TVAR_ash_pGAS[483] */
+ {S5K6AAFX_REG_WR, 0x0024}, /* TVAR_ash_pGAS[484] */
+ {S5K6AAFX_REG_WR, 0x000F}, /* TVAR_ash_pGAS[485] */
+ {S5K6AAFX_REG_WR, 0x0007}, /* TVAR_ash_pGAS[486] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* TVAR_ash_pGAS[487] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* TVAR_ash_pGAS[488] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[489] */
+ {S5K6AAFX_REG_WR, 0x0017}, /* TVAR_ash_pGAS[490] */
+ {S5K6AAFX_REG_WR, 0x0037}, /* TVAR_ash_pGAS[491] */
+ {S5K6AAFX_REG_WR, 0x0060}, /* TVAR_ash_pGAS[492] */
+ {S5K6AAFX_REG_WR, 0x0083}, /* TVAR_ash_pGAS[493] */
+ {S5K6AAFX_REG_WR, 0x0081}, /* TVAR_ash_pGAS[494] */
+ {S5K6AAFX_REG_WR, 0x0060}, /* TVAR_ash_pGAS[495] */
+ {S5K6AAFX_REG_WR, 0x003D}, /* TVAR_ash_pGAS[496] */
+ {S5K6AAFX_REG_WR, 0x001D}, /* TVAR_ash_pGAS[497] */
+ {S5K6AAFX_REG_WR, 0x000C}, /* TVAR_ash_pGAS[498] */
+ {S5K6AAFX_REG_WR, 0x0006}, /* TVAR_ash_pGAS[499] */
+ {S5K6AAFX_REG_WR, 0x0001}, /* TVAR_ash_pGAS[500] */
+ {S5K6AAFX_REG_WR, 0x0001}, /* TVAR_ash_pGAS[501] */
+ {S5K6AAFX_REG_WR, 0x0002}, /* TVAR_ash_pGAS[502] */
+ {S5K6AAFX_REG_WR, 0x0009}, /* TVAR_ash_pGAS[503] */
+ {S5K6AAFX_REG_WR, 0x0022}, /* TVAR_ash_pGAS[504] */
+ {S5K6AAFX_REG_WR, 0x0047}, /* TVAR_ash_pGAS[505] */
+ {S5K6AAFX_REG_WR, 0x0068}, /* TVAR_ash_pGAS[506] */
+ {S5K6AAFX_REG_WR, 0x0084}, /* TVAR_ash_pGAS[507] */
+ {S5K6AAFX_REG_WR, 0x0064}, /* TVAR_ash_pGAS[508] */
+ {S5K6AAFX_REG_WR, 0x0042}, /* TVAR_ash_pGAS[509] */
+ {S5K6AAFX_REG_WR, 0x0023}, /* TVAR_ash_pGAS[510] */
+ {S5K6AAFX_REG_WR, 0x0010}, /* TVAR_ash_pGAS[511] */
+ {S5K6AAFX_REG_WR, 0x0007}, /* TVAR_ash_pGAS[512] */
+ {S5K6AAFX_REG_WR, 0x0002}, /* TVAR_ash_pGAS[513] */
+ {S5K6AAFX_REG_WR, 0x0001}, /* TVAR_ash_pGAS[514] */
+ {S5K6AAFX_REG_WR, 0x0001}, /* TVAR_ash_pGAS[515] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[516] */
+ {S5K6AAFX_REG_WR, 0x001C}, /* TVAR_ash_pGAS[517] */
+ {S5K6AAFX_REG_WR, 0x0039}, /* TVAR_ash_pGAS[518] */
+ {S5K6AAFX_REG_WR, 0x005B}, /* TVAR_ash_pGAS[519] */
+ {S5K6AAFX_REG_WR, 0x009C}, /* TVAR_ash_pGAS[520] */
+ {S5K6AAFX_REG_WR, 0x0076}, /* TVAR_ash_pGAS[521] */
+ {S5K6AAFX_REG_WR, 0x005B}, /* TVAR_ash_pGAS[522] */
+ {S5K6AAFX_REG_WR, 0x0037}, /* TVAR_ash_pGAS[523] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[524] */
+ {S5K6AAFX_REG_WR, 0x000F}, /* TVAR_ash_pGAS[525] */
+ {S5K6AAFX_REG_WR, 0x0009}, /* TVAR_ash_pGAS[526] */
+ {S5K6AAFX_REG_WR, 0x0008}, /* TVAR_ash_pGAS[527] */
+ {S5K6AAFX_REG_WR, 0x0009}, /* TVAR_ash_pGAS[528] */
+ {S5K6AAFX_REG_WR, 0x0011}, /* TVAR_ash_pGAS[529] */
+ {S5K6AAFX_REG_WR, 0x0025}, /* TVAR_ash_pGAS[530] */
+ {S5K6AAFX_REG_WR, 0x003E}, /* TVAR_ash_pGAS[531] */
+ {S5K6AAFX_REG_WR, 0x005F}, /* TVAR_ash_pGAS[532] */
+ {S5K6AAFX_REG_WR, 0x00D0}, /* TVAR_ash_pGAS[533] */
+ {S5K6AAFX_REG_WR, 0x0095}, /* TVAR_ash_pGAS[534] */
+ {S5K6AAFX_REG_WR, 0x007E}, /* TVAR_ash_pGAS[535] */
+ {S5K6AAFX_REG_WR, 0x005C}, /* TVAR_ash_pGAS[536] */
+ {S5K6AAFX_REG_WR, 0x003A}, /* TVAR_ash_pGAS[537] */
+ {S5K6AAFX_REG_WR, 0x0025}, /* TVAR_ash_pGAS[538] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[539] */
+ {S5K6AAFX_REG_WR, 0x001B}, /* TVAR_ash_pGAS[540] */
+ {S5K6AAFX_REG_WR, 0x001E}, /* TVAR_ash_pGAS[541] */
+ {S5K6AAFX_REG_WR, 0x0027}, /* TVAR_ash_pGAS[542] */
+ {S5K6AAFX_REG_WR, 0x003A}, /* TVAR_ash_pGAS[543] */
+ {S5K6AAFX_REG_WR, 0x004F}, /* TVAR_ash_pGAS[544] */
+ {S5K6AAFX_REG_WR, 0x007B}, /* TVAR_ash_pGAS[545] */
+ {S5K6AAFX_REG_WR, 0x012F}, /* TVAR_ash_pGAS[546] */
+ {S5K6AAFX_REG_WR, 0x00C8}, /* TVAR_ash_pGAS[547] */
+ {S5K6AAFX_REG_WR, 0x00A7}, /* TVAR_ash_pGAS[548] */
+ {S5K6AAFX_REG_WR, 0x008E}, /* TVAR_ash_pGAS[549] */
+ {S5K6AAFX_REG_WR, 0x006F}, /* TVAR_ash_pGAS[550] */
+ {S5K6AAFX_REG_WR, 0x0057}, /* TVAR_ash_pGAS[551] */
+ {S5K6AAFX_REG_WR, 0x0048}, /* TVAR_ash_pGAS[552] */
+ {S5K6AAFX_REG_WR, 0x0047}, /* TVAR_ash_pGAS[553] */
+ {S5K6AAFX_REG_WR, 0x0049}, /* TVAR_ash_pGAS[554] */
+ {S5K6AAFX_REG_WR, 0x004F}, /* TVAR_ash_pGAS[555] */
+ {S5K6AAFX_REG_WR, 0x0058}, /* TVAR_ash_pGAS[556] */
+ {S5K6AAFX_REG_WR, 0x006E}, /* TVAR_ash_pGAS[557] */
+ {S5K6AAFX_REG_WR, 0x00B9}, /* TVAR_ash_pGAS[558] */
+ {S5K6AAFX_REG_WR, 0x01CB}, /* TVAR_ash_pGAS[559] */
+ {S5K6AAFX_REG_WR, 0x0123}, /* TVAR_ash_pGAS[560] */
+ {S5K6AAFX_REG_WR, 0x00D5}, /* TVAR_ash_pGAS[561] */
+ {S5K6AAFX_REG_WR, 0x00B9}, /* TVAR_ash_pGAS[562] */
+ {S5K6AAFX_REG_WR, 0x00A2}, /* TVAR_ash_pGAS[563] */
+ {S5K6AAFX_REG_WR, 0x008E}, /* TVAR_ash_pGAS[564] */
+ {S5K6AAFX_REG_WR, 0x0080}, /* TVAR_ash_pGAS[565] */
+ {S5K6AAFX_REG_WR, 0x007B}, /* TVAR_ash_pGAS[566] */
+ {S5K6AAFX_REG_WR, 0x0079}, /* TVAR_ash_pGAS[567] */
+ {S5K6AAFX_REG_WR, 0x0078}, /* TVAR_ash_pGAS[568] */
+ {S5K6AAFX_REG_WR, 0x0081}, /* TVAR_ash_pGAS[569] */
+ {S5K6AAFX_REG_WR, 0x00A9}, /* TVAR_ash_pGAS[570] */
+ {S5K6AAFX_REG_WR, 0x0108}, /* TVAR_ash_pGAS[571] */
+ /* parawrite _end - TVAR_ash_pGAS */
+
+ {S5K6AAFX_REG_W_ADDL, 0x0C48},
+ {S5K6AAFX_REG_WR, 0x0550}, /* R*/
+ {S5K6AAFX_REG_WR, 0x0400}, /* G*/
+ {S5K6AAFX_REG_WR, 0x0600}, /*B */
+
+#if 0
+ {S5K6AAFX_REG_W_ADDL, 0x0F12},
+ {S5K6AAFX_REG_WR, 0x02C9}, /* awbb_GLocusR */
+ {S5K6AAFX_REG_WR, 0x033F}, /* awbb_GLocusB */
+#endif
+
+ /* param_start - TVAR_ash_AwbAshCord */
+ {S5K6AAFX_REG_W_ADDL, 0x0704},
+ {S5K6AAFX_REG_WR, 0x00ED/*0x00C7*/}, /* TVAR_ash_AwbAshCord[0] */
+ {S5K6AAFX_REG_WR, 0x0124/*0x00F7*/}, /* TVAR_ash_AwbAshCord[1] */
+ {S5K6AAFX_REG_WR, 0x012B/*0x0107*/}, /* TVAR_ash_AwbAshCord[2] */
+ {S5K6AAFX_REG_WR, 0x014A/*0x0142*/}, /* TVAR_ash_AwbAshCord[3] */
+ {S5K6AAFX_REG_WR, 0x0190/*0x017A*/}, /* TVAR_ash_AwbAshCord[4] */
+ {S5K6AAFX_REG_WR, 0x01B2/*0x01A0*/}, /* TVAR_ash_AwbAshCord[5] */
+ {S5K6AAFX_REG_WR, 0x01C4/*0x01B6*/}, /* TVAR_ash_AwbAshCord[6] */
+ /* param_end - TVAR_ash_AwbAshCord */
+
+ {S5K6AAFX_REG_W_ADDL, 0x0754},
+ {S5K6AAFX_REG_WR, 0x247C},
+ {S5K6AAFX_REG_WR, 0x7000},
+
+ {S5K6AAFX_REG_W_ADDL, 0x0E1A},
+ {S5K6AAFX_REG_WR, 0x0138},
+
+ /* AWB Speed */
+ {S5K6AAFX_REG_W_ADDL, 0x0E7C},
+ {S5K6AAFX_REG_WR, 0x0010},
+ {S5K6AAFX_REG_WR, 0x0003},
+
+ /* AWB grid */
+ {S5K6AAFX_REG_W_ADDL, 0x0E42},
+ {S5K6AAFX_REG_WR, 0x0001},
+
+ {S5K6AAFX_REG_W_ADDL, 0x0E82},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xFFC4},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xFFDA},
+ {S5K6AAFX_REG_WR, 0xFFF2},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xFFC4},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xFFC4},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0064},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0064},
+ {S5K6AAFX_REG_WR, 0x004B},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0064},
+ //{S5K6AAFX_REG_WR, 0x0030},
+ //{S5K6AAFX_REG_WR, 0x0040},
+ //{S5K6AAFX_REG_WR, 0x0000},
+ //{S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0064},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ /* param_start - awbb_IndoorGrZones_m_BGrid */
+ {S5K6AAFX_REG_W_ADDL, 0x0C50},
+ {S5K6AAFX_REG_WR, 0x0389},
+ {S5K6AAFX_REG_WR, 0x0396},
+ {S5K6AAFX_REG_WR, 0x0365},
+ {S5K6AAFX_REG_WR, 0x03A4},
+ {S5K6AAFX_REG_WR, 0x0343},
+ {S5K6AAFX_REG_WR, 0x03A4},
+ {S5K6AAFX_REG_WR, 0x0323},
+ {S5K6AAFX_REG_WR, 0x0390},
+ {S5K6AAFX_REG_WR, 0x0300},
+ {S5K6AAFX_REG_WR, 0x036D},
+ {S5K6AAFX_REG_WR, 0x02E0},
+ {S5K6AAFX_REG_WR, 0x0356},
+ {S5K6AAFX_REG_WR, 0x02CC},
+ {S5K6AAFX_REG_WR, 0x033C},
+ {S5K6AAFX_REG_WR, 0x02C0},
+ {S5K6AAFX_REG_WR, 0x0325},
+ {S5K6AAFX_REG_WR, 0x02B4},
+ {S5K6AAFX_REG_WR, 0x0303},
+ {S5K6AAFX_REG_WR, 0x02AA},
+ {S5K6AAFX_REG_WR, 0x02E7},
+ {S5K6AAFX_REG_WR, 0x02A1},
+ {S5K6AAFX_REG_WR, 0x02D5},
+ {S5K6AAFX_REG_WR, 0x0298},
+ {S5K6AAFX_REG_WR, 0x02C9},
+ {S5K6AAFX_REG_WR, 0x028D},
+ {S5K6AAFX_REG_WR, 0x02BF},
+ {S5K6AAFX_REG_WR, 0x0284},
+ {S5K6AAFX_REG_WR, 0x02B4},
+ {S5K6AAFX_REG_WR, 0x0279},
+ {S5K6AAFX_REG_WR, 0x02A9},
+ {S5K6AAFX_REG_WR, 0x026D},
+ {S5K6AAFX_REG_WR, 0x02A1},
+ {S5K6AAFX_REG_WR, 0x0260},
+ {S5K6AAFX_REG_WR, 0x029B},
+ {S5K6AAFX_REG_WR, 0x025A},
+ {S5K6AAFX_REG_WR, 0x0291},
+ {S5K6AAFX_REG_WR, 0x0252},
+ {S5K6AAFX_REG_WR, 0x028A},
+ {S5K6AAFX_REG_WR, 0x024F},
+ {S5K6AAFX_REG_WR, 0x0284},
+ {S5K6AAFX_REG_WR, 0x024C},
+ {S5K6AAFX_REG_WR, 0x0279},
+ {S5K6AAFX_REG_WR, 0x0259},
+ {S5K6AAFX_REG_WR, 0x0265},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x0000},
+ /* param_end - awbb_IndoorGrZones_m_BGrid */
+
+ {S5K6AAFX_REG_WR, 0x0004},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x0CF8},
+ {S5K6AAFX_REG_WR, 0x0115},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ /* param_end - awbb_OutdoorGrZones_m_BGrid */
+ {S5K6AAFX_REG_W_ADDL, 0x0d08},
+ {S5K6AAFX_REG_WR, 0X026D},
+ {S5K6AAFX_REG_WR, 0X029D},
+ {S5K6AAFX_REG_WR, 0X025B},
+ {S5K6AAFX_REG_WR, 0X029D},
+ {S5K6AAFX_REG_WR, 0X024D},
+ {S5K6AAFX_REG_WR, 0X0293},
+ {S5K6AAFX_REG_WR, 0X0240},
+ {S5K6AAFX_REG_WR, 0X0286},
+ {S5K6AAFX_REG_WR, 0X0236},
+ {S5K6AAFX_REG_WR, 0X0279},
+ {S5K6AAFX_REG_WR, 0X022D},
+ {S5K6AAFX_REG_WR, 0X026C},
+ {S5K6AAFX_REG_WR, 0X0225},
+ {S5K6AAFX_REG_WR, 0X0260},
+ {S5K6AAFX_REG_WR, 0X0225},
+ {S5K6AAFX_REG_WR, 0X0254},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_WR, 0X0000},
+
+ {S5K6AAFX_REG_WR, 0X0004},
+ {S5K6AAFX_REG_WR, 0X0000},
+ {S5K6AAFX_REG_W_ADDL, 0x0D74},
+ {S5K6AAFX_REG_WR, 0X0222},
+ {S5K6AAFX_REG_WR, 0X0000},
+
+ /* param_start - SARR_usGammaLutRGBIndoor */
+ {S5K6AAFX_REG_W_ADDL, 0x04C8},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x000A},
+ {S5K6AAFX_REG_WR, 0x0028},
+ {S5K6AAFX_REG_WR, 0x003E},
+ {S5K6AAFX_REG_WR, 0x0072},
+ {S5K6AAFX_REG_WR, 0x00DA},
+ {S5K6AAFX_REG_WR, 0x0129},
+ {S5K6AAFX_REG_WR, 0x0165},
+ {S5K6AAFX_REG_WR, 0x01C5},
+ {S5K6AAFX_REG_WR, 0x0224},
+ {S5K6AAFX_REG_WR, 0x028F},
+ {S5K6AAFX_REG_WR, 0x02EE},
+ {S5K6AAFX_REG_WR, 0x033C},
+ {S5K6AAFX_REG_WR, 0x0380},
+ {S5K6AAFX_REG_WR, 0x03C3},
+ {S5K6AAFX_REG_WR, 0x03FF},
+
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x000A},
+ {S5K6AAFX_REG_WR, 0x0028},
+ {S5K6AAFX_REG_WR, 0x003E},
+ {S5K6AAFX_REG_WR, 0x0072},
+ {S5K6AAFX_REG_WR, 0x00DA},
+ {S5K6AAFX_REG_WR, 0x0129},
+ {S5K6AAFX_REG_WR, 0x0165},
+ {S5K6AAFX_REG_WR, 0x01C5},
+ {S5K6AAFX_REG_WR, 0x0224},
+ {S5K6AAFX_REG_WR, 0x028F},
+ {S5K6AAFX_REG_WR, 0x02EE},
+ {S5K6AAFX_REG_WR, 0x033C},
+ {S5K6AAFX_REG_WR, 0x0380},
+ {S5K6AAFX_REG_WR, 0x03C3},
+ {S5K6AAFX_REG_WR, 0x03FF},
+
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0x000A},
+ {S5K6AAFX_REG_WR, 0x0028},
+ {S5K6AAFX_REG_WR, 0x003E},
+ {S5K6AAFX_REG_WR, 0x0072},
+ {S5K6AAFX_REG_WR, 0x00DA},
+ {S5K6AAFX_REG_WR, 0x0129},
+ {S5K6AAFX_REG_WR, 0x0165},
+ {S5K6AAFX_REG_WR, 0x01C5},
+ {S5K6AAFX_REG_WR, 0x0224},
+ {S5K6AAFX_REG_WR, 0x028F},
+ {S5K6AAFX_REG_WR, 0x02EE},
+ {S5K6AAFX_REG_WR, 0x033C},
+ {S5K6AAFX_REG_WR, 0x0380},
+ {S5K6AAFX_REG_WR, 0x03C3},
+ {S5K6AAFX_REG_WR, 0x03FF},
+ /* param_end - SARR_usGammaLutRGBIndoor */
+
+
+ {S5K6AAFX_REG_W_ADDL, 0x1000},
+ {S5K6AAFX_REG_WR, 0x003F},
+
+ {S5K6AAFX_REG_W_ADDL, 0x0474},
+ {S5K6AAFX_REG_WR, 0x0112/*0x010F*//*0x0114*/},
+ {S5K6AAFX_REG_WR, 0x00EF/*0x00F1*//*0x00F9*/},
+
+ {S5K6AAFX_REG_W_ADDL, 0x2180},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ {S5K6AAFX_REG_W_ADDL, 0x1006},
+ {S5K6AAFX_REG_WR, 0x001F},
+
+ {S5K6AAFX_REG_W_ADDL, 0x108E},
+ {S5K6AAFX_REG_WR, 0x00C7},
+ {S5K6AAFX_REG_WR, 0x00F7},
+ {S5K6AAFX_REG_WR, 0x0107},
+ {S5K6AAFX_REG_WR, 0x0142},
+ {S5K6AAFX_REG_WR, 0x017A},
+ {S5K6AAFX_REG_WR, 0x01A0},
+ {S5K6AAFX_REG_WR, 0x01B6},
+
+ {S5K6AAFX_REG_WR, 0x0100/*0x0112*/},
+ {S5K6AAFX_REG_WR, 0x0100/*0x0122*/},
+ {S5K6AAFX_REG_WR, 0x0100/*0x0136*/},
+ {S5K6AAFX_REG_WR, 0x0100/*0x00F6*/},
+ {S5K6AAFX_REG_WR, 0x0100/*0x0100*/},
+ {S5K6AAFX_REG_WR, 0x0100/*0x00FE*/},
+ {S5K6AAFX_REG_WR, 0x0100/*0x0100*/},
+
+ /* param_start - TVAR_wbt_pBaseCcms */
+ {S5K6AAFX_REG_W_ADDL, 0x23A4},
+ {S5K6AAFX_REG_WR, 0x01FA}, /* H */
+ {S5K6AAFX_REG_WR, 0xFFB9},
+ {S5K6AAFX_REG_WR, 0xFFF8},
+ {S5K6AAFX_REG_WR, 0x0116},
+ {S5K6AAFX_REG_WR, 0x00BD},
+ {S5K6AAFX_REG_WR, 0xFF38},
+ {S5K6AAFX_REG_WR, 0xFF23},
+ {S5K6AAFX_REG_WR, 0x01AB},
+ {S5K6AAFX_REG_WR, 0xFF81},
+ {S5K6AAFX_REG_WR, 0xFF0D},
+ {S5K6AAFX_REG_WR, 0x0169},
+ {S5K6AAFX_REG_WR, 0x00DE},
+ {S5K6AAFX_REG_WR, 0xFFEF},
+ {S5K6AAFX_REG_WR, 0xFFCA},
+ {S5K6AAFX_REG_WR, 0x014D},
+ {S5K6AAFX_REG_WR, 0x01C3},
+ {S5K6AAFX_REG_WR, 0xFF7E},
+ {S5K6AAFX_REG_WR, 0x016F},
+
+ {S5K6AAFX_REG_WR, 0x01FA}, /* A */
+ {S5K6AAFX_REG_WR, 0xFFB9},
+ {S5K6AAFX_REG_WR, 0xFFF8},
+ {S5K6AAFX_REG_WR, 0x0116},
+ {S5K6AAFX_REG_WR, 0x00BD},
+ {S5K6AAFX_REG_WR, 0xFF38},
+ {S5K6AAFX_REG_WR, 0xFF23},
+ {S5K6AAFX_REG_WR, 0x01AB},
+ {S5K6AAFX_REG_WR, 0xFF81},
+ {S5K6AAFX_REG_WR, 0xFF0D},
+ {S5K6AAFX_REG_WR, 0x0169},
+ {S5K6AAFX_REG_WR, 0x00DE},
+ {S5K6AAFX_REG_WR, 0xFFEF},
+ {S5K6AAFX_REG_WR, 0xFFCA},
+ {S5K6AAFX_REG_WR, 0x014D},
+ {S5K6AAFX_REG_WR, 0x01C3},
+ {S5K6AAFX_REG_WR, 0xFF7E},
+ {S5K6AAFX_REG_WR, 0x016F},
+
+ {S5K6AAFX_REG_WR, 0x01FA}, /* WW */
+ {S5K6AAFX_REG_WR, 0xFFB9},
+ {S5K6AAFX_REG_WR, 0xFFF8},
+ {S5K6AAFX_REG_WR, 0x0116},
+ {S5K6AAFX_REG_WR, 0x00BD},
+ {S5K6AAFX_REG_WR, 0xFF38},
+ {S5K6AAFX_REG_WR, 0xFF23},
+ {S5K6AAFX_REG_WR, 0x01AB},
+ {S5K6AAFX_REG_WR, 0xFF81},
+ {S5K6AAFX_REG_WR, 0xFF0D},
+ {S5K6AAFX_REG_WR, 0x0169},
+ {S5K6AAFX_REG_WR, 0x00DE},
+ {S5K6AAFX_REG_WR, 0xFFEF},
+ {S5K6AAFX_REG_WR, 0xFFCA},
+ {S5K6AAFX_REG_WR, 0x014D},
+ {S5K6AAFX_REG_WR, 0x01C3},
+ {S5K6AAFX_REG_WR, 0xFF7E},
+ {S5K6AAFX_REG_WR, 0x016F},
+
+ {S5K6AAFX_REG_WR, 0x01FA}, /* CW */
+ {S5K6AAFX_REG_WR, 0xFFB9},
+ {S5K6AAFX_REG_WR, 0xFFF8},
+ {S5K6AAFX_REG_WR, 0x0116},
+ {S5K6AAFX_REG_WR, 0x00BD},
+ {S5K6AAFX_REG_WR, 0xFF38},
+ {S5K6AAFX_REG_WR, 0xFF23},
+ {S5K6AAFX_REG_WR, 0x01AB},
+ {S5K6AAFX_REG_WR, 0xFF81},
+ {S5K6AAFX_REG_WR, 0xFF0D},
+ {S5K6AAFX_REG_WR, 0x0169},
+ {S5K6AAFX_REG_WR, 0x00DE},
+ {S5K6AAFX_REG_WR, 0xFFEF},
+ {S5K6AAFX_REG_WR, 0xFFCA},
+ {S5K6AAFX_REG_WR, 0x014D},
+ {S5K6AAFX_REG_WR, 0x01C3},
+ {S5K6AAFX_REG_WR, 0xFF7E},
+ {S5K6AAFX_REG_WR, 0x016F},
+
+ {S5K6AAFX_REG_WR, 0x0276/*0x028D*/}, /* D50 */
+ {S5K6AAFX_REG_WR, 0xFFCA/*0xFFBC*/},
+ {S5K6AAFX_REG_WR, 0xFFCF/*0xFFA9*/},
+ {S5K6AAFX_REG_WR, 0x010D/*0x0124*/},
+ {S5K6AAFX_REG_WR, 0x010E/*0x0115*/},
+ {S5K6AAFX_REG_WR, 0xFF6D/*0xFF1B*/},
+ {S5K6AAFX_REG_WR, 0xFE97/*0xFEC5*/},
+ {S5K6AAFX_REG_WR, 0x0144/*0x01F8*/},
+ {S5K6AAFX_REG_WR, 0xFF9E/*0xFF4B*/},
+ {S5K6AAFX_REG_WR, 0xFE8A/*0xFEA4*/},
+ {S5K6AAFX_REG_WR, 0x0137/*0x0198*/},
+ {S5K6AAFX_REG_WR, 0x0131/*0x00D0*/},
+ {S5K6AAFX_REG_WR, 0xFFF3/*0xFFE7*/},
+ {S5K6AAFX_REG_WR, 0xFFF3/*0xFFB1*/},
+ {S5K6AAFX_REG_WR, 0x0193/*0x016E*/},
+ {S5K6AAFX_REG_WR, 0x0269/*0x0217*/},
+ {S5K6AAFX_REG_WR, 0xFFBD/*0xFF43*/},
+ {S5K6AAFX_REG_WR, 0x0162/*0x019E*/},
+
+
+ {S5K6AAFX_REG_WR, 0x01A0}, /* D65 */
+ {S5K6AAFX_REG_WR, 0xFFC4},
+ {S5K6AAFX_REG_WR, 0xFF8F},
+ {S5K6AAFX_REG_WR, 0x00FC},
+ {S5K6AAFX_REG_WR, 0x012D},
+ {S5K6AAFX_REG_WR, 0xFF21},
+ {S5K6AAFX_REG_WR, 0xFF5C},
+ {S5K6AAFX_REG_WR, 0x0169},
+ {S5K6AAFX_REG_WR, 0xFF92},
+ {S5K6AAFX_REG_WR, 0xFF60},
+ {S5K6AAFX_REG_WR, 0x013C},
+ {S5K6AAFX_REG_WR, 0x0171},
+ {S5K6AAFX_REG_WR, 0x0004},
+ {S5K6AAFX_REG_WR, 0xFFD3},
+ {S5K6AAFX_REG_WR, 0x01DF},
+ {S5K6AAFX_REG_WR, 0x01A4},
+ {S5K6AAFX_REG_WR, 0xFF97},
+ {S5K6AAFX_REG_WR, 0x016E},
+ /* param_end - TVAR_wbt_pBaseCcms */
+
+ /* param_start - TVAR_wbt_pOutdoorCcm */
+ {S5K6AAFX_REG_W_ADDL, 0x2380},
+ {S5K6AAFX_REG_WR, 0x01F2/*0x01F2*//*0x019D*/}, /* TVAR_wbt_pOutdoorCcm[0] */
+ {S5K6AAFX_REG_WR, 0xFFC3/*0xFFc3*//*0xFFC8*/}, /* TVAR_wbt_pOutdoorCcm[1] */
+ {S5K6AAFX_REG_WR, 0xFFE3/*0xFFe3*//*0x000C*/}, /* TVAR_wbt_pOutdoorCcm[2] */
+ {S5K6AAFX_REG_WR, 0x00F9/*0x00F9*//*0x008D*/}, /* TVAR_wbt_pOutdoorCcm[3] */
+ {S5K6AAFX_REG_WR, 0x013F/*0x013F*//*0x00CD*/}, /* TVAR_wbt_pOutdoorCcm[4] */
+ {S5K6AAFX_REG_WR, 0xFF6E/*0xFF6E*//*0xFF3F*/}, /* TVAR_wbt_pOutdoorCcm[5] */
+ {S5K6AAFX_REG_WR, 0xFEBB/*0xFEbb*//*0xFEDD*/}, /* TVAR_wbt_pOutdoorCcm[6] */
+ {S5K6AAFX_REG_WR, 0x01F2/*0x01F2*//*0x01C6*/}, /* TVAR_wbt_pOutdoorCcm[7] */
+ {S5K6AAFX_REG_WR, 0xFEFA/*0xFEFA*//*0xFF77*/}, /* TVAR_wbt_pOutdoorCcm[8] */
+ {S5K6AAFX_REG_WR, 0xFF37/*0xFF37*//*0xFEAB*/}, /* TVAR_wbt_pOutdoorCcm[9] */
+ {S5K6AAFX_REG_WR, 0x01A2/*0x01A2*//*0x015D*/}, /* TVAR_wbt_pOutdoorCcm[10] */
+ {S5K6AAFX_REG_WR, 0x0126/*0x0126*//*0x0082*/}, /* TVAR_wbt_pOutdoorCcm[11] */
+ {S5K6AAFX_REG_WR, 0xFFE0/*0xFFE0*//*0xFFCA*/}, /* TVAR_wbt_pOutdoorCcm[12] */
+ {S5K6AAFX_REG_WR, 0xFFBF/*0xFFBF*//*0xFFA2*/}, /* TVAR_wbt_pOutdoorCcm[13] */
+ {S5K6AAFX_REG_WR, 0x01E6/*0x01E6*//*0x016F*/}, /* TVAR_wbt_pOutdoorCcm[14] */
+ {S5K6AAFX_REG_WR, 0x0186/*0x0186*//*0x0171*/}, /* TVAR_wbt_pOutdoorCcm[15] */
+ {S5K6AAFX_REG_WR, 0xFF4B/*0xFF4B*//*0xFF35*/}, /* TVAR_wbt_pOutdoorCcm[16] */
+ {S5K6AAFX_REG_WR, 0x01B1/*0x01B1*//*0x013E*/}, /* TVAR_wbt_pOutdoorCcm[17] */
+ /* param_end - TVAR_wbt_pOutdoorCcm */
+
+ {S5K6AAFX_REG_W_ADDL, 0x06D4},
+ {S5K6AAFX_REG_WR, 0x2380},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_W_ADDL, 0x06CC},
+ {S5K6AAFX_REG_WR, 0x23A4},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_W_ADDL, 0x06E8},
+ {S5K6AAFX_REG_WR, 0x23A4},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x23C8},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x23EC},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x2410},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x2434},
+ {S5K6AAFX_REG_WR, 0x7000},
+ {S5K6AAFX_REG_WR, 0x2458},
+ {S5K6AAFX_REG_WR, 0x7000},
+
+ {S5K6AAFX_REG_W_ADDL, 0x06DA},
+ {S5K6AAFX_REG_WR, 0x00BF}, /* SARR_AwbCcmCord[0] */
+ {S5K6AAFX_REG_WR, 0x00E6}, /* SARR_AwbCcmCord[1] */
+ {S5K6AAFX_REG_WR, 0x00F2}, /* SARR_AwbCcmCord[2] */
+ {S5K6AAFX_REG_WR, 0x0143}, /* SARR_AwbCcmCord[3] */
+ {S5K6AAFX_REG_WR, 0x0178}, /* SARR_AwbCcmCord[4] */
+ {S5K6AAFX_REG_WR, 0x01A3}, /* SARR_AwbCcmCord[5] */
+
+ /* param_start - SARR_uNormBrInDoor */
+ {S5K6AAFX_REG_W_ADDL, 0x07E8},
+ {S5K6AAFX_REG_WR, 0x0016/*0x000A*/}, /* SARR_uNormBrInDoor[0] */
+ {S5K6AAFX_REG_WR, 0x0028/*0x0019*/}, /* SARR_uNormBrInDoor[1] */
+ {S5K6AAFX_REG_WR, 0x0096/*0x0096*/}, /* SARR_uNormBrInDoor[2] */
+ {S5K6AAFX_REG_WR, 0x01F4/*0x01F4*/}, /* SARR_uNormBrInDoor[3] */
+ {S5K6AAFX_REG_WR, 0x07D0/*0x07D0*/}, /* SARR_uNormBrInDoor[4] */
+ /* param_end - SARR_uNormBrInDoor */
+
+ /* param_start - afit_uNoiseIndInDoor */
+ {S5K6AAFX_REG_W_ADDL, 0x07D0},
+ {S5K6AAFX_REG_WR, 0x0030}, /* afit_uNoiseIndInDoor[0] */
+ {S5K6AAFX_REG_WR, 0x0046}, /* afit_uNoiseIndInDoor[1] */
+ {S5K6AAFX_REG_WR, 0x0088}, /* afit_uNoiseIndInDoor[2] */
+ {S5K6AAFX_REG_WR, 0x0205}, /* afit_uNoiseIndInDoor[3] */
+ {S5K6AAFX_REG_WR, 0x02BC}, /* afit_uNoiseIndInDoor[4] */
+ /* param_end - afit_uNoiseIndInDoor */
+
+ {S5K6AAFX_REG_W_ADDL, 0x07E6},
+ {S5K6AAFX_REG_WR, 0x0000}, /* afit_bUseNoiseInd */
+
+ /* param_start - TVAR_afit_pBaseVals */
+ {S5K6AAFX_REG_W_ADDL, 0x0828},
+ {S5K6AAFX_REG_WR, 0x0010}, /*TVAR_afit_pBaseVals[0] 70000828 */
+ {S5K6AAFX_REG_WR, 0x0031}, /*TVAR_afit_pBaseVals[1] 7000082A */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[2] 7000082C */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[3] 7000082E */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[4] 70000830 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[5] 70000832 */
+ {S5K6AAFX_REG_WR, 0x0021}, /*TVAR_afit_pBaseVals[6] 70000834 */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[7] 70000836 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[8] 70000838 */
+ {S5K6AAFX_REG_WR, 0x00FF}, /*TVAR_afit_pBaseVals[9] 7000083A */
+ {S5K6AAFX_REG_WR, 0x0129}, /*TVAR_afit_pBaseVals[10] 7000083C */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[11] 7000083E */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[12] 70000840 */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[13] 70000842 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[14] 70000844 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[15] 70000846 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[16] 70000848 */
+ {S5K6AAFX_REG_WR, 0x0344}, /*TVAR_afit_pBaseVals[17] 7000084A */
+ {S5K6AAFX_REG_WR, 0x033A}, /*TVAR_afit_pBaseVals[18] 7000084C */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[19] 7000084E */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[20] 70000850 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[21] 70000852 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[22] 70000854 */
+ {S5K6AAFX_REG_WR, 0x001E}, /*TVAR_afit_pBaseVals[23] 70000856 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[24] 70000858 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[25] 7000085A */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[26] 7000085C */
+ {S5K6AAFX_REG_WR, 0x0010}, /*TVAR_afit_pBaseVals[27] 7000085E */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[28] 70000860 */
+ {S5K6AAFX_REG_WR, 0x0106}, /*TVAR_afit_pBaseVals[29] 70000862 */
+ {S5K6AAFX_REG_WR, 0x006F}, /*TVAR_afit_pBaseVals[30] 70000864 */
+ {S5K6AAFX_REG_WR, 0x0C0F}, /*TVAR_afit_pBaseVals[31] 70000866 */
+ {S5K6AAFX_REG_WR, 0x0C0F}, /*TVAR_afit_pBaseVals[32] 70000868 */
+ {S5K6AAFX_REG_WR, 0x0303}, /*TVAR_afit_pBaseVals[33] 7000086A */
+ {S5K6AAFX_REG_WR, 0x0303}, /*TVAR_afit_pBaseVals[34] 7000086C */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[35] 7000086E */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[36] 70000870 */
+ {S5K6AAFX_REG_WR, 0x2828}, /*TVAR_afit_pBaseVals[37] 70000872 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[38] 70000874 */
+ {S5K6AAFX_REG_WR, 0x020A}, /*TVAR_afit_pBaseVals[39] 70000876 */
+ {S5K6AAFX_REG_WR, 0x0480}, /*TVAR_afit_pBaseVals[40] 70000878 */
+ {S5K6AAFX_REG_WR, 0x0E08}, /*TVAR_afit_pBaseVals[41] 7000087A */
+ {S5K6AAFX_REG_WR, 0x030A}, /*TVAR_afit_pBaseVals[42] 7000087C */
+ {S5K6AAFX_REG_WR, 0x0A03}, /*TVAR_afit_pBaseVals[43] 7000087E */
+ {S5K6AAFX_REG_WR, 0x0A11}, /*TVAR_afit_pBaseVals[44] 70000880 */
+ {S5K6AAFX_REG_WR, 0x000F}, /*TVAR_afit_pBaseVals[45] 70000882 */
+ {S5K6AAFX_REG_WR, 0x0500}, /*TVAR_afit_pBaseVals[46] 70000884 */
+ {S5K6AAFX_REG_WR, 0x0914}, /*TVAR_afit_pBaseVals[47] 70000886 */
+ {S5K6AAFX_REG_WR, 0x0012}, /*TVAR_afit_pBaseVals[48] 70000888 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[49] 7000088A */
+ {S5K6AAFX_REG_WR, 0x0005}, /*TVAR_afit_pBaseVals[50] 7000088C */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[51] 7000088E */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[52] 70000890 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[53] 70000892 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[54] 70000894 */
+ {S5K6AAFX_REG_WR, 0x0A00}, /*TVAR_afit_pBaseVals[55] 70000896 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[56] 70000898 */
+ {S5K6AAFX_REG_WR, 0x014C}, /*TVAR_afit_pBaseVals[57] 7000089A */
+ {S5K6AAFX_REG_WR, 0x014D}, /*TVAR_afit_pBaseVals[58] 7000089C */
+ {S5K6AAFX_REG_WR, 0x0100}, /*TVAR_afit_pBaseVals[59] 7000089E */
+ {S5K6AAFX_REG_WR, 0xA020/*0x8020*/}, /*TVAR_afit_pBaseVals[60] 700008A0 */ //CKLIN_20100908 White level low brightness 2.5 pass
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[61] 700008A2 */
+ {S5K6AAFX_REG_WR, 0x0001/*0x000A*/}, /*TVAR_afit_pBaseVals[62] 700008A4 */ //CKLIN_20100908 Black Noise pass
+
+ {S5K6AAFX_REG_WR, 0xFFFE}, /*TVAR_afit_pBaseVals[63] 700008A6 */
+ {S5K6AAFX_REG_WR, 0x0031}, /*TVAR_afit_pBaseVals[64] 700008A8 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[65] 700008AA */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[66] 700008AC */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[67] 700008AE */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[68] 700008B0 */
+ {S5K6AAFX_REG_WR, 0x000C}, /*TVAR_afit_pBaseVals[69] 700008B2 */
+ {S5K6AAFX_REG_WR, 0x000E}, /*TVAR_afit_pBaseVals[70] 700008B4 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[71] 700008B6 */
+ {S5K6AAFX_REG_WR, 0x00FF}, /*TVAR_afit_pBaseVals[72] 700008B8 */
+ {S5K6AAFX_REG_WR, 0x0129}, /*TVAR_afit_pBaseVals[73] 700008BA */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[74] 700008BC */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[75] 700008BE */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[76] 700008C0 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[77] 700008C2 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[78] 700008C4 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[79] 700008C6 */
+ {S5K6AAFX_REG_WR, 0x0114}, /*TVAR_afit_pBaseVals[80] 700008C8 */
+ {S5K6AAFX_REG_WR, 0x020A}, /*TVAR_afit_pBaseVals[81] 700008CA */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[82] 700008CC */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[83] 700008CE */
+ {S5K6AAFX_REG_WR, 0x0018}, /*TVAR_afit_pBaseVals[84] 700008D0 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[85] 700008D2 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[86] 700008D4 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[87] 700008D6 */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[88] 700008D8 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[89] 700008DA */
+ {S5K6AAFX_REG_WR, 0x0010}, /*TVAR_afit_pBaseVals[90] 700008DC */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[91] 700008DE */
+ {S5K6AAFX_REG_WR, 0x0106}, /*TVAR_afit_pBaseVals[92] 700008E0 */
+ {S5K6AAFX_REG_WR, 0x006F}, /*TVAR_afit_pBaseVals[93] 700008E2 */
+ {S5K6AAFX_REG_WR, 0x050F}, /*TVAR_afit_pBaseVals[94] 700008E4 */
+ {S5K6AAFX_REG_WR, 0x0A1F}, /*TVAR_afit_pBaseVals[95] 700008E6 */
+ {S5K6AAFX_REG_WR, 0x0203}, /*TVAR_afit_pBaseVals[96] 700008E8 */
+ {S5K6AAFX_REG_WR, 0x0303}, /*TVAR_afit_pBaseVals[97] 700008EA */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[98] 700008EC */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[99] 700008EE */
+ {S5K6AAFX_REG_WR, 0x2828}, /*TVAR_afit_pBaseVals[100] 700008F0 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[101] 700008F2 */
+ {S5K6AAFX_REG_WR, 0x020A}, /*TVAR_afit_pBaseVals[102] 700008F4 */
+ {S5K6AAFX_REG_WR, 0x0480}, /*TVAR_afit_pBaseVals[103] 700008F6 */
+ {S5K6AAFX_REG_WR, 0x0E08}, /*TVAR_afit_pBaseVals[104] 700008F8 */
+ {S5K6AAFX_REG_WR, 0x030A}, /*TVAR_afit_pBaseVals[105] 700008FA */
+ {S5K6AAFX_REG_WR, 0x1403}, /*TVAR_afit_pBaseVals[106] 700008FC */
+ {S5K6AAFX_REG_WR, 0x0A11}, /*TVAR_afit_pBaseVals[107] 700008FE */
+ {S5K6AAFX_REG_WR, 0x0A0F}, /*TVAR_afit_pBaseVals[108] 70000900 */
+ {S5K6AAFX_REG_WR, 0x050A}, /*TVAR_afit_pBaseVals[109] 70000902 */
+ {S5K6AAFX_REG_WR, 0x101E}, /*TVAR_afit_pBaseVals[110] 70000904 */
+ {S5K6AAFX_REG_WR, 0x101E}, /*TVAR_afit_pBaseVals[111] 70000906 */
+ {S5K6AAFX_REG_WR, 0x0A08}, /*TVAR_afit_pBaseVals[112] 70000908 */
+ {S5K6AAFX_REG_WR, 0x0005}, /*TVAR_afit_pBaseVals[113] 7000090A */
+ {S5K6AAFX_REG_WR, 0x0400}, /*TVAR_afit_pBaseVals[114] 7000090C */
+ {S5K6AAFX_REG_WR, 0x0400}, /*TVAR_afit_pBaseVals[115] 7000090E */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[116] 70000910 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[117] 70000912 */
+ {S5K6AAFX_REG_WR, 0x0A00}, /*TVAR_afit_pBaseVals[118] 70000914 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[119] 70000916 */
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[120] 70000918 */
+ {S5K6AAFX_REG_WR, 0x0151}, /*TVAR_afit_pBaseVals[121] 7000091A */
+ {S5K6AAFX_REG_WR, 0x0100}, /*TVAR_afit_pBaseVals[122] 7000091C */
+ {S5K6AAFX_REG_WR, 0x9820}, /*TVAR_afit_pBaseVals[123] 7000091E */
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[124] 70000920 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[125] 70000922 */
+
+ {S5K6AAFX_REG_WR, 0xFFFB}, /*TVAR_afit_pBaseVals[126] 70000924 */
+ {S5K6AAFX_REG_WR, 0x0031}, /*TVAR_afit_pBaseVals[127] 70000926 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[128] 70000928 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[129] 7000092A */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[130] 7000092C */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[131] 7000092E */
+ {S5K6AAFX_REG_WR, 0x0008}, /*TVAR_afit_pBaseVals[132] 70000930 */
+ {S5K6AAFX_REG_WR, 0x0006}, /*TVAR_afit_pBaseVals[133] 70000932 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[134] 70000934 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[135] 70000936 */
+ {S5K6AAFX_REG_WR, 0x0002}, /*TVAR_afit_pBaseVals[136] 70000938 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[137] 7000093A */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[138] 7000093C */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[139] 7000093E */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[140] 70000940 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[141] 70000942 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[142] 70000944 */
+ {S5K6AAFX_REG_WR, 0x0014}, /*TVAR_afit_pBaseVals[143] 70000946 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[144] 70000948 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[145] 7000094A */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[146] 7000094C */
+ {S5K6AAFX_REG_WR, 0x001C}, /*TVAR_afit_pBaseVals[147] 7000094E */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[148] 70000950 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[149] 70000952 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[150] 70000954 */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[151] 70000956 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[152] 70000958 */
+ {S5K6AAFX_REG_WR, 0x0010}, /*TVAR_afit_pBaseVals[153] 7000095A */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[154] 7000095C */
+ {S5K6AAFX_REG_WR, 0x0106}, /*TVAR_afit_pBaseVals[155] 7000095E */
+ {S5K6AAFX_REG_WR, 0x006F}, /*TVAR_afit_pBaseVals[156] 70000960 */
+ {S5K6AAFX_REG_WR, 0x0205}, /*TVAR_afit_pBaseVals[157] 70000962 */
+ {S5K6AAFX_REG_WR, 0x051E}, /*TVAR_afit_pBaseVals[158] 70000964 */
+ {S5K6AAFX_REG_WR, 0x0101}, /*TVAR_afit_pBaseVals[159] 70000966 */
+ {S5K6AAFX_REG_WR, 0x0202}, /*TVAR_afit_pBaseVals[160] 70000968 */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[161] 7000096A */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[162] 7000096C */
+ {S5K6AAFX_REG_WR, 0x2828}, /*TVAR_afit_pBaseVals[163] 7000096E */
+ {S5K6AAFX_REG_WR, 0x0606}, /*TVAR_afit_pBaseVals[164] 70000970 */
+ {S5K6AAFX_REG_WR, 0x0205}, /*TVAR_afit_pBaseVals[165] 70000972 */
+ {S5K6AAFX_REG_WR, 0x0480}, /*TVAR_afit_pBaseVals[166] 70000974 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[167] 70000976 */
+ {S5K6AAFX_REG_WR, 0x0005}, /*TVAR_afit_pBaseVals[168] 70000978 */
+ {S5K6AAFX_REG_WR, 0x1903}, /*TVAR_afit_pBaseVals[169] 7000097A */
+ {S5K6AAFX_REG_WR, 0x1911}, /*TVAR_afit_pBaseVals[170] 7000097C */
+ {S5K6AAFX_REG_WR, 0x0A0F}, /*TVAR_afit_pBaseVals[171] 7000097E */
+ {S5K6AAFX_REG_WR, 0x050A}, /*TVAR_afit_pBaseVals[172] 70000980 */
+ {S5K6AAFX_REG_WR, 0x2028}, /*TVAR_afit_pBaseVals[173] 70000982 */
+ {S5K6AAFX_REG_WR, 0x2028}, /*TVAR_afit_pBaseVals[174] 70000984 */
+ {S5K6AAFX_REG_WR, 0x0A08}, /*TVAR_afit_pBaseVals[175] 70000986 */
+ {S5K6AAFX_REG_WR, 0x0007}, /*TVAR_afit_pBaseVals[176] 70000988 */
+ {S5K6AAFX_REG_WR, 0x0403}, /*TVAR_afit_pBaseVals[177] 7000098A */
+ {S5K6AAFX_REG_WR, 0x0402}, /*TVAR_afit_pBaseVals[178] 7000098C */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[179] 7000098E */
+ {S5K6AAFX_REG_WR, 0x0203}, /*TVAR_afit_pBaseVals[180] 70000990 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[181] 70000992 */
+ {S5K6AAFX_REG_WR, 0x0006}, /*TVAR_afit_pBaseVals[182] 70000994 */
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[183] 70000996 */
+ {S5K6AAFX_REG_WR, 0x0170}, /*TVAR_afit_pBaseVals[184] 70000998 */
+ {S5K6AAFX_REG_WR, 0x0100}, /*TVAR_afit_pBaseVals[185] 7000099A */
+ {S5K6AAFX_REG_WR, 0x8050/*0x8030*/}, /*TVAR_afit_pBaseVals[186] 7000099C */ //CKLIN_20100908 Shading pass
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[187] 7000099E */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[188] 700009A0 */
+
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[189] 700009A2 */
+ {S5K6AAFX_REG_WR, 0x0031}, /*TVAR_afit_pBaseVals[190] 700009A4 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[191] 700009A6 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[192] 700009A8 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[193] 700009AA */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[194] 700009AC */
+ {S5K6AAFX_REG_WR, 0x0008}, /*TVAR_afit_pBaseVals[195] 700009AE */
+ {S5K6AAFX_REG_WR, 0x0006}, /*TVAR_afit_pBaseVals[196] 700009B0 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[197] 700009B2 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[198] 700009B4 */
+ {S5K6AAFX_REG_WR, 0x0002}, /*TVAR_afit_pBaseVals[199] 700009B6 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[200] 700009B8 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[201] 700009BA */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[202] 700009BC */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[203] 700009BE */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[204] 700009C0 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[205] 700009C2 */
+ {S5K6AAFX_REG_WR, 0x0014}, /*TVAR_afit_pBaseVals[206] 700009C4 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[207] 700009C6 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[208] 700009C8 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[209] 700009CA */
+ {S5K6AAFX_REG_WR, 0x001C}, /*TVAR_afit_pBaseVals[210] 700009CC */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[211] 700009CE */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[212] 700009D0 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[213] 700009D2 */
+ {S5K6AAFX_REG_WR, 0x0028}, /*TVAR_afit_pBaseVals[214] 700009D4 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[215] 700009D6 */
+ {S5K6AAFX_REG_WR, 0x0010}, /*TVAR_afit_pBaseVals[216] 700009D8 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[217] 700009DA */
+ {S5K6AAFX_REG_WR, 0x0106}, /*TVAR_afit_pBaseVals[218] 700009DC */
+ {S5K6AAFX_REG_WR, 0x006F}, /*TVAR_afit_pBaseVals[219] 700009DE */
+ {S5K6AAFX_REG_WR, 0x0205}, /*TVAR_afit_pBaseVals[220] 700009E0 */
+ {S5K6AAFX_REG_WR, 0x051E}, /*TVAR_afit_pBaseVals[221] 700009E2 */
+ {S5K6AAFX_REG_WR, 0x0101}, /*TVAR_afit_pBaseVals[222] 700009E4 */
+ {S5K6AAFX_REG_WR, 0x0202}, /*TVAR_afit_pBaseVals[223] 700009E6 */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[224] 700009E8 */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[225] 700009EA */
+ {S5K6AAFX_REG_WR, 0x2828}, /*TVAR_afit_pBaseVals[226] 700009EC */
+ {S5K6AAFX_REG_WR, 0x0606}, /*TVAR_afit_pBaseVals[227] 700009EE */
+ {S5K6AAFX_REG_WR, 0x0205}, /*TVAR_afit_pBaseVals[228] 700009F0 */
+ {S5K6AAFX_REG_WR, 0x0480}, /*TVAR_afit_pBaseVals[229] 700009F2 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[230] 700009F4 */
+ {S5K6AAFX_REG_WR, 0x0005}, /*TVAR_afit_pBaseVals[231] 700009F6 */
+ {S5K6AAFX_REG_WR, 0x1903}, /*TVAR_afit_pBaseVals[232] 700009F8 */
+ {S5K6AAFX_REG_WR, 0x1911}, /*TVAR_afit_pBaseVals[233] 700009FA */
+ {S5K6AAFX_REG_WR, 0x0A0F}, /*TVAR_afit_pBaseVals[234] 700009FC */
+ {S5K6AAFX_REG_WR, 0x050A}, /*TVAR_afit_pBaseVals[235] 700009FE */
+ {S5K6AAFX_REG_WR, 0x2028}, /*TVAR_afit_pBaseVals[236] 70000A00 */
+ {S5K6AAFX_REG_WR, 0x2028}, /*TVAR_afit_pBaseVals[237] 70000A02 */
+ {S5K6AAFX_REG_WR, 0x0A08}, /*TVAR_afit_pBaseVals[238] 70000A04 */
+ {S5K6AAFX_REG_WR, 0x0007}, /*TVAR_afit_pBaseVals[239] 70000A06 */
+ {S5K6AAFX_REG_WR, 0x0403}, /*TVAR_afit_pBaseVals[240] 70000A08 */
+ {S5K6AAFX_REG_WR, 0x0402}, /*TVAR_afit_pBaseVals[241] 70000A0A */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[242] 70000A0C */
+ {S5K6AAFX_REG_WR, 0x0203}, /*TVAR_afit_pBaseVals[243] 70000A0E */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[244] 70000A10 */
+ {S5K6AAFX_REG_WR, 0x0006}, /*TVAR_afit_pBaseVals[245] 70000A12 */
+ {S5K6AAFX_REG_WR, 0x0170}, /*TVAR_afit_pBaseVals[246] 70000A14 */
+ {S5K6AAFX_REG_WR, 0x0175}, /*TVAR_afit_pBaseVals[247] 70000A16 */
+ {S5K6AAFX_REG_WR, 0x0100}, /*TVAR_afit_pBaseVals[248] 70000A18 */
+ {S5K6AAFX_REG_WR, 0x8070/*0x8068*/}, /*TVAR_afit_pBaseVals[249] 70000A1A */ //CKLIN_20100908 Shading pass
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[250] 70000A1C */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[251] 70000A1E */
+
+ {S5K6AAFX_REG_WR, 0x0032/*0x0000*/}, /*TVAR_afit_pBaseVals[252] 70000A20 */ //CKLIN_20100908 White level high brightness 286~2292 pass
+ {S5K6AAFX_REG_WR, 0x0031}, /*TVAR_afit_pBaseVals[253] 70000A22 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[254] 70000A24 */
+ {S5K6AAFX_REG_WR, 0x0014}, /*TVAR_afit_pBaseVals[255] 70000A26 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[256] 70000A28 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[257] 70000A2A */
+ {S5K6AAFX_REG_WR, 0x000E}, /*TVAR_afit_pBaseVals[258] 70000A2C */
+ {S5K6AAFX_REG_WR, 0x0006}, /*TVAR_afit_pBaseVals[259] 70000A2E */
+ {S5K6AAFX_REG_WR, 0x0020}, /*TVAR_afit_pBaseVals[260] 70000A30 */
+ {S5K6AAFX_REG_WR, 0x0050}, /*TVAR_afit_pBaseVals[261] 70000A32 */
+ {S5K6AAFX_REG_WR, 0x0002}, /*TVAR_afit_pBaseVals[262] 70000A34 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[263] 70000A36 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[264] 70000A38 */
+ {S5K6AAFX_REG_WR, 0x000A}, /*TVAR_afit_pBaseVals[265] 70000A3A */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[266] 70000A3C */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[267] 70000A3E */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[268] 70000A40 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[269] 70000A42 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[270] 70000A44 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[271] 70000A46 */
+ {S5K6AAFX_REG_WR, 0x03FF}, /*TVAR_afit_pBaseVals[272] 70000A48 */
+ {S5K6AAFX_REG_WR, 0x0014}, /*TVAR_afit_pBaseVals[273] 70000A4A */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[274] 70000A4C */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[275] 70000A4E */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[276] 70000A50 */
+ {S5K6AAFX_REG_WR, 0x0020}, /*TVAR_afit_pBaseVals[277] 70000A52 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[278] 70000A54 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[279] 70000A56 */
+ {S5K6AAFX_REG_WR, 0x0032}, /*TVAR_afit_pBaseVals[280] 70000A58 */
+ {S5K6AAFX_REG_WR, 0x0106}, /*TVAR_afit_pBaseVals[281] 70000A5A */
+ {S5K6AAFX_REG_WR, 0x006F}, /*TVAR_afit_pBaseVals[282] 70000A5C */
+ {S5K6AAFX_REG_WR, 0x0202}, /*TVAR_afit_pBaseVals[283] 70000A5E */
+ {S5K6AAFX_REG_WR, 0x051E}, /*TVAR_afit_pBaseVals[284] 70000A60 */
+ {S5K6AAFX_REG_WR, 0x0101}, /*TVAR_afit_pBaseVals[285] 70000A62 */
+ {S5K6AAFX_REG_WR, 0x0202}, /*TVAR_afit_pBaseVals[286] 70000A64 */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[287] 70000A66 */
+ {S5K6AAFX_REG_WR, 0x140A}, /*TVAR_afit_pBaseVals[288] 70000A68 */
+ {S5K6AAFX_REG_WR, 0x2828}, /*TVAR_afit_pBaseVals[289] 70000A6A */
+ {S5K6AAFX_REG_WR, 0x0606}, /*TVAR_afit_pBaseVals[290] 70000A6C */
+ {S5K6AAFX_REG_WR, 0x0205}, /*TVAR_afit_pBaseVals[291] 70000A6E */
+ {S5K6AAFX_REG_WR, 0x0880}, /*TVAR_afit_pBaseVals[292] 70000A70 */
+ {S5K6AAFX_REG_WR, 0x000F}, /*TVAR_afit_pBaseVals[293] 70000A72 */
+ {S5K6AAFX_REG_WR, 0x0005}, /*TVAR_afit_pBaseVals[294] 70000A74 */
+ {S5K6AAFX_REG_WR, 0x1903}, /*TVAR_afit_pBaseVals[295] 70000A76 */
+ {S5K6AAFX_REG_WR, 0x1911}, /*TVAR_afit_pBaseVals[296] 70000A78 */
+ {S5K6AAFX_REG_WR, 0x0A0F}, /*TVAR_afit_pBaseVals[297] 70000A7A */
+ {S5K6AAFX_REG_WR, 0x050A}, /*TVAR_afit_pBaseVals[298] 70000A7C */
+ {S5K6AAFX_REG_WR, 0x2020}, /*TVAR_afit_pBaseVals[299] 70000A7E */
+ {S5K6AAFX_REG_WR, 0x2020}, /*TVAR_afit_pBaseVals[300] 70000A80 */
+ {S5K6AAFX_REG_WR, 0x0A08}, /*TVAR_afit_pBaseVals[301] 70000A82 */
+ {S5K6AAFX_REG_WR, 0x0007}, /*TVAR_afit_pBaseVals[302] 70000A84 */
+ {S5K6AAFX_REG_WR, 0x0408}, /*TVAR_afit_pBaseVals[303] 70000A86 */
+ {S5K6AAFX_REG_WR, 0x0406}, /*TVAR_afit_pBaseVals[304] 70000A88 */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[305] 70000A8A */
+ {S5K6AAFX_REG_WR, 0x0608}, /*TVAR_afit_pBaseVals[306] 70000A8C */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[307] 70000A8E */
+ {S5K6AAFX_REG_WR, 0x0006}, /*TVAR_afit_pBaseVals[308] 70000A90 */
+ {S5K6AAFX_REG_WR, 0x0170}, /*TVAR_afit_pBaseVals[309] 70000A92 */
+ {S5K6AAFX_REG_WR, 0x0175}, /*TVAR_afit_pBaseVals[310] 70000A94 */
+ {S5K6AAFX_REG_WR, 0x0100}, /*TVAR_afit_pBaseVals[311] 70000A96 */
+ {S5K6AAFX_REG_WR, 0x7058/*0x7050*/}, /*TVAR_afit_pBaseVals[312] 70000A98 */ //CKLIN_20100908 Shading pass
+ {S5K6AAFX_REG_WR, 0x0180}, /*TVAR_afit_pBaseVals[313] 70000A9A */
+ {S5K6AAFX_REG_WR, 0x0000}, /*TVAR_afit_pBaseVals[314] 70000A9C */
+ /* param_end - TVAR_afit_pBaseVals */
+
+ /* param_start - afit_pConstBaseVals */
+ {S5K6AAFX_REG_WR, 0x00FF}, /* afit_pConstBaseVals[0] */
+ {S5K6AAFX_REG_WR, 0x00FF}, /* afit_pConstBaseVals[1] */
+ {S5K6AAFX_REG_WR, 0x0800}, /* afit_pConstBaseVals[2] */
+ {S5K6AAFX_REG_WR, 0x0600}, /* afit_pConstBaseVals[3] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* afit_pConstBaseVals[4] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* afit_pConstBaseVals[5] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* afit_pConstBaseVals[6] */
+ {S5K6AAFX_REG_WR, 0x0300}, /* afit_pConstBaseVals[7] */
+ {S5K6AAFX_REG_WR, 0x0002}, /* afit_pConstBaseVals[8] */
+ {S5K6AAFX_REG_WR, 0x0400}, /* afit_pConstBaseVals[9] */
+ {S5K6AAFX_REG_WR, 0x0106}, /* afit_pConstBaseVals[10] */
+ {S5K6AAFX_REG_WR, 0x0005}, /* afit_pConstBaseVals[11] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* afit_pConstBaseVals[12] */
+ {S5K6AAFX_REG_WR, 0x0703}, /* afit_pConstBaseVals[13] */
+ {S5K6AAFX_REG_WR, 0x0000}, /* afit_pConstBaseVals[14] */
+ {S5K6AAFX_REG_WR, 0xFFD6}, /* afit_pConstBaseVals[15] */
+ {S5K6AAFX_REG_WR, 0x53C1}, /* afit_pConstBaseVals[16] */
+ {S5K6AAFX_REG_WR, 0xE1FE}, /* afit_pConstBaseVals[17] */
+ {S5K6AAFX_REG_WR, 0x0001}, /* afit_pConstBaseVals[18] */
+ /* param_end - afit_pConstBaseVals */
+
+
+ {S5K6AAFX_REG_W_ADDL, 0x0488},
+ {S5K6AAFX_REG_WR, 0x416E},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xA316},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x2174},
+ {S5K6AAFX_REG_WR, 0xF424},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ {S5K6AAFX_REG_W_ADDL, 0x0490},
+ {S5K6AAFX_REG_WR, 0x416E},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_WR, 0xA316},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x2178},
+ {S5K6AAFX_REG_WR, 0xF424},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ {S5K6AAFX_REG_W_ADDL, 0x0498},
+ {S5K6AAFX_REG_WR, 0x01E8},
+ {S5K6AAFX_REG_WR, 0x0310/*0x0270*/},
+ {S5K6AAFX_REG_W_ADDL, 0x217C},
+ {S5K6AAFX_REG_WR, 0x0580},
+ {S5K6AAFX_REG_W_ADDL, 0x049C},
+ {S5K6AAFX_REG_WR, 0x0160},
+
+
+ /* WRITE #AWBBTune_EVT4_uMaxExp3 0000 */
+ /* WRITE #AWBBTune_EVT4_uCapMaxExp3 0000 */
+ /* WRITE #AWBBTune_EVT4_uMaxAnGain3 0000 */
+
+ {S5K6AAFX_REG_W_ADDL, 0x2170},
+ {S5K6AAFX_REG_WR, 0x0001},
+ {S5K6AAFX_REG_WR, 0x0090},
+
+ /* AE Weight */
+ {S5K6AAFX_REG_W_ADDL, 0x100E},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0201},
+ {S5K6AAFX_REG_WR, 0x0202},
+ {S5K6AAFX_REG_WR, 0x0202},
+ {S5K6AAFX_REG_WR, 0x0102},
+ {S5K6AAFX_REG_WR, 0x0201},
+ {S5K6AAFX_REG_WR, 0x0302},
+ {S5K6AAFX_REG_WR, 0x0203},
+ {S5K6AAFX_REG_WR, 0x0102},
+ {S5K6AAFX_REG_WR, 0x0201},
+ {S5K6AAFX_REG_WR, 0x0302},
+ {S5K6AAFX_REG_WR, 0x0203},
+ {S5K6AAFX_REG_WR, 0x0102},
+ {S5K6AAFX_REG_WR, 0x0201},
+ {S5K6AAFX_REG_WR, 0x0302},
+ {S5K6AAFX_REG_WR, 0x0203},
+ {S5K6AAFX_REG_WR, 0x0102},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0202},
+ {S5K6AAFX_REG_WR, 0x0202},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+ {S5K6AAFX_REG_WR, 0x0101},
+};
+
+static const struct s5k6aafx_i2c_reg_conf const clk_init_tbl[] = {
+ /* clk Settings */
+ {S5K6AAFX_REG_W_ADDL, 0x01B8},
+ {S5K6AAFX_REG_WR, 0x5DC0}, /* 24MHz input clock */
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x01C6},
+ {S5K6AAFX_REG_WR, 0x0002}, /* PLL configurations */
+ {S5K6AAFX_REG_W_ADDL, 0x01CC},
+ {S5K6AAFX_REG_WR, 0x1770}, /* 1st system CLK 24MHz */
+ {S5K6AAFX_REG_WR, 0x1770}, /* 24MHz output clock */
+ {S5K6AAFX_REG_WR, 0x1770}, /* 2nd system CLK */
+ {S5K6AAFX_REG_WR, 0x1B58},
+ {S5K6AAFX_REG_WR, 0x36B0},
+ {S5K6AAFX_REG_WR, 0x36B0},
+ {S5K6AAFX_REG_W_ADDL, 0x01E0},
+ {S5K6AAFX_REG_WR, 0x0001},
+
+ /* delay 100ms */
+};
+
+static const struct s5k6aafx_i2c_reg_conf const clk_init_tb2[] = {
+ /* clk Settings */
+ {S5K6AAFX_REG_W_ADDL, 0x01B8},
+ {S5K6AAFX_REG_WR, 0x5DC0}, /* 24MHz input clock */
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x01C6},
+ {S5K6AAFX_REG_WR, 0x0002}, /* PLL configurations */
+ {S5K6AAFX_REG_W_ADDL, 0x01CC},
+ {S5K6AAFX_REG_WR, 0x1770}, /* 1st system CLK 24MHz */
+ {S5K6AAFX_REG_WR, 0x1770}, /* 24MHz output clock */
+ {S5K6AAFX_REG_WR, 0x1770}, /* 2nd system CLK */
+ {S5K6AAFX_REG_WR, 0x1770},
+ {S5K6AAFX_REG_WR, 0x2EE0},
+ {S5K6AAFX_REG_WR, 0x2EE0},
+ {S5K6AAFX_REG_W_ADDL, 0x01E0},
+ {S5K6AAFX_REG_WR, 0x0001},
+
+ /* delay 100ms */
+};
+
+static const struct s5k6aafx_i2c_reg_conf const prev_snap_conf_init_tbl[] = {
+ /* PREVIEW CONFIGURATION 3 (VGA, YUV) */
+ {S5K6AAFX_REG_W_ADDL, 0x02B4},
+ {S5K6AAFX_REG_WR, S5K6AAFX_QTR_SIZE_WIDTH},
+ {S5K6AAFX_REG_WR, S5K6AAFX_QTR_SIZE_HEIGHT},
+ {S5K6AAFX_REG_WR, 0x0005}, /* YUV */
+ {S5K6AAFX_REG_W_ADDL, 0x02C0},
+ {S5K6AAFX_REG_WR, 0x0000}, /* PLL config */
+ {S5K6AAFX_REG_W_ADDL, 0x02BA},
+ {S5K6AAFX_REG_WR, 0x1770},
+ {S5K6AAFX_REG_WR, 0x1700},
+ {S5K6AAFX_REG_WR, 0x0042},
+ {S5K6AAFX_REG_W_ADDL, 0x02C4},
+ {S5K6AAFX_REG_WR, 0x0001}, /* 1b: Avg S.S 2b: SXGA */
+ {S5K6AAFX_REG_W_ADDL, 0x02C2},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x02C6},
+ {S5K6AAFX_REG_WR, 0x03E8},
+ {S5K6AAFX_REG_WR, 0x0168},
+ {S5K6AAFX_REG_W_ADDL, 0x02D4},/* flip and mirror */
+ {S5K6AAFX_REG_WR, 0x0002},/* 0x02D4 value */
+ {S5K6AAFX_REG_WR, 0x0002},/* 0x02D4 value */
+
+ /*********** APPLY PREVIEW CONFIGURATION & RUN PREVIEW ***********/
+ /* REG_TC_GP_ActivePrevConfig-Select preview configuration_3 */
+ {S5K6AAFX_REG_W_ADDL, 0x021C},
+ {S5K6AAFX_REG_WR, 0x0003},
+ /* REG_TC_GP_PrevOpenAfterChange */
+ {S5K6AAFX_REG_W_ADDL, 0x0220},
+ {S5K6AAFX_REG_WR, 0x0001},
+ /* REG_TC_GP_NewConfigSync-Update preview configuration */
+ {S5K6AAFX_REG_W_ADDL, 0x01F8},
+ {S5K6AAFX_REG_WR, 0x0001},
+ /* REG_TC_GP_PrevConfigChanged */
+ {S5K6AAFX_REG_W_ADDL, 0x021E},
+ {S5K6AAFX_REG_WR, 0x0001}, /* Enable output after config change */
+ {S5K6AAFX_REG_W_ADDL, 0x01F0},
+ {S5K6AAFX_REG_WR, 0x0001}, /* REG_TC_GP_EnablePreview - Start preview */
+ {S5K6AAFX_REG_WR, 0x0001}, /* REG_TC_GP_EnablePreviewChanged */
+
+
+ /* CAPTURE CONFIGURATION 0 (SXGA, YUV) */
+ {S5K6AAFX_REG_W_ADDL, 0x030E},
+ {S5K6AAFX_REG_WR, S5K6AAFX_FULL_SIZE_WIDTH}, /* 1280 */
+ {S5K6AAFX_REG_WR, S5K6AAFX_FULL_SIZE_HEIGHT}, /* 1024 */
+ {S5K6AAFX_REG_WR, 0x0005}, /* YUV */
+ {S5K6AAFX_REG_W_ADDL, 0x031A},
+ {S5K6AAFX_REG_WR, 0x0000}, /* PLL config */
+ {S5K6AAFX_REG_W_ADDL, 0x0314},
+ {S5K6AAFX_REG_WR, 0x1770},
+ {S5K6AAFX_REG_WR, 0x1770},
+ {S5K6AAFX_REG_WR, 0x0042},
+ {S5K6AAFX_REG_W_ADDL, 0x031E},
+ {S5K6AAFX_REG_WR, 0x0002}, /* 1b: Avg S.S 2b: SXGA */
+ {S5K6AAFX_REG_W_ADDL, 0x031C},
+ {S5K6AAFX_REG_WR, 0x0002},
+ {S5K6AAFX_REG_W_ADDL, 0x0320},
+ {S5K6AAFX_REG_WR, 0x0535},
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ /* REG_TC_GP_CapConfigChanged */
+ {S5K6AAFX_REG_W_ADDL, 0x0226},
+ {S5K6AAFX_REG_WR, 0x0001}, /* Enable output after config change */
+
+ {S5K6AAFX_REG_W_ADDL, 0x01FA},
+ /* REG_TC_GP_PrevReqInputWidth */
+ {S5K6AAFX_REG_WR, S5K6AAFX_ADJ_FULL_SIZE_WIDTH},
+ /* REG_TC_GP_PrevReqInputHeight */
+ {S5K6AAFX_REG_WR, S5K6AAFX_ADJ_FULL_SIZE_HEIGHT},
+ /* REG_TC_GP_PrevInputWidthOfs */
+ {S5K6AAFX_REG_WR, (S5K6AAFX_FULL_SIZE_WIDTH-S5K6AAFX_ADJ_FULL_SIZE_WIDTH)/2},
+ /* REG_TC_GP_PrevInputHeightOfs */
+ {S5K6AAFX_REG_WR, (S5K6AAFX_FULL_SIZE_HEIGHT-S5K6AAFX_ADJ_FULL_SIZE_HEIGHT)/2},
+ {S5K6AAFX_REG_W_ADDL, 0x020A},
+ /* REG_TC_GP_PrevZoomReqInputWidth */
+ {S5K6AAFX_REG_WR, S5K6AAFX_ADJ_FULL_SIZE_WIDTH},
+ /* REG_TC_GP_PrevZoomReqInputHeight */
+ {S5K6AAFX_REG_WR, S5K6AAFX_ADJ_FULL_SIZE_HEIGHT},
+ /* REG_TC_GP_PrevZoomReqInputWidthOfs */
+ {S5K6AAFX_REG_WR, 0x0000},
+ /* REG_TC_GP_PrevZoomReqInputHeightOfs */
+ {S5K6AAFX_REG_WR, 0x0000},
+
+ /* REG_TC_GEP_InputsChangeRequest */
+ {S5K6AAFX_REG_W_ADDL, 0x021A},
+ {S5K6AAFX_REG_WR, 0x0001},
+
+};
+
+static const struct s5k6aafx_i2c_reg_conf const prev_snap_conf_init_tb2[] = {
+ /* PREVIEW CONFIGURATION 3 (VGA, YUV) */
+ {S5K6AAFX_REG_W_ADDL, 0x02B4},
+ {S5K6AAFX_REG_WR, S5K6AAFX_QTR_SIZE_WIDTH},
+ {S5K6AAFX_REG_WR, S5K6AAFX_QTR_SIZE_HEIGHT},
+ {S5K6AAFX_REG_WR, 0x0005}, /* YUV */
+ {S5K6AAFX_REG_W_ADDL, 0x02C0},
+ {S5K6AAFX_REG_WR, 0x0001}, /* PLL config */
+ {S5K6AAFX_REG_W_ADDL, 0x02BA},
+ {S5K6AAFX_REG_WR, 0x1770},
+ {S5K6AAFX_REG_WR, 0x1700},
+ {S5K6AAFX_REG_WR, 0x0042},
+ {S5K6AAFX_REG_W_ADDL, 0x02C4},
+ {S5K6AAFX_REG_WR, 0x0001}, /* 1b: Avg S.S 2b: SXGA */
+ {S5K6AAFX_REG_W_ADDL, 0x0250},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x02C6},
+ {S5K6AAFX_REG_WR, 0x0535},
+ {S5K6AAFX_REG_WR, 0x0168},
+ {S5K6AAFX_REG_W_ADDL, 0x02D4},/* flip and mirror */
+ {S5K6AAFX_REG_WR, 0x0001},/* 0x0288 value */
+ {S5K6AAFX_REG_WR, 0x0001},
+
+ /* PREVIEW CONFIGURATION 1 (SXGA, YUV) */
+ {S5K6AAFX_REG_W_ADDL, 0x0268},
+ {S5K6AAFX_REG_WR, S5K6AAFX_FULL_SIZE_WIDTH},
+ {S5K6AAFX_REG_WR, S5K6AAFX_FULL_SIZE_HEIGHT},
+ {S5K6AAFX_REG_WR, 0x0005}, /* YUV */
+ {S5K6AAFX_REG_W_ADDL, 0x0274},
+ {S5K6AAFX_REG_WR, 0x0001}, /* PLL config */
+ {S5K6AAFX_REG_W_ADDL, 0x026E},
+ {S5K6AAFX_REG_WR, 0x2EE0},
+ {S5K6AAFX_REG_WR, 0x2EE0},
+ {S5K6AAFX_REG_WR, 0x0042},
+ {S5K6AAFX_REG_W_ADDL, 0x0278},
+ {S5K6AAFX_REG_WR, 0x0002}, /* 1b: Avg S.S 2b: SXGA */
+ {S5K6AAFX_REG_W_ADDL, 0x0276},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x027A},
+ {S5K6AAFX_REG_WR, 0x0535},
+ {S5K6AAFX_REG_WR, 0x029A},
+ {S5K6AAFX_REG_W_ADDL, 0x0288}, /* flip and mirror */
+ {S5K6AAFX_REG_WR, 0x0001}, /* 0x0288 value */
+ {S5K6AAFX_REG_WR, 0x0001}, /* 0x0288 value */
+
+ /*********** APPLY PREVIEW CONFIGURATION & RUN PREVIEW ***********/
+ /* REG_TC_GP_ActivePrevConfig-Select preview configuration_3 */
+ {S5K6AAFX_REG_W_ADDL, 0x021C},
+ {S5K6AAFX_REG_WR, 0x0001},/*Preview: 3 : VGA 30fps. 1:Full size 15fps*/
+ /* REG_TC_GP_PrevOpenAfterChange */
+ {S5K6AAFX_REG_W_ADDL, 0x0220},
+ {S5K6AAFX_REG_WR, 0x0001},
+ /* REG_TC_GP_NewConfigSync-Update preview configuration */
+ {S5K6AAFX_REG_W_ADDL, 0x01F8},
+ {S5K6AAFX_REG_WR, 0x0001},
+ /* REG_TC_GP_PrevConfigChanged */
+ {S5K6AAFX_REG_W_ADDL, 0x021E},
+ {S5K6AAFX_REG_WR, 0x0001}, /* Enable output after config change */
+ {S5K6AAFX_REG_W_ADDL, 0x01F0},
+ {S5K6AAFX_REG_WR, 0x0001}, /* REG_TC_GP_EnablePreview - Start preview */
+ {S5K6AAFX_REG_WR, 0x0001}, /* REG_TC_GP_EnablePreviewChanged */
+
+
+ /* CAPTURE CONFIGURATION 0 (SXGA, YUV) */
+ {S5K6AAFX_REG_W_ADDL, 0x030E},
+ {S5K6AAFX_REG_WR, S5K6AAFX_FULL_SIZE_WIDTH}, /* 1280 */
+ {S5K6AAFX_REG_WR, S5K6AAFX_FULL_SIZE_HEIGHT}, /* 1024 */
+ {S5K6AAFX_REG_WR, 0x0005}, /* YUV */
+ {S5K6AAFX_REG_W_ADDL, 0x031A},
+ {S5K6AAFX_REG_WR, 0x0001}, /* PLL config */
+ {S5K6AAFX_REG_W_ADDL, 0x0314},
+ {S5K6AAFX_REG_WR, 0x2EE0},
+ {S5K6AAFX_REG_WR, 0x2EE0},
+ {S5K6AAFX_REG_WR, 0x0042},
+ {S5K6AAFX_REG_W_ADDL, 0x031E},
+ {S5K6AAFX_REG_WR, 0x0002}, /* 1b: Avg S.S 2b: SXGA */
+ {S5K6AAFX_REG_W_ADDL, 0x031C},
+ {S5K6AAFX_REG_WR, 0x0000},
+ {S5K6AAFX_REG_W_ADDL, 0x0320},
+ {S5K6AAFX_REG_WR, 0x0535},
+ {S5K6AAFX_REG_WR, 0x029A},
+
+ /* REG_TC_GP_CapConfigChanged */
+ {S5K6AAFX_REG_W_ADDL, 0x0226},
+ {S5K6AAFX_REG_WR, 0x0001}, /* Enable output after config change */
+};
+
+
+struct s5k6aafx_reg s5k6aafx_regs = {
+ .reset_init = &reset_init_tbl[0],
+ .reset_init_size = ARRAY_SIZE(reset_init_tbl),
+ .TP_init = &TP_init_tbl[0],
+ .TP_init_size = ARRAY_SIZE(TP_init_tbl),
+ .analog_setting_init = &analog_setting_init_tbl[0],
+ .analog_setting_init_size = ARRAY_SIZE(analog_setting_init_tbl),
+ .register_init = &register_init_tbl[0],
+ .register_init_size = ARRAY_SIZE(register_init_tbl),
+ .clk_init = &clk_init_tbl[0],
+ .clk_init_size = ARRAY_SIZE(clk_init_tbl),
+ .prev_snap_conf_init = &prev_snap_conf_init_tbl[0],
+ .prev_snap_conf_init_size = ARRAY_SIZE(prev_snap_conf_init_tbl),
+ /* for full-size preview */
+ .clk_init_tb2 = &clk_init_tb2[0],
+ .clk_init_tb2_size = ARRAY_SIZE(clk_init_tb2),
+ .prev_snap_conf_init_tb2 = &prev_snap_conf_init_tb2[0],
+ .prev_snap_conf_init_tb2_size = ARRAY_SIZE(prev_snap_conf_init_tb2),
+};
file:c9476a3ccb1c30e73b4619c8743342bf8c203ad8 -> file:e974f70a90930b0dcecfd1f39967e4b3cbf1616f
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -512,13 +512,14 @@ static int mmc_blk_issue_rq(struct mmc_q
req->rq_disk->disk_name, err);
goto cmd_err;
}
-
if (time_after(jiffies, delay)) {
- if (try_recovery == 1)
- do_reinit = 1;
- else if (mmc_card_sd(card) && (try_recovery == 2))
- do_remove = 1;
- try_recovery++;
+ if (mmc_card_sd(card)) {
+ if (try_recovery == 1)
+ do_reinit = 1;
+ else if (try_recovery == 2)
+ do_remove = 1;
+ try_recovery++;
+ }
err = 1;
card_no_ready++;
printk(KERN_ERR "%s: failed to get card ready\n",
@@ -556,10 +557,8 @@ recovery:
mmc_blk_set_blksize(md, card);
continue;
} else {
- if (mmc_card_sd(card)) {
- printk(KERN_INFO "mmc: reinit failed, remove card\n");
- remove_card(card->host);
- }
+ printk(KERN_INFO "mmc: reinit failed, remove card\n");
+ remove_card(card->host);
goto cmd_err;
}
} else if (do_remove) {
@@ -570,13 +569,15 @@ recovery:
if (brq.cmd.error || brq.stop.error ||
brq.data.error || card_no_ready) {
- if (try_recovery == 1)
- do_reinit = 1;
- else if (mmc_card_sd(card) && (try_recovery == 2))
- do_remove = 1;
- try_recovery++;
- if (do_reinit || do_remove)
- goto recovery;
+ if (mmc_card_sd(card)) {
+ if (try_recovery == 1)
+ do_reinit = 1;
+ else if (try_recovery == 2)
+ do_remove = 1;
+ try_recovery++;
+ if (do_reinit || do_remove)
+ goto recovery;
+ }
if (rq_data_dir(req) == READ) {
/*
* After an error, we redo I/O one sector at a
@@ -760,7 +761,8 @@ static int mmc_blk_probe(struct mmc_card
mmc_set_drvdata(card, md);
mmc_init_bus_resume_flags(card->host);
#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
- mmc_set_bus_resume_policy(card->host, 1);
+ if (mmc_card_sd(card))
+ mmc_set_bus_resume_policy(card->host, 1);
#endif
add_disk(md->disk);
return 0;
file:405686771a5b1484f97f0715c1c0c112c6a51ed1 -> file:a31fe4d385a72faeb0d13b3000ce9839874704fa
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -184,6 +184,10 @@ static void mmc_wait_done(struct mmc_req
complete(mrq->done_data);
}
+struct msmsdcc_host;
+void msmsdcc_request_end(struct msmsdcc_host *host, struct mmc_request *mrq);
+void msmsdcc_stop_data(struct msmsdcc_host *host);
+
/**
* mmc_wait_for_req - start a request and wait for completion
* @host: MMC host to start command
@@ -195,6 +199,10 @@ static void mmc_wait_done(struct mmc_req
*/
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{
+#ifdef CONFIG_WIMAX
+ int ret = 0;
+#endif
+
DECLARE_COMPLETION_ONSTACK(complete);
mrq->done_data = &complete;
@@ -202,7 +210,20 @@ void mmc_wait_for_req(struct mmc_host *h
mmc_start_request(host, mrq);
+#ifdef CONFIG_WIMAX
+ ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(5000));
+ if (ret <= 0) {
+ struct msmsdcc_host *msm_host = mmc_priv(host);
+ printk("[ERR] %s: %s wait_for_completion_timeout!\n", __func__, mmc_hostname(host));
+
+ msmsdcc_stop_data(msm_host);
+
+ mrq->cmd->error = -ETIMEDOUT;
+ msmsdcc_request_end(msm_host, mrq);
+ }
+#else
wait_for_completion(&complete);
+#endif
}
EXPORT_SYMBOL(mmc_wait_for_req);
@@ -1082,6 +1103,7 @@ void mmc_remove_sd_card(struct work_stru
mmc_release_host(host);
}
mmc_bus_put(host);
+ wake_unlock(&mmc_delayed_work_wake_lock);
printk(KERN_INFO "%s: %s exit\n", mmc_hostname(host),
__func__);
}
file:7e59bcc2551afaffc80369dd1c99d41f89126111 -> file:433be5852d1b37095934e4447900c5d2f402a3a5
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -556,7 +556,6 @@ static void mmc_sd_remove(struct mmc_hos
mmc_remove_card(host->card);
host->card = NULL;
}
-
#if 0
/*
* When "deferred resume" fails, run another thread to stop mmcqd.
@@ -588,7 +587,6 @@ static void mmc_sd_err_with_deferred_res
}
}
#endif
-
/*
* Card detection callback from host.
*/
@@ -693,6 +691,14 @@ static int mmc_sd_resume(struct mmc_host
#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
if (err)
mmc_sd_err_with_deferred_resume(host);
+#else
+ if (err) {
+ mmc_sd_remove(host);
+
+ mmc_claim_host(host);
+ mmc_detach_bus(host);
+ mmc_release_host(host);
+ }
#endif
#endif
file:c33d49f03d62d8f0d96d73f7ac552c20e14a21d4 -> file:10be0e44e9ffea91ee15ec963fb4848de81e97ce
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -56,7 +56,6 @@
pr_debug("%s: %s: " fmt "\n", mmc_hostname(host->mmc), __func__ , args)
#define IRQ_DEBUG 0
-#define DISABLE_WIMAX_BUSCLK_PWRSAVE 1
#if defined(CONFIG_DEBUG_FS)
static void msmsdcc_dbg_createhost(struct msmsdcc_host *);
@@ -72,6 +71,7 @@ static int msmsdcc_auto_suspend(struct m
#define BUSCLK_PWRSAVE 1
#define BUSCLK_TIMEOUT (HZ)
#define SQN_BUSCLK_TIMEOUT (5 * HZ)
+
static unsigned int msmsdcc_fmin = 144000;
static unsigned int msmsdcc_fmax = 50000000;
static unsigned int msmsdcc_4bit = 1;
@@ -86,14 +86,18 @@ static unsigned long msmsdcc_irqtime;
#define PIO_SPINMAX 30
#define CMD_SPINMAX 20
-#define WRITE_WAIT_DAT0_MAX 10
+#define WRITE_WAIT_DAT0_MAX 10
-#define VERBOSE_COMMAND_TIMEOUTS 1
+#define VERBOSE_COMMAND_TIMEOUTS 1
+#define SDC_CLK_VERBOSE 1
#ifdef CONFIG_WIMAX
extern int mmc_wimax_get_status(void);
+extern int mmc_wimax_get_busclk_pwrsave(void);
+extern void mmc_wimax_enable_host_wakeup(int on);
#else
static int mmc_wimax_get_status(void) { return 0; }
+static int mmc_wimax_get_busclk_pwrsave(void) { return 0; }
#endif
#if IRQ_DEBUG == 1
@@ -130,14 +134,6 @@ static int is_sd_platform(struct mmc_pla
return 0;
}
-static int is_mmc_platform(struct mmc_platform_data *plat)
-{
- if (plat->slot_type && *plat->slot_type == MMC_TYPE_MMC)
- return 1;
-
- return 0;
-}
-
#if BUSCLK_PWRSAVE
static int is_wimax_platform(struct mmc_platform_data *plat)
{
@@ -151,11 +147,28 @@ static inline void
msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr)
{
u32 delay = BUSCLK_TIMEOUT;
+
+ if (is_wimax_platform(host->plat) && mmc_wimax_get_status()) {
+ if (host->curr.mrq) {
+ printk("%s [WiMAX] %s curr.mrq != NULL", __func__, mmc_hostname(host->mmc));
+ return;
+ }
+
+ if (!host->clks_on) {
+ printk("%s [WiMAX] %s clks_on is OFF", __func__, mmc_hostname(host->mmc));
+ return;
+ }
+ }
+
WARN_ON(!host->clks_on);
- WARN_ON(host->curr.mrq);
+
+ if (host->curr.mrq)
+ printk("%s call %s()", mmc_hostname(host->mmc), __func__);
+
+ BUG_ON(host->curr.mrq);
if (is_wimax_platform(host->plat) && mmc_wimax_get_status()) {
- if (DISABLE_WIMAX_BUSCLK_PWRSAVE)
+ if (!mmc_wimax_get_busclk_pwrsave())
return;
else
delay = SQN_BUSCLK_TIMEOUT;
@@ -166,12 +179,31 @@ msmsdcc_disable_clocks(struct msmsdcc_ho
} else {
del_timer_sync(&host->busclk_timer);
if (host->clks_on) {
+#if SDC_CLK_VERBOSE
+ if (is_wimax_platform(host->plat)) {
+#ifdef CONFIG_WIMAX
+ mmc_wimax_enable_host_wakeup(1);
+#endif
+ pr_info("%s: Disable clocks\n", mmc_hostname(host->mmc));
+ }
+#endif
clk_disable(host->clk);
clk_disable(host->pclk);
host->clks_on = 0;
}
}
}
+EXPORT_SYMBOL(msmsdcc_disable_clocks);
+
+int
+msmsdcc_get_sdc_clocks(struct msmsdcc_host *host)
+{
+ if (host->clks_on)
+ return 1;
+ else
+ return 0;
+}
+EXPORT_SYMBOL(msmsdcc_get_sdc_clocks);
static void
msmsdcc_busclk_expired(unsigned long _data)
@@ -180,6 +212,12 @@ msmsdcc_busclk_expired(unsigned long _da
unsigned long flags;
/* dev_info(mmc_dev(host->mmc), "Bus clock timer expired - S\n"); */
+#if SDC_CLK_VERBOSE
+ if (is_wimax_platform(host->plat)) {
+ pr_info("%s: Bus clock timer expired\n", mmc_hostname(host->mmc));
+ }
+#endif
+
spin_lock_irqsave(&host->lock, flags);
if (host->clks_on)
msmsdcc_disable_clocks(host, 0);
@@ -196,6 +234,15 @@ msmsdcc_enable_clocks(struct msmsdcc_hos
del_timer_sync(&host->busclk_timer);
if (!host->clks_on) {
+#if SDC_CLK_VERBOSE
+ if (is_wimax_platform(host->plat)) {
+ pr_info("%s: Enable clocks\n", mmc_hostname(host->mmc));
+
+#ifdef CONFIG_WIMAX
+ mmc_wimax_enable_host_wakeup(0);
+#endif
+ }
+#endif
rc = clk_enable(host->pclk);
if (rc)
return rc;
@@ -242,7 +289,7 @@ static void
msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd,
u32 c);
-static void
+void
msmsdcc_request_end(struct msmsdcc_host *host, struct mmc_request *mrq)
{
BUG_ON(host->curr.data);
@@ -266,13 +313,15 @@ msmsdcc_request_end(struct msmsdcc_host
mmc_request_done(host->mmc, mrq);
spin_lock(&host->lock);
}
+EXPORT_SYMBOL(msmsdcc_request_end);
-static void
+void
msmsdcc_stop_data(struct msmsdcc_host *host)
{
host->curr.data = NULL;
host->curr.got_dataend = 0;
}
+EXPORT_SYMBOL(msmsdcc_stop_data);
uint32_t msmsdcc_fifo_addr(struct msmsdcc_host *host)
{
@@ -785,6 +834,8 @@ msmsdcc_pio_irq(int irq, void *dev_id)
struct msmsdcc_host *host = dev_id;
uint32_t status;
+
+ spin_lock(&host->lock);
status = msmsdcc_readl(host, MMCISTATUS);
#if IRQ_DEBUG
msmsdcc_print_status(host, "irq1-r", status);
@@ -821,6 +872,7 @@ msmsdcc_pio_irq(int irq, void *dev_id)
printk("TX\n");
}
+ spin_unlock(&host->lock);
return IRQ_HANDLED;
}
@@ -886,6 +938,7 @@ msmsdcc_pio_irq(int irq, void *dev_id)
if (!host->curr.xfer_remain)
msmsdcc_writel(host, 0, MMCIMASK1);
+ spin_unlock(&host->lock);
return IRQ_HANDLED;
}
@@ -971,8 +1024,11 @@ msmsdcc_handle_irq_data(struct msmsdcc_h
* Check to see if there is still data to be read,
* and simulate a PIO irq.
*/
- if (readl(base + MMCISTATUS) & MCI_RXDATAAVLBL)
+ if (readl(base + MMCISTATUS) & MCI_RXDATAAVLBL) {
+ spin_unlock(&host->lock);
msmsdcc_pio_irq(1, host);
+ spin_lock(&host->lock);
+ }
msmsdcc_stop_data(host);
if (!data->error)
@@ -1110,11 +1166,8 @@ msmsdcc_set_ios(struct mmc_host *mmc, st
clk |= MCI_CLK_ENABLE;
}
- /* Set WIDEBUS */
- if (ios->bus_width == MMC_BUS_WIDTH_8)
- clk |= MCI_CLK_WIDEBUS_8;
- else if (ios->bus_width == MMC_BUS_WIDTH_4)
- clk |= MCI_CLK_WIDEBUS_4;
+ if (ios->bus_width == MMC_BUS_WIDTH_4)
+ clk |= (2 << 10); /* Set WIDEBUS */
if (ios->clock > 400000 && msmsdcc_pwrsave)
clk |= (1 << 9); /* PWRSAVE */
@@ -1305,6 +1358,12 @@ static void msmsdcc_early_suspend(struct
host->polling_enabled = host->mmc->caps & MMC_CAP_NEEDS_POLL;
host->mmc->caps &= ~MMC_CAP_NEEDS_POLL;
spin_unlock_irqrestore(&host->lock, flags);
+
+ if (is_wimax_platform(host->plat)) {
+ if (host->clks_on) {
+ msmsdcc_disable_clocks(host, 0);
+ }
+ }
};
static void msmsdcc_late_resume(struct early_suspend *h)
{
@@ -1318,6 +1377,7 @@ static void msmsdcc_late_resume(struct e
mmc_detect_change(host->mmc, 0);
spin_unlock_irqrestore(&host->lock, flags);
}
+
};
#endif
@@ -1442,11 +1502,8 @@ msmsdcc_probe(struct platform_device *pd
mmc->f_max = msmsdcc_fmax;
mmc->ocr_avail = plat->ocr_mask;
- if (is_mmc_platform(host->plat))
- mmc->caps |= MMC_CAP_8_BIT_DATA;
- else if (msmsdcc_4bit)
+ if (msmsdcc_4bit)
mmc->caps |= MMC_CAP_4_BIT_DATA;
-
if (msmsdcc_sdioirq)
mmc->caps |= MMC_CAP_SDIO_IRQ;
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
@@ -1587,6 +1644,10 @@ msmsdcc_suspend(struct platform_device *
struct mmc_host *mmc = mmc_get_drvdata(dev);
int rc = 0;
+#if SDC_CLK_VERBOSE
+ printk("%s enter\n", __func__);
+#endif
+
if (mmc) {
struct msmsdcc_host *host = mmc_priv(mmc);
@@ -1602,11 +1663,22 @@ msmsdcc_suspend(struct platform_device *
del_timer_sync(&host->busclk_timer);
#endif
if (host->clks_on) {
+#if SDC_CLK_VERBOSE
+ if (is_wimax_platform(host->plat)) {
+ pr_info("%s: Disable clocks in %s\n", mmc_hostname(host->mmc), __func__);
+ }
+#endif
+ // For suspend case
clk_disable(host->clk);
clk_disable(host->pclk);
host->clks_on = 0;
}
}
+
+#if SDC_CLK_VERBOSE
+ printk("%s leave\n", __func__);
+#endif
+
return rc;
}
@@ -1615,6 +1687,10 @@ msmsdcc_resume(struct platform_device *d
{
struct mmc_host *mmc = mmc_get_drvdata(dev);
+#if SDC_CLK_VERBOSE
+ printk("%s enter\n", __func__);
+#endif
+
if (mmc) {
struct msmsdcc_host *host = mmc_priv(mmc);
@@ -1634,9 +1710,16 @@ msmsdcc_resume(struct platform_device *d
enable_irq(host->stat_irq);
#if BUSCLK_PWRSAVE
- msmsdcc_disable_clocks(host, 1);
+ if (host->clks_on)
+ msmsdcc_disable_clocks(host, 1);
#endif
+
}
+
+#if SDC_CLK_VERBOSE
+ printk("%s leave\n", __func__);
+#endif
+
return 0;
}
file:f8f14e793dbf635cea8ebb8674d8f6c0d5c9d918 -> file:49d8ba07fb61d11b3b611d223892dcc4f13ba81d
--- a/include/linux/android_alarm.h
+++ b/include/linux/android_alarm.h
@@ -75,6 +75,10 @@ ktime_t alarm_get_elapsed_realtime(void)
/* set rtc while preserving elapsed realtime */
int alarm_set_rtc(const struct timespec ts);
+#ifdef CONFIG_BUILD_CIQ
+int alarm_get_elapsed_ticks(struct timespec *ts);
+#endif
+
#endif
enum android_alarm_return_flags {
@@ -103,4 +107,9 @@ enum android_alarm_return_flags {
#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
+#ifdef CONFIG_BUILD_CIQ
+/* device:IQPortingSysem_Linux.cpp */
+#define ANDROID_ALARM_GET_TICKS(type) ALARM_IOW(10, type, struct timespec)
+#endif
+
#endif
file:6048cecb4f9301982cf994f5f6247e71374bd74b(new)
--- /dev/null
+++ b/include/linux/tps65200.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2007 HTC Incorporated
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#ifndef _TPS65200_H_
+#define _TPS65200_H_
+#include <linux/notifier.h>
+#include <mach/htc_battery.h>
+
+#ifdef CONFIG_TPS65200
+extern int tps_set_charger_ctrl(u32 ctl);
+#else
+static int tps_set_charger_ctrl(u32 ctl) {return 0 ; }
+#endif
+#endif
file:ce5cf6ea52a6d3e9292b67aa36c15d51a6a181a3 -> file:db24284960407190a0d8367adba5d91ab22c3390
--- a/include/media/msm_camera.h
+++ b/include/media/msm_camera.h
@@ -431,7 +431,8 @@ struct msm_snapshot_pp_status {
#define CFG_GET_EXP_FOR_LED 37
#define CFG_UPDATE_AEC_FOR_LED 38
#define CFG_SET_FRONT_CAMERA_MODE 39
-#define CFG_MAX 40
+#define CFG_SET_QCT_LSC_RAW_CAPTURE 40 /* 20101011 QCT mesh LSC Calibration */
+#define CFG_MAX 41
#define MOVE_NEAR 0
#define MOVE_FAR 1