diff mbox series

[v6,6/6] drm/bridge: add PHY initialization in mhdp8546 driver.

Message ID 1539034953-11274-7-git-send-email-dkos@cadence.com (mailing list archive)
State New, archived
Headers show
Series drm: add support for Cadence MHDP DPI/DP bridge. | expand

Commit Message

Damian Kos Oct. 8, 2018, 9:42 p.m. UTC
This patch modifies the mhdp8546 driver to initialize sd0801 "Torrent" PHY.

And removes the dbg_regs field from cdns_mhdp_device structure.

Signed-off-by: Damian Kos <dkos@cadence.com>
---
 drivers/gpu/drm/bridge/cdns-mhdp.c    | 9 +++++++++
 include/drm/bridge/cdns-mhdp-common.h | 1 -
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Andrzej Hajda Nov. 7, 2018, 11:49 a.m. UTC | #1
On 08.10.2018 23:42, Damian Kos wrote:
> This patch modifies the mhdp8546 driver to initialize sd0801 "Torrent" PHY.
>
> And removes the dbg_regs field from cdns_mhdp_device structure.
>
> Signed-off-by: Damian Kos <dkos@cadence.com>
> ---
>  drivers/gpu/drm/bridge/cdns-mhdp.c    | 9 +++++++++
>  include/drm/bridge/cdns-mhdp-common.h | 1 -
>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/cdns-mhdp.c b/drivers/gpu/drm/bridge/cdns-mhdp.c
> index 48ac5cf1e031..caaf3c17d74f 100644
> --- a/drivers/gpu/drm/bridge/cdns-mhdp.c
> +++ b/drivers/gpu/drm/bridge/cdns-mhdp.c
> @@ -17,6 +17,7 @@
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> +#include <linux/phy/phy.h>
>  
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_bridge.h>
> @@ -1220,6 +1221,12 @@ static int mhdp_probe(struct platform_device *pdev)
>  	if (IS_ERR(mhdp->regs))
>  		return PTR_ERR(mhdp->regs);
>  
> +	mhdp->phy = devm_phy_get(&pdev->dev, "dpphy");


It is not documented in the bindings.


> +	if (IS_ERR(mhdp->phy)) {
> +		dev_err(&pdev->dev, "no PHY configured\n");


dev_err only if err != -EPROBE_DEFER


> +		return PTR_ERR(mhdp->phy);
> +	}
> +
>  	platform_set_drvdata(pdev, mhdp);
>  
>  	ret = load_firmware(mhdp, FW_NAME, CDNS_MHDP_IMEM);
> @@ -1291,6 +1298,8 @@ static int mhdp_probe(struct platform_device *pdev)
>  			   mhdp->dev, HDMI_CODEC_DRV_NAME, PLATFORM_DEVID_AUTO,
>  			   &codec_data, sizeof(codec_data));
>  
> +	phy_init(mhdp->phy);
> +


Beside this:

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej


>  	/* Enable VIF clock for stream 0 */
>  	cdns_mhdp_reg_read(mhdp, CDNS_DPTX_CAR, &resp);
>  	cdns_mhdp_reg_write(mhdp, CDNS_DPTX_CAR,
> diff --git a/include/drm/bridge/cdns-mhdp-common.h b/include/drm/bridge/cdns-mhdp-common.h
> index d4711091ff2b..1e8a44138ce2 100644
> --- a/include/drm/bridge/cdns-mhdp-common.h
> +++ b/include/drm/bridge/cdns-mhdp-common.h
> @@ -553,7 +553,6 @@ struct cdns_mhdp_device {
>  	struct cdns_mhdp_sink	sink;
>  	struct cdns_mhdp_bridge	bridge;
>  	struct phy		*phy;
> -	void __iomem		*dbg_regs;
>  
>  	struct video_info	video_info;
>  	struct drm_display_mode	mode;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/cdns-mhdp.c b/drivers/gpu/drm/bridge/cdns-mhdp.c
index 48ac5cf1e031..caaf3c17d74f 100644
--- a/drivers/gpu/drm/bridge/cdns-mhdp.c
+++ b/drivers/gpu/drm/bridge/cdns-mhdp.c
@@ -17,6 +17,7 @@ 
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/phy/phy.h>
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
@@ -1220,6 +1221,12 @@  static int mhdp_probe(struct platform_device *pdev)
 	if (IS_ERR(mhdp->regs))
 		return PTR_ERR(mhdp->regs);
 
+	mhdp->phy = devm_phy_get(&pdev->dev, "dpphy");
+	if (IS_ERR(mhdp->phy)) {
+		dev_err(&pdev->dev, "no PHY configured\n");
+		return PTR_ERR(mhdp->phy);
+	}
+
 	platform_set_drvdata(pdev, mhdp);
 
 	ret = load_firmware(mhdp, FW_NAME, CDNS_MHDP_IMEM);
@@ -1291,6 +1298,8 @@  static int mhdp_probe(struct platform_device *pdev)
 			   mhdp->dev, HDMI_CODEC_DRV_NAME, PLATFORM_DEVID_AUTO,
 			   &codec_data, sizeof(codec_data));
 
+	phy_init(mhdp->phy);
+
 	/* Enable VIF clock for stream 0 */
 	cdns_mhdp_reg_read(mhdp, CDNS_DPTX_CAR, &resp);
 	cdns_mhdp_reg_write(mhdp, CDNS_DPTX_CAR,
diff --git a/include/drm/bridge/cdns-mhdp-common.h b/include/drm/bridge/cdns-mhdp-common.h
index d4711091ff2b..1e8a44138ce2 100644
--- a/include/drm/bridge/cdns-mhdp-common.h
+++ b/include/drm/bridge/cdns-mhdp-common.h
@@ -553,7 +553,6 @@  struct cdns_mhdp_device {
 	struct cdns_mhdp_sink	sink;
 	struct cdns_mhdp_bridge	bridge;
 	struct phy		*phy;
-	void __iomem		*dbg_regs;
 
 	struct video_info	video_info;
 	struct drm_display_mode	mode;