Skip to contentSkip to conversation

phy: qcom: Add driver for QCOM IPQ806x SATA PHY

PATCH Superseded Kumar Gala 2 participants 2 messages Jun 16, 2014 – Jun 17, 2014

Subsystems (3)

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH v3 1/2 phy: qcom: Add driver for QCOM IPQ806x SATA PHY

Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.

---
v3:
* Added Kconfig HAS_IOMEM dep
* re-ordered probe function so phy_provider_register is last

v2:
* dropped unused dev pointer in struct qcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clock

 drivers/phy/Kconfig                 |   7 ++
 drivers/phy/Makefile                |   1 +
 drivers/phy/phy-qcom-ipq806x-sata.c | 211 ++++++++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)
 create mode 100644 drivers/phy/phy-qcom-ipq806x-sata.c
drivers/phy/Kconfig +7 -0
index 16a2f06..b7b6bce 100644
@@ -178,4 +178,11 @@ config PHY_XGENE
 	help
 	  This option enables support for APM X-Gene SoC multi-purpose PHY.
 
+config PHY_QCOM_IPQ806X_SATA
+	tristate "Qualcomm IPQ806x SATA SerDes/PHY driver"
+	depends on ARCH_QCOM
+	depends on HAS_IOMEM
+	depends on OF
+	select GENERIC_PHY
+
 endmenu
drivers/phy/Makefile +1 -0
index b4f1d57..d950317 100644
@@ -20,3 +20,4 @@ phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4X12_USB2)	+= phy-exynos4x12-usb2.o
 phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2)	+= phy-exynos5250-usb2.o
 obj-$(CONFIG_PHY_EXYNOS5_USBDRD)	+= phy-exynos5-usbdrd.o
 obj-$(CONFIG_PHY_XGENE)			+= phy-xgene.o
+obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA)	+= phy-qcom-ipq806x-sata.o
drivers/phy/phy-qcom-ipq806x-sata.c new file +211 -0

211 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#1 lore raw

Hi,

Quoted 52 lines · Kumar Gala

Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.

---
v3:
* Added Kconfig HAS_IOMEM dep
* re-ordered probe function so phy_provider_register is last

v2:
* dropped unused dev pointer in struct qcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clock

 drivers/phy/Kconfig                 |   7 ++
 drivers/phy/Makefile                |   1 +
 drivers/phy/phy-qcom-ipq806x-sata.c | 211 ++++++++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)
 create mode 100644 drivers/phy/phy-qcom-ipq806x-sata.c
drivers/phy/Kconfig +7 -0
index 16a2f06..b7b6bce 100644
@@ -178,4 +178,11 @@ config PHY_XGENE
 	help
 	  This option enables support for APM X-Gene SoC multi-purpose PHY.
 
+config PHY_QCOM_IPQ806X_SATA
+	tristate "Qualcomm IPQ806x SATA SerDes/PHY driver"
+	depends on ARCH_QCOM
+	depends on HAS_IOMEM
+	depends on OF
+	select GENERIC_PHY
+
 endmenu
drivers/phy/Makefile +1 -0
index b4f1d57..d950317 100644
@@ -20,3 +20,4 @@ phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4X12_USB2)	+= phy-exynos4x12-usb2.o
 phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2)	+= phy-exynos5250-usb2.o
 obj-$(CONFIG_PHY_EXYNOS5_USBDRD)	+= phy-exynos5-usbdrd.o
 obj-$(CONFIG_PHY_XGENE)			+= phy-xgene.o
+obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA)	+= phy-qcom-ipq806x-sata.o
drivers/phy/phy-qcom-ipq806x-sata.c new file +0 -0
new file mode 100644
index 0000000..e931aee

[...]

drivers/phy/phy-qcom-ipq806x-sata.c line 64

Quoted 5 lines
drivers/phy/phy-qcom-ipq806x-sata.c new file +5 -0
+static inline void qcom_ipq806x_sata_delay_us(unsigned int delay)
+{
+	/* sleep for max. 50us more to combine processor wakeups */
+	usleep_range(delay, delay + 50);
+}

This is used only once in the driver so there is no need to make it into static inline helper.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics