From: jmondi <jacopo@jmondi.org>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
laurent.pinchart@ideasonboard.com,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v1 05/12] media: rcar: vin: Prepare to parse Gen3 digital input
Date: Tue, 20 Jun 2017 09:28:29 +0200 [thread overview]
Message-ID: <20170620072829.GB27008@w540> (raw)
In-Reply-To: <20170619193946.GF11365@bigcity.dyn.berto.se>
Hi Niklas,
thanks for review
On Mon, Jun 19, 2017 at 09:39:46PM +0200, Niklas Söderlund wrote:
> Hi Jacopo,
>
> Thanks for your patch.
>
> On 2017-06-19 19:04:42 +0200, Jacopo Mondi wrote:
> > Support parsing digital input on configurable port id and reg
> > properties. Also make the function return -ENOENT when no subdevice is
> > found.
> > This change is needed to support parsing digital input on Gen3.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > ---
> > drivers/media/platform/rcar-vin/rcar-core.c | 22 ++++++++++++----------
> > 1 file changed, 12 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
> > index 175f138..ef61bcc 100644
> > --- a/drivers/media/platform/rcar-vin/rcar-core.c
> > +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> > @@ -511,7 +511,9 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
> > return 0;
> > }
> >
> > -static int rvin_digital_graph_parse(struct rvin_dev *vin)
> > +static int rvin_digital_graph_parse(struct rvin_dev *vin,
> > + unsigned int port,
> > + unsigned int reg)
> > {
> > struct device_node *ep, *np;
> > int ret;
> > @@ -519,13 +521,9 @@ static int rvin_digital_graph_parse(struct rvin_dev *vin)
> > vin->digital.asd.match.fwnode.fwnode = NULL;
> > vin->digital.subdev = NULL;
> >
> > - /*
> > - * Port 0 id 0 is local digital input, try to get it.
> > - * Not all instances can or will have this, that is OK
> > - */
> > - ep = of_graph_get_endpoint_by_regs(vin->dev->of_node, 0, 0);
> > + ep = of_graph_get_endpoint_by_regs(vin->dev->of_node, port, reg);
>
> I don't think it's necessary to supply the port and reg from the caller.
> If the DT proposed in rcar_vin.txt is used.
>
> > if (!ep)
> > - return 0;
> > + return -ENOENT;
>
> I'm not saying this is wrong, but why do you change this? I can't see a
> clear advantage in doing so. And if do it I think it should be done in a
> separate patch explaining why.
For both questions, as I parse entries in port@2 and
rvin_digital_notify_bound was intended to use port@0 by default I made
port and reg parameters. I use -ENOENT to distinguish the case where
no endpoint has been found
>
> >
> > np = of_graph_get_remote_port_parent(ep);
> > if (!np) {
> > @@ -555,11 +553,15 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
> > if (ret)
> > return ret;
> >
> > - ret = rvin_digital_graph_parse(vin);
> > - if (ret)
> > + /*
> > + * Port 0 id 0 is local digital input, try to get it.
> > + * Not all instances can or will have this, that is OK
> > + */
> > + ret = rvin_digital_graph_parse(vin, 0, 0);
> > + if (ret && ret != -ENOENT)
> > return ret;
> >
> > - if (!vin->digital.asd.match.fwnode.fwnode) {
> > + if (ret == -ENOENT) {
> > vin_dbg(vin, "No digital subdevice found\n");
> > return -ENODEV;
> > }
> > --
> > 2.7.4
> >
>
> --
> Regards,
> Niklas Söderlund
next prev parent reply other threads:[~2017-06-20 7:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 17:04 [PATCH v1 00/12] rcar: vin: Add digital input to Gen3 Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 01/12] arm64: boot: dts: salvator-x: Add camera module Jacopo Mondi
2017-06-20 7:20 ` Geert Uytterhoeven
2017-06-20 7:45 ` Laurent Pinchart
2017-06-19 17:04 ` [PATCH v1 02/12] arm64: boot: dts: Salvator-X: Add VIN parallel input Jacopo Mondi
2017-06-19 19:32 ` Niklas Söderlund
2017-06-19 17:04 ` [PATCH v1 03/12] media: i2c: mt9m111: Skip chid identification Jacopo Mondi
2017-06-20 7:48 ` Laurent Pinchart
2017-06-26 13:19 ` jmondi
2017-06-19 17:04 ` [PATCH v1 04/12] media: i2c: mt9m111: Add source pad Jacopo Mondi
2017-06-20 7:50 ` Laurent Pinchart
2017-06-19 17:04 ` [PATCH v1 05/12] media: rcar: vin: Prepare to parse Gen3 digital input Jacopo Mondi
2017-06-19 19:39 ` Niklas Söderlund
2017-06-20 7:28 ` jmondi [this message]
2017-06-19 17:04 ` [PATCH v1 06/12] media: rcar: vin: Accept parallel input on Gen3 Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 07/12] media: rcar: vin: Add ID for " Jacopo Mondi
2017-06-19 19:46 ` Niklas Söderlund
2017-06-19 17:04 ` [PATCH v1 08/12] media: rcar: vin: Parse digital input after CSI " Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 09/12] media: rcar: vin: Install notifier for digital input Jacopo Mondi
2017-06-19 19:51 ` Niklas Söderlund
2017-06-20 7:32 ` jmondi
2017-06-19 17:04 ` [PATCH v1 10/12] media: rcar: vin: Add digital input mask to vin_dev Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 11/12] media: rcar: vin: Store VIN instance id Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 12/12] media: rcar: vin: Link digital subdev to VIN instance Jacopo Mondi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170620072829.GB27008@w540 \
--to=jacopo@jmondi.org \
--cc=jacopo+renesas@jmondi.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.