Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1676805pxk; Sun, 13 Sep 2020 11:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrgNPr0bsEN8meuzv+m72rhL/b8KT8vjoz7+UixQ+DluvRgZinV5JEJTo+J29KZYThq1Oj X-Received: by 2002:a17:907:70cb:: with SMTP id yk11mr11084061ejb.312.1600022692000; Sun, 13 Sep 2020 11:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600022691; cv=none; d=google.com; s=arc-20160816; b=gctziPKaog1Tv7MGLI5IfF5hFD9js1r6sI4IiReLAfv9AiIUQQpwad5javE4j3S3Gf tlomBPmMRYdpUOr2MwOezWIeaK1BJaE+zmVX1VTpG6yiGRzxqzTQCTfcFOgtwENzawhB 7phbj6yRgTLCnOPa6CSrT7dUrgVpc5kXUEJ95+1iOzYdccYDufMTaip3xR7QNlIo3vgy IPlgfDtzF2fTrPNEwIaY+hbQIdcnyCQ7eNDJU89MvCtGpJaKwpvDAo4kMta91qbfQ98q V5Qr7WJNd8iPfvZFPZSYo3q3BKihRewkJqfGU3jPGkLakfJDhI4S8uu36He/Cu7GdSwe +eRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=BKH0BCHTEIwTChqSz6+Ud+0anqimtyatOrH3jhzr25g=; b=LBJW1TjKoTgCtFfD7/Zi8iloAKUtrtQUEjDpw82T8Mmt45ciqvyg2WE+oWuHJBYc17 eGP1GIo8uACIbi7ELepIEz3tWljHVpXYthPPMLhNkU2CPGChHhXCnsDaTBpGeEgsPKf7 JDJuOHQGF5oJ/TILZgfbNzjQhf4Qp1TJ2pyjlnUaNpNzZYiaMWZPuivlkC0q/X6Y1yu/ gykfNMk+zN9UAj1uxHCwUwZaxzdt9gkkBLW5OiwCI6L7gVq77GosCXkr586MP4GqkSgr 5rBjuh4fD7BRKEjVDhGJjVp2au3+W+etxdIE5gHXMxoRCsDtIQG9J26PIJphEM811+nJ Ho5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si5886366edi.140.2020.09.13.11.44.30; Sun, 13 Sep 2020 11:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726004AbgIMSnS (ORCPT + 99 others); Sun, 13 Sep 2020 14:43:18 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:58490 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725970AbgIMSnA (ORCPT ); Sun, 13 Sep 2020 14:43:00 -0400 X-IronPort-AV: E=Sophos;i="5.76,423,1592838000"; d="scan'208";a="56925266" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 14 Sep 2020 03:42:58 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 5608B40078B7; Mon, 14 Sep 2020 03:42:56 +0900 (JST) From: Lad Prabhakar To: Jacopo Mondi , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Lad Prabhakar , Prabhakar Subject: [PATCH v4 2/3] media: i2c: ov772x: Add support for BT656 mode Date: Sun, 13 Sep 2020 19:42:46 +0100 Message-Id: <20200913184247.618-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200913184247.618-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20200913184247.618-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to read the bus-type for V4L2_MBUS_BT656 and enable BT656 mode in the sensor if needed. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das --- drivers/media/i2c/ov772x.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c index 551082aa7026..edd7c4c22225 100644 --- a/drivers/media/i2c/ov772x.c +++ b/drivers/media/i2c/ov772x.c @@ -583,6 +583,13 @@ static int ov772x_s_stream(struct v4l2_subdev *sd, int enable) if (priv->streaming == enable) goto done; + if (priv->bus_type == V4L2_MBUS_BT656) { + ret = regmap_update_bits(priv->regmap, COM7, ITU656_ON_OFF, + enable ? ITU656_ON_OFF : ~ITU656_ON_OFF); + if (ret) + goto done; + } + ret = regmap_update_bits(priv->regmap, COM2, SOFT_SLEEP_MODE, enable ? 0 : SOFT_SLEEP_MODE); if (ret) @@ -1427,16 +1434,24 @@ static int ov772x_probe(struct i2c_client *client) goto error_clk_put; } - bus_cfg.bus_type = V4L2_MBUS_PARALLEL; + bus_cfg = (struct v4l2_fwnode_endpoint) + { .bus_type = V4L2_MBUS_BT656 }; ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); priv->bus_type = bus_cfg.bus_type; v4l2_fwnode_endpoint_free(&bus_cfg); if (ret) { - /* For backward compatibility with the existing DT where - * bus-type isnt specified fallback to V4L2_MBUS_PARALLEL - */ - priv->bus_type = V4L2_MBUS_PARALLEL; - dev_notice(&client->dev, "Falling back to V4L2_MBUS_PARALLEL mode\n"); + bus_cfg.bus_type = V4L2_MBUS_PARALLEL; + ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); + priv->bus_type = bus_cfg.bus_type; + v4l2_fwnode_endpoint_free(&bus_cfg); + if (ret) { + /* For backward compatibility with the existing DT where + * bus-type isnt specified fallback to V4L2_MBUS_PARALLEL + */ + priv->bus_type = V4L2_MBUS_PARALLEL; + dev_notice(&client->dev, + "Falling back to V4L2_MBUS_PARALLEL mode\n"); + } } ret = ov772x_video_probe(priv); -- 2.17.1