]> Pileus Git - ~andy/linux/blobdiff - drivers/video/exynos/exynos_mipi_dsi.c
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / drivers / video / exynos / exynos_mipi_dsi.c
index 32e540600f995b42937653832c3e4d8508012c50..00b3a52c1d68766d42cab3c65a1a9405d4a04617 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/interrupt.h>
 #include <linux/kthread.h>
 #include <linux/notifier.h>
+#include <linux/phy/phy.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/err.h>
@@ -156,8 +157,7 @@ static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power)
                exynos_mipi_regulator_enable(dsim);
 
                /* enable MIPI-DSI PHY. */
-               if (dsim->pd->phy_enable)
-                       dsim->pd->phy_enable(pdev, true);
+               phy_power_on(dsim->phy);
 
                clk_enable(dsim->clock);
 
@@ -373,6 +373,10 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
                return ret;
        }
 
+       dsim->phy = devm_phy_get(&pdev->dev, "dsim");
+       if (IS_ERR(dsim->phy))
+               return PTR_ERR(dsim->phy);
+
        dsim->clock = devm_clk_get(&pdev->dev, "dsim0");
        if (IS_ERR(dsim->clock)) {
                dev_err(&pdev->dev, "failed to get dsim clock source\n");
@@ -439,8 +443,7 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
        exynos_mipi_regulator_enable(dsim);
 
        /* enable MIPI-DSI PHY. */
-       if (dsim->pd->phy_enable)
-               dsim->pd->phy_enable(pdev, true);
+       phy_power_on(dsim->phy);
 
        exynos_mipi_update_cfg(dsim);
 
@@ -504,9 +507,8 @@ static int exynos_mipi_dsi_suspend(struct device *dev)
        if (client_drv && client_drv->suspend)
                client_drv->suspend(client_dev);
 
-       /* enable MIPI-DSI PHY. */
-       if (dsim->pd->phy_enable)
-               dsim->pd->phy_enable(pdev, false);
+       /* disable MIPI-DSI PHY. */
+       phy_power_off(dsim->phy);
 
        clk_disable(dsim->clock);
 
@@ -536,8 +538,7 @@ static int exynos_mipi_dsi_resume(struct device *dev)
        exynos_mipi_regulator_enable(dsim);
 
        /* enable MIPI-DSI PHY. */
-       if (dsim->pd->phy_enable)
-               dsim->pd->phy_enable(pdev, true);
+       phy_power_on(dsim->phy);
 
        clk_enable(dsim->clock);