Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1611774pxk; Fri, 2 Oct 2020 14:17:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybI9d+3owXyTKaTl1rzE2f1dn71PzhDTROljXYWTVoQrN8q85VMO17lWFqbcy61HrDUHty X-Received: by 2002:a17:906:a2cf:: with SMTP id by15mr3952072ejb.298.1601673423179; Fri, 02 Oct 2020 14:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601673423; cv=none; d=google.com; s=arc-20160816; b=nC4uEc1knQYxUt2OTBXC52aHIN6yYrULqe5PbIkCetGdXo5OVt1id4SKox94BZpR4G aebg2p1RkZn50fJ3cGvD2/VYsScvVQVz5Th9B+46c7KW6guTcfhZydJHttL/0anV/1/u GiGtOSvulB927a18fZW6t+l0LepNxBCwdj++oZveWdJc9UzK/jzSMLSGaPyLL0Jm4P1v P6aNG5u62JyzMznGBR3ecCYkNTBweV7pJeMaygYF9AiffHWFdomWjhVqJ4hOQvSwWOZD gchKDDF+NqYHDXXaGcrWj0ycsSniR/KAvIUGQI6cYvsfl9KSwtWt2mNTrcpvCtM+jtZK oVBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=jk2E8xQDxJ/FCC4mA3h0mWLMjGVhap3GK38XZvLl52Q=; b=d6OG1fa8VMo9L3KMmN8CuRnXK6vmQOllAiK5dvcnWLUP1+hT4PbSPg9N8wnKp3/yyV R6dsHnRFZxeB/7QSu66N3gSLIgsseiuFlRxuRnw6n+3/8H3ZXu8cBpF6SZMqf8FVA2XC Owe69h5tBsm8omz9iuHNSmTRIW6ENcX2/9Nnb+Csz6dpSMes0GqYew4qu4iUtaekF/mO t3UKlb5LjcEpj6f+tkkUnyZV/9UWcM7kF7xkqgP0wu/uZtxbtq+o8UxVXwrcfHFnWH+5 s+jt082BFCoLp9uRulwUV/6CM1g9lygB4YHKIcmxGQdUMrBp4J5lmOeYZZDEUcmRpQR6 LuVw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch15si2109080ejb.264.2020.10.02.14.16.40; Fri, 02 Oct 2020 14:17:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725820AbgJBVNj (ORCPT + 99 others); Fri, 2 Oct 2020 17:13:39 -0400 Received: from mga04.intel.com ([192.55.52.120]:55896 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbgJBVNj (ORCPT ); Fri, 2 Oct 2020 17:13:39 -0400 IronPort-SDR: ycG5J1ZnZ2GK1PeWFW/fLs4A0VRnl7Hp5Vi2IIgCv3afO/wql/LEECu9xg610o+/DwPZCxqmOK 6fa/dSgwK0Gg== X-IronPort-AV: E=McAfee;i="6000,8403,9762"; a="160480616" X-IronPort-AV: E=Sophos;i="5.77,329,1596524400"; d="scan'208";a="160480616" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2020 14:13:38 -0700 IronPort-SDR: i3g4u9Rxh/hEXvioCGiWPvXMcewTwUKhj33tGO7l9AtKFw15lZYqPna56zc1UjfONFSmPml2qP xD7i2yEVodnw== X-IronPort-AV: E=Sophos;i="5.77,329,1596524400"; d="scan'208";a="342089885" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2020 14:13:36 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 1E184205EA; Sat, 3 Oct 2020 00:13:34 +0300 (EEST) Date: Sat, 3 Oct 2020 00:13:34 +0300 From: Sakari Ailus To: Lad Prabhakar Cc: Jacopo Mondi , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das Subject: Re: [PATCH v7 2/3] media: i2c: ov772x: Add support for BT.656 mode Message-ID: <20201002211334.GY26842@paasikivi.fi.intel.com> References: <20201002165656.16744-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20201002165656.16744-3-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201002165656.16744-3-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 02, 2020 at 05:56:55PM +0100, Lad Prabhakar wrote: > Add support to read the bus-type for V4L2_MBUS_BT656 and enable BT.656 > mode in the sensor if needed. > > For backward compatibility with older DTS where the bus-type property was > not mandatory, assume V4L2_MBUS_PARALLEL as it was the only supported bus > at the time. v4l2_fwnode_endpoint_alloc_parse() will not fail if > 'bus-type' is not specified. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Biju Das > Reviewed-by: Jacopo Mondi > --- > drivers/media/i2c/ov772x.c | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c > index b56f8d7609e6..6b46ad493bf7 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); Here, too... > + if (ret) > + goto done; > + } > + > ret = regmap_update_bits(priv->regmap, COM2, SOFT_SLEEP_MODE, > enable ? 0 : SOFT_SLEEP_MODE); > if (ret) > @@ -1364,9 +1371,21 @@ static int ov772x_parse_dt(struct i2c_client *client, > return -EINVAL; > } > > + /* > + * For backward compatibility with older DTS where the > + * bus-type property was not mandatory, assume > + * V4L2_MBUS_PARALLEL as it was the only supported bus at the > + * time. v4l2_fwnode_endpoint_alloc_parse() will not fail if > + * 'bus-type' is not specified. > + */ > ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); > - if (ret) > - goto error_fwnode_put; > + if (ret) { > + bus_cfg = (struct v4l2_fwnode_endpoint) > + { .bus_type = V4L2_MBUS_BT656 }; > + ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); > + if (ret) > + goto error_fwnode_put; > + } > > priv->bus_type = bus_cfg.bus_type; > v4l2_fwnode_endpoint_free(&bus_cfg); -- Sakari Ailus