All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, jmondi@jmondi.org
Subject: Re: [PATCH 4/5] v4l2-fwnode: Rework v4l2_fwnode_endpoint_parse documentation
Date: Mon, 5 Oct 2020 09:53:01 +0300	[thread overview]
Message-ID: <20201005065301.GA26842@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20201004084013.GE3938@pendragon.ideasonboard.com>

Hi Laurent,

On Sun, Oct 04, 2020 at 11:40:13AM +0300, Laurent Pinchart wrote:
> Hi Sakari,
> 
> Thank you for the patch.
> 
> On Wed, Sep 30, 2020 at 05:48:10PM +0300, Sakari Ailus wrote:
> > Rework the documentation of v4l2_fwnode_endpoint_parse for better
> > readability, usefulness and correctness.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> >  include/media/v4l2-fwnode.h | 62 ++++++++++++++++++++++++-------------
> >  1 file changed, 40 insertions(+), 22 deletions(-)
> > 
> > diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
> > index 0f9a768b1a8d..0c28dc11e829 100644
> > --- a/include/media/v4l2-fwnode.h
> > +++ b/include/media/v4l2-fwnode.h
> > @@ -219,17 +219,26 @@ struct v4l2_fwnode_connector {
> >   * @vep: pointer to the V4L2 fwnode data structure
> >   *
> >   * This function parses the V4L2 fwnode endpoint specific parameters from the
> > - * firmware. The caller is responsible for assigning @vep.bus_type to a valid
> > - * media bus type. The caller may also set the default configuration for the
> > - * endpoint --- a configuration that shall be in line with the DT binding
> > - * documentation. Should a device support multiple bus types, the caller may
> > - * call this function once the correct type is found --- with a default
> > - * configuration valid for that type.
> > - *
> > - * It is also allowed to set @vep.bus_type to V4L2_MBUS_UNKNOWN. USING THIS
> > - * FEATURE REQUIRES "bus-type" PROPERTY IN DT BINDINGS. For old drivers,
> > - * guessing @vep.bus_type between CSI-2 D-PHY, parallel and BT.656 busses is
> > - * supported. NEVER RELY ON GUESSING @vep.bus_type IN NEW DRIVERS!
> > + * firmware. There are two ways to use this function, either by letting it
> > + * obtain the type of the bus (by setting the @vep.bus_type field to
> > + * V4L2_MBUS_UNKNOWN) or specifying the bus type explicitly to one of the &enum
> > + * v4l2_mbus_type types.
> > + *
> > + * When @vep.bus_type is V4L2_MBUS_UNKNOWN, the function will use the "bus-type"
> > + * property to determine the type when it is available. The caller is
> > + * responsible for validating the contents of @vep.bus_type field after the call
> > + * returns.
> 
> As an additional improvement, I wonder if it would make sense to turn
> the bus types into a bit flag, to let the caller tell which bus types it
> supports. Or maybe that would be overkill ?
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks for the review!

I wonder how useful that would be as drivers typically do bus type specific
checks right after this function returns. Although I wouldn't object a
patch doing that if it's seen useful somewhere.

-- 
Sakari Ailus

  reply	other threads:[~2020-10-05  6:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 14:48 [PATCH 0/5] V4L2 fwnode fixes, improvements and cleanups Sakari Ailus
2020-09-30 14:48 ` [PATCH 1/5] adv748x: Zero entire struct v4l2_fwnode_endpoint Sakari Ailus
2020-10-02 15:48   ` Niklas Söderlund
2020-10-04  8:31   ` Laurent Pinchart
2020-09-30 14:48 ` [PATCH 2/5] v4l2-fwnode: v4l2_fwnode_endpoint_parse caller must init vep argument Sakari Ailus
2020-10-02 15:53   ` Niklas Söderlund
2020-10-02 21:01     ` Sakari Ailus
2020-10-04  8:35   ` Laurent Pinchart
2020-09-30 14:48 ` [PATCH 3/5] v4l2-fwnode: Don't zero parts of struct v4l2_fwnode_endpoint anymore Sakari Ailus
2020-10-02 17:42   ` Niklas Söderlund
2020-10-04  8:36   ` Laurent Pinchart
2020-09-30 14:48 ` [PATCH 4/5] v4l2-fwnode: Rework v4l2_fwnode_endpoint_parse documentation Sakari Ailus
2020-10-02 17:21   ` Niklas Söderlund
2020-10-04  8:40   ` Laurent Pinchart
2020-10-05  6:53     ` Sakari Ailus [this message]
2020-09-30 14:48 ` [PATCH 5/5] v4l2-fwnode: Say it's fine to use v4l2_fwnode_endpoint_parse Sakari Ailus
2020-10-02 17:22   ` Niklas Söderlund
2020-10-04  8:41   ` Laurent Pinchart
2020-10-05  6:55     ` Sakari Ailus
2020-10-05  7:46     ` Sakari Ailus

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=20201005065301.GA26842@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=jmondi@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /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.