phy: qcom: Add driver for QCOM IPQ806x SATA PHY
Subsystems (3)
PATCH v5 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.
---
v5:
* Fix copy/paste error when killing qcom_ipq806x_sata_delay_us
v4:
* removed qcom_ipq806x_sata_delay_us as it was only used one
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 | 206 ++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 drivers/phy/phy-qcom-ipq806x-sata.c
drivers/phy/Kconfig +7 -0
@@ -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
@@ -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 +206 -0
206 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
Quoted 21 lines · Kumar Gala
Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.
Signed-off-by Kumar Gala <[email protected]>---
v5:
* Fix copy/paste error when killingqcom_ipq806x_sata_delay_usv4:
* removedqcom_ipq806x_sata_delay_usas it was only used onev3:
* AddedKconfigHAS_IOMEMdep
* re-ordered probe function sophy_provider_registeris lastv2:
* dropped unused dev pointer in structqcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clock
Quoted 5 lines
drivers/phy/Kconfig | 7 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-ipq806x-sata.c | 206 ++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+)create mode 100644
drivers/phy/phy-qcom-ipq806x-sata.c
any update?
- k
Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Hi,
Quoted 32 lines · Kumar Gala
Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.
Signed-off-by Kumar Gala <[email protected]>---
v5:
* Fix copy/paste error when killingqcom_ipq806x_sata_delay_usv4:
* removedqcom_ipq806x_sata_delay_usas it was only used onev3:
* AddedKconfigHAS_IOMEMdep
* re-ordered probe function sophy_provider_registeris lastv2:
* dropped unused dev pointer in structqcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clockdrivers/phy/Kconfig | 7 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-ipq806x-sata.c | 206 ++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 drivers/phy/phy-qcom-ipq806x-sata.cdrivers/phy/Kconfig +0
-0
drivers/phy/Kconfig config PHY_XGENE · line 180
Quoted 3 lines
drivers/phy/Kconfig +0
-0@@ -178,4 +178,11 @@ config PHY_XGENE help This option enables support for APM X-Gene SoC multi-purpose PHY.
.
.
<snip>
.
.
Quoted 42 lines
drivers/phy/Kconfig +42
-0+ +static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy; + struct device *dev = &pdev->dev; + struct resource *res; + struct phy_provider *phy_provider; + struct phy *generic_phy; + int ret; + + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); + if (!phy) { + dev_err(dev, "%s: failed to allocate phy\n", __func__); + return -ENOMEM; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + phy->mmio = devm_ioremap_resource(dev, res); + if (IS_ERR(phy->mmio)) + return PTR_ERR(phy->mmio); + + generic_phy = devm_phy_create(dev, &qcom_ipq806x_sata_phy_ops, NULL); + if (IS_ERR(generic_phy)) { + dev_err(dev, "%s: failed to create phy\n", __func__); + return PTR_ERR(generic_phy); + } + + phy_set_drvdata(generic_phy, phy); + + phy->cfg_clk = devm_clk_get(dev, "cfg"); + if (IS_ERR(phy->cfg_clk)) { + dev_err(dev, "Failed to get sata cfg clock\n"); + return PTR_ERR(phy->cfg_clk); + } + + ret = clk_prepare_enable(phy->cfg_clk); + if (ret) + return ret; + + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { + clk_disable_unprepare(phy->cfg_clk);
drivers/phy/Kconfig config PHY_XGENE
Quoted 10 lines
drivers/phy/Kconfig +10
-0+ dev_err(dev, "%s: failed to register phy\n", __func__); + return PTR_ERR(phy_provider); + } + + return 0; +} + +static int qcom_ipq806x_sata_phy_remove(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy = platform_get_drvdata(pdev);
Where is platform_set_drvdata()?
Thanks
Kishon
Quoted 89 lines · Kishon Vijay Abraham I
Hi,
Quoted 32 lines · Kumar Gala
Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.
Signed-off-by Kumar Gala <[email protected]>---
v5:
* Fix copy/paste error when killingqcom_ipq806x_sata_delay_usv4:
* removedqcom_ipq806x_sata_delay_usas it was only used onev3:
* AddedKconfigHAS_IOMEMdep
* re-ordered probe function sophy_provider_registeris lastv2:
* dropped unused dev pointer in structqcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clockdrivers/phy/Kconfig | 7 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-ipq806x-sata.c | 206 ++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 drivers/phy/phy-qcom-ipq806x-sata.cdrivers/phy/Kconfig +0
-0drivers/phy/Kconfig config PHY_XGENE · line 180
Quoted 3 lines
drivers/phy/Kconfig +0
-0@@ -178,4 +178,11 @@ config PHY_XGENE help This option enables support for APM X-Gene SoC multi-purpose PHY..
.
<snip>
.
.Quoted 46 lines
drivers/phy/Kconfig +46
-0+ +static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy; + struct device *dev = &pdev->dev; + struct resource *res; + struct phy_provider *phy_provider; + struct phy *generic_phy; + int ret; + + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); + if (!phy) { + dev_err(dev, "%s: failed to allocate phy\n", __func__); + return -ENOMEM; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + phy->mmio = devm_ioremap_resource(dev, res); + if (IS_ERR(phy->mmio)) + return PTR_ERR(phy->mmio); + + generic_phy = devm_phy_create(dev, &qcom_ipq806x_sata_phy_ops, NULL); + if (IS_ERR(generic_phy)) { + dev_err(dev, "%s: failed to create phy\n", __func__); + return PTR_ERR(generic_phy); + } + + phy_set_drvdata(generic_phy, phy); + + phy->cfg_clk = devm_clk_get(dev, "cfg"); + if (IS_ERR(phy->cfg_clk)) { + dev_err(dev, "Failed to get sata cfg clock\n"); + return PTR_ERR(phy->cfg_clk); + } + + ret = clk_prepare_enable(phy->cfg_clk); + if (ret) + return ret; + + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { + clk_disable_unprepare(phy->cfg_clk); + dev_err(dev, "%s: failed to register phy\n", __func__); + return PTR_ERR(phy_provider); + } +
Quoted 8 lines
drivers/phy/Kconfig
Quoted 6 lines
drivers/phy/Kconfig +6
-0+ return 0; +} + +static int qcom_ipq806x_sata_phy_remove(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy = platform_get_drvdata(pdev);Where is
platform_set_drvdata()?
Btw the patch subject says 1/2 but I couldn't find the second patch. Can you re-send both the patches?
Thanks
Kishon
Quoted 9 lines
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 101 lines · Kishon Vijay Abraham I
Quoted 89 lines · Kishon Vijay Abraham I
Hi,
Quoted 32 lines · Kumar Gala
Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.
Signed-off-by Kumar Gala <[email protected]>---
v5:
* Fix copy/paste error when killingqcom_ipq806x_sata_delay_usv4:
* removedqcom_ipq806x_sata_delay_usas it was only used onev3:
* AddedKconfigHAS_IOMEMdep
* re-ordered probe function sophy_provider_registeris lastv2:
* dropped unused dev pointer in structqcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clockdrivers/phy/Kconfig | 7 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-ipq806x-sata.c | 206 ++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+)create mode 100644
drivers/phy/phy-qcom-ipq806x-sata.cdrivers/phy/Kconfig +0
-0drivers/phy/Kconfig config PHY_XGENE · line 180
Quoted 3 lines
drivers/phy/Kconfig +0
-0@@ -178,4 +178,11 @@ config PHY_XGENE help This option enables support for APM X-Gene SoC multi-purpose PHY..
.
<snip>
.
.Quoted 46 lines
drivers/phy/Kconfig +46
-0+ +static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy; + struct device *dev = &pdev->dev; + struct resource *res; + struct phy_provider *phy_provider; + struct phy *generic_phy; + int ret; + + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); + if (!phy) { + dev_err(dev, "%s: failed to allocate phy\n", __func__); + return -ENOMEM; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + phy->mmio = devm_ioremap_resource(dev, res); + if (IS_ERR(phy->mmio)) + return PTR_ERR(phy->mmio); + + generic_phy = devm_phy_create(dev, &qcom_ipq806x_sata_phy_ops, NULL); + if (IS_ERR(generic_phy)) { + dev_err(dev, "%s: failed to create phy\n", __func__); + return PTR_ERR(generic_phy); + } + + phy_set_drvdata(generic_phy, phy); + + phy->cfg_clk = devm_clk_get(dev, "cfg"); + if (IS_ERR(phy->cfg_clk)) { + dev_err(dev, "Failed to get sata cfg clock\n"); + return PTR_ERR(phy->cfg_clk); + } + + ret = clk_prepare_enable(phy->cfg_clk); + if (ret) + return ret; + + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { + clk_disable_unprepare(phy->cfg_clk); + dev_err(dev, "%s: failed to register phy\n", __func__); + return PTR_ERR(phy_provider); + } +Quoted 8 lines
drivers/phy/Kconfig
Quoted 6 lines
drivers/phy/Kconfig +6
-0+ return 0; +} + +static int qcom_ipq806x_sata_phy_remove(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy = platform_get_drvdata(pdev);Where is
platform_set_drvdata()?
Quoted 2 lines
Btw the patch subject says 1/2 but I couldn't find the second patch. Can you re-send both the patches?
sent, rebased against your linux-phy.git/next branch.
- k
Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Quoted 89 lines · Kishon Vijay Abraham I
Hi,
Quoted 32 lines · Kumar Gala
Add a PHY driver for uses with AHCI based SATA controller driver on the IPQ806x family of SoCs.
Signed-off-by Kumar Gala <[email protected]>---
v5:
* Fix copy/paste error when killingqcom_ipq806x_sata_delay_usv4:
* removedqcom_ipq806x_sata_delay_usas it was only used onev3:
* AddedKconfigHAS_IOMEMdep
* re-ordered probe function sophy_provider_registeris lastv2:
* dropped unused dev pointer in structqcom_ipq806x_sata_phy
* remove unnecessary reg initializaiton
* Removed unneeded error message
* Added remove function to disable the clockdrivers/phy/Kconfig | 7 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-qcom-ipq806x-sata.c | 206 ++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+)create mode 100644
drivers/phy/phy-qcom-ipq806x-sata.cdrivers/phy/Kconfig +0
-0drivers/phy/Kconfig config PHY_XGENE · line 180
Quoted 3 lines
drivers/phy/Kconfig +0
-0@@ -178,4 +178,11 @@ config PHY_XGENE help This option enables support for APM X-Gene SoC multi-purpose PHY..
.
<snip>
.
.Quoted 46 lines
drivers/phy/Kconfig +46
-0+ +static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy; + struct device *dev = &pdev->dev; + struct resource *res; + struct phy_provider *phy_provider; + struct phy *generic_phy; + int ret; + + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); + if (!phy) { + dev_err(dev, "%s: failed to allocate phy\n", __func__); + return -ENOMEM; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + phy->mmio = devm_ioremap_resource(dev, res); + if (IS_ERR(phy->mmio)) + return PTR_ERR(phy->mmio); + + generic_phy = devm_phy_create(dev, &qcom_ipq806x_sata_phy_ops, NULL); + if (IS_ERR(generic_phy)) { + dev_err(dev, "%s: failed to create phy\n", __func__); + return PTR_ERR(generic_phy); + } + + phy_set_drvdata(generic_phy, phy); + + phy->cfg_clk = devm_clk_get(dev, "cfg"); + if (IS_ERR(phy->cfg_clk)) { + dev_err(dev, "Failed to get sata cfg clock\n"); + return PTR_ERR(phy->cfg_clk); + } + + ret = clk_prepare_enable(phy->cfg_clk); + if (ret) + return ret; + + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { + clk_disable_unprepare(phy->cfg_clk); + dev_err(dev, "%s: failed to register phy\n", __func__); + return PTR_ERR(phy_provider); + } +
Quoted 8 lines
drivers/phy/Kconfig
Quoted 6 lines
drivers/phy/Kconfig +6
-0+ return 0; +} + +static int qcom_ipq806x_sata_phy_remove(struct platform_device *pdev) +{ + struct qcom_ipq806x_sata_phy *phy = platform_get_drvdata(pdev);Where is
platform_set_drvdata()?
Fixed in v6
- k
Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation