Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp739091pxk; Thu, 1 Oct 2020 12:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdjfgFH3jeFNct0ISU2SP9udhdU1/oJsvVjhcGPDNl1amZfyYxw9C4K5hchBVx6ngPgV5u X-Received: by 2002:a17:906:4c4c:: with SMTP id d12mr9421332ejw.491.1601580951380; Thu, 01 Oct 2020 12:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601580951; cv=none; d=google.com; s=arc-20160816; b=WZNw/D4TM/I7nyIeVD0MPylw64qbinsdRu8oYmpErLFZAp+dK3r2QJD3BJIMbKLusw Yo/AX1Jf1gVEL/xo1tMeGr5uOAHFLEknBQufav3XVPNYsg38arof3YdLuRsiWPPFSg91 Tpe9RXDX/u/yNkGrEYsj68xX6lGG1t71mYZeybqT87+bMS8LNcY/p5s/guHzucToIu3a AFV1Q7QEtbWDdqDqpBNNPmLYXt2zVwWIiGM5Zy+9ExtRTkwjf5XRYgJpk6x1CzN/Oedj E7KPT8fjcgb73e4x8NUV3lNbS2iambr1xGGdyheIAj17vK+rD+n3NETMIllPbDA591Ne 4ecw== 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=4++IbdGgoHG7+GlYUAVS08bwWq0gKbP7Mj2KqzfpnW8=; b=VXIVsMWgo7PWLSias+b3zZxdzTorVpglVshLLNqj0eqUVOYdoZo06JUob4HaxuIoF1 fGmlvCuiSY76TPz7LyENvp/A1tPFJ+tRt5r6tkLrOUqrIPwn5n0Fre03tCq3d1ERmsRn meiA+gyikF2S4r7Qa7ulXCyl8TSLcT+V6+0eWaVUDSRvHxCiE9rezb+NWgRVHSdRLaR4 mpSna5YgYHMV/L+AEuNpLx1T4ThgNgSmrY5KUhFp8V/CBl0tcXA9pNmnK3xO9R4nT+7Z 7o80G+WJz2uw7FX+uveWFxBeuJ8O57YgTSvjUbzqvivVZIK5u46n4at8VAz+JCoeoraH LkUQ== 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 kt18si4134023ejb.338.2020.10.01.12.35.28; Thu, 01 Oct 2020 12:35: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732711AbgJATeX (ORCPT + 99 others); Thu, 1 Oct 2020 15:34:23 -0400 Received: from mga01.intel.com ([192.55.52.88]:9885 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729993AbgJATeX (ORCPT ); Thu, 1 Oct 2020 15:34:23 -0400 IronPort-SDR: KLrPimqFu8V6XM6tpuixUFrcco+/nXpZsr0b7lYAexU83/cP9IEV4sTH8CyH+4lecdwO9Dz+ht mTNVJFo4TD/Q== X-IronPort-AV: E=McAfee;i="6000,8403,9761"; a="180969962" X-IronPort-AV: E=Sophos;i="5.77,324,1596524400"; d="scan'208";a="180969962" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 12:34:21 -0700 IronPort-SDR: 6fxbX/vp4tfPSW725Un360VuAcraUtk4SfFHtCNMfLpIIz1R27PHe3hU10n8F0cla1VKXGiGWP y5Ds7yzXg8rQ== X-IronPort-AV: E=Sophos;i="5.77,324,1596524400"; d="scan'208";a="308767771" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 12:34:18 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 12A562068C; Thu, 1 Oct 2020 22:34:14 +0300 (EEST) Date: Thu, 1 Oct 2020 22:34:14 +0300 From: Sakari Ailus To: "Lad, Prabhakar" Cc: Lad Prabhakar , Jacopo Mondi , Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , linux-media , LKML , Linux-Renesas , Biju Das Subject: Re: [PATCH v6 1/3] media: i2c: ov772x: Parse endpoint properties Message-ID: <20201001193413.GR26842@paasikivi.fi.intel.com> References: <20200917174224.11430-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200917174224.11430-2-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200930114529.GM26842@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 01:19:40PM +0100, Lad, Prabhakar wrote: > HI Sakari, > > Thank you for the review. > > On Wed, Sep 30, 2020 at 12:45 PM Sakari Ailus > wrote: > > > > Hi Prabhakar, > > > > On Thu, Sep 17, 2020 at 06:42:22PM +0100, Lad Prabhakar wrote: > > > Parse endpoint properties using v4l2_fwnode_endpoint_alloc_parse() > > > to determine the bus type and store it in the driver structure. > > > > > > Set bus_type to V4L2_MBUS_PARALLEL as it's the only supported one > > > > > > Signed-off-by: Lad Prabhakar > > > --- > > > drivers/media/i2c/ov772x.c | 34 ++++++++++++++++++++++++++++++++++ > > > 1 file changed, 34 insertions(+) > > > > > > diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c > > > index 2cc6a678069a..f61a3f09ad64 100644 > > > --- a/drivers/media/i2c/ov772x.c > > > +++ b/drivers/media/i2c/ov772x.c > > > @@ -31,6 +31,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > > > > @@ -434,6 +435,7 @@ struct ov772x_priv { > > > #ifdef CONFIG_MEDIA_CONTROLLER > > > struct media_pad pad; > > > #endif > > > + enum v4l2_mbus_type bus_type; > > > }; > > > > > > /* > > > @@ -1348,6 +1350,34 @@ static const struct v4l2_subdev_ops ov772x_subdev_ops = { > > > .pad = &ov772x_subdev_pad_ops, > > > }; > > > > > > +static int ov772x_parse_dt(struct i2c_client *client, > > > + struct ov772x_priv *priv) > > > +{ > > > + struct v4l2_fwnode_endpoint bus_cfg; > > > + struct fwnode_handle *ep; > > > + int ret; > > > + > > > + ep = fwnode_graph_get_next_endpoint(dev_fwnode(&client->dev), > > > + NULL); > > > + if (!ep) { > > > + dev_err(&client->dev, "Endpoint node not found\n"); > > > + return -EINVAL; > > > + } > > > + > > > + bus_cfg.bus_type = V4L2_MBUS_PARALLEL; > > > > Please zero the entire struct, i.e. do this assignment in the declaration. > > > Agreed, but instead at the declaration I would prefer here as below, > since patch 2/3 has a comment related to backward compatibility with > the bindings. Is this OK with you ? > bus_cfg = (struct v4l2_fwnode_endpoint) > { .bus_type = V4L2_MBUS_PARALLEL }; Why not in variable declaration? -- Sakari Ailus