From patchwork Wed May 16 16:32:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10404389 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 BB720601F7 for ; Wed, 16 May 2018 16:32:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8BC228565 for ; Wed, 16 May 2018 16:32:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BF452856F; Wed, 16 May 2018 16:32:53 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3565528565 for ; Wed, 16 May 2018 16:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbeEPQcv (ORCPT ); Wed, 16 May 2018 12:32:51 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:45455 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbeEPQct (ORCPT ); Wed, 16 May 2018 12:32:49 -0400 Received: from w540.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 1769F100024; Wed, 16 May 2018 18:32:46 +0200 (CEST) From: Jacopo Mondi To: niklas.soderlund@ragnatech.se, laurent.pinchart@ideasonboard.com, horms@verge.net.au, geert@glider.be Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH 3/6] media: rcar-vin: Handle data-active property Date: Wed, 16 May 2018 18:32:29 +0200 Message-Id: <1526488352-898-4-git-send-email-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526488352-898-1-git-send-email-jacopo+renesas@jmondi.org> References: <1526488352-898-1-git-send-email-jacopo+renesas@jmondi.org> 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 The data-active property has to be specified when running with embedded synchronization. The VIN peripheral can use HSYNC in place of CLOCKENB when the CLOCKENB pin is not connected, this requires explicit synchronization to be in use. Now that the driver supports 'data-active' property, it makes not sense to zero the mbus configuration flags when running with implicit synch (V4L2_MBUS_BT656). Signed-off-by: Jacopo Mondi --- drivers/media/platform/rcar-vin/rcar-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c index d3072e1..075d08f 100644 --- a/drivers/media/platform/rcar-vin/rcar-core.c +++ b/drivers/media/platform/rcar-vin/rcar-core.c @@ -531,15 +531,21 @@ static int rvin_digital_parse_v4l2(struct device *dev, return -ENOTCONN; vin->mbus_cfg.type = vep->bus_type; + vin->mbus_cfg.flags = vep->bus.parallel.flags; switch (vin->mbus_cfg.type) { case V4L2_MBUS_PARALLEL: vin_dbg(vin, "Found PARALLEL media bus\n"); - vin->mbus_cfg.flags = vep->bus.parallel.flags; break; case V4L2_MBUS_BT656: vin_dbg(vin, "Found BT656 media bus\n"); - vin->mbus_cfg.flags = 0; + + if (!(vin->mbus_cfg.flags & V4L2_MBUS_DATA_ACTIVE_HIGH) && + !(vin->mbus_cfg.flags & V4L2_MBUS_DATA_ACTIVE_LOW)) { + vin_err(vin, + "Missing data enable signal polarity property\n"); + return -EINVAL; + } break; default: vin_err(vin, "Unknown media bus type\n");