mbox series

[v3,0/9] media: i2c: ds90ub9xx: Misc improvements

Message ID 20230731-fpdlink-additions-v3-0-8acfc49c215a@ideasonboard.com
Headers show
Series media: i2c: ds90ub9xx: Misc improvements | expand

Message

Tomi Valkeinen July 31, 2023, 1:24 p.m. UTC
This series contains small miscellaneous improvements to the FPD-Link
drivers.

These were sent originally in v14 of the "i2c-atr and FPDLink" series
(link below), but were then left out for v15. So I have assigned v2 to
the "first" version of this series.

I have trimmed the to/cc list a bit, as these don't really deal with i2c
and dt anymore.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
Changes in v3:
- New patch which fixes the async sub-device matching
- Addressed all the comments from Laurent
- Added Laurent's & Andy's Rbs
- Link to v2: https://lore.kernel.org/r/20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com

Changes in v2:
- New patch which renames ASYNC to NONSYNC
- Minor cosmetic change
- I didn't take u32_fract into use (as suggested by Andy), as I think it
  makes the driver a bit more confusing.
- Link to v1: https://lore.kernel.org/r/20230616135922.442979-1-tomi.valkeinen@ideasonboard.com

---
Tomi Valkeinen (9):
      media: i2c: ds90ub9x3: Fix sub-device matching
      media: i2c: ds90ub960: Configure CSI-2 continuous clock
      media: i2c: ds90ub953: Use v4l2_fwnode_endpoint_parse()
      media: i2c: ds90ub913: Use v4l2_fwnode_endpoint_parse()
      media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK
      media: i2c: ds90ub960: Allow FPD-Link async mode
      media: i2c: ds90ub953: Restructure clkout management
      media: i2c: ds90ub953: Support non-sync mode
      media: i2c: ds90ub960: Rename RXPORT_MODE_CSI2_ASYNC to RXPORT_MODE_CSI2_NONSYNC

 drivers/media/i2c/ds90ub913.c |  47 +++++----
 drivers/media/i2c/ds90ub953.c | 215 ++++++++++++++++++++++++------------------
 drivers/media/i2c/ds90ub960.c |  31 +++---
 3 files changed, 164 insertions(+), 129 deletions(-)
---
base-commit: 38d6a03d2511bee97455b2ea0314c918537ef1ec
change-id: 20230720-fpdlink-additions-fb5397336725

Best regards,

Comments

Laurent Pinchart July 31, 2023, 2:43 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Mon, Jul 31, 2023 at 04:24:35PM +0300, Tomi Valkeinen wrote:
> 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode

s/^/Commit /

> matching") recently changed how async sub-device matching works. This
> breaks the UB9x3 drivers, as they set the subdev.fwnode to an endpoint.
> Afaiu, the fix is simply to not set subdev.fwnode at all.
> 
> Fixes: 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode matching")
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>

Sakari, was the v4l2-async series meant to break these drivers ? I
understand the two series got merged for the same kernel version, is
this a merge conflict, or is there an issue in the v4l2-async rework ?

> ---
>  drivers/media/i2c/ds90ub913.c | 14 +-------------
>  drivers/media/i2c/ds90ub953.c | 13 +------------
>  2 files changed, 2 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c
> index 80d9cf6dd945..5410ccb54057 100644
> --- a/drivers/media/i2c/ds90ub913.c
> +++ b/drivers/media/i2c/ds90ub913.c
> @@ -749,19 +749,9 @@ static int ub913_subdev_init(struct ub913_data *priv)
>  	if (ret)
>  		return dev_err_probe(dev, ret, "Failed to init pads\n");
>  
> -	priv->sd.fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev),
> -							  UB913_PAD_SOURCE, 0,
> -							  0);
> -
> -	if (!priv->sd.fwnode) {
> -		ret = -ENODEV;
> -		dev_err_probe(dev, ret, "Missing TX endpoint\n");
> -		goto err_entity_cleanup;
> -	}
> -
>  	ret = v4l2_subdev_init_finalize(&priv->sd);
>  	if (ret)
> -		goto err_fwnode_put;
> +		goto err_entity_cleanup;
>  
>  	ret = ub913_v4l2_notifier_register(priv);
>  	if (ret) {
> @@ -782,8 +772,6 @@ static int ub913_subdev_init(struct ub913_data *priv)
>  	ub913_v4l2_nf_unregister(priv);
>  err_subdev_cleanup:
>  	v4l2_subdev_cleanup(&priv->sd);
> -err_fwnode_put:
> -	fwnode_handle_put(priv->sd.fwnode);
>  err_entity_cleanup:
>  	media_entity_cleanup(&priv->sd.entity);
>  
> diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c
> index cadf75eb0773..20b9cf893f74 100644
> --- a/drivers/media/i2c/ds90ub953.c
> +++ b/drivers/media/i2c/ds90ub953.c
> @@ -1221,18 +1221,9 @@ static int ub953_subdev_init(struct ub953_data *priv)
>  	if (ret)
>  		return dev_err_probe(dev, ret, "Failed to init pads\n");
>  
> -	priv->sd.fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev),
> -							  UB953_PAD_SOURCE, 0,
> -							  0);
> -	if (!priv->sd.fwnode) {
> -		ret = -ENODEV;
> -		dev_err_probe(dev, ret, "Missing TX endpoint\n");
> -		goto err_entity_cleanup;
> -	}
> -
>  	ret = v4l2_subdev_init_finalize(&priv->sd);
>  	if (ret)
> -		goto err_fwnode_put;
> +		goto err_entity_cleanup;
>  
>  	ret = ub953_v4l2_notifier_register(priv);
>  	if (ret) {
> @@ -1253,8 +1244,6 @@ static int ub953_subdev_init(struct ub953_data *priv)
>  	ub953_v4l2_notifier_unregister(priv);
>  err_free_state:
>  	v4l2_subdev_cleanup(&priv->sd);
> -err_fwnode_put:
> -	fwnode_handle_put(priv->sd.fwnode);
>  err_entity_cleanup:
>  	media_entity_cleanup(&priv->sd.entity);
>  
>