Commit 7e0be9f9f7cba3356f75b86737dbe3a005da067e

Authored by Sylwester Nawrocki
Committed by Greg Kroah-Hartman
1 parent f1468a2077

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>

Showing 3 changed files with 13 additions and 12 deletions Side-by-side Diff

drivers/video/exynos/Kconfig
... ... @@ -16,6 +16,7 @@
16 16 config EXYNOS_MIPI_DSI
17 17 bool "EXYNOS MIPI DSI driver support."
18 18 depends on ARCH_S5PV210 || ARCH_EXYNOS
  19 + select GENERIC_PHY
19 20 help
20 21 This enables support for MIPI-DSI device.
21 22  
drivers/video/exynos/exynos_mipi_dsi.c
... ... @@ -30,6 +30,7 @@
30 30 #include <linux/interrupt.h>
31 31 #include <linux/kthread.h>
32 32 #include <linux/notifier.h>
  33 +#include <linux/phy/phy.h>
33 34 #include <linux/regulator/consumer.h>
34 35 #include <linux/pm_runtime.h>
35 36 #include <linux/err.h>
... ... @@ -156,8 +157,7 @@
156 157 exynos_mipi_regulator_enable(dsim);
157 158  
158 159 /* enable MIPI-DSI PHY. */
159   - if (dsim->pd->phy_enable)
160   - dsim->pd->phy_enable(pdev, true);
  160 + phy_power_on(dsim->phy);
161 161  
162 162 clk_enable(dsim->clock);
163 163  
... ... @@ -373,6 +373,10 @@
373 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 380 dsim->clock = devm_clk_get(&pdev->dev, "dsim0");
377 381 if (IS_ERR(dsim->clock)) {
378 382 dev_err(&pdev->dev, "failed to get dsim clock source\n");
... ... @@ -439,8 +443,7 @@
439 443 exynos_mipi_regulator_enable(dsim);
440 444  
441 445 /* enable MIPI-DSI PHY. */
442   - if (dsim->pd->phy_enable)
443   - dsim->pd->phy_enable(pdev, true);
  446 + phy_power_on(dsim->phy);
444 447  
445 448 exynos_mipi_update_cfg(dsim);
446 449  
... ... @@ -504,9 +507,8 @@
504 507 if (client_drv && client_drv->suspend)
505 508 client_drv->suspend(client_dev);
506 509  
507   - /* enable MIPI-DSI PHY. */
508   - if (dsim->pd->phy_enable)
509   - dsim->pd->phy_enable(pdev, false);
  510 + /* disable MIPI-DSI PHY. */
  511 + phy_power_off(dsim->phy);
510 512  
511 513 clk_disable(dsim->clock);
512 514  
... ... @@ -536,8 +538,7 @@
536 538 exynos_mipi_regulator_enable(dsim);
537 539  
538 540 /* enable MIPI-DSI PHY. */
539   - if (dsim->pd->phy_enable)
540   - dsim->pd->phy_enable(pdev, true);
  541 + phy_power_on(dsim->phy);
541 542  
542 543 clk_enable(dsim->clock);
543 544  
include/video/exynos_mipi_dsim.h
... ... @@ -216,6 +216,7 @@
216 216 * automatically.
217 217 * @e_clk_src: select byte clock source.
218 218 * @pd: pointer to MIPI-DSI driver platform data.
  219 + * @phy: pointer to the MIPI-DSI PHY
219 220 */
220 221 struct mipi_dsim_device {
221 222 struct device *dev;
... ... @@ -236,6 +237,7 @@
236 237 bool suspended;
237 238  
238 239 struct mipi_dsim_platform_data *pd;
  240 + struct phy *phy;
239 241 };
240 242  
241 243 /*
... ... @@ -248,7 +250,6 @@
248 250 * @enabled: indicate whether mipi controller got enabled or not.
249 251 * @lcd_panel_info: pointer for lcd panel specific structure.
250 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 254 struct mipi_dsim_platform_data {
254 255 char lcd_panel_name[PANEL_NAME_SIZE];
... ... @@ -256,8 +257,6 @@
256 257 struct mipi_dsim_config *dsim_config;
257 258 unsigned int enabled;
258 259 void *lcd_panel_info;
259   -
260   - int (*phy_enable)(struct platform_device *pdev, bool on);
261 260 };
262 261  
263 262 /*