I appreciate this is an old thread, but in case someone stumbles across it.
We're using the 3.14.79 kernel at GitHub - SolidRun/linux-fslc: Linux kernel source tree although I believe the adv7180.c driver is the same as the fslc kernel.
PAL was okay, but NTSC rolled - the same issue you described.
The solution was to add a missing case for V4L2_BUF_TYPE_SENSOR in the ioctl_g_fmt_cap() function in adv7180.c...
static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
{
struct sensor *sensor = s->priv;
dev_dbg(&adv7180_data.sen.i2c_client->dev, "adv7180:ioctl_g_fmt_cap\n");
switch (f->type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
pr_debug(" Returning size of %dx%d\n",
sensor->sen.pix.width, sensor->sen.pix.height);
f->fmt.pix = sensor->sen.pix;
break;
case V4L2_BUF_TYPE_SENSOR:
pr_debug("%s: left=%d, top=%d, %dx%d\n", __func__,
sensor->sen.spix.left, sensor->sen.spix.top,
sensor->sen.spix.swidth, sensor->sen.spix.sheight);
f->fmt.spix = sensor->sen.spix;
break;
case V4L2_BUF_TYPE_PRIVATE: {
v4l2_std_id std;
adv7180_get_std(&std);
f->fmt.pix.pixelformat = (u32)std;
}
break;
default:
f->fmt.pix = sensor->sen.pix;
break;
}
return 0;
}
The I2C settings for the adv7180 remained the same (as in I didn't need to do the changes described in this thread). In our case VSYNC and HSYNC are not connected (so seems to be correctly used from those in the data stream).
And also a change to mxc_v4l2_capture.c (.active_top should be 13 in the NTSC settings)...
static video_fmt_t video_fmts[] = {
{
.v4l2_id = V4L2_STD_NTSC,
.name = "NTSC",
.raw_width = 720,
.raw_height = 525,
.active_width = 720,
.active_height = 480,
.active_top = 13,
.active_left = 0,
},
{
.v4l2_id = V4L2_STD_PAL,
.name = "PAL",
.raw_width = 720,
.raw_height = 625,
.active_width = 720,
.active_height = 576,
.active_top = 0,
.active_left = 0,
},
{
.v4l2_id = V4L2_STD_ALL,
.name = "Autodetect",
.raw_width = 720,
.raw_height = 625,
.active_width = 720,
.active_height = 576,
.active_top = 0,
.active_left = 0,
},
};
JamesCC