diff options
author | Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | 2013-10-16 12:28:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-16 16:48:08 -0400 |
commit | 7e0be9f9f7cba3356f75b86737dbe3a005da067e (patch) | |
tree | c74a9b404d878545c57fc190455ab93c03b55909 | |
parent | f1468a2077e8c00fddb6cecec41b356637195ca3 (diff) |
video: exynos_mipi_dsim: Use the generic PHY driver
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>
-rw-r--r-- | drivers/video/exynos/Kconfig | 1 | ||||
-rw-r--r-- | drivers/video/exynos/exynos_mipi_dsi.c | 19 | ||||
-rw-r--r-- | include/video/exynos_mipi_dsim.h | 5 |
3 files changed, 13 insertions, 12 deletions
diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig index 1b035b2eb6b6..976594d578a9 100644 --- a/drivers/video/exynos/Kconfig +++ b/drivers/video/exynos/Kconfig | |||
@@ -16,6 +16,7 @@ if EXYNOS_VIDEO | |||
16 | config EXYNOS_MIPI_DSI | 16 | config EXYNOS_MIPI_DSI |
17 | bool "EXYNOS MIPI DSI driver support." | 17 | bool "EXYNOS MIPI DSI driver support." |
18 | depends on ARCH_S5PV210 || ARCH_EXYNOS | 18 | depends on ARCH_S5PV210 || ARCH_EXYNOS |
19 | select GENERIC_PHY | ||
19 | help | 20 | help |
20 | This enables support for MIPI-DSI device. | 21 | This enables support for MIPI-DSI device. |
21 | 22 | ||
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index 32e540600f99..00b3a52c1d68 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/kthread.h> | 31 | #include <linux/kthread.h> |
32 | #include <linux/notifier.h> | 32 | #include <linux/notifier.h> |
33 | #include <linux/phy/phy.h> | ||
33 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
34 | #include <linux/pm_runtime.h> | 35 | #include <linux/pm_runtime.h> |
35 | #include <linux/err.h> | 36 | #include <linux/err.h> |
@@ -156,8 +157,7 @@ static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) | |||
156 | exynos_mipi_regulator_enable(dsim); | 157 | exynos_mipi_regulator_enable(dsim); |
157 | 158 | ||
158 | /* enable MIPI-DSI PHY. */ | 159 | /* enable MIPI-DSI PHY. */ |
159 | if (dsim->pd->phy_enable) | 160 | phy_power_on(dsim->phy); |
160 | dsim->pd->phy_enable(pdev, true); | ||
161 | 161 | ||
162 | clk_enable(dsim->clock); | 162 | clk_enable(dsim->clock); |
163 | 163 | ||
@@ -373,6 +373,10 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) | |||
373 | return ret; | 373 | return ret; |
374 | } | 374 | } |
375 | 375 | ||
376 | dsim->phy = devm_phy_get(&pdev->dev, "dsim"); | ||
377 | if (IS_ERR(dsim->phy)) | ||
378 | return PTR_ERR(dsim->phy); | ||
379 | |||
376 | dsim->clock = devm_clk_get(&pdev->dev, "dsim0"); | 380 | dsim->clock = devm_clk_get(&pdev->dev, "dsim0"); |
377 | if (IS_ERR(dsim->clock)) { | 381 | if (IS_ERR(dsim->clock)) { |
378 | dev_err(&pdev->dev, "failed to get dsim clock source\n"); | 382 | 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) | |||
439 | exynos_mipi_regulator_enable(dsim); | 443 | exynos_mipi_regulator_enable(dsim); |
440 | 444 | ||
441 | /* enable MIPI-DSI PHY. */ | 445 | /* enable MIPI-DSI PHY. */ |
442 | if (dsim->pd->phy_enable) | 446 | phy_power_on(dsim->phy); |
443 | dsim->pd->phy_enable(pdev, true); | ||
444 | 447 | ||
445 | exynos_mipi_update_cfg(dsim); | 448 | exynos_mipi_update_cfg(dsim); |
446 | 449 | ||
@@ -504,9 +507,8 @@ static int exynos_mipi_dsi_suspend(struct device *dev) | |||
504 | if (client_drv && client_drv->suspend) | 507 | if (client_drv && client_drv->suspend) |
505 | client_drv->suspend(client_dev); | 508 | client_drv->suspend(client_dev); |
506 | 509 | ||
507 | /* enable MIPI-DSI PHY. */ | 510 | /* disable MIPI-DSI PHY. */ |
508 | if (dsim->pd->phy_enable) | 511 | phy_power_off(dsim->phy); |
509 | dsim->pd->phy_enable(pdev, false); | ||
510 | 512 | ||
511 | clk_disable(dsim->clock); | 513 | clk_disable(dsim->clock); |
512 | 514 | ||
@@ -536,8 +538,7 @@ static int exynos_mipi_dsi_resume(struct device *dev) | |||
536 | exynos_mipi_regulator_enable(dsim); | 538 | exynos_mipi_regulator_enable(dsim); |
537 | 539 | ||
538 | /* enable MIPI-DSI PHY. */ | 540 | /* enable MIPI-DSI PHY. */ |
539 | if (dsim->pd->phy_enable) | 541 | phy_power_on(dsim->phy); |
540 | dsim->pd->phy_enable(pdev, true); | ||
541 | 542 | ||
542 | clk_enable(dsim->clock); | 543 | clk_enable(dsim->clock); |
543 | 544 | ||
diff --git a/include/video/exynos_mipi_dsim.h b/include/video/exynos_mipi_dsim.h index 89dc88a171af..6a578f8a1b3e 100644 --- a/include/video/exynos_mipi_dsim.h +++ b/include/video/exynos_mipi_dsim.h | |||
@@ -216,6 +216,7 @@ struct mipi_dsim_config { | |||
216 | * automatically. | 216 | * automatically. |
217 | * @e_clk_src: select byte clock source. | 217 | * @e_clk_src: select byte clock source. |
218 | * @pd: pointer to MIPI-DSI driver platform data. | 218 | * @pd: pointer to MIPI-DSI driver platform data. |
219 | * @phy: pointer to the MIPI-DSI PHY | ||
219 | */ | 220 | */ |
220 | struct mipi_dsim_device { | 221 | struct mipi_dsim_device { |
221 | struct device *dev; | 222 | struct device *dev; |
@@ -236,6 +237,7 @@ struct mipi_dsim_device { | |||
236 | bool suspended; | 237 | bool suspended; |
237 | 238 | ||
238 | struct mipi_dsim_platform_data *pd; | 239 | struct mipi_dsim_platform_data *pd; |
240 | struct phy *phy; | ||
239 | }; | 241 | }; |
240 | 242 | ||
241 | /* | 243 | /* |
@@ -248,7 +250,6 @@ struct mipi_dsim_device { | |||
248 | * @enabled: indicate whether mipi controller got enabled or not. | 250 | * @enabled: indicate whether mipi controller got enabled or not. |
249 | * @lcd_panel_info: pointer for lcd panel specific structure. | 251 | * @lcd_panel_info: pointer for lcd panel specific structure. |
250 | * this structure specifies width, height, timing and polarity and so on. | 252 | * this structure specifies width, height, timing and polarity and so on. |
251 | * @phy_enable: pointer to a callback controlling D-PHY enable/reset | ||
252 | */ | 253 | */ |
253 | struct mipi_dsim_platform_data { | 254 | struct mipi_dsim_platform_data { |
254 | char lcd_panel_name[PANEL_NAME_SIZE]; | 255 | char lcd_panel_name[PANEL_NAME_SIZE]; |
@@ -256,8 +257,6 @@ struct mipi_dsim_platform_data { | |||
256 | struct mipi_dsim_config *dsim_config; | 257 | struct mipi_dsim_config *dsim_config; |
257 | unsigned int enabled; | 258 | unsigned int enabled; |
258 | void *lcd_panel_info; | 259 | void *lcd_panel_info; |
259 | |||
260 | int (*phy_enable)(struct platform_device *pdev, bool on); | ||
261 | }; | 260 | }; |
262 | 261 | ||
263 | /* | 262 | /* |