From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Ying Liu <victor.liu@nxp.com>
Cc: "neil.armstrong@linaro.org" <neil.armstrong@linaro.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"rfoss@kernel.org" <rfoss@kernel.org>,
"krzysztof.kozlowski+dt@linaro.org"
<krzysztof.kozlowski+dt@linaro.org>,
"jonas@kwiboo.se" <jonas@kwiboo.se>,
"shawnguo@kernel.org" <shawnguo@kernel.org>,
"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
"jernej.skrabec@gmail.com" <jernej.skrabec@gmail.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"Laurent.pinchart@ideasonboard.com"
<Laurent.pinchart@ideasonboard.com>,
"andrzej.hajda@intel.com" <andrzej.hajda@intel.com>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH 9/9] drm/bridge: imx: Add i.MX93 MIPI DSI support
Date: Tue, 18 Jul 2023 11:31:01 +0200 [thread overview]
Message-ID: <8287028.NyiUUSuA9g@steina-w> (raw)
In-Reply-To: <DB8PR04MB7051324184846E6206E495BF9838A@DB8PR04MB7051.eurprd04.prod.outlook.com>
Hi,
Am Dienstag, 18. Juli 2023, 11:00:25 CEST schrieb Ying Liu:
> On Tuesday, July 18, 2023 3:49 PM Alexander Stein <alexander.stein@ew.tq-
group.com> wrote:
> > Hi,
>
> Hi,
>
> > thanks for the patch.
>
> Thanks for your review.
>
> > Am Montag, 17. Juli 2023, 08:18:31 CEST schrieb Liu Ying:
> > > Freescale i.MX93 SoC embeds a Synopsys Designware MIPI DSI host
> > > controller and a Synopsys Designware MIPI DPHY. Some configurations
> > > and extensions to them are controlled by i.MX93 media blk-ctrl.
> > >
> > > Add a DRM bridge for i.MX93 MIPI DSI by using existing DW MIPI DSI
> > > bridge helpers and implementing i.MX93 MIPI DSI specific extensions.
> > >
> > > Signed-off-by: Liu Ying <victor.liu@nxp.com>
> > > ---
> > >
> > > drivers/gpu/drm/bridge/imx/Kconfig | 10 +
> > > drivers/gpu/drm/bridge/imx/Makefile | 1 +
> > > drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 934
> >
> > ++++++++++++++++++++
> >
> > > 3 files changed, 945 insertions(+)
> > > create mode 100644 drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > >
> > > diff --git a/drivers/gpu/drm/bridge/imx/Kconfig
> > > b/drivers/gpu/drm/bridge/imx/Kconfig index
> >
> > 9fae28db6aa7..5182298c7182
> >
> > > 100644
> > > --- a/drivers/gpu/drm/bridge/imx/Kconfig
> > > +++ b/drivers/gpu/drm/bridge/imx/Kconfig
> > > @@ -49,4 +49,14 @@ config DRM_IMX8QXP_PIXEL_LINK_TO_DPI
> > >
> > > Choose this to enable pixel link to display pixel
> >
> > interface(PXL2DPI)
> >
> > > found in Freescale i.MX8qxp processor.
> > >
> > > +config DRM_IMX93_MIPI_DSI
> > > + tristate "Freescale i.MX93 specific extensions for Synopsys DW MIPI
> >
> > DSI"
> >
> > > + depends on OF
> > > + depends on COMMON_CLK
> > > + select DRM_DW_MIPI_DSI
> > > + select GENERIC_PHY_MIPI_DPHY
> > > + help
> > > + Choose this to enable MIPI DSI controller found in Freescale
> >
> > i.MX93
> >
> > > + processor.
> > > +
> > >
> > > endif # ARCH_MXC || COMPILE_TEST
> > >
> > > diff --git a/drivers/gpu/drm/bridge/imx/Makefile
> > > b/drivers/gpu/drm/bridge/imx/Makefile index
> >
> > 8e2ebf3399a1..2b0c2e44aa1b
> >
> > > 100644
> > > --- a/drivers/gpu/drm/bridge/imx/Makefile
> > > +++ b/drivers/gpu/drm/bridge/imx/Makefile
> > > @@ -4,3 +4,4 @@ obj-$(CONFIG_DRM_IMX8QXP_LDB) += imx8qxp-ldb.o
> > >
> > > obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-
> >
> > combiner.o
> >
> > > obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK) += imx8qxp-pixel-link.o
> > > obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK_TO_DPI) += imx8qxp-pxl2dpi.o
> > >
> > > +obj-$(CONFIG_DRM_IMX93_MIPI_DSI) += imx93-mipi-dsi.o
> > > diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > > b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c new file mode 100644
> > > index 000000000000..77f59e3407a0
> > > --- /dev/null
> > > +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > >
> > > [snip]
> > >
> > > +static int imx93_dsi_probe(struct platform_device *pdev)
> > > +{
> > > + struct device *dev = &pdev->dev;
> > > + struct device_node *np = dev->of_node;
> > > + struct imx93_dsi *dsi;
> > > + int ret;
> > > +
> > > + dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
> > > + if (!dsi)
> > > + return -ENOMEM;
> > > +
> > > + dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-
> >
> > blk-
> > ctrl");
> >
> > > + if (IS_ERR(dsi->regmap)) {
> > > + ret = PTR_ERR(dsi->regmap);
> >
> > > + DRM_DEV_ERROR(dev, "failed to get block ctrl regmap:
> > %d\n", ret);
> >
> > Could you use dev_err_probe here instead?
>
> Maybe, it's better to keep using DRM_DEV_ERROR to achieve consistent
> error log format across the driver which is implemented in drm_dev_printk().
> I see other DRM drivers do the same.
I see your point. On the other hand the benefit of dev_err_probe() is that the
message of deferred probe can be seen in /sys/kernel/debug/devices_deferred.
Your check against EPROBE_DEFER will hide the message if something is not
correct.
Maybe a to be introduced DRM_DEV_ERROR_PROBE might be useful.
Best regards,
Alexander
> > > + return ret;
> > > + }
> > > +
> > > + dsi->clk_pixel = devm_clk_get(dev, "pix");
> > > + if (IS_ERR(dsi->clk_pixel)) {
> > > + ret = PTR_ERR(dsi->clk_pixel);
> > > + if (ret != -EPROBE_DEFER)
> >
> > > + DRM_DEV_ERROR(dev, "failed to get pixel clock:
> > %d\n", ret);
> >
> > Could you use dev_err_probe here instead?
>
> Ditto.
>
> > > + return ret;
> > > + }
> > > +
> > > + dsi->clk_cfg = devm_clk_get(dev, "phy_cfg");
> > > + if (IS_ERR(dsi->clk_cfg)) {
> > > + ret = PTR_ERR(dsi->clk_cfg);
> > > + if (ret != -EPROBE_DEFER)
> >
> > > + DRM_DEV_ERROR(dev, "failed to get phy cfg clock:
> > %d\n", ret);
> >
> > > + return ret;
> > > + }
> > > +
> > > + dsi->clk_ref = devm_clk_get(dev, "phy_ref");
> > > + if (IS_ERR(dsi->clk_ref)) {
> > > + ret = PTR_ERR(dsi->clk_ref);
> > > + if (ret != -EPROBE_DEFER)
> >
> > > + DRM_DEV_ERROR(dev, "failed to get phy ref clock:
> > %d\n", ret);
> >
> > Could you use dev_err_probe here instead?
>
> Ditto.
>
> > > + return ret;
> > > + }
> > > +
> > > + dsi->ref_clk_rate = clk_get_rate(dsi->clk_ref);
> > > + if (dsi->ref_clk_rate < REF_CLK_RATE_MIN ||
> > > + dsi->ref_clk_rate > REF_CLK_RATE_MAX) {
> > > + DRM_DEV_ERROR(dev, "invalid phy ref clock rate %lu\n",
> > > + dsi->ref_clk_rate);
> > > + return -EINVAL;
> > > + }
> > > + DRM_DEV_DEBUG_DRIVER(dev, "phy ref clock rate: %lu\n", dsi-
> > >
> > >ref_clk_rate);
> > >
> > > +
> > > + dsi->dev = dev;
> > > + dsi->pdata.max_data_lanes = 4;
> > > + dsi->pdata.mode_valid = imx93_dsi_mode_valid;
> > > + dsi->pdata.mode_fixup = imx93_dsi_mode_fixup;
> > > + dsi->pdata.get_input_bus_fmts = imx93_dsi_get_input_bus_fmts;
> > > + dsi->pdata.phy_ops = &imx93_dsi_phy_ops;
> > > + dsi->pdata.host_ops = &imx93_dsi_host_ops;
> > > + dsi->pdata.priv_data = dsi;
> > > + platform_set_drvdata(pdev, dsi);
> > > +
> > > + dsi->dmd = dw_mipi_dsi_probe(pdev, &dsi->pdata);
> > > + if (IS_ERR(dsi->dmd)) {
> > > + ret = PTR_ERR(dsi->dmd);
> > > + if (ret != -EPROBE_DEFER)
> >
> > > + DRM_DEV_ERROR(dev, "failed to probe dw_mipi_dsi:
> > %d\n", ret);
> >
> > Could you use dev_err_probe here instead?
>
> Ditto.
>
> Regards,
> Liu Ying
>
> > Best regards,
> > Alexander
> >
> > > + return ret;
> > > + }
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static void imx93_dsi_remove(struct platform_device *pdev)
> > > +{
> > > + struct imx93_dsi *dsi = platform_get_drvdata(pdev);
> > > +
> > > + dw_mipi_dsi_remove(dsi->dmd);
> > > +}
> > > +
> > > +static const struct of_device_id imx93_dsi_dt_ids[] = {
> > > + { .compatible = "fsl,imx93-mipi-dsi", },
> > > + { /* sentinel */ }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, imx93_dsi_dt_ids);
> > > +
> > > +static struct platform_driver imx93_dsi_driver = {
> > > + .probe = imx93_dsi_probe,
> > > + .remove_new = imx93_dsi_remove,
> > > + .driver = {
> > > + .of_match_table = imx93_dsi_dt_ids,
> > > + .name = "imx93_mipi_dsi",
> > > + },
> > > +};
> > > +module_platform_driver(imx93_dsi_driver);
> > > +
> > > +MODULE_DESCRIPTION("Freescale i.MX93 MIPI DSI driver");
> > > +MODULE_AUTHOR("Liu Ying <victor.liu@nxp.com>");
> > > +MODULE_LICENSE("GPL");
> >
> > --
> > TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> > Amtsgericht München, HRB 105018
> > Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> > http://www.t/
> > q-
> > group.com%2F&data=05%7C01%7Cvictor.liu%40nxp.com%7Cc42417f9a9484
> > 3ead2b808db876380d3%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0
> > %7C638252633665634690%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj
> > AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%
> > 7C%7C&sdata=GUWOZgHFFp0nKImw2aIAsaqMv9KtgI6%2BD%2BaOdDhJ%2B
> > tU%3D&reserved=0
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-19 5:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 6:18 [PATCH 0/9] drm/bridge: imx: Add i.MX93 MIPI DSI support Liu Ying
2023-07-17 6:18 ` [PATCH 1/9] drm/bridge: synopsys: dw-mipi-dsi: Add dw_mipi_dsi_get_bridge() helper Liu Ying
2023-07-17 6:18 ` [PATCH 2/9] drm/bridge: synopsys: dw-mipi-dsi: Add input bus format negotiation support Liu Ying
2023-07-17 6:18 ` [PATCH 3/9] drm/bridge: synopsys: dw-mipi-dsi: Force input bus flags Liu Ying
2023-07-17 6:18 ` [PATCH 4/9] drm/bridge: synopsys: dw-mipi-dsi: Add mode fixup support Liu Ying
2023-07-17 6:18 ` [PATCH 5/9] drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc Liu Ying
2023-08-01 9:42 ` neil.armstrong
2023-10-16 18:14 ` Heiko Stübner
2023-10-17 10:15 ` Ying Liu
2023-10-17 12:13 ` Heiko Stübner
2023-07-17 6:18 ` [PATCH 6/9] drm/bridge: synopsys: dw-mipi-dsi: Set minimum lane byte clock cycles for HSA and HBP Liu Ying
2023-08-01 9:42 ` neil.armstrong
2023-07-17 6:18 ` [PATCH 7/9] drm/bridge: synopsys: dw-mipi-dsi: Disable HSTX and LPRX timeout check Liu Ying
2023-08-01 9:42 ` neil.armstrong
2023-07-17 6:18 ` [PATCH 8/9] dt-bindings: display: bridge: Document Freescale i.MX93 MIPI DSI Liu Ying
2023-07-18 22:24 ` Rob Herring
2023-07-17 6:18 ` [PATCH 9/9] drm/bridge: imx: Add i.MX93 MIPI DSI support Liu Ying
2023-07-17 6:44 ` Jagan Teki
2023-07-18 2:58 ` Ying Liu
2023-07-18 9:34 ` Jagan Teki
2023-07-18 9:49 ` Ying Liu
2023-07-18 10:50 ` Jagan Teki
2023-07-19 8:35 ` Ying Liu
2023-07-30 18:38 ` Jagan Teki
2023-07-18 7:49 ` Alexander Stein
2023-07-18 9:00 ` Ying Liu
2023-07-18 9:31 ` Alexander Stein [this message]
2023-07-18 9:55 ` Ying Liu
2023-07-18 15:46 ` Sam Ravnborg
2023-07-19 8:37 ` Ying Liu
2023-07-19 1:10 ` kernel test robot
2023-07-18 7:39 ` [PATCH 0/9] " Alexander Stein
2023-07-18 8:52 ` Ying Liu
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=8287028.NyiUUSuA9g@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=andrzej.hajda@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel@pengutronix.de \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=victor.liu@nxp.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