Skip to content

Commit

Permalink
video: exynos_mipi_dsim: Use the generic PHY driver
Browse files Browse the repository at this point in the history
Use the generic PHY API instead of the platform callback
for the MIPI DSIM DPHY enable/reset control.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Donghwa Lee <dh09.lee@samsung.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sylwester Nawrocki authored and Greg Kroah-Hartman committed Oct 16, 2013
1 parent f1468a2 commit 7e0be9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions drivers/video/exynos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if EXYNOS_VIDEO
config EXYNOS_MIPI_DSI
bool "EXYNOS MIPI DSI driver support."
depends on ARCH_S5PV210 || ARCH_EXYNOS
select GENERIC_PHY
help
This enables support for MIPI-DSI device.

Expand Down
19 changes: 10 additions & 9 deletions drivers/video/exynos/exynos_mipi_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
5 changes: 2 additions & 3 deletions include/video/exynos_mipi_dsim.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ struct mipi_dsim_config {
* automatically.
* @e_clk_src: select byte clock source.
* @pd: pointer to MIPI-DSI driver platform data.
* @phy: pointer to the MIPI-DSI PHY
*/
struct mipi_dsim_device {
struct device *dev;
Expand All @@ -236,6 +237,7 @@ struct mipi_dsim_device {
bool suspended;

struct mipi_dsim_platform_data *pd;
struct phy *phy;
};

/*
Expand All @@ -248,16 +250,13 @@ struct mipi_dsim_device {
* @enabled: indicate whether mipi controller got enabled or not.
* @lcd_panel_info: pointer for lcd panel specific structure.
* this structure specifies width, height, timing and polarity and so on.
* @phy_enable: pointer to a callback controlling D-PHY enable/reset
*/
struct mipi_dsim_platform_data {
char lcd_panel_name[PANEL_NAME_SIZE];

struct mipi_dsim_config *dsim_config;
unsigned int enabled;
void *lcd_panel_info;

int (*phy_enable)(struct platform_device *pdev, bool on);
};

/*
Expand Down

0 comments on commit 7e0be9f

Please sign in to comment.