Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sylwester Nawrocki and committed by
Greg Kroah-Hartman
7e0be9f9 f1468a20

+13 -12
+1
drivers/video/exynos/Kconfig
··· 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
+10 -9
drivers/video/exynos/exynos_mipi_dsi.c
··· 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> ··· 157 156 exynos_mipi_regulator_enable(dsim); 158 157 159 158 /* enable MIPI-DSI PHY. */ 160 - if (dsim->pd->phy_enable) 161 - dsim->pd->phy_enable(pdev, true); 159 + phy_power_on(dsim->phy); 162 160 163 161 clk_enable(dsim->clock); 164 162 ··· 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"); ··· 443 439 exynos_mipi_regulator_enable(dsim); 444 440 445 441 /* enable MIPI-DSI PHY. */ 446 - if (dsim->pd->phy_enable) 447 - dsim->pd->phy_enable(pdev, true); 442 + phy_power_on(dsim->phy); 448 443 449 444 exynos_mipi_update_cfg(dsim); 450 445 ··· 507 504 if (client_drv && client_drv->suspend) 508 505 client_drv->suspend(client_dev); 509 506 510 - /* enable MIPI-DSI PHY. */ 511 - if (dsim->pd->phy_enable) 512 - dsim->pd->phy_enable(pdev, false); 507 + /* disable MIPI-DSI PHY. */ 508 + phy_power_off(dsim->phy); 513 509 514 510 clk_disable(dsim->clock); 515 511 ··· 538 536 exynos_mipi_regulator_enable(dsim); 539 537 540 538 /* enable MIPI-DSI PHY. */ 541 - if (dsim->pd->phy_enable) 542 - dsim->pd->phy_enable(pdev, true); 539 + phy_power_on(dsim->phy); 543 540 544 541 clk_enable(dsim->clock); 545 542
+2 -3
include/video/exynos_mipi_dsim.h
··· 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; ··· 237 236 bool suspended; 238 237 239 238 struct mipi_dsim_platform_data *pd; 239 + struct phy *phy; 240 240 }; 241 241 242 242 /* ··· 250 248 * @enabled: indicate whether mipi controller got enabled or not. 251 249 * @lcd_panel_info: pointer for lcd panel specific structure. 252 250 * this structure specifies width, height, timing and polarity and so on. 253 - * @phy_enable: pointer to a callback controlling D-PHY enable/reset 254 251 */ 255 252 struct mipi_dsim_platform_data { 256 253 char lcd_panel_name[PANEL_NAME_SIZE]; ··· 257 256 struct mipi_dsim_config *dsim_config; 258 257 unsigned int enabled; 259 258 void *lcd_panel_info; 260 - 261 - int (*phy_enable)(struct platform_device *pdev, bool on); 262 259 }; 263 260 264 261 /*