Skip to contentSkip to conversation

phy: Add driver for Exynos DP PHY

PATCH Superseded Jingoo Han 3 participants 4 messages Jun 28, 2013 – Jul 1, 2013

Subsystems (5)

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH v2 1/3 phy: Add driver for Exynos DP PHY

Add a PHY provider driver for the Samsung Exynos SoC DP PHY.

---
 .../phy/samsung,exynos5250-dp-video-phy.txt        |    7 ++
 drivers/phy/Kconfig                                |    8 ++
 drivers/phy/Makefile                               |    3 +-
 drivers/phy/phy-exynos-dp-video.c                  |  122 ++++++++++++++++++++
 4 files changed, 139 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt
 create mode 100644 drivers/phy/phy-exynos-dp-video.c
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt new file mode 100644
index 0000000..d1771ef

Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt new file +7 -0
@@ -0,0 +1,7 @@
+Samsung EXYNOS SoC series DP PHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,exynos5250-dp-video-phy";
+- reg : offset and length of the DP PHY register set;
+- #phy-cells : from the generic phy bindings, must be 0;
drivers/phy/Kconfig +8 -0
index 5f85909..6d10e3b 100644
@@ -11,3 +11,11 @@ menuconfig GENERIC_PHY
 	  devices present in the kernel. This layer will have the generic
 	  API by which phy drivers can create PHY using the phy framework and
 	  phy users can obtain reference to the PHY.
+
+if GENERIC_PHY
+
+config PHY_EXYNOS_DP_VIDEO
+	tristate "EXYNOS SoC series DP PHY driver"
+	help
+	  Support for DP PHY found on Samsung EXYNOS SoCs.
+endif
drivers/phy/Makefile +2 -1
index 9e9560f..d8d861c 100644
@@ -2,4 +2,5 @@
 # Makefile for the phy drivers.
 #
 
-obj-$(CONFIG_GENERIC_PHY)	+= phy-core.o
+obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
+obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
drivers/phy/phy-exynos-dp-video.c new file +122 -0

122 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/3 phy: Add driver for Exynos DP PHY

Quoted 3 lines · Jingoo Han

Add a PHY provider driver for the Samsung Exynos SoC DP PHY.

Now that you fixed Kishon's concerns, this looks pretty good:

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/20130628/38302254/attachment.sig>
#2 lore raw

PATCH v2 1/3 phy: Add driver for Exynos DP PHY

In reply to Jingoo Han

Hi,

Quoted 74 lines · Jingoo Han

Add a PHY provider driver for the Samsung Exynos SoC DP PHY.

---
  .../phy/samsung,exynos5250-dp-video-phy.txt        |    7 ++
  drivers/phy/Kconfig                                |    8 ++
  drivers/phy/Makefile                               |    3 +-
  drivers/phy/phy-exynos-dp-video.c                  |  122 ++++++++++++++++++++
  4 files changed, 139 insertions(+), 1 deletion(-)

create mode 100644 Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt create mode 100644 drivers/phy/phy-exynos-dp-video.c

Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt new file +7 -0
new file mode 100644
index 0000000..d1771ef
@@ -0,0 +1,7 @@
+Samsung EXYNOS SoC series DP PHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,exynos5250-dp-video-phy";
+- reg : offset and length of the DP PHY register set;
+- #phy-cells : from the generic phy bindings, must be 0;
drivers/phy/Kconfig +8 -0
index 5f85909..6d10e3b 100644
@@ -11,3 +11,11 @@ menuconfig GENERIC_PHY
  	  devices present in the kernel. This layer will have the generic
  	  API by which phy drivers can create PHY using the phy framework and
  	  phy users can obtain reference to the PHY.
+
+if GENERIC_PHY
+
+config PHY_EXYNOS_DP_VIDEO
+	tristate "EXYNOS SoC series DP PHY driver"
+	help
+	  Support for DP PHY found on Samsung EXYNOS SoCs.
+endif
drivers/phy/Makefile +2 -1
index 9e9560f..d8d861c 100644
@@ -2,4 +2,5 @@
  # Makefile for the phy drivers.
  #
 
-obj-$(CONFIG_GENERIC_PHY)	+= phy-core.o
+obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
+obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
drivers/phy/phy-exynos-dp-video.c new file +15 -0
new file mode 100644
index 0000000..9a3d6f1
@@ -0,0 +1,122 @@
+/*
+ * Samsung EXYNOS SoC series DP PHY driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Jingoo Han <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>

drivers/phy/phy-exynos-dp-video.c line 25

Quoted 10 lines
drivers/phy/phy-exynos-dp-video.c new file +10 -0
+#include <linux/of_address.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+#include <linux/spinlock.h>
+
+/* DPTX_PHY_CONTROL register */
+#define EXYNOS_DPTX_PHY_ENABLE		(1 << 0)
+
+struct exynos_dp_video_phy {
+	spinlock_t slock;

I think spinlock is not needed at all since the PHY ops is already protected by a mutex.

drivers/phy/phy-exynos-dp-video.c line 26

Quoted 1 line
drivers/phy/phy-exynos-dp-video.c new file +1 -0
+	struct phy *phys;

_phys_ no longer need to part of this structure.

drivers/phy/phy-exynos-dp-video.c line 28

Quoted 2 lines
drivers/phy/phy-exynos-dp-video.c new file +2 -0
+	void __iomem *regs;
+};

Thanks
Kishon

author
#3 lore raw

PATCH v2 1/3 phy: Add driver for Exynos DP PHY

Quoted 83 lines · Kishon Vijay Abraham I

Hi,

Quoted 79 lines · Jingoo Han

Add a PHY provider driver for the Samsung Exynos SoC DP PHY.

---
  .../phy/samsung,exynos5250-dp-video-phy.txt        |    7 ++
  drivers/phy/Kconfig                                |    8 ++
  drivers/phy/Makefile                               |    3 +-
  drivers/phy/phy-exynos-dp-video.c                  |  122 ++++++++++++++++++++
  4 files changed, 139 insertions(+), 1 deletion(-)

create mode 100644 Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt create mode 100644 drivers/phy/phy-exynos-dp-video.c

Documentation/devicetree/bindings/phy/samsung,exynos5250-dp-video-phy.txt new file +7 -0
new file mode 100644
index 0000000..d1771ef
@@ -0,0 +1,7 @@
+Samsung EXYNOS SoC series DP PHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,exynos5250-dp-video-phy";
+- reg : offset and length of the DP PHY register set;
+- #phy-cells : from the generic phy bindings, must be 0;
drivers/phy/Kconfig +8 -0
index 5f85909..6d10e3b 100644
@@ -11,3 +11,11 @@ menuconfig GENERIC_PHY
  	  devices present in the kernel. This layer will have the generic
  	  API by which phy drivers can create PHY using the phy framework and
  	  phy users can obtain reference to the PHY.
+
+if GENERIC_PHY
+
+config PHY_EXYNOS_DP_VIDEO
+	tristate "EXYNOS SoC series DP PHY driver"
+	help
+	  Support for DP PHY found on Samsung EXYNOS SoCs.
+endif
drivers/phy/Makefile +2 -1
index 9e9560f..d8d861c 100644
@@ -2,4 +2,5 @@
  # Makefile for the phy drivers.
  #
 
-obj-$(CONFIG_GENERIC_PHY)	+= phy-core.o
+obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
+obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
drivers/phy/phy-exynos-dp-video.c new file +20 -0
new file mode 100644
index 0000000..9a3d6f1
@@ -0,0 +1,122 @@
+/*
+ * Samsung EXYNOS SoC series DP PHY driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Jingoo Han <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+#include <linux/spinlock.h>
+
Quoted 8 lines

drivers/phy/phy-exynos-dp-video.c line 25

Quoted 5 lines
drivers/phy/phy-exynos-dp-video.c new file +5 -0
+/* DPTX_PHY_CONTROL register */
+#define EXYNOS_DPTX_PHY_ENABLE		(1 << 0)
+
+struct exynos_dp_video_phy {
+	spinlock_t slock;

I think spinlock is not needed at all since the PHY ops is already protected by a mutex.

Yes, you're right.
Only one PHY object access the control register; thus, there is no need to add spinlock.
I will remove it.

Quoted 3 lines

drivers/phy/phy-exynos-dp-video.c line 26

Quoted 1 line
drivers/phy/phy-exynos-dp-video.c new file +1 -0
+	struct phy *phys;

_phys_ no longer need to part of this structure.

OK, I see.
'struct phy' is only used at exynos_dp_video_phy_probe(). So, I will remove 'struct phy *phys' from 'struct exynos_dp_video_phy'.

Thank you for your comment.

Best regards,
Jingoo Han

Quoted 5 lines

drivers/phy/phy-exynos-dp-video.c line 28

Quoted 2 lines
drivers/phy/phy-exynos-dp-video.c new file +2 -0
+	void __iomem *regs;
+};

Thanks
Kishon