Samsung VZW MB1 update
/arch/arm/mach-msm/board-8960-camera.c
blob:c6028eee6c205b70c7e604e037c1fe755b8b33aa -> blob:d5f102d5a9048287a0023a57426e797bc8bf5239
--- arch/arm/mach-msm/board-8960-camera.c
+++ arch/arm/mach-msm/board-8960-camera.c
@@ -167,15 +167,6 @@ static struct msm_gpiomux_config msm8960
},
},
#endif
-#if defined(CONFIG_MACH_INFINITE)/* >=REV04 */
- {
- .gpio = GPIO_MSM_FLASH_CNTL_EN2,
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[2],
- [GPIOMUX_SUSPENDED] = &cam_settings[0],
- },
- },
-#endif
{
.gpio = GPIO_MSM_FLASH_NOW,
.settings = {
@@ -231,7 +222,7 @@ static struct msm_gpiomux_config msm8960
[GPIOMUX_SUSPENDED] = &cam_settings[0],
},
},
-#if defined(CONFIG_MACH_STRETTO) || defined(CONFIG_MACH_INFINITE)
+#if defined(CONFIG_MACH_STRETTO)
{
.gpio = GPIO_CAM_MCLK2,
.settings = {
@@ -646,7 +637,7 @@ static struct msm_camera_gpio_conf msm_8
};
#endif
-static struct regulator *l8,*l11, *l12,*l16, *l18, *l29,*l30, *l28, *isp_core;
+static struct regulator *l11, *l12, *l18, *l29, *l28, *isp_core;
/* CAM power
CAM_SENSOR_A_2.8 : GPIO_CAM_A_EN(GPIO 46)
CAM_SENSOR_IO_1.8 : VREG_L29 : l29
@@ -812,12 +803,12 @@ static void cam_ldo_power_off(int mode)
gpio_set_value_cansleep(GPIO_CAM_CORE_EN, 0);
}
-#elif defined(CONFIG_ISX012) && defined(CONFIG_SR030PC50) /* KonaLTE*/
+#elif defined(CONFIG_ISX012) && defined(CONFIG_SR030PC50) /* ApexQ*/
static void cam_ldo_power_on(int mode)
{
int ret = 0;
- printk(KERN_DEBUG "[%s : %d] %s KONA CAMERA POWER ON!!\n",
+ printk(KERN_DEBUG "[%s : %d] %s CAMERA POWER ON!!\n",
__func__, __LINE__, mode ? "FRONT" : "REAR");
/*5M Core 1.2V - CAM_ISP_CORE_1P2*/
@@ -830,80 +821,70 @@ static void cam_ldo_power_on(int mode)
ret = regulator_enable(l29);
if (ret)
cam_err("error enabling regulator 8921_lvs5\n");
-
- printk(KERN_DEBUG "check CAM_SENSOR_IO_1P8 : %d\n", ret);
/*Sensor AVDD 2.8V - CAM_SENSOR_A2P8 */
- l16 = regulator_get(NULL, "8921_l16");
- ret = regulator_set_voltage(l16, 2800000, 2800000);
+ gpio_set_value_cansleep(GPIO_CAM_A_EN, 1);
+ ret = gpio_get_value(GPIO_CAM_A_EN);
+ printk(KERN_DEBUG "check GPIO_CAM_A_EN : %d\n", ret);
+
+/*VT core 1.2V - CAM_DVDD_1P2V*/
+ l18 = regulator_get(NULL, "cam_vio");
+ ret = regulator_set_voltage(l18, 1800000, 1800000);
if (ret)
cam_err("error setting voltage\n");
- ret = regulator_enable(l16);
+ ret = regulator_enable(l18);
if (ret)
cam_err("error enabling regulator\n");
-
-/*VT core 1.5V - CAM_DVDD_1P5V*/
- l30 = regulator_get(NULL, "8921_lvs6");
- ret = regulator_enable(l30);
- if (ret)
- cam_err("error enabling regulator 8921_lv6\n");
usleep(20);
-#if 1
/*Sensor AF 2.8V -CAM_AF_2P8 */
if (!mode) {
- l8 = regulator_get(NULL, "8921_l8");
- ret = regulator_set_voltage(l8, 2800000, 2800000);
+ l11 = regulator_get(NULL, "8921_l11");
+ ret = regulator_set_voltage(l11, 2800000, 2800000);
if (ret)
cam_err("error setting voltage\n");
- ret = regulator_enable(l8);
+ ret = regulator_enable(l11);
if (ret)
cam_err("error enabling regulator\n");
}
- printk(KERN_DEBUG "check CAM_AF_2P8 : %d\n", ret);
-#endif
-}
+ }
static void cam_ldo_power_off(int mode)
{
int ret = 0;
- printk(KERN_DEBUG "[%s : %d] %s KONA CAMERA POWER OFF!!\n",
+ printk(KERN_DEBUG "[%s : %d] %s CAMERA POWER OFF!!\n",
__func__, __LINE__, mode ? "FRONT" : "REAR");
-#if 1
+
/*Sensor AF 2.8V -CAM_AF_2P8 */
if (!mode) {
- if (l8) {
- ret = regulator_disable(l8);
+ if (l11) {
+ ret = regulator_disable(l11);
if (ret)
cam_err("error disabling regulator\n");
}
}
-#endif
-/*VT core 1.5 - CAM_DVDD_1P5V*/
- if (l30) {
- ret = regulator_disable(l30);
+
+/*VT core 1.2 - CAM_DVDD_1P2V*/
+ if (l18) {
+ ret = regulator_disable(l18);
if (ret)
- cam_err(" l30 error disabling regulator\n");
+ cam_err("error disabling regulator\n");
}
/*Sensor AVDD 2.8V - CAM_SENSOR_A2P8 */
- if (l16) {
- ret = regulator_disable(l16);
- if (ret)
- cam_err(" l16 error disabling regulator\n");
- }
+ gpio_set_value_cansleep(GPIO_CAM_A_EN, 0);
+
/*Sensor IO 1.8V -CAM_SENSOR_IO_1P8 */
if (l29) {
ret = regulator_disable(l29);
if (ret)
- cam_err(" l29 error disabling regulator\n");
+ cam_err("error disabling regulator\n");
}
/*5M Core 1.2V - CAM_ISP_CORE_1P2*/
gpio_set_value_cansleep(GPIO_CAM_CORE_EN, 0);
- printk(KERN_DEBUG "OFF CAM_CORE_EN \n");
}
#elif defined(CONFIG_ISX012) && defined(CONFIG_S5K8AAY) /* JAGUAR */
@@ -1183,13 +1164,11 @@ static void cam_ldo_power_on(int mode)
printk(KERN_DEBUG "check FLASH_LED_UNLOCK : %d\n", ret);
}
#else
- if (!mode && torchonoff == 0) {
- gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
- (PMIC_MPP_FLASH_LED_UNLOCK), 1);
- ret = gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS
- (PMIC_MPP_FLASH_LED_UNLOCK));
- printk(KERN_DEBUG "check FLASH_LED_UNLOCK : %d\n", ret);
- }
+ gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
+ (PMIC_MPP_FLASH_LED_UNLOCK), 1);
+ ret = gpio_get_value_cansleep(PM8921_MPP_PM_TO_SYS
+ (PMIC_MPP_FLASH_LED_UNLOCK));
+ printk(KERN_DEBUG "check FLASH_LED_UNLOCK : %d\n", ret);
#endif
/*5M Core 1.2V - CAM_ISP_CORE_1P2*/
@@ -1247,10 +1226,8 @@ static void cam_ldo_power_off(int mode)
(PMIC_MPP_FLASH_LED_UNLOCK), 0);
}
#else
- if (!mode && torchonoff == 0) {
- gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
- (PMIC_MPP_FLASH_LED_UNLOCK), 0);
- }
+ gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
+ (PMIC_MPP_FLASH_LED_UNLOCK), 0);
#endif
/*Sensor AF 2.8V -CAM_AF_2P8 */
@@ -1807,11 +1784,7 @@ static void cam_ldo_power_off(int mode)
}
#elif defined(CONFIG_S5C73M3) && defined(CONFIG_S5K6A3YX) /* D2 */
-#if defined(CONFIG_MACH_M2_DCM)
-static int vddCore = 1230000;
-#else
static int vddCore = 1150000;
-#endif
static bool isVddCoreSet;
static u8 gpio_cam_flash_sw;
static u8 pmic_gpio_msm_flash_cntl_en;
@@ -1819,29 +1792,12 @@ static bool isFlashCntlEn;
static void cam_set_isp_core(int level)
{
-
-#if defined(CONFIG_MACH_M2_DCM)
- if (level == 1000000) {
- pr_err("Change core voltage\n");
- vddCore = 1060000;
- } else if (level == 1050000) {
- pr_err("Change core voltage\n");
- vddCore = 1110000;
- } else if (level == 1100000) {
- pr_err("Change core voltage\n");
- vddCore = 1170000;
- } else if (level == 1150000) {
- pr_err("Change core voltage\n");
- vddCore = 1230000;
- } else
- vddCore = level;
-#else
if (level == 1050000) {
pr_err("Change core voltage\n");
vddCore = 1100000;
} else
vddCore = level;
-#endif
+
isVddCoreSet = true;
pr_err("ISP CORE = %d\n", vddCore);
}
@@ -1965,23 +1921,7 @@ static void cam_ldo_power_on(int mode, i
cam_err("error enabling regulator.");
} else
gpio_set_value_cansleep(CAM_CORE_EN, 1);
-#elif defined(CONFIG_MACH_M2_DCM)
- if (system_rev >= BOARD_REV03) {
- printk(KERN_DEBUG "[s5c73m3] dcm check vddCore : %d\n",
- vddCore);
-
- isp_core = regulator_get(NULL, "cam_isp_core");
- ret = regulator_set_voltage(isp_core,
- vddCore, vddCore);
- if (ret)
- cam_err("error setting voltage\n");
-
- ret = regulator_enable(isp_core);
- if (ret)
- cam_err("error enabling regulator.");
- } else
- gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 1);
-#elif defined(CONFIG_MACH_K2_KDI)
+#elif defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 1);
#else
gpio_set_value_cansleep(CAM_CORE_EN, 1);
@@ -2126,16 +2066,7 @@ static void cam_ldo_power_off(int mode)
if (ret)
cam_err("error disabling regulator");
regulator_put(isp_core);
-#elif defined(CONFIG_MACH_M2_DCM)
- if (system_rev >= BOARD_REV03){
- ret = regulator_disable(isp_core);
- if (ret)
- cam_err("error disabling regulator");
- regulator_put(isp_core);
- }
- else
- gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 0);
-#elif defined(CONFIG_MACH_K2_KDI)
+#elif defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 0);
#else
gpio_set_value_cansleep(CAM_CORE_EN, 0);
@@ -2316,15 +2247,11 @@ struct platform_device msm8960_camera_se
#ifdef CONFIG_ISX012
static struct msm_camera_sensor_flash_data flash_isx012 = {
-#if defined(CONFIG_MACH_KONA)
- .flash_type = MSM_CAMERA_FLASH_NONE,
-#else
- .flash_type = MSM_CAMERA_FLASH_LED,
-#endif
+ .flash_type = MSM_CAMERA_FLASH_LED,
};
static struct msm_camera_sensor_platform_info sensor_board_info_isx012 = {
- .mount_angle = 90,
+ .mount_angle = 90,
.sensor_reset = GPIO_CAM1_RST_N,
#ifdef CONFIG_MACH_AEGIS2
.sensor_stby = PM8921_GPIO_PM_TO_SYS(PMIC_GPIO_MAIN_CAM_STBY),
@@ -2430,12 +2357,9 @@ static struct msm_camera_sensor_flash_da
static struct msm_camera_sensor_platform_info sensor_board_info_s5k5ccgx = {
.sensor_reset = GPIO_CAM1_RST_N,
-#if defined(CONFIG_MACH_JASPER)
+#ifdef CONFIG_MACH_JASPER
.mount_angle = 90,
.sensor_stby = PM8921_GPIO_PM_TO_SYS(PMIC_GPIO_MAIN_CAM_STBY),
-#elif defined(CONFIG_MACH_ESPRESSO_VZW)
- .mount_angle = 90,
- .sensor_stby = GPIO_MAIN_CAM_STBY,
#else
.mount_angle = 0,
.sensor_stby = GPIO_MAIN_CAM_STBY,
@@ -2470,7 +2394,7 @@ static struct msm_camera_sensor_flash_da
};
static struct msm_camera_sensor_platform_info sensor_board_info_sr030pc50 = {
-#if defined(CONFIG_MACH_ESPRESSO_ATT) \
+#if defined(CONFIG_MACH_ESPRESSO_VZW) || defined(CONFIG_MACH_ESPRESSO_ATT) \
|| defined(CONFIG_MACH_ESPRESSO10_VZW) \
|| defined(CONFIG_MACH_ESPRESSO10_SPR) \
|| defined(CONFIG_MACH_ESPRESSO10_ATT) \
@@ -2704,11 +2628,7 @@ static ssize_t front_camera_type_show(st
#elif defined(CONFIG_S5K6A3YX)
char cam_type[] = "SLSI_S5K6A3YX\n";
#elif defined(CONFIG_DB8131M)
-#if defined(CONFIG_MACH_INFINITE)
- char cam_type[] = "DB8131A\n";
-#else
char cam_type[] = "DUB_DB8131M\n";
-#endif
#elif defined(CONFIG_SR030PC50)
char cam_type[] = "SILICON_SR030PC50\n";
#else
@@ -2749,11 +2669,7 @@ static ssize_t front_camera_firmware_sho
#elif defined(CONFIG_S5K6A3YX)
char *cam_fw[] = {"S5K6A3", "S5K6A3"}; /*char cam_fw[] = "S5K6A3YX\n";*/
#elif defined(CONFIG_DB8131M)
-#if defined(CONFIG_MACH_INFINITE)
- char cam_fw[] = "DB8131A\n";
-#else
char cam_fw[] = "DB8131M\n";
-#endif
#elif defined(CONFIG_SR030PC50)
char cam_fw[] = "SR030PC50\n";
#else
@@ -2847,56 +2763,6 @@ static ssize_t cameraflash_file_cmd_stor
}
#endif
-#if defined(CONFIG_MACH_EXPRESS)
- if (system_rev >= BOARD_REV05) {
- if (value == 0) {
- pr_err("[Torch flash]OFF\n");
-
- gpio_set_value_cansleep(gpio_flash_en, 0);
-
- if ((system_rev == BOARD_REV05)\
- || (system_rev == BOARD_REV06))
- gpio_set_value_cansleep(
- gpio_flash_set, 0);
-
- torchonoff = 0;
-
- } else {
- pr_err("[Torch flash]ON\n");
- for (i = 1; i > 0; i--) {
- gpio_set_value_cansleep(
- gpio_flash_en, 0);
- udelay(0);
- gpio_set_value_cansleep(
- gpio_flash_en, 1);
- udelay(1);
- }
- torchonoff = 1;
- }
- } else {
- if (value == 0) {
- pr_err("[Torch flash]OFF\n");
- gpio_set_value_cansleep(gpio_flash_en, 0);
- gpio_set_value_cansleep(gpio_flash_set, 0);
- torchonoff = 0;
- } else {
- pr_err("[Torch flash]ON\n");
- gpio_set_value_cansleep(
- gpio_flash_en, 0);
- for (i = 5; i > 1; i--) {
- gpio_set_value_cansleep(
- gpio_flash_set, 1);
- udelay(1);
- gpio_set_value_cansleep(
- gpio_flash_set, 0);
- udelay(1);
- }
- gpio_set_value_cansleep(gpio_flash_set, 1);
- usleep(2*1000);
- torchonoff = 1;
- }
- }
-#else
if (value == 0) {
pr_err("[Torch flash]OFF\n");
gpio_set_value_cansleep(gpio_flash_en, 0);
@@ -2904,9 +2770,6 @@ static ssize_t cameraflash_file_cmd_stor
torchonoff = 0;
} else {
pr_err("[Torch flash]ON\n");
-#if defined(CONFIG_MACH_INFINITE)
- mdelay(5);
-#endif
gpio_set_value_cansleep(gpio_flash_en, 0);
for (i = 5; i > 1; i--) {
@@ -2922,7 +2785,6 @@ static ssize_t cameraflash_file_cmd_stor
torchonoff = 1;
}
#endif
-#endif
return size;
}
@@ -3063,8 +2925,6 @@ static int get_mclk_rev(void)
return ((system_rev >= BOARD_REV07) ? 1 : 0);
#elif defined(CONFIG_MACH_JASPER)
return ((system_rev >= BOARD_REV08) ? 1 : 0);
-#elif defined(CONFIG_MACH_INFINITE)
- return ((system_rev >= BOARD_REV04) ? 1 : 0);
#elif defined(CONFIG_MACH_STRETTO)
return 1;
#elif defined(CONFIG_MACH_SUPERIORLTE_SKT)
@@ -3210,15 +3070,6 @@ void __init msm8960_init_cam(void)
gpio_tlmm_config(GPIO_CFG(GPIO_MSM_FLASH_NOW, 0, GPIO_CFG_OUTPUT,
GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#endif
-
-#if defined(CONFIG_MACH_INFINITE)
- if (system_rev >= BOARD_REV04) {
- gpio_tlmm_config(GPIO_CFG(GPIO_MSM_FLASH_CNTL_EN2, 0,
- GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA),
- GPIO_CFG_ENABLE);
- }
-#endif
-
#endif
/*CAM_MCLK0*/
@@ -3273,36 +3124,16 @@ void __init msm8960_init_cam(void)
s_info = &msm_camera_sensor_isx012_data;
if (rev) {
-#if defined(CONFIG_MACH_APEXQ) || defined(CONFIG_MACH_COMANCHE)
-
+#if defined(CONFIG_MACH_APEXQ) || defined(CONFIG_MACH_COMANCHE) \
+ || defined(CONFIG_MACH_EXPRESS)
s_info->sensor_platform_info->flash_en =
pmic_gpio_msm_flash_cntl_en;
#elif defined(CONFIG_MACH_AEGIS2)
s_info->sensor_platform_info->flash_set =
GPIO_MSM_FLASH_NOW2;
-#elif defined(CONFIG_MACH_EXPRESS)
- if (system_rev >= BOARD_REV07) {
- s_info->sensor_platform_info->flash_en =
- GPIO_MSM_FLASH_NOW;
- s_info->sensor_platform_info->flash_set =
- -1;
- } else{
- s_info->sensor_platform_info->flash_en =
- pmic_gpio_msm_flash_cntl_en;
- }
-#elif defined(CONFIG_MACH_INFINITE)
- s_info->sensor_platform_info->flash_set =
- GPIO_MSM_FLASH_NOW;
- if (system_rev >= BOARD_REV04) {
- s_info->sensor_platform_info->flash_en =
- GPIO_MSM_FLASH_CNTL_EN2;
- } else {
- s_info->sensor_platform_info->flash_en =
- GPIO_MSM_FLASH_CNTL_EN;
- }
#endif
}
-#if defined(CONFIG_MACH_GOGH)
+#if defined(CONFIG_MACH_GOGH) || defined(CONFIG_MACH_INFINITE)
else {
if (system_rev <= BOARD_REV02) {
s_info->sensor_platform_info->flash_en =
@@ -3326,7 +3157,7 @@ void __init msm8960_init_cam(void)
#if defined(CONFIG_MACH_APEXQ) || defined(CONFIG_MACH_COMANCHE) \
|| defined(CONFIG_MACH_EXPRESS) || defined(CONFIG_MACH_AEGIS2) \
- || defined(CONFIG_MACH_JASPER) || defined(CONFIG_MACH_INFINITE)
+ || defined(CONFIG_MACH_JASPER)
if (rev) {
s_info->sensor_platform_info->mclk =
GPIO_CAM_MCLK2;