AnsweredAssumed Answered

VIDIOC_DQBUF failed

Question asked by Yang Lv on Oct 20, 2017
Latest reply on Oct 26, 2017 by igorpadykov

Recently, I modified the driver of tvp5150 according to the driver of adc7180 for imx6q.

Amend as follows:

1、In tvp5150_probe fuction, I added like this :

tvin_plat = c->dev.platform_data;
if (tvin_plat->dvddio_reg) {
dvddio_regulator =
regulator_get(&c->dev, tvin_plat->dvddio_reg);
if (!IS_ERR_VALUE((unsigned long)dvddio_regulator)) {
regulator_set_voltage(dvddio_regulator, 3300000, 3300000);
if (regulator_enable(dvddio_regulator) != 0)
return -ENODEV;
}
}

if (tvin_plat->dvdd_reg) {
dvdd_regulator =
regulator_get(&c->dev, tvin_plat->dvdd_reg);
if (!IS_ERR_VALUE((unsigned long)dvdd_regulator)) {
regulator_set_voltage(dvdd_regulator, 1800000, 1800000);
if (regulator_enable(dvdd_regulator) != 0)
return -ENODEV;
}
}

if (tvin_plat->avdd_reg) {
avdd_regulator =
regulator_get(&c->dev, tvin_plat->avdd_reg);
if (!IS_ERR_VALUE((unsigned long)avdd_regulator)) {
regulator_set_voltage(avdd_regulator, 1800000, 1800000);
if (regulator_enable(avdd_regulator) != 0)
return -ENODEV;
}
}

if (tvin_plat->pvdd_reg) {
pvdd_regulator =
regulator_get(&c->dev, tvin_plat->pvdd_reg);
if (!IS_ERR_VALUE((unsigned long)pvdd_regulator)) {
regulator_set_voltage(pvdd_regulator, 1800000, 1800000);
if (regulator_enable(pvdd_regulator) != 0)
return -ENODEV;
}
}

if (tvin_plat->io_init)
tvin_plat->io_init();
msleep(1);
/* Set initial values for the sensor struct. */
memset(&tvp5150_data, 0, sizeof(tvp5150_data));
tvp5150_data.sen.i2c_client = c;
tvp5150_data.sen.streamcap.timeperframe.denominator = 30;
tvp5150_data.sen.streamcap.timeperframe.numerator = 1;
tvp5150_data.std_id = V4L2_STD_ALL;
video_idx = TVP5150_NOT_LOCKED;
tvp5150_data.sen.pix.width = video_fmts[video_idx].raw_width;
tvp5150_data.sen.pix.height = video_fmts[video_idx].raw_height;
tvp5150_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY; /* YUV422 */
tvp5150_data.sen.pix.priv = 1; /* 1 is used to indicate TV in */
tvp5150_data.sen.on = true;
tvp5150_data.sen.csi = 0;
tvp5150_data.sen.mclk = 0;
tvp5150_data.sen.mclk_source = 0;

gpio_sensor_active();
tvp5150_int_device.priv = &tvp5150_data;
v4l2_int_device_register(&tvp5150_int_device);

2、

static struct v4l2_int_ioctl_desc tvp5150_ioctl_desc[] = {

{vidioc_int_dev_init_num, (v4l2_int_ioctl_func*)ioctl_dev_init},

{vidioc_int_g_ifparm_num, (v4l2_int_ioctl_func*)ioctl_g_ifparm},
{vidioc_int_init_num, (v4l2_int_ioctl_func*)ioctl_init},

{vidioc_int_g_fmt_cap_num, (v4l2_int_ioctl_func*)ioctl_g_fmt_cap},

{vidioc_int_g_fmt_cap_num, (v4l2_int_ioctl_func*)ioctl_g_fmt_cap},

{vidioc_int_enum_framesizes_num, (v4l2_int_ioctl_func *) ioctl_enum_framesizes},
{vidioc_int_g_chip_ident_num, (v4l2_int_ioctl_func *)ioctl_g_chip_ident},
};

Every fuction is same as adv7180 driver!

3、

static struct v4l2_int_slave tvp5150_slave = {
.ioctls = tvp5150_ioctl_desc,
.num_ioctls = ARRAY_SIZE(tvp5150_ioctl_desc),
};

static struct v4l2_int_device tvp5150_int_device = {
.module = THIS_MODULE,
.name = "tvp5150",
.type = v4l2_int_type_slave,
.u = {
.slave = &tvp5150_slave,
},
};

 

I am sure the tvp5150 chip is configured to output BT656 data.

As result, I run my image capture procedure, the print information as follow:

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed

Outcomes