Skip to contentSkip to conversation

video phy's adaptation to *generic phy framework*

PATCH New Kishon Vijay Abraham I 11 participants 24 messages Oct 16, 2013 – Oct 30, 2013

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover video phy's adaptation to *generic phy framework*

Hi Greg,

This series includes video PHY adaptation to Generic PHY Framework. With the adaptation they were able to get rid of plat data callbacks.

Since you've taken the Generic PHY Framework, I think this series should also go into your tree.

We should thank Sylwester for actively testing and giving comments from the initial versions of Generic Phy Framework. Both Sylwester and Jingoo had been floating many revisions of their adaptation to Generic PHY Framework.

This has been in my repo for quite some time and has got acks from samsung maintainer and video maintainer.

If you want me to change anything, please let me know.

This patch series can be found @
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git testing

Jingoo Han (3):
phy: Add driver for Exynos DP PHY
video: exynos_dp: remove non-DT support for Exynos Display Port
video: exynos_dp: Use the generic PHY driver

Sylwester Nawrocki (4):
phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs
exynos4-is: Use the generic MIPI CSIS PHY driver
video: exynos_mipi_dsim: Use the generic PHY driver
ARM: Samsung: Remove the MIPI PHY setup code

 .../devicetree/bindings/phy/samsung-phy.txt        |   22 +++
 .../devicetree/bindings/video/exynos_dp.txt        |   17 +-
 arch/arm/mach-exynos/include/mach/regs-pmu.h       |    5 -
 arch/arm/mach-s5pv210/include/mach/regs-clock.h    |    4 -
 arch/arm/plat-samsung/Kconfig                      |    5 -
 arch/arm/plat-samsung/Makefile                     |    1 -
 arch/arm/plat-samsung/setup-mipiphy.c              |   60 -------
 drivers/media/platform/exynos4-is/Kconfig          |    2 +-
 drivers/media/platform/exynos4-is/mipi-csis.c      |   13 +-
 drivers/phy/Kconfig                                |   13 ++
 drivers/phy/Makefile                               |    8 +-
 drivers/phy/phy-exynos-dp-video.c                  |  111 ++++++++++++
 drivers/phy/phy-exynos-mipi-video.c                |  176 ++++++++++++++++++++
 drivers/video/exynos/Kconfig                       |    3 +-
 drivers/video/exynos/exynos_dp_core.c              |  132 ++++-----------
 drivers/video/exynos/exynos_dp_core.h              |  110 ++++++++++++
 drivers/video/exynos/exynos_dp_reg.c               |    2 -
 drivers/video/exynos/exynos_mipi_dsi.c             |   19 ++-
 include/linux/platform_data/mipi-csis.h            |    9 -
 include/video/exynos_dp.h                          |  131 ---------------
 include/video/exynos_mipi_dsim.h                   |    5 +-
 21 files changed, 508 insertions(+), 340 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/samsung-phy.txt
 delete mode 100644 arch/arm/plat-samsung/setup-mipiphy.c
 create mode 100644 drivers/phy/phy-exynos-dp-video.c
 create mode 100644 drivers/phy/phy-exynos-mipi-video.c
 delete mode 100644 include/video/exynos_dp.h
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/7 phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs

From: Sylwester Nawrocki <[email protected]>

Add a PHY provider driver for the Samsung S5P/Exynos SoC MIPI CSI-2 receiver and MIPI DSI transmitter DPHYs.

---
 .../devicetree/bindings/phy/samsung-phy.txt        |   14 ++
 drivers/phy/Kconfig                                |    6 +
 drivers/phy/Makefile                               |    7 +-
 drivers/phy/phy-exynos-mipi-video.c                |  176 ++++++++++++++++++++
 4 files changed, 200 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/samsung-phy.txt
 create mode 100644 drivers/phy/phy-exynos-mipi-video.c
Documentation/devicetree/bindings/phy/samsung-phy.txt new file +14 -0
new file mode 100644
index 0000000..5ff208c
@@ -0,0 +1,14 @@
+Samsung S5P/EXYNOS SoC series MIPI CSIS/DSIM DPHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,s5pv210-mipi-video-phy";
+- reg : offset and length of the MIPI DPHY register set;
+- #phy-cells : from the generic phy bindings, must be 1;
+
+For "samsung,s5pv210-mipi-video-phy" compatible PHYs the second cell in
+the PHY specifier identifies the PHY and its meaning is as follows:
+  0 - MIPI CSIS 0,
+  1 - MIPI DSIM 0,
+  2 - MIPI CSIS 1,
+  3 - MIPI DSIM 1.
drivers/phy/Kconfig +6 -0
index ac239ac..0062d7e 100644
@@ -15,6 +15,12 @@ config GENERIC_PHY
 	  phy users can obtain reference to the PHY. All the users of this
 	  framework should select this config.
 
+config PHY_EXYNOS_MIPI_VIDEO
+	tristate "S5P/EXYNOS SoC series MIPI CSI-2/DSI PHY driver"
+	help
+	  Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P
+	  and EXYNOS SoCs.
+
 config OMAP_USB2
 	tristate "OMAP USB2 PHY Driver"
 	depends on ARCH_OMAP2PLUS
drivers/phy/Makefile +4 -3
index 0dd8a98..6344053 100644
@@ -2,6 +2,7 @@
 # Makefile for the phy drivers.
 #
 
-obj-$(CONFIG_GENERIC_PHY)	+= phy-core.o
-obj-$(CONFIG_OMAP_USB2)		+= phy-omap-usb2.o
-obj-$(CONFIG_TWL4030_USB)	+= phy-twl4030-usb.o
+obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
+obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)	+= phy-exynos-mipi-video.o
+obj-$(CONFIG_OMAP_USB2)			+= phy-omap-usb2.o
+obj-$(CONFIG_TWL4030_USB)		+= phy-twl4030-usb.o
drivers/phy/phy-exynos-mipi-video.c new file +176 -0

176 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/7 exynos4-is: Use the generic MIPI CSIS PHY driver

In reply to Kishon Vijay Abraham I

From: Sylwester Nawrocki <[email protected]>

Use the generic PHY API instead of the platform callback to control the MIPI CSIS DPHY.

---
 drivers/media/platform/exynos4-is/Kconfig     |    2 +-
 drivers/media/platform/exynos4-is/mipi-csis.c |   13 ++++++++++---
 include/linux/platform_data/mipi-csis.h       |    9 ---------
 3 files changed, 11 insertions(+), 13 deletions(-)
drivers/media/platform/exynos4-is/Kconfig +1 -1
index 53ad0f0..d2d3b4b 100644
@@ -29,7 +29,7 @@ config VIDEO_S5P_FIMC
 config VIDEO_S5P_MIPI_CSIS
 	tristate "S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver"
 	depends on REGULATOR
-	select S5P_SETUP_MIPIPHY
+	select GENERIC_PHY
 	help
 	  This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
 	  receiver (MIPI-CSIS) devices.
drivers/media/platform/exynos4-is/mipi-csis.c +10 -3
index 0914230..9fc2af6 100644
@@ -20,6 +20,7 @@
 #include <linux/memory.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/phy/phy.h>
 #include <linux/platform_data/mipi-csis.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
@@ -180,6 +181,7 @@ struct csis_drvdata {
  * @sd: v4l2_subdev associated with CSIS device instance
  * @index: the hardware instance index
  * @pdev: CSIS platform device
+ * @phy: pointer to the CSIS generic PHY
  * @regs: mmaped I/O registers memory
  * @supplies: CSIS regulator supplies
  * @clock: CSIS clocks
@@ -203,6 +205,7 @@ struct csis_state {
 	struct v4l2_subdev sd;
 	u8 index;
 	struct platform_device *pdev;
+	struct phy *phy;
 	void __iomem *regs;
 	struct regulator_bulk_data supplies[CSIS_NUM_SUPPLIES];
 	struct clk *clock[NUM_CSIS_CLOCKS];
@@ -779,8 +782,8 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
 					"samsung,csis-wclk");
 
 	state->num_lanes = endpoint.bus.mipi_csi2.num_data_lanes;
-
 	of_node_put(node);
+
 	return 0;
 }
 #else
@@ -829,6 +832,10 @@ static int s5pcsis_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	state->phy = devm_phy_get(dev, "csis");
+	if (IS_ERR(state->phy))
+		return PTR_ERR(state->phy);
+
 	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	state->regs = devm_ioremap_resource(dev, mem_res);
 	if (IS_ERR(state->regs))
@@ -922,7 +929,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
 	mutex_lock(&state->lock);
 	if (state->flags & ST_POWERED) {
 		s5pcsis_stop_stream(state);
-		ret = s5p_csis_phy_enable(state->index, false);
+		ret = phy_power_off(state->phy);
 		if (ret)
 			goto unlock;
 		ret = regulator_bulk_disable(CSIS_NUM_SUPPLIES,
@@ -958,7 +965,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
 					    state->supplies);
 		if (ret)
 			goto unlock;
-		ret = s5p_csis_phy_enable(state->index, true);
+		ret = phy_power_on(state->phy);
 		if (!ret) {
 			state->flags |= ST_POWERED;
 		} else {
include/linux/platform_data/mipi-csis.h +0 -9
index bf34e17..c2fd902 100644
@@ -25,13 +25,4 @@ struct s5p_platform_mipi_csis {
 	u8 hs_settle;
 };
 
-/**
- * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
- * @id:     MIPI-CSIS harware instance index (0...1)
- * @on:     true to enable D-PHY and deassert its reset
- *          false to disable D-PHY
- * @return: 0 on success, or negative error code on failure
- */
-int s5p_csis_phy_enable(int id, bool on);
-
 #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

In reply to Kishon Vijay Abraham I

From: Sylwester Nawrocki <[email protected]>

Use the generic PHY API instead of the platform callback for the MIPI DSIM DPHY enable/reset control.

---
 drivers/video/exynos/Kconfig           |    1 +
 drivers/video/exynos/exynos_mipi_dsi.c |   19 ++++++++++---------
 include/video/exynos_mipi_dsim.h       |    5 ++---
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/video/exynos/Kconfig +1 -0
index 1b035b2..976594d 100644
@@ -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.
 
drivers/video/exynos/exynos_mipi_dsi.c +10 -9
index 32e5406..00b3a52 100644
@@ -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);
 
include/video/exynos_mipi_dsim.h +2 -3
index 89dc88a..6a578f8 100644
@@ -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;
@@ -236,6 +237,7 @@ struct mipi_dsim_device {
 	bool				suspended;
 
 	struct mipi_dsim_platform_data	*pd;
+	struct phy			*phy;
 };
 
 /*
@@ -248,7 +250,6 @@ 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];
@@ -256,8 +257,6 @@ struct mipi_dsim_platform_data {
 	struct mipi_dsim_config		*dsim_config;
 	unsigned int			enabled;
 	void				*lcd_panel_info;
-
-	int (*phy_enable)(struct platform_device *pdev, bool on);
 };
 
 /*
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Hi Kishon,

Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

-Olof

#5 lore raw

PATCH 1/1 drivers: video: exynos: Fix compiler Warning

Fixed the following compilation warning:
../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

---
 drivers/video/exynos/exynos_mipi_dsi.c |    1 -
 1 file changed, 1 deletion(-)
drivers/video/exynos/exynos_mipi_dsi.c +0 -1
index 00b3a52..cee9602 100644
@@ -141,7 +141,6 @@ static int exynos_mipi_dsi_early_blank_mode(struct mipi_dsim_device *dsim,
 
 static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power)
 {
-	struct platform_device *pdev = to_platform_device(dsim->dev);
 	struct mipi_dsim_lcd_driver *client_drv = dsim->dsim_lcd_drv;
 	struct mipi_dsim_lcd_device *client_dev = dsim->dsim_lcd_dev;
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#6 lore raw

Re: [PATCH] drivers: video: exynos: Fix compiler Warning

Quoted 10 lines · Kishon Vijay Abraham I

Fixed the following compilation warning:
../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

pretty obvious patch:

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131024/7d86c480/attachment.sig>
#7 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

In reply to Olof Johansson

Hi Olof,

Quoted 20 lines · Olof Johansson

Hi Kishon,

Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 6 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

I have already submitted a patch to fix this [1]

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Signature · 2 lines
With warm regards,
Sachin
#8 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Hi,

Quoted 30 lines · Sachin Kamat

Hi Olof,

Quoted 20 lines · Olof Johansson

Hi Kishon,

Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 6 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

Quoted 3 lines

I have already submitted a patch to fix this [1]

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Sorry, missed that :-(

Thanks
Kishon

Quoted 2 lines
#9 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Quoted 20 lines · Kishon Vijay Abraham I
Quoted 19 lines · Sachin Kamat
Quoted 18 lines · Olof Johansson
Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

Sorry about missing that, I only noticed this warning recently and didn't get around to submit a patch.

Quoted 1 line
Quoted 1 line

I have already submitted a patch to fix this [1]

Thanks a lot guys for fixing this.

Quoted 3 lines
Quoted 1 line

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Sorry, missed that :-(

This MIPI DSIM driver is affectively a dead code in the mainline now, once Exynos become a dt-only platform. I guess it can be deleted for 3.14, once S5P gets converted to the device tree. The new driver using CDF is basically a complete rewrite. Or device tree support should be added to that driver, but I believe it doesn't make sense without CDF.

--
Regards,
Sylwester

#10 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Quoted 36 lines · Sylwester Nawrocki
Quoted 20 lines · Kishon Vijay Abraham I
Quoted 19 lines · Sachin Kamat
Quoted 18 lines · Olof Johansson
Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

Sorry about missing that, I only noticed this warning recently and didn't get around to submit a patch.

Quoted 1 line
Quoted 1 line

I have already submitted a patch to fix this [1]

Thanks a lot guys for fixing this.

Quoted 2 lines
Quoted 1 line

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Quoted 8 lines
Quoted 1 line

Sorry, missed that :-(

This MIPI DSIM driver is affectively a dead code in the mainline now, once Exynos become a dt-only platform. I guess it can be deleted for 3.14, once S5P gets converted to the device tree. The new driver using CDF is basically a complete rewrite. Or device tree support should be added to that driver, but I believe it doesn't make sense without CDF.

MIPI DSIM driver is not a dead code. There is a steady trickle of patches. It's kind of late, but, I will update it as DT based drivers as soon as possible. And Why do you think that DT support of existing MIPI DSIM is something less than great?

Quoted 8 lines
Signature · 6 lines
Regards,
Sylwester
-- 
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Hi Donghwa,

Quoted 46 lines · On Monday 28 of October 2013 15:12:08 Donghwa Lee wrote:
Quoted 36 lines · Sylwester Nawrocki
Quoted 20 lines · Kishon Vijay Abraham I
Quoted 19 lines · Sachin Kamat
Quoted 18 lines · Olof Johansson
Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

Sorry about missing that, I only noticed this warning recently and didn't get around to submit a patch.

Quoted 1 line
Quoted 1 line

I have already submitted a patch to fix this [1]

Thanks a lot guys for fixing this.

Quoted 2 lines
Quoted 1 line

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Quoted 8 lines
Quoted 1 line

Sorry, missed that :-(

This MIPI DSIM driver is affectively a dead code in the mainline now, once Exynos become a dt-only platform. I guess it can be deleted for 3.14, once S5P gets converted to the device tree. The new driver using CDF is basically a complete rewrite. Or device tree support should be added to that driver, but I believe it doesn't make sense without CDF.

Quoted 4 lines

MIPI DSIM driver is not a dead code. There is a steady trickle of patches. It's kind of late, but, I will update it as DT based drivers as soon as possible. And Why do you think that DT support of existing MIPI DSIM is something less than great?

First of all, the exynos_mipi_dsim driver has currently no users in mainline kernel, so it is essentially dead code. In addition, on a platform that is the primary candidate for using it, which is Exynos, there is no way to use it, due to no DT support.

As for the driver itself, it is not really a great example of good code. It contains a hacks, like calling msleep() without any clear reason and also many coding style issues. I'd prefer to replace it with the new exynos-dsi driver rewritten completely in SRPOL, when CDF is finished.

Best regards,
Tomasz

#12 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Hi Tomasz,

Quoted 43 lines · Tomasz Figa

Hi Donghwa,

Quoted 40 lines · On Monday 28 of October 2013 15:12:08 Donghwa Lee wrote:
Quoted 39 lines · Sylwester Nawrocki
Quoted 19 lines · Kishon Vijay Abraham I
Quoted 18 lines · Sachin Kamat
Quoted 17 lines · Olof Johansson
Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

Sorry about missing that, I only noticed this warning recently and didn't get around to submit a patch.

Quoted 1 line
Quoted 1 line

I have already submitted a patch to fix this [1]

Thanks a lot guys for fixing this.

Quoted 2 lines
Quoted 1 line

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Sorry, missed that :-(

This MIPI DSIM driver is affectively a dead code in the mainline now, once Exynos become a dt-only platform. I guess it can be deleted for 3.14, once S5P gets converted to the device tree. The new driver using CDF is basically a complete rewrite. Or device tree support should be added to that driver, but I believe it doesn't make sense without CDF.

Quoted 8 lines
Quoted 4 lines

MIPI DSIM driver is not a dead code. There is a steady trickle of patches. It's kind of late, but, I will update it as DT based drivers as soon as possible. And Why do you think that DT support of existing MIPI DSIM is something less than great?

First of all, the exynos_mipi_dsim driver has currently no users in mainline kernel, so it is essentially dead code. In addition, on a platform that is the primary candidate for using it, which is Exynos, there is no way to use it, due to no DT support.

As I mentioned above, patches are submitted sometimes and I will update this driver as soon as possible to support DT.

Quoted 4 lines

As for the driver itself, it is not really a great example of good code. It contains a hacks, like calling msleep() without any clear reason and also many coding style issues. I'd prefer to replace it with the new exynos-dsi driver rewritten completely in SRPOL, when CDF is finished.

Yes, I know this drivers had been changed about only minor issues and it is not really good code style. And CDF is more good and light. But discussion for CDF is still remaining a kind of requests. If it is merged into linux kernel and many users use it, existing MIPI DSI drivers will be replaced with the new drivers naturally, isn't it?
Until that, I and quite a few users will update and code re-factory for this drivers to be more better.

BR,
Donghwa Lee

Quoted 4 lines

Best regards,
Tomasz

#13 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

Quoted 2 lines · Donghwa Lee
Quoted 1 line · Tomasz Figa

On Monday 28 of October 2013 15:12:08 Donghwa Lee wrote:

[...]

Quoted 13 lines
Quoted 4 lines

First of all, the exynos_mipi_dsim driver has currently no users in mainline kernel, so it is essentially dead code. In addition, on a platform that is the primary candidate for using it, which is Exynos, there is no way to use it, due to no DT support.

As I mentioned above, patches are submitted sometimes and I will update this driver as soon as possible to support DT.

Quoted 4 lines

As for the driver itself, it is not really a great example of good code. It contains a hacks, like calling msleep() without any clear reason and also many coding style issues. I'd prefer to replace it with the new exynos-dsi driver rewritten completely in SRPOL, when CDF is finished.

Quoted 5 lines

Yes, I know this drivers had been changed about only minor issues and it is not really good code style. And CDF is more good and light. But discussion for CDF is still remaining a kind of requests. If it is merged into linux kernel and many users use it, existing MIPI DSI drivers will be replaced with the new drivers naturally, isn't it?

Not necessarily. Our goal should be to have fairly stable DT binding at the SoC side so all available panels can possibly be used with any SoC without problems.

Then please refrain for a while from pushing entirely vendor specific DT bindings upstream. Let's focus instead on an as much as possible common framework and the DT bindings. Whether the CDF will be part of DRM or not the DT bindings are supposed to be generic, so they work with whatever driver architecture.

I guess you could try to come up with an unstable DT binding for the MIPI DSIM and display panels it is used with, but at this stage it seems just a waste of time.
If there were no SoC specific panel drivers in the kernel there would be now much less trouble with DT support.

--
Thanks,
Sylwester

#14 lore raw

PATCH 3/7 video: exynos_mipi_dsim: Use the generic PHY driver

In reply to Sachin Kamat
Quoted 30 lines · Sachin Kamat

Hi Olof,

Quoted 20 lines · Olof Johansson

Hi Kishon,

Quoted 5 lines · Kishon Vijay Abraham I
drivers/video/exynos/exynos_mipi_dsi.c +0 -0
index 32e5406..00b3a52 100644

drivers/video/exynos/exynos_mipi_dsi.c static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) · line 163

Quoted 9 lines
drivers/video/exynos/exynos_mipi_dsi.c +1 -2
@@ -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);
 

This introduces the below with exynos_defconfig:

Quoted 6 lines

../../drivers/video/exynos/exynos_mipi_dsi.c: In function 'exynos_mipi_dsi_blank_mode':
../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused variable 'pdev' [-Wunused-variable]
struct platform_device *pdev = to_platform_device(dsim->dev);

Quoted 3 lines

I have already submitted a patch to fix this [1]

[1] http://marc.info/?l=linux-fbdev&m=138233359617936&w=2

Ah, I'm not subscribed to the fbdev list. Next time it might be a good idea to cc the same lists as the original patch. But thanks for fixing it!

-Olof

#15 lore raw

PATCH 4/7 ARM: Samsung: Remove the MIPI PHY setup code

In reply to Kishon Vijay Abraham I

From: Sylwester Nawrocki <[email protected]>

Generic PHY drivers are used to handle the MIPI CSIS and MIPI DSIM DPHYs so we can remove now unused code at arch/arm/plat-samsung. In case there is any board file for S5PV210 platforms using MIPI CSIS/DSIM (not any upstream currently) it should use the generic PHY API to bind the PHYs to respective PHY consumer drivers and a platform device for the PHY provider should be defined.

---
 arch/arm/mach-exynos/include/mach/regs-pmu.h    |    5 --
 arch/arm/mach-s5pv210/include/mach/regs-clock.h |    4 --
 arch/arm/plat-samsung/Kconfig                   |    5 --
 arch/arm/plat-samsung/Makefile                  |    1 -
 arch/arm/plat-samsung/setup-mipiphy.c           |   60 -----------------------
 5 files changed, 75 deletions(-)
 delete mode 100644 arch/arm/plat-samsung/setup-mipiphy.c
arch/arm/mach-exynos/include/mach/regs-pmu.h +0 -5
index 57344b7..2cdb63e 100644
@@ -44,11 +44,6 @@
 #define S5P_DAC_PHY_CONTROL			S5P_PMUREG(0x070C)
 #define S5P_DAC_PHY_ENABLE			(1 << 0)
 
-#define S5P_MIPI_DPHY_CONTROL(n)		S5P_PMUREG(0x0710 + (n) * 4)
-#define S5P_MIPI_DPHY_ENABLE			(1 << 0)
-#define S5P_MIPI_DPHY_SRESETN			(1 << 1)
-#define S5P_MIPI_DPHY_MRESETN			(1 << 2)
-
 #define S5P_INFORM0				S5P_PMUREG(0x0800)
 #define S5P_INFORM1				S5P_PMUREG(0x0804)
 #define S5P_INFORM2				S5P_PMUREG(0x0808)
arch/arm/mach-s5pv210/include/mach/regs-clock.h +0 -4
index 032de66..e345584 100644
@@ -147,10 +147,6 @@
 #define S5P_HDMI_PHY_CONTROL	S5P_CLKREG(0xE804)
 #define S5P_USB_PHY_CONTROL	S5P_CLKREG(0xE80C)
 #define S5P_DAC_PHY_CONTROL	S5P_CLKREG(0xE810)
-#define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814)
-#define S5P_MIPI_DPHY_ENABLE	(1 << 0)
-#define S5P_MIPI_DPHY_SRESETN	(1 << 1)
-#define S5P_MIPI_DPHY_MRESETN	(1 << 2)
 
 #define S5P_INFORM0		S5P_CLKREG(0xF000)
 #define S5P_INFORM1		S5P_CLKREG(0xF004)
arch/arm/plat-samsung/Kconfig +0 -5
index 7dfba93..ec882ad 100644
@@ -395,11 +395,6 @@ config S3C24XX_PWM
 	  Support for exporting the PWM timer blocks via the pwm device
 	  system
 
-config S5P_SETUP_MIPIPHY
-	bool
-	help
-	  Compile in common setup code for MIPI-CSIS and MIPI-DSIM devices
-
 config S3C_SETUP_CAMIF
 	bool
 	help
arch/arm/plat-samsung/Makefile +0 -1
index 498c7c2..9267d29 100644
@@ -38,7 +38,6 @@ obj-$(CONFIG_S5P_DEV_UART)	+= s5p-dev-uart.o
 obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT)	+= dev-backlight.o
 
 obj-$(CONFIG_S3C_SETUP_CAMIF)	+= setup-camif.o
-obj-$(CONFIG_S5P_SETUP_MIPIPHY)	+= setup-mipiphy.o
 
 # DMA support
 
arch/arm/plat-samsung/setup-mipiphy.c deleted +0 -60

60 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#16 lore raw

PATCH 5/7 phy: Add driver for Exynos DP PHY

In reply to Kishon Vijay Abraham I

From: Jingoo Han <[email protected]>

Add a PHY provider driver for the Samsung Exynos SoC Display Port PHY.

---
 .../devicetree/bindings/phy/samsung-phy.txt        |    8 ++
 drivers/phy/Kconfig                                |    7 ++
 drivers/phy/Makefile                               |    1 +
 drivers/phy/phy-exynos-dp-video.c                  |  111 ++++++++++++++++++++
 4 files changed, 127 insertions(+)
 create mode 100644 drivers/phy/phy-exynos-dp-video.c
Documentation/devicetree/bindings/phy/samsung-phy.txt +8 -0
index 5ff208c..c0fccaa 100644
@@ -12,3 +12,11 @@ the PHY specifier identifies the PHY and its meaning is as follows:
   1 - MIPI DSIM 0,
   2 - MIPI CSIS 1,
   3 - MIPI DSIM 1.
+
+Samsung EXYNOS SoC series Display Port PHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,exynos5250-dp-video-phy";
+- reg : offset and length of the Display Port PHY register set;
+- #phy-cells : from the generic PHY bindings, must be 0;
drivers/phy/Kconfig +7 -0
index 0062d7e..a344f3d 100644
@@ -44,4 +44,11 @@ config TWL4030_USB
 	  This transceiver supports high and full speed devices plus,
 	  in host mode, low speed.
 
+config PHY_EXYNOS_DP_VIDEO
+	tristate "EXYNOS SoC series Display Port PHY driver"
+	depends on OF
+	select GENERIC_PHY
+	help
+	  Support for Display Port PHY found on Samsung EXYNOS SoCs.
+
 endmenu
drivers/phy/Makefile +1 -0
index 6344053..d0caae9 100644
@@ -3,6 +3,7 @@
 #
 
 obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
+obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
 obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)	+= phy-exynos-mipi-video.o
 obj-$(CONFIG_OMAP_USB2)			+= phy-omap-usb2.o
 obj-$(CONFIG_TWL4030_USB)		+= phy-twl4030-usb.o
drivers/phy/phy-exynos-dp-video.c new file +111 -0

111 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#17 lore raw

PATCH 5/7 phy: Add driver for Exynos DP PHY

Hi Kishon,
Recently, I posted 'simple-phy' driver.
It is a part of patchset for HDMI enabling on Exynos4 using Device Tree.

http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg23655.html

The simple-phy was dedicated for single register PHYs like HDMI or DP. Using such a generic phy may help to avoid code duplication.

Regards,
Tomasz Stanislawski

Quoted 17 lines · Kishon Vijay Abraham I

From: Jingoo Han <[email protected]>

Add a PHY provider driver for the Samsung Exynos SoC Display Port PHY.

---
 .../devicetree/bindings/phy/samsung-phy.txt        |    8 ++
 drivers/phy/Kconfig                                |    7 ++
 drivers/phy/Makefile                               |    1 +
 drivers/phy/phy-exynos-dp-video.c                  |  111 ++++++++++++++++++++
 4 files changed, 127 insertions(+)
 create mode 100644 drivers/phy/phy-exynos-dp-video.c
#18 lore raw

PATCH 6/7 video: exynos_dp: remove non-DT support for Exynos Display Port

In reply to Kishon Vijay Abraham I

From: Jingoo Han <[email protected]>

Exynos Display Port can be used only for Exynos SoCs. In addition, non-DT for EXYNOS SoCs is not supported from v3.11; thus, there is no need to support non-DT for Exynos Display Port.

The 'include/video/exynos_dp.h' file has been used for non-DT support and the content of file include/video/exynos_dp.h is moved to drivers/video/exynos/exynos_dp_core.h. Thus, the 'exynos_dp.h' file is removed. Also, 'struct exynos_dp_platdata' is removed, because it is not used any more.

---
 drivers/video/exynos/Kconfig          |    2 +-
 drivers/video/exynos/exynos_dp_core.c |  116 +++++++----------------------
 drivers/video/exynos/exynos_dp_core.h |  109 +++++++++++++++++++++++++++
 drivers/video/exynos/exynos_dp_reg.c  |    2 -
 include/video/exynos_dp.h             |  131 ---------------------------------
 5 files changed, 135 insertions(+), 225 deletions(-)
 delete mode 100644 include/video/exynos_dp.h
drivers/video/exynos/Kconfig +1 -1
index 976594d..1129d0e 100644
@@ -30,7 +30,7 @@ config EXYNOS_LCD_S6E8AX0
 
 config EXYNOS_DP
 	bool "EXYNOS DP driver support"
-	depends on ARCH_EXYNOS
+	depends on OF && ARCH_EXYNOS
 	default n
 	help
 	  This enables support for DP device.
drivers/video/exynos/exynos_dp_core.c +25 -91

211 lines not on this page · raw message

drivers/video/exynos/exynos_dp_core.h +109 -0

121 lines not on this page · raw message

drivers/video/exynos/exynos_dp_reg.c +0 -2
index 29d9d03..b70da50 100644
@@ -14,8 +14,6 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 
-#include <video/exynos_dp.h>
-
 #include "exynos_dp_core.h"
 #include "exynos_dp_reg.h"
 
include/video/exynos_dp.h deleted +0 -131

131 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#19 lore raw

PATCH 7/7 video: exynos_dp: Use the generic PHY driver

In reply to Kishon Vijay Abraham I

From: Jingoo Han <[email protected]>

Use the generic PHY API to control the DP PHY.

---
 Documentation/devicetree/bindings/video/exynos_dp.txt |   17 +++++++++--------
 drivers/video/exynos/exynos_dp_core.c                 |   16 ++++++++++++----
 drivers/video/exynos/exynos_dp_core.h                 |    1 +
 3 files changed, 22 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/video/exynos_dp.txt +9 -8
index 84f10c1..3289d76 100644
@@ -6,10 +6,10 @@ We use two nodes:
 	-dptx-phy node(defined inside dp-controller node)
 
 For the DP-PHY initialization, we use the dptx-phy node.
-Required properties for dptx-phy:
-	-reg:
+Required properties for dptx-phy: deprecated, use phys and phy-names
+	-reg: deprecated
 		Base address of DP PHY register.
-	-samsung,enable-mask:
+	-samsung,enable-mask: deprecated
 		The bit-mask used to enable/disable DP PHY.
 
 For the Panel initialization, we read data from dp-controller node.
@@ -27,6 +27,10 @@ Required properties for dp-controller:
 		from common clock binding: Shall be "dp".
 	-interrupt-parent:
 		phandle to Interrupt combiner node.
+	-phys:
+		from general PHY binding: the phandle for the PHY device.
+	-phy-names:
+		from general PHY binding: Should be "dp".
 	-samsung,color-space:
 		input video data format.
 			COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2
@@ -68,11 +72,8 @@ SOC specific portion:
 		clocks = <&clock 342>;
 		clock-names = "dp";
 
-		dptx-phy {
-			reg = <0x10040720>;
-			samsung,enable-mask = <1>;
-		};
-
+		phys = <&dp_phy>;
+		phy-names = "dp";
 	};
 
 Board Specific portion:
drivers/video/exynos/exynos_dp_core.c +12 -4
index 05fed7d..5e1a715 100644
@@ -19,6 +19,7 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/of.h>
+#include <linux/phy/phy.h>
 
 #include "exynos_dp_core.h"
 
@@ -960,8 +961,11 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
 
 	dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy");
 	if (!dp_phy_node) {
-		dev_err(dp->dev, "could not find dptx-phy node\n");
-		return -ENODEV;
+		dp->phy = devm_phy_get(dp->dev, "dp");
+		if (IS_ERR(dp->phy))
+			return PTR_ERR(dp->phy);
+		else
+			return 0;
 	}
 
 	if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) {
@@ -992,7 +996,9 @@ err:
 
 static void exynos_dp_phy_init(struct exynos_dp_device *dp)
 {
-	if (dp->phy_addr) {
+	if (dp->phy) {
+		phy_power_on(dp->phy);
+	} else if (dp->phy_addr) {
 		u32 reg;
 
 		reg = __raw_readl(dp->phy_addr);
@@ -1003,7 +1009,9 @@ static void exynos_dp_phy_init(struct exynos_dp_device *dp)
 
 static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
 {
-	if (dp->phy_addr) {
+	if (dp->phy) {
+		phy_power_off(dp->phy);
+	} else if (dp->phy_addr) {
 		u32 reg;
 
 		reg = __raw_readl(dp->phy_addr);
drivers/video/exynos/exynos_dp_core.h +1 -0
index 56cfec8..607e36d 100644
@@ -151,6 +151,7 @@ struct exynos_dp_device {
 	struct video_info	*video_info;
 	struct link_train	link_train;
 	struct work_struct	hotplug_work;
+	struct phy		*phy;
 };
 
 /* exynos_dp_reg.c */
Signature · 1 line
1.7.10.4
#20 lore raw

PATCH 1/1 phy: exynos-mipi-video: Fix phy_power_off() callback

In reply to Kishon Vijay Abraham I

Fix argument passed to the register setup helper function so the phy is actually disabled. Now due to cut&paste error 1 is passed to both phy_power_on() and phy_power_off().

Reported by: Kyungmin Park <[email protected]>

---

This fixes a cut&paste typo which snicked in while doing very last adaptation to latest version of the phy framework.

Thanks,
Sylwester

---
 drivers/phy/phy-exynos-mipi-video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-exynos-mipi-video.c +1 -1
index b73b86a..0c5efab 100644
@@ -93,7 +93,7 @@ static int exynos_mipi_video_phy_power_off(struct phy *phy)
 	struct video_phy_desc *phy_desc = phy_get_drvdata(phy);
 	struct exynos_mipi_video_phy *state = to_mipi_video_phy(phy_desc);
 
-	return __set_phy_state(state, phy_desc->index, 1);
+	return __set_phy_state(state, phy_desc->index, 0);
 }
 
 static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH 1/1 phy: exynos-mipi-video: Fix phy_power_off() callback

Quoted 7 lines · Sylwester Nawrocki

Fix argument passed to the register setup helper function so the phy is actually disabled. Now due to cut&paste error 1 is passed to both phy_power_on() and phy_power_off().

Reported by: Kyungmin Park <[email protected]>

Best regards,
Jingoo Han

Quoted 26 lines

---

This fixes a cut&paste typo which snicked in while doing very last adaptation to latest version of the phy framework.

Thanks,
Sylwester

---
 drivers/phy/phy-exynos-mipi-video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-exynos-mipi-video.c +1 -2
index b73b86a..0c5efab 100644
@@ -93,7 +93,7 @@ static int exynos_mipi_video_phy_power_off(struct phy *phy)
 	struct video_phy_desc *phy_desc = phy_get_drvdata(phy);
 	struct exynos_mipi_video_phy *state = to_mipi_video_phy(phy_desc);
 
-	return __set_phy_state(state, phy_desc->index, 1);
+	return __set_phy_state(state, phy_desc->index, 0);
 }
 
 static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
--

1.7.9.5

#22 lore raw

PATCH 1/1 phy: exynos-mipi-video: Fix phy_power_off() callback

In reply to Sylwester Nawrocki

Hi Greg,

Quoted 3 lines · Sylwester Nawrocki

Fix argument passed to the register setup helper function so the phy is actually disabled. Now due to cut&paste error 1 is passed to both phy_power_on() and phy_power_off().

Can you take this patch?

Quoted 28 lines

Reported by: Kyungmin Park <[email protected]>

---

This fixes a cut&paste typo which snicked in while doing very last adaptation to latest version of the phy framework.

Thanks,
Sylwester

---
 drivers/phy/phy-exynos-mipi-video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-exynos-mipi-video.c +1 -1
index b73b86a..0c5efab 100644
@@ -93,7 +93,7 @@ static int exynos_mipi_video_phy_power_off(struct phy *phy)
 	struct video_phy_desc *phy_desc = phy_get_drvdata(phy);
 	struct exynos_mipi_video_phy *state = to_mipi_video_phy(phy_desc);
 
-	return __set_phy_state(state, phy_desc->index, 1);
+	return __set_phy_state(state, phy_desc->index, 0);
 }
 
 static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
#23 lore raw

cover video phy's adaptation to *generic phy framework*

In reply to Kishon Vijay Abraham I
Quoted 7 lines · Kishon Vijay Abraham I

Hi Greg,

This series includes video PHY adaptation to Generic PHY Framework. With the adaptation they were able to get rid of plat data callbacks.

Since you've taken the Generic PHY Framework, I think this series should also go into your tree.

All now applied, thanks.

greg k-h