mbox series

[v2,00/16] media: imx-pxp: add support for i.MX7D

Message ID 20230112-imx-pxp-v2-0-e2281da1db55@pengutronix.de
Headers show
Series media: imx-pxp: add support for i.MX7D | expand

Message

Michael Tretter Jan. 13, 2023, 9:54 a.m. UTC
This is v2 of the series to add support for the PXP found on the i.MX7D to the
imx-pxp driver.

The PXP on the i.MX7D has a few differences compared to the one on the
i.MX6ULL. Especially, it has more processing blocks and slightly different
multiplexers to route the data between the blocks. Therefore, the driver must
configure a different data path depending on the platform.

While the PXP has a version register, the reported version is the same on the
i.MX6ULL and the i.MX7D. Therefore, we cannot use the version register to
change the driver behavior, but have to use the device tree compatible. The
driver still prints the found version to the log to help bringing up the PXP
on further platforms.

The patches are inspired by some earlier patches [0] by Laurent to add PXP
support to the i.MX7d. Compared to the earlier patches, these patches add
different behavior depending on the platform. Furthermore, the patches disable
only the LUT block, but keep the rotator block enabled, as it may now be
configured via the V4L2 rotate control.

In v2, I included Laurent's patch series [1], which was based on this series
anyway and added regmap support.

Patch 1 converts the dt-binding to yaml.

Patches 2 to 5 cleanup and refactor the driver in preparation of handling
different PXP versions.

Patches 6 and 7 add the handling of different platforms and the i.MX7d
specific configuration.

Patch 8 adds the device tree node for the PXP to the i.MX7d device tree.

Patches 9 to 15 are the cleanup and enhancement patches to add media
controller support, implement enum_framesizes, and add pxp_read/pxp_write
helpers.

Patch 16 adds regmap support to the driver.

Michael

[0] https://lore.kernel.org/linux-media/20200510223100.11641-1-laurent.pinchart@ideasonboard.com/
[1] https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com

---

Changelog

v2:

- fix device tree binding
- reduce log level of PXP version to debug
- drop fallback for missing pdata
- add cleanup and enhancement patches to series
- convert driver to regmap

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
To: linux-media@vger.kernel.org
To: devicetree@vger.kernel.org
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: kernel@pengutronix.de
Cc: linux-imx@nxp.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: Michael Tretter <m.tretter@pengutronix.de>

---
Laurent Pinchart (7):
      media: imx-pxp: Sort headers alphabetically
      media: imx-pxp: Don't set bus_info manually in .querycap()
      media: imx-pxp: Add media controller support
      media: imx-pxp: Pass pixel format value to find_format()
      media: imx-pxp: Implement frame size enumeration
      media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
      media: imx-pxp: Use non-threaded IRQ

Michael Tretter (9):
      dt-bindings: media: fsl-pxp: convert to yaml
      media: imx-pxp: detect PXP version
      media: imx-pxp: extract helper function to setup data path
      media: imx-pxp: explicitly disable unused blocks
      media: imx-pxp: disable LUT block
      media: imx-pxp: make data_path_ctrl0 platform dependent
      media: imx-pxp: add support for i.MX7D
      ARM: dts: imx7d: add node for PXP
      media: imx-pxp: convert to regmap

 .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml |  82 +++++
 .../devicetree/bindings/media/fsl-pxp.txt          |  26 --
 arch/arm/boot/dts/imx7d.dtsi                       |   9 +
 drivers/media/platform/nxp/imx-pxp.c               | 359 +++++++++++++++------
 4 files changed, 355 insertions(+), 121 deletions(-)
---
base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
change-id: 20230112-imx-pxp-073008b3c857

Best regards,

Comments

Laurent Pinchart Jan. 13, 2023, 10:44 a.m. UTC | #1
Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:08AM +0100, Michael Tretter wrote:
> Different versions of the Pixel Pipeline have different blocks and their
> routing may be different. Read the PXP_HW_VERSION register to determine
> the version of the PXP and print it to the log for debugging purposes.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - reduce debug level for version to dev_dbg
> - drop hw_version field from struct pxp_dev
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index 689ae5e6ac62..5b671c6e5cae 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -10,6 +10,7 @@
>   * Pawel Osciak, <pawel@osciak.com>
>   * Marek Szyprowski, <m.szyprowski@samsung.com>
>   */
> +#include <linux/bitfield.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> @@ -52,6 +53,11 @@ MODULE_PARM_DESC(debug, "activates debug info");
>  #define MEM2MEM_HFLIP	(1 << 0)
>  #define MEM2MEM_VFLIP	(1 << 1)
>  
> +#define PXP_VERSION_MAJOR(version) \
> +	FIELD_GET(BM_PXP_VERSION_MAJOR, version)
> +#define PXP_VERSION_MINOR(version) \
> +	FIELD_GET(BM_PXP_VERSION_MINOR, version)
> +
>  #define dprintk(dev, fmt, arg...) \
>  	v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
>  
> @@ -1665,6 +1671,7 @@ static int pxp_probe(struct platform_device *pdev)
>  	struct pxp_dev *dev;
>  	struct video_device *vfd;
>  	int irq;
> +	u32 hw_version;

I'd move this one line up. Up to you, with or without that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  	int ret;
>  
>  	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> @@ -1705,6 +1712,10 @@ static int pxp_probe(struct platform_device *pdev)
>  		goto err_clk;
>  	}
>  
> +	hw_version = readl(dev->mmio + HW_PXP_VERSION);
> +	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
> +		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
> +
>  	ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
>  	if (ret)
>  		goto err_clk;
>
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #2
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Different versions of the Pixel Pipeline have different blocks and their
> routing may be different. Read the PXP_HW_VERSION register to determine
> the version of the PXP and print it to the log for debugging purposes.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #3
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The driver must configure the data path through the Pixel Pipeline.
> 
> Currently, the driver is using a fixed setup, but once there are
> different pipeline configurations, it is helpful to have a dedicated
> function for determining the register value for the data path.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #4
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Various multiplexers in the pipeline are not used with the currently
> configured data path. Disable all unused multiplexers by selecting the
> "no output" (3) option.
> 
> The datasheet doesn't explicitly require this, but the PXP has been seen
> to hang after processing a few hundreds of frames otherwise.
> 
> As at it, add documentation for the multiplexers that are actually
> relevant for the data path.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #5
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The LUT block is always configured in bypass mode.
> 
> Take it entirely out of the pipeline by disabling it and routing the
> data path around the LUT.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #6
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
> and on the i.MX6ULL as version 3.0, although the PXP versions on these
> SoCs have significant differences.
> 
> Use the compatible to configure the ctrl0 register as required dependent
> on the platform.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #7
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The i.MX7D needs a different data path configuration than the i.MX6ULL.
> Configure the data path as close as possible to the data path on the
> i.MX6ULL.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #8
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> node to make it available.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #9
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Sorting headers alphabetically helps locating duplicates, and make it
> easier to figure out where to insert new headers.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #10
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The v4l2_capability.bus_info field is set by the V4L2 core when left
> empty by the .querycap() handler. This is the recommended practice, in
> order to ensure bus_info coherence between drivers. Don't set it
> manually.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #11
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Register a media device for the PXP, using the v4l2-mem2mem MC
> infrastructure to populate the media graph. No media device operation is
> implemented, the main use of the MC API is to allow consistent discovery
> of media devices for userspace.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:46 a.m. UTC | #12
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The find_format() function looks up format information for a given pixel
> format. It takes a v4l2_format pointer, but only uses the contained
> pixel format value. To prepare it for being used by callers that don't
> have v4l2_format, modify it to take the pixel format value directly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:49 a.m. UTC | #13
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Implement support for the VIDIOC_ENUM_FRAMESIZES ioctl.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:50 a.m. UTC | #14
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Add pxp_read() and pxp_write() functions to wrap readl() and writel()
> respectively. This can be useful for debugging register accesses.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:52 a.m. UTC | #15
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> There's no need to use threaded IRQs with the PXP, as the interrupt
> handler doesn't need to sleep and doesn't perform any time-consuming
> operation. Switch to regular IRQ handler.
> 
> This fixes lockups of the PXP noticed on i.MX7, where the PXP would stop
> generating interrupts after a variable number of frames (from a few
> dozens to a few hundreds). The root cause is however unknown.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Philipp Zabel Jan. 13, 2023, 11:56 a.m. UTC | #16
On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Replace the readl and writel with regmap to ease debugging the registers
> from userspace.
> 
> Suggested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Laurent Pinchart Jan. 13, 2023, 12:03 p.m. UTC | #17
Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:12AM +0100, Michael Tretter wrote:
> Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
> and on the i.MX6ULL as version 3.0, although the PXP versions on these
> SoCs have significant differences.
> 
> Use the compatible to configure the ctrl0 register as required dependent
> on the platform.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Changelog
> 
> v2:
> 
> - drop fallback for missing data_path_ctrl0
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index bf3be989a552..c7f8a1808516 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -19,6 +19,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> +#include <linux/of_device.h>
>  #include <linux/sched.h>
>  #include <linux/slab.h>
>  
> @@ -191,6 +192,12 @@ static struct pxp_fmt *find_format(struct v4l2_format *f)
>  	return &formats[k];
>  }
>  
> +struct pxp_ctx;
> +
> +struct pxp_pdata {
> +	u32 (*data_path_ctrl0)(struct pxp_ctx *ctx);
> +};
> +
>  struct pxp_dev {
>  	struct v4l2_device	v4l2_dev;
>  	struct video_device	vfd;
> @@ -198,6 +205,8 @@ struct pxp_dev {
>  	struct clk		*clk;
>  	void __iomem		*mmio;
>  
> +	const struct pxp_pdata	*pdata;
> +
>  	atomic_t		num_inst;
>  	struct mutex		dev_mutex;
>  	spinlock_t		irqlock;
> @@ -724,7 +733,7 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
>  	}
>  }
>  
> -static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
> +static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
>  {
>  	u32 ctrl0;
>  
> @@ -760,7 +769,7 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
>  	u32 ctrl0;
>  	u32 ctrl1;
>  
> -	ctrl0 = pxp_data_path_ctrl0(ctx);
> +	ctrl0 = dev->pdata->data_path_ctrl0(ctx);
>  
>  	ctrl1 = 0;
>  	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
> @@ -1705,6 +1714,8 @@ static int pxp_probe(struct platform_device *pdev)
>  	if (!dev)
>  		return -ENOMEM;
>  
> +	dev->pdata = of_device_get_match_data(&pdev->dev);
> +
>  	dev->clk = devm_clk_get(&pdev->dev, "axi");
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);
> @@ -1804,8 +1815,12 @@ static int pxp_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct pxp_pdata pxp_imx6ull_pdata = {
> +	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
> +};
> +
>  static const struct of_device_id pxp_dt_ids[] = {
> -	{ .compatible = "fsl,imx6ull-pxp", .data = NULL },
> +	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, pxp_dt_ids);
Laurent Pinchart Jan. 14, 2023, 9:29 p.m. UTC | #18
Hi Michael,

The whole series has been reviewed, and only the DT bindings need a
small change. If you post a v2.1 of just that patch (--in-reply-to v2
and CC me, or I may not notice quickly), I can take the whole series and
get it merged in v6.3.

On Fri, Jan 13, 2023 at 10:54:07AM +0100, Michael Tretter wrote:
> This is v2 of the series to add support for the PXP found on the i.MX7D to the
> imx-pxp driver.
> 
> The PXP on the i.MX7D has a few differences compared to the one on the
> i.MX6ULL. Especially, it has more processing blocks and slightly different
> multiplexers to route the data between the blocks. Therefore, the driver must
> configure a different data path depending on the platform.
> 
> While the PXP has a version register, the reported version is the same on the
> i.MX6ULL and the i.MX7D. Therefore, we cannot use the version register to
> change the driver behavior, but have to use the device tree compatible. The
> driver still prints the found version to the log to help bringing up the PXP
> on further platforms.
> 
> The patches are inspired by some earlier patches [0] by Laurent to add PXP
> support to the i.MX7d. Compared to the earlier patches, these patches add
> different behavior depending on the platform. Furthermore, the patches disable
> only the LUT block, but keep the rotator block enabled, as it may now be
> configured via the V4L2 rotate control.
> 
> In v2, I included Laurent's patch series [1], which was based on this series
> anyway and added regmap support.
> 
> Patch 1 converts the dt-binding to yaml.
> 
> Patches 2 to 5 cleanup and refactor the driver in preparation of handling
> different PXP versions.
> 
> Patches 6 and 7 add the handling of different platforms and the i.MX7d
> specific configuration.
> 
> Patch 8 adds the device tree node for the PXP to the i.MX7d device tree.
> 
> Patches 9 to 15 are the cleanup and enhancement patches to add media
> controller support, implement enum_framesizes, and add pxp_read/pxp_write
> helpers.
> 
> Patch 16 adds regmap support to the driver.
> 
> Michael
> 
> [0] https://lore.kernel.org/linux-media/20200510223100.11641-1-laurent.pinchart@ideasonboard.com/
> [1] https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
> 
> ---
> 
> Changelog
> 
> v2:
> 
> - fix device tree binding
> - reduce log level of PXP version to debug
> - drop fallback for missing pdata
> - add cleanup and enhancement patches to series
> - convert driver to regmap
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> To: linux-media@vger.kernel.org
> To: devicetree@vger.kernel.org
> To: Philipp Zabel <p.zabel@pengutronix.de>
> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
> Cc: kernel@pengutronix.de
> Cc: linux-imx@nxp.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Michael Tretter <m.tretter@pengutronix.de>
> 
> ---
> Laurent Pinchart (7):
>       media: imx-pxp: Sort headers alphabetically
>       media: imx-pxp: Don't set bus_info manually in .querycap()
>       media: imx-pxp: Add media controller support
>       media: imx-pxp: Pass pixel format value to find_format()
>       media: imx-pxp: Implement frame size enumeration
>       media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
>       media: imx-pxp: Use non-threaded IRQ
> 
> Michael Tretter (9):
>       dt-bindings: media: fsl-pxp: convert to yaml
>       media: imx-pxp: detect PXP version
>       media: imx-pxp: extract helper function to setup data path
>       media: imx-pxp: explicitly disable unused blocks
>       media: imx-pxp: disable LUT block
>       media: imx-pxp: make data_path_ctrl0 platform dependent
>       media: imx-pxp: add support for i.MX7D
>       ARM: dts: imx7d: add node for PXP
>       media: imx-pxp: convert to regmap
> 
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml |  82 +++++
>  .../devicetree/bindings/media/fsl-pxp.txt          |  26 --
>  arch/arm/boot/dts/imx7d.dtsi                       |   9 +
>  drivers/media/platform/nxp/imx-pxp.c               | 359 +++++++++++++++------
>  4 files changed, 355 insertions(+), 121 deletions(-)
> ---
> base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
> change-id: 20230112-imx-pxp-073008b3c857
Laurent Pinchart Jan. 16, 2023, 4:26 p.m. UTC | #19
Hi Michael,

(CC'ing Shawn)

On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> node to make it available.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Should this go through Shawn's tree ? If so, how would you like to
handle the dependency on the DT bindings in patch 01/16 ?

> ---
> Changelog
> 
> v2:
> 
> - fix alignment
> ---
>  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> index 7ceb7c09f7ad..4b94b8afb55d 100644
> --- a/arch/arm/boot/dts/imx7d.dtsi
> +++ b/arch/arm/boot/dts/imx7d.dtsi
> @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
>  		  reg = <0x306d0000 0x10000>;
>  		  status = "disabled";
>  	};
> +
> +	pxp: pxp@30700000 {
> +		compatible = "fsl,imx7d-pxp";
> +		reg = <0x30700000 0x10000>;
> +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&clks IMX7D_PXP_CLK>;
> +		clock-names = "axi";
> +	};
>  };
>  
>  &aips3 {
Michael Tretter Jan. 20, 2023, 9:06 a.m. UTC | #20
On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > node to make it available.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> 
> Should this go through Shawn's tree ? If so, how would you like to
> handle the dependency on the DT bindings in patch 01/16 ?

There is no actual dependency. The binding was already specified as a txt,
just not as a yaml, and the added node matches both.

Michael

> 
> > ---
> > Changelog
> > 
> > v2:
> > 
> > - fix alignment
> > ---
> >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > --- a/arch/arm/boot/dts/imx7d.dtsi
> > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> >  		  reg = <0x306d0000 0x10000>;
> >  		  status = "disabled";
> >  	};
> > +
> > +	pxp: pxp@30700000 {
> > +		compatible = "fsl,imx7d-pxp";
> > +		reg = <0x30700000 0x10000>;
> > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&clks IMX7D_PXP_CLK>;
> > +		clock-names = "axi";
> > +	};
> >  };
> >  
> >  &aips3 {
Laurent Pinchart Jan. 20, 2023, 9:20 a.m. UTC | #21
On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > node to make it available.
> > > 
> > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > 
> > Should this go through Shawn's tree ? If so, how would you like to
> > handle the dependency on the DT bindings in patch 01/16 ?
> 
> There is no actual dependency. The binding was already specified as a txt,
> just not as a yaml, and the added node matches both.

Good point. I'll send a pull request for the series then, without this
patch, which can be picked by Shawn separately.

> > > ---
> > > Changelog
> > > 
> > > v2:
> > > 
> > > - fix alignment
> > > ---
> > >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > > --- a/arch/arm/boot/dts/imx7d.dtsi
> > > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> > >  		  reg = <0x306d0000 0x10000>;
> > >  		  status = "disabled";
> > >  	};
> > > +
> > > +	pxp: pxp@30700000 {
> > > +		compatible = "fsl,imx7d-pxp";
> > > +		reg = <0x30700000 0x10000>;
> > > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > > +		clocks = <&clks IMX7D_PXP_CLK>;
> > > +		clock-names = "axi";
> > > +	};
> > >  };
> > >  
> > >  &aips3 {
Michael Tretter Feb. 9, 2023, 2:02 p.m. UTC | #22
Hi Shawn,

On Fri, 20 Jan 2023 11:20:24 +0200, Laurent Pinchart wrote:
> On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> > On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > > node to make it available.
> > > > 
> > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > 
> > > Should this go through Shawn's tree ? If so, how would you like to
> > > handle the dependency on the DT bindings in patch 01/16 ?
> > 
> > There is no actual dependency. The binding was already specified as a txt,
> > just not as a yaml, and the added node matches both.
> 
> Good point. I'll send a pull request for the series then, without this
> patch, which can be picked by Shawn separately.

Can you pick this patch or should I resend it as a separate series?

Michael

> 
> > > > ---
> > > > Changelog
> > > > 
> > > > v2:
> > > > 
> > > > - fix alignment
> > > > ---
> > > >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> > > >  1 file changed, 9 insertions(+)
> > > > 
> > > > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > > > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > > > --- a/arch/arm/boot/dts/imx7d.dtsi
> > > > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > > > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> > > >  		  reg = <0x306d0000 0x10000>;
> > > >  		  status = "disabled";
> > > >  	};
> > > > +
> > > > +	pxp: pxp@30700000 {
> > > > +		compatible = "fsl,imx7d-pxp";
> > > > +		reg = <0x30700000 0x10000>;
> > > > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > > > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > > > +		clocks = <&clks IMX7D_PXP_CLK>;
> > > > +		clock-names = "axi";
> > > > +	};
> > > >  };
> > > >  
> > > >  &aips3 {
Shawn Guo March 6, 2023, 1:19 a.m. UTC | #23
On Thu, Feb 09, 2023 at 03:02:25PM +0100, Michael Tretter wrote:
> Hi Shawn,
> 
> On Fri, 20 Jan 2023 11:20:24 +0200, Laurent Pinchart wrote:
> > On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> > > On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > > > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > > > node to make it available.
> > > > > 
> > > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > > 
> > > > Should this go through Shawn's tree ? If so, how would you like to
> > > > handle the dependency on the DT bindings in patch 01/16 ?
> > > 
> > > There is no actual dependency. The binding was already specified as a txt,
> > > just not as a yaml, and the added node matches both.
> > 
> > Good point. I'll send a pull request for the series then, without this
> > patch, which can be picked by Shawn separately.
> 
> Can you pick this patch or should I resend it as a separate series?

Applied, thanks!