From patchwork Wed Aug 3 18:03:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9261685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50BCE60754 for ; Wed, 3 Aug 2016 18:05:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4668828236 for ; Wed, 3 Aug 2016 18:05:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B07B28307; Wed, 3 Aug 2016 18:05:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4E4A28236 for ; Wed, 3 Aug 2016 18:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932490AbcHCSEN (ORCPT ); Wed, 3 Aug 2016 14:04:13 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35297 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932378AbcHCSEF (ORCPT ); Wed, 3 Aug 2016 14:04:05 -0400 Received: by mail-pa0-f67.google.com with SMTP id cf3so14370745pad.2; Wed, 03 Aug 2016 11:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nreA9AzN/CxUDeEHtlGZWCmVJxa0yc9yXa6Fcqax8HY=; b=m+FTinVqvlrk+tSKe1iaEicKy3xMzaL+a7C+4B/tdXhqDBVHyaqxRaOPwfLHRJNP5c O2q/kgDGzYQtLL5IMLoKpM5zwjtVpiTRUPAbF95UtZZlvJoMmcazBaCtsrDXodkjQMV/ FvCtDLETV/FQZ0syJ9Yd/9+RrOvXIJHOsO9cIgQdoU/DeUfyTPdb3z0Mr4nyRra8oL+x 7N7BEFOgOHENeU/6SDiyhtzSqHtB6PaYZ9RZ2Hl8RbemjRlWojT9pxq/+DNggGNi70Rs sEZ6c20NdQzAUfw5NMX5ZWBHGhNr5J+/owMJzSauYIiX7VIMOhHSZkgcaAul+sTosOS3 uDMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nreA9AzN/CxUDeEHtlGZWCmVJxa0yc9yXa6Fcqax8HY=; b=ANnLEnlQHi8k3s00Pptr+o8DhjUxv8CfLW87q2I5cSV/1wMKp962o9CaQIrZXGtE2P hmC9CtEjyZ2O5ipqEP5NwjVSyq5+saRYS5SH3oSFjPqW5Z1CDebd4c+4Yfa/YgoNgdOq uMQZe1SZffB6Bn+6j/r9lWTvjjjbOVX9DpRgE31r/+vWM5im/1wQyO3rfyzBQbNxuGCv 7+J/vQByViKZIkopux7Wzr0TPRUNQVCsdX3BMsSgV+vDYul13QWD+Lo7K8Ctwrmvz5Dd J32ZV2moT6hQI3JECrZFSzaRDnJcOTaCk5G4z5VZihVBxTv5AaXWySRJ/Qk756ef8g43 G9KQ== X-Gm-Message-State: AEkoouukwa33aRZkT9PxAlMSD/wZsfBj9G4kjWa0KONBbEGISm6JdVSq0S5BemE1qgs0Pg== X-Received: by 10.66.237.7 with SMTP id uy7mr82863079pac.152.1470247439937; Wed, 03 Aug 2016 11:03:59 -0700 (PDT) Received: from mothership.sklembedded.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id w64sm14219878pfb.93.2016.08.03.11.03.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 11:03:58 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: lars@metafoo.de Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Steve Longerbeam , Steve Longerbeam , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v4 1/8] media: adv7180: fix field type Date: Wed, 3 Aug 2016 11:03:43 -0700 Message-Id: <1470247430-11168-2-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470247430-11168-1-git-send-email-steve_longerbeam@mentor.com> References: <1470247430-11168-1-git-send-email-steve_longerbeam@mentor.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Steve Longerbeam The ADV7180 and ADV7182 transmit whole fields, bottom field followed by top (or vice-versa, depending on detected video standard). So for chips that do not have support for explicitly setting the field mode via I2P, set the field mode to V4L2_FIELD_ALTERNATE. Signed-off-by: Steve Longerbeam Signed-off-by: Niklas Söderlund Acked-by: Lars-Peter Clausen --- v4: - switch V4L2_FIELD_SEQ_TB/V4L2_FIELD_SEQ_BT to V4L2_FIELD_ALTERNATE. This is from Niklas Söderlund. - remove checks for ADV7180_FLAG_I2P when setting field mode, since I2P support is planned to be removed. - move init of state->curr_norm back to its original location, since state->field init is no longer dependent on state->curr_norm. v3: no changes v2: - the init of state->curr_norm in probe needs to be moved up, ahead of the init of state->field. --- drivers/media/i2c/adv7180.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 95cbc85..192eeae 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -679,10 +679,10 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, switch (format->format.field) { case V4L2_FIELD_NONE: if (!(state->chip_info->flags & ADV7180_FLAG_I2P)) - format->format.field = V4L2_FIELD_INTERLACED; + format->format.field = V4L2_FIELD_ALTERNATE; break; default: - format->format.field = V4L2_FIELD_INTERLACED; + format->format.field = V4L2_FIELD_ALTERNATE; break; } @@ -1251,7 +1251,7 @@ static int adv7180_probe(struct i2c_client *client, return -ENOMEM; state->client = client; - state->field = V4L2_FIELD_INTERLACED; + state->field = V4L2_FIELD_ALTERNATE; state->chip_info = (struct adv7180_chip_info *)id->driver_data; if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {