htcleo: add camera

This commit is contained in:
mastermerlin 2010-08-29 21:18:25 +02:00
parent 5f773f97c8
commit dfbf44e2bb

View File

@ -194,6 +194,9 @@ static struct i2c_board_info base_i2c_devices[] =
.platform_data = &compass_platform_data,
.irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_COMPASS_INT_N),
},
{
I2C_BOARD_INFO("s5k3e2fx", 0x20 >> 1),
},
};
///////////////////////////////////////////////////////////////////////
@ -305,6 +308,116 @@ static struct platform_device htcleo_flashlight_device =
},
};
///////////////////////////////////////////////////////////////////////
// Camera
///////////////////////////////////////////////////////////////////////
static uint32_t camera_off_gpio_table[] =
{
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 */
};
static uint32_t camera_on_gpio_table[] =
{
PCOM_GPIO_CFG(0, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT0 */
PCOM_GPIO_CFG(1, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT1 */
PCOM_GPIO_CFG(2, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT2 */
PCOM_GPIO_CFG(3, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT3 */
PCOM_GPIO_CFG(4, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT4 */
PCOM_GPIO_CFG(5, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT5 */
PCOM_GPIO_CFG(6, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT6 */
PCOM_GPIO_CFG(7, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT7 */
PCOM_GPIO_CFG(8, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT8 */
PCOM_GPIO_CFG(9, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT9 */
PCOM_GPIO_CFG(10, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT10 */
PCOM_GPIO_CFG(11, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* DAT11 */
PCOM_GPIO_CFG(12, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_16MA), /* PCLK */
PCOM_GPIO_CFG(13, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* HSYNC */
PCOM_GPIO_CFG(14, 1, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), /* VSYNC */
PCOM_GPIO_CFG(15, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* MCLK */
};
void config_camera_on_gpios(void)
{
config_gpio_table(camera_on_gpio_table, ARRAY_SIZE(camera_on_gpio_table));
}
void config_camera_off_gpios(void)
{
config_gpio_table(camera_off_gpio_table, ARRAY_SIZE(camera_off_gpio_table));
}
static struct resource msm_camera_resources[] =
{
{
.start = MSM_VFE_PHYS,
.end = MSM_VFE_PHYS + MSM_VFE_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.start = INT_VFE,
INT_VFE,
.flags = IORESOURCE_IRQ,
},
};
static struct msm_camera_device_platform_data msm_camera_device_data =
{
.camera_gpio_on = config_camera_on_gpios,
.camera_gpio_off = config_camera_off_gpios,
.ioext.mdcphy = MSM_MDC_PHYS,
.ioext.mdcsz = MSM_MDC_SIZE,
.ioext.appphy = MSM_CLK_CTL_PHYS,
.ioext.appsz = MSM_CLK_CTL_SIZE,
};
static int flashlight_control(int mode)
{
return aat1271_flashlight_control(mode);
}
static struct camera_flash_cfg msm_camera_sensor_flash_cfg = {
.camera_flash = flashlight_control,
.num_flash_levels = FLASHLIGHT_NUM,
};
static struct msm_camera_sensor_info msm_camera_sensor_s5k3e2fx_data =
{
.sensor_name = "s5k3e2fx",
.sensor_reset = 144,
/* CAM1_PWDN, enabled in a9 */
//.sensor_pwd = 143,
/* CAM1_VCM_EN, enabled in a9 */
//.vcm_pwd = 31,
.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_s5k3e2fx =
{
.name = "msm_camera_s5k3e2fx",
.dev = {
.platform_data = &msm_camera_sensor_s5k3e2fx_data,
},
};
///////////////////////////////////////////////////////////////////////
// bluetooth
///////////////////////////////////////////////////////////////////////
@ -493,13 +606,13 @@ static struct platform_device *devices[] __initdata =
// &htcleo_headset,
&msm_kgsl_device,
// &capella_cm3602,
// &msm_camera_sensor_s5k3e2fx,
&msm_camera_sensor_s5k3e2fx,
&htcleo_flashlight_device,
&htcleo_power,
&qsd_device_spi,
};
///////////////////////////////////////////////////////////////////////
// Vivrator
// Vibrator
///////////////////////////////////////////////////////////////////////
static struct timed_gpio timed_gpios[] = {