From patchwork Tue Jul 18 15:51:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9848783 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 09DE4602C8 for ; Tue, 18 Jul 2017 15:51:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D77F122B27 for ; Tue, 18 Jul 2017 15:51:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC5E2269DA; Tue, 18 Jul 2017 15:51:33 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 4A40F22B27 for ; Tue, 18 Jul 2017 15:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411AbdGRPvb (ORCPT ); Tue, 18 Jul 2017 11:51:31 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:58120 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbdGRPvb (ORCPT ); Tue, 18 Jul 2017 11:51:31 -0400 Received: from avalon.ideasonboard.com (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 05C4C2017E; Tue, 18 Jul 2017 17:50:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1500393053; bh=d03A3QzMfv3hm9ZrJy6/WANOwg0l1B882SZrmMFKgLg=; h=From:To:Cc:Subject:Date:From; b=haw4JyfzIWDcdsont5ZzOMhMC3SM509c5bzm7v74yw7xkseS38VpzHcgYlyzJE8Kn 7rl3ykJJmfcpSaePQpRmmijqDBYUos7D5l1zh//9mhM6qCc/x1MTUsvbR1WDmefOVI /JH3sEaOVFaDtfWB82yxwNiUhrJoEtZZzjJsm2yo= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Sakari Ailus Subject: [PATCH] v4l: omap3isp: Get the parallel bus type from DT Date: Tue, 18 Jul 2017 18:51:35 +0300 Message-Id: <20170718155135.29632-1-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.13.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 The OMAP3 ISP supports both external and embedded BT.656 synchronization for parallel buses. It currently gets the bus type information from the source subdev through the .g_mbus_config() operation, but should instead get it from DT as that's the authoritative source of bus configuration information. Signed-off-by: Laurent Pinchart --- drivers/media/platform/omap3isp/isp.c | 1 + drivers/media/platform/omap3isp/ispccdc.c | 8 +------- drivers/media/platform/omap3isp/omap3isp.h | 2 ++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 9df64c189883..5ddf3396b7da 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2039,6 +2039,7 @@ static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode, !!(vep.bus.parallel.flags & V4L2_MBUS_FIELD_EVEN_LOW); buscfg->bus.parallel.data_pol = !!(vep.bus.parallel.flags & V4L2_MBUS_DATA_ACTIVE_LOW); + buscfg->bus.parallel.bt656 = vep.bus_type == V4L2_MBUS_BT656; break; case ISP_OF_PHY_CSIPHY1: diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index 7207558d722c..4947876cfadf 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -1139,15 +1139,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) pad = media_entity_remote_pad(&ccdc->pads[CCDC_PAD_SINK]); sensor = media_entity_to_v4l2_subdev(pad->entity); if (ccdc->input == CCDC_INPUT_PARALLEL) { - struct v4l2_mbus_config cfg; - int ret; - - ret = v4l2_subdev_call(sensor, video, g_mbus_config, &cfg); - if (!ret) - ccdc->bt656 = cfg.type == V4L2_MBUS_BT656; - parcfg = &((struct isp_bus_cfg *)sensor->host_priv) ->bus.parallel; + ccdc->bt656 = parcfg->bt656; } /* CCDC_PAD_SINK */ diff --git a/drivers/media/platform/omap3isp/omap3isp.h b/drivers/media/platform/omap3isp/omap3isp.h index 443e8f7673e2..48508d452556 100644 --- a/drivers/media/platform/omap3isp/omap3isp.h +++ b/drivers/media/platform/omap3isp/omap3isp.h @@ -46,6 +46,7 @@ enum isp_interface_type { * 0 - Positive, 1 - Negative * @data_pol: Data polarity * 0 - Normal, 1 - One's complement + * @bt656: Data contain BT.656 embedded synchronization */ struct isp_parallel_cfg { unsigned int data_lane_shift:3; @@ -54,6 +55,7 @@ struct isp_parallel_cfg { unsigned int vs_pol:1; unsigned int fld_pol:1; unsigned int data_pol:1; + unsigned int bt656; }; enum {