From: Conor Dooley <conor@kernel.org>
To: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: jacopo.mondi@ideasonboard.com, laurent.pinchart@ideasonboard.com,
martin.hecht@avnet.eu, michael.roeder@avnet.eu,
linuxfancy@googlegroups.com,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Hans Verkuil" <hverkuil@xs4all.nl>,
"Marco Felsch" <m.felsch@pengutronix.de>,
"Gerald Loacker" <gerald.loacker@wolfvision.net>,
"Mikhail Rudenko" <mike.rudenko@gmail.com>,
"Nicholas Roth" <nicholas@rothemail.net>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Michael Riesch" <michael.riesch@wolfvision.net>,
"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
"Krzysztof Hałasa" <khalasa@piap.pl>,
"Shawn Tu" <shawnx.tu@intel.com>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/3] media: dt-bindings: alvium: add document YAML binding
Date: Wed, 7 Jun 2023 18:16:19 +0100 [thread overview]
Message-ID: <20230607-pyromania-germinate-b5e3dbd54632@spud> (raw)
In-Reply-To: <20230607131936.382406-3-tomm.merciai@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2679 bytes --]
Hey Tommaso,
On Wed, Jun 07, 2023 at 03:19:24PM +0200, Tommaso Merciai wrote:
> + alliedvision,lp2hs-delay-us:
> + maximum: 150000
> + description: |
> + Low power to high speed delay time.
> +
> + If the value is larger than 0, the camera forces a reset of all
> + D-PHY lanes for the duration specified by this property. All lanes
> + will transition to the low-power state and back to the high-speed
> + state after the delay. Otherwise the lanes will transition to and
> + remain in the high-speed state immediately after power on.
> +
> + This is meant to help CSI-2 receivers synchronizing their D-PHY
> + RX.
Since this new version was posted before I got a chance to reply, I
still don't think it makes sense to allow 0 & then special case it,
when testing for the presence of a property is trivial.
The property should describe some behaviour/property of the hardware,
not be a mechanism to convey what you want to write into registers.
I don't really get why you'd not do:
If present, the camera forces a reset of all D-PHY lanes, for the
duration specified by this property. All lanes will transition to
the low-power state and back to the high-speed state after the
delay.
Otherwise the lanes will transition to and remain in the high-speed
state immediately after power on.
> +static int alvium_get_dt_data(struct alvium_dev *alvium)
> +{
> + struct device *dev = &alvium->i2c_client->dev;
> + struct device_node *node = dev->of_node;
> + struct fwnode_handle *endpoint;
> + int ret = 0;
> +
> + if (!node)
> + return -EINVAL;
> +
> + ret = fwnode_property_read_u32(dev_fwnode(dev),
> + "alliedvision,lp2hs-delay-us",
> + &alvium->lp2hs_delay);
> + if (ret)
> + dev_info(dev, "lp2hs-delay-us not found\n");
And this print, which I also don't understand the presence of as
well behaving driver should be quiet, goes away.
Cheers,
Conor.
> +
> + endpoint = fwnode_graph_get_next_endpoint(dev_fwnode(dev), NULL);
> + if (!endpoint) {
> + dev_err(dev, "endpoint node not found\n");
> + return -EINVAL;
> + }
> +
> + if (v4l2_fwnode_endpoint_alloc_parse(endpoint, &alvium->ep)) {
> + dev_err(dev, "could not parse endpoint\n");
> + return 0;
> + }
> +
> + if (alvium->ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
> + dev_err(dev, "unsupported bus type\n");
> + return -EINVAL;
> + }
> +
> + if (!alvium->ep.nr_of_link_frequencies) {
> + dev_err(dev, "no link frequencies defined");
> + return -EINVAL;
> + }
> +
> + dev_info(dev, "freq: %llu\n",
> + alvium->ep.link_frequencies[0]);
> + dev_info(dev, "lanes: %d\n",
> + alvium->ep.bus.mipi_csi2.num_data_lanes);
> +
> + return 0;
> +}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-06-07 17:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230607131936.382406-1-tomm.merciai@gmail.com>
2023-06-07 13:19 ` [PATCH v4 1/3] dt-bindings: vendor-prefixes: Add prefix alliedvision Tommaso Merciai
2023-06-07 13:19 ` [PATCH v4 2/3] media: dt-bindings: alvium: add document YAML binding Tommaso Merciai
2023-06-07 14:06 ` Laurent Pinchart
2023-06-07 14:19 ` Tommaso Merciai
2023-06-07 14:18 ` Krzysztof Kozlowski
2023-06-07 15:20 ` Tommaso Merciai
2023-06-07 16:11 ` Krzysztof Kozlowski
2023-06-07 19:38 ` Tommaso Merciai
2023-06-07 14:20 ` Rob Herring
2023-06-07 17:16 ` Conor Dooley [this message]
2023-06-07 19:49 ` Tommaso Merciai
2023-06-07 20:46 ` Conor Dooley
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=20230607-pyromania-germinate-b5e3dbd54632@spud \
--to=conor@kernel.org \
--cc=benjamin.mugnier@foss.st.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gerald.loacker@wolfvision.net \
--cc=hverkuil@xs4all.nl \
--cc=jacopo.mondi@ideasonboard.com \
--cc=khalasa@piap.pl \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxfancy@googlegroups.com \
--cc=m.felsch@pengutronix.de \
--cc=martin.hecht@avnet.eu \
--cc=mchehab@kernel.org \
--cc=michael.riesch@wolfvision.net \
--cc=michael.roeder@avnet.eu \
--cc=mike.rudenko@gmail.com \
--cc=nicholas@rothemail.net \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=shawnx.tu@intel.com \
--cc=tomm.merciai@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).