Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4454717pxk; Wed, 30 Sep 2020 03:29:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM+du4SL0vNaNpHEDLiA8eIguzswa7u66leTOve/0k0I75+XWZl5Q7zO9wAEn767yI4/0H X-Received: by 2002:aa7:ca46:: with SMTP id j6mr1864376edt.155.1601461795237; Wed, 30 Sep 2020 03:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601461795; cv=none; d=google.com; s=arc-20160816; b=HJR6YD8FfDlNFheOBC9OSKsd2GfnVoYVT85TQkn6Ce60gBVEHHSFQxxRT9GRPkkZ6q 3zC589MushEDD4xNSEEkdvVWPK58X8uDDe0vMRrY15q0qaEHsfjxyYFf9Yc1AioT+rzA s/e6A7aY49L9JeXl/O3lsfyLI2y8gMA1NwyFOZvTt/KbKQKGtHAeTxUne0OPsD0LoG31 a5N+hRxKH6VpNHIdDYBHcQ9+RqScGK3OGqL9t/KopOz1PwTklpRaU9+u8zn5Iy/uVzcB AP8Nik10ZBEtUveQkh0dKQNLtxAqBrIJUL+BdK7NLduPhPKr7ytqJbWrFIh1dltnj+Bk I83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Z9NQEtNTFj2VM1ldghLidfqNZJa7A90FjGiYigUBj0A=; b=N2SwiRgSXldWYwnHAcAQs1IuDhr2uUQQ9WtdQlR92KqyYOyH897WDbAFgMuPRPRKxa cHrsDA6gKxNJL4NoUTGgcmNN7A1kux6jzymXk7GTAnu38Ro2RM6cZqrbxpZ/jLCyEajj bsghMe20Ed84i1KACy2kNUUuvHpMjB0AVBa+mH16hXa7l0nVCtidbv4XY9l+6yw0wHpD slb4caO3UX72ITRxJmJz3h06tOHjpR/RiuLzLUaYzpTGDkwmYAh31orFqTT8PVOBDGts 8+C+HoWkBVGvcANjxVZhWUiV076VDK1JY6cyE9StdJ2aP7lLyFZUAOm8Zn9TKafjzwLD DUJg== 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 l7si847137edv.115.2020.09.30.03.29.32; Wed, 30 Sep 2020 03:29:55 -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 S1729261AbgI3K2R (ORCPT + 99 others); Wed, 30 Sep 2020 06:28:17 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:55650 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728500AbgI3K2Q (ORCPT ); Wed, 30 Sep 2020 06:28:16 -0400 Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 876BF3B815C; Wed, 30 Sep 2020 10:27:04 +0000 (UTC) Received: from uno.localdomain (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 03CA7200005; Wed, 30 Sep 2020 10:26:40 +0000 (UTC) Date: Wed, 30 Sep 2020 12:30:37 +0200 From: Jacopo Mondi To: Lad Prabhakar Cc: Sakari Ailus , Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , "Lad, Prabhakar" Subject: Re: [PATCH v6 1/3] media: i2c: ov772x: Parse endpoint properties Message-ID: <20200930103037.putcmd7sjyaut6lr@uno.localdomain> References: <20200917174224.11430-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200917174224.11430-2-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200917174224.11430-2-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi 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 Looks good! Reviewed-by: Jacopo Mondi Thanks j > --- > 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; > + 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); > + > +error_fwnode_put: > + fwnode_handle_put(ep); > + > + return ret; > +} > + > /* > * i2c_driver function > */ > @@ -1415,6 +1445,10 @@ static int ov772x_probe(struct i2c_client *client) > goto error_clk_put; > } > > + ret = ov772x_parse_dt(client, priv); > + if (ret) > + goto error_clk_put; > + > ret = ov772x_video_probe(priv); > if (ret < 0) > goto error_gpio_put; > -- > 2.17.1 >