Hello,Cyril,
By default, In iMX53QSB BSP, ADV7180(we call it TV IN) is not supported, if you want it to support it, you will have to add corresponding codes to BSP file (linux/arch/arm/mx53_loco.c), the following code is tested and passed on i.mx51 platform. you can refer to them.
Open mx53_loco.c file and do :
(1) define a GPIO for ADV7180 power and reset control
#define PAD_CVBS_PWDN (1*32 + 22) /* GPIO_2_22 */
#define PAD_CVBS_RST (1*32 + 23) /* GPIO_2_23 */
(2)IOMUX configuration for CSI0 or CSI1
static iomux_v3_cfg_t mx53_loco_pads[] = {
.....
/* CSI0 pins */
MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12,
MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13,
MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14,
MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15,
MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16,
MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17,
MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18,
MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19,
MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC,
MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC,
MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK,
....
}
In mx53_loco.c, there is no CSI0_DAT12 pin, you will have to add it like above.
(3)define a function for power control
static void adv7180_pwdn(int pwdn)
{
gpio_request(PAD_CVBS_PWDN, "tvin-pwr");
if (pwdn)
gpio_set_value(PAD_CVBS_PWDN, 0);
else
gpio_set_value(PAD_CVBS_PWDN, 1);
gpio_free(PAD_CVBS_PWDN);
}
(4)define camera data
static struct mxc_camera_platform_data camera_data = {
.csi = 0,
};
static struct mxc_tvin_platform_data adv7180_data = {
.dvddio_reg = NULL,
.dvdd_reg = NULL,
.avdd_reg = NULL,
.pvdd_reg = NULL,
.pwdn = adv7180_pwdn,
.reset = NULL,
.cvbs = true,
};
(5)add ADV7180 to corresponding I2C BUS
static struct i2c_board_info soft_i2c0_dev_info[] __initdata = {
{
.type = "adv7180",
.addr = 0x20,
.platform_data = (void *)&adv7180_data,
},
};
(6)Power On and pull-up reset pin to High
In io_init function , do :
/* ADV7180 pwr on */
gpio_request(PAD_CVBS_PWDN, "tv-pwr-dn");
gpio_direction_output(PAD_CVBS_PWDN, 0);
/* ADV7180 Reset */
gpio_request(PAD_CVBS_RST, "cvbs-reset");
gpio_direction_output(PAD_CVBS_RST, 0);
msleep(10);
gpio_set_value(PAD_CVBS_RST,1);
(7)Register I2C device in function board_init()
i2c_register_board_info(1, mxc_i2c0_board_info,ARRAY_SIZE(mxc_i2c0_board_info));
(8)select ADV7180 when you run "make menuconfig".
Please notice, adv7180 driver is at "linux/drivers/media/video/mxc/capture/adv7180.c", don't select "linux/drivers/meida/video/adv7180.c"
Ok,Please try to test !
Regards,
Weidong