Return-path: Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.14]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n881kkn8010729 for ; Mon, 7 Sep 2009 21:46:47 -0400 Received: from mail02.idc.renesas.com (mail.renesas.com [202.234.163.13]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n881kaKC027557 for ; Mon, 7 Sep 2009 21:46:36 -0400 Date: Tue, 08 Sep 2009 09:48:57 +0900 From: Kuninori Morimoto To: Guennadi Liakhovetski Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII Cc: V4L-Linux Subject: [PATCH 4/4] soc-camera: tw9910: use V4L2_FIELD_INTERLACED_TB/BT for field List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: video4linux-list-bounces@redhat.com Errors-To: video4linux-list-bounces@redhat.com List-ID: Signed-off-by: Kuninori Morimoto --- drivers/media/video/tw9910.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index 478be16..3bbdc76 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c @@ -828,13 +828,19 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) static int tw9910_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) { struct i2c_client *client = sd->priv; + struct tw9910_priv *priv = to_tw9910(client); struct soc_camera_device *icd = client->dev.platform_data; struct v4l2_pix_format *pix = &f->fmt.pix; const struct tw9910_scale_ctrl *scale; + enum v4l2_field field; + + field = i2c_smbus_read_byte_data(client, STATUS1) & 0x10 ? + V4L2_FIELD_INTERLACED_TB : V4L2_FIELD_INTERLACED_BT; - if (V4L2_FIELD_ANY == pix->field) { - pix->field = V4L2_FIELD_INTERLACED; - } else if (V4L2_FIELD_INTERLACED != pix->field) { + if ((V4L2_FIELD_ANY == pix->field) || + (V4L2_FIELD_INTERLACED == pix->field)) { + pix->field = field; + } else if (field != pix->field) { dev_err(&client->dev, "Field type invalid.\n"); return -EINVAL; } -- 1.6.0.4 -- video4linux-list mailing list Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list