IMX53 - implementation of ADV7180

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX53 - implementation of ADV7180

ソリューションへジャンプ
3,515件の閲覧回数
cyrilcrocquesel
Contributor II

Hi,

I work with the imx53 QSB and I tried to display a captured video signal gotten with an ADV7180 (using mxc_v4l2_tvin program test). I get the following error during  execution (command line mxc_v4l2_tvin.out -oh 768 -ow 1024) :

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

VIDIOC_DQBUF failed.

It seems the imx never get the end of frame interruption that is waited as output condition of this called (in modifying the cam->enc_counter value) :

wait_event_interruptible_timeout(cam->enc_queue,cam->enc_counter != 0, 10 * HZ)  //line 1269 from mxc_v4l2_capture.c


I don't find any information to solve this problem. Are there any suggestion?

I could provide log or other information if needed

Cordially

Cyril

ラベル(1)
1 解決策
2,204件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

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

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
2,204件の閲覧回数
yennivenkateswa
Contributor II

test.jpgotest.jpg

hi,

please observe these images, in this images some noise is there.

can you please tell me,why blur images are coming from my analog camera ?

and can you please tell me is it hardware issue or my driver issue ?

Thanks&Regards

Venkatesh

0 件の賞賛
返信
2,204件の閲覧回数
yennivenkateswa
Contributor II

hi Weidong sun,

when i run this command ./mxc_v4l2_tvin.out -ot 0 -ol 10 -ow 720 -oh 480 -m 2 without connect analog camera blue screen is coming. once i connect camera blur video coming. 

0 件の賞賛
返信
2,204件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi venkatesh,

    could you paste a picture of your video here, let me see it .

Regards,

Weidong

0 件の賞賛
返信
2,204件の閲覧回数
yennivenkateswa
Contributor II

IMG_20141209_121814626.jpghi Weidong sun,IMG_20141209_121639064_HDR.jpg

0 件の賞賛
返信
2,205件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信
2,204件の閲覧回数
yennivenkateswa
Contributor II

hi,

i am using adv7180 driver as a reference

modprobe adv7180_camera

modprobe mxc_v4l2_capture

cd /unit_tests

lucid@lucid-desktop:/unit_tests$ ./mxc_v4l2_tvin.out -ot 0 -ol 10 -ow 720 -oh 480 -m 2

problem is iam getting blur video,can you please tell me why like this it is coming?

Thanks&regards

venkatesh

0 件の賞賛
返信
2,204件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Venkatesh,

     It seems that the issue is generated by CVBS input, blue video means that ADV7180 has been working , so you should check if there are some issues with analog camera input.

Regards,

Weidong

0 件の賞賛
返信