Skip to contentSkip to conversation

phy: for 4.1 merge window

GIT PULL New Kishon Vijay Abraham I 2 participants 23 messages Apr 3, 2015 – Apr 10, 2015

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

Hi Greg,

Please find the pull request for 4.1 merge window. This includes two new PHY driver, bug fixes and few cleanups.

A patch to add MAINTAINER for miphy PHY drivers has also been included. There is also a patch that modifies stih416.dtsi to use the generic phy type constants for which I have got Acked by from the st device tree maintainer (Maxime Coquelin) and there shouldn't be conflicts when it gets merged to linus tree.

Let me know if you want me to change something.

Cheers
Kishon

The following changes since commit c517d838eb7d07bbe9507871fab3931deccff539:

Linux 4.0-rc1 (2015-02-22 18:21:14 -0800)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/for-4.1

for you to fetch changes up to e95cf393d2097a7744f98de1c7936fcbde0843e3:

MAINTAINERS: Add phy-miphy28lp.c and phy-miphy365x.c to ARCH/STI architecture (2015-04-03 18:16:22 +0530)

----------------------------------------------------------------
New Features
============
*) Add driver for USB PHYs on sun9i
*) Add driver for USB PHY on dm816x
*) Modified exynos5-usbdrd driver to add support for Exynos5433 SoC

Fixes
=====
*) Fix power_on/power_off failure paths in some drivers *) Make miphy365x use generic PHY type constants
*) Fix build errors due to missing export symbols in qcom-ufs driver *) Make all the functions return proper error values

Cleanups
========
*) use PTR_ERR_OR_ZERO to simplify code
*) use devm_kcalloc instead of devm_kzalloc with multiply *) remove un-necessary ifdef CONFIG_OF

----------------------------------------------------------------
Axel Lin (15):
phy: berlin-usb: Use PTR_ERR_OR_ZERO
phy: xgene: Use PTR_ERR_OR_ZERO
phy: berlin-sata: Use devm_kcalloc at appropriate place
phy: miphy28lp: Use PTR_ERR_OR_ZERO
phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
phy: omap-usb2: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
phy: ti-pipe3: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
phy: berlin-usb: Set drvdata for phy and use it
phy: stih41x-usb: Fixup stih41x_usb_phy_power_on failure path
phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe
phy: samsung_usb2: Fixup samsung_usb2_phy_power_on/off paths
phy: qcom-ufs: Fix build error due to missing export symbols
phy: samsung_usb2: Fixup samsung_usb2_phy_power_on/off paths
phy: qcom-ufs: Fix build error due to missing export symbols
phy: qcom-ufs: Don't return error if fail to get optional resource
phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate
phy: spear1340-miphy: Return proper error for spear1340_miphy_xlate

Chen-Yu Tsai (1):
phy: Add driver to support individual USB PHYs on sun9i

Jaewon Kim (1):
phy: exynos5-usbdrd: Add to support for Exynos5433 SoC

Peter Griffin (2):
phy: miphy365x: Use the generic phy type constants in dt-bindings/phy/phy.h
MAINTAINERS: Add phy-miphy28lp.c and phy-miphy365x.c to ARCH/STI architecture

Tony Lindgren (1):
phy: Add a driver for dm816x USB PHY

 .../devicetree/bindings/phy/dm816x-phy.txt         |   24 ++
 .../devicetree/bindings/phy/phy-miphy365x.txt      |    8 +-
 .../devicetree/bindings/phy/samsung-phy.txt        |    3 +-
 .../devicetree/bindings/phy/sun9i-usb-phy.txt      |   38 +++
 MAINTAINERS                                        |    2 +
 arch/arm/boot/dts/stih416.dtsi                     |    4 +-
 drivers/phy/Kconfig                                |   18 ++
 drivers/phy/Makefile                               |    2 +
 drivers/phy/phy-berlin-sata.c                      |    2 +-
 drivers/phy/phy-berlin-usb.c                       |   19 +-
 drivers/phy/phy-dm816x-usb.c                       |  290 ++++++++++++++++++++
 drivers/phy/phy-exynos5-usbdrd.c                   |   10 +
 drivers/phy/phy-miphy28lp.c                        |    5 +-
 drivers/phy/phy-miphy365x.c                        |   14 +-
 drivers/phy/phy-omap-control.c                     |   10 +-
 drivers/phy/phy-omap-usb2.c                        |    6 +-
 drivers/phy/phy-qcom-ufs.c                         |   33 +--
 drivers/phy/phy-samsung-usb2.c                     |   10 +-
 drivers/phy/phy-spear1310-miphy.c                  |    4 +-
 drivers/phy/phy-spear1340-miphy.c                  |    4 +-
 drivers/phy/phy-stih41x-usb.c                      |    8 +-
 drivers/phy/phy-sun9i-usb.c                        |  202 ++++++++++++++
 drivers/phy/phy-ti-pipe3.c                         |    9 +-
 drivers/phy/phy-xgene.c                            |   23 +-
 include/dt-bindings/phy/phy-miphy365x.h            |   14 -
 include/linux/mfd/syscon/exynos5-pmu.h             |    3 +
 26 files changed, 655 insertions(+), 110 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/dm816x-phy.txt
 create mode 100644 Documentation/devicetree/bindings/phy/sun9i-usb-phy.txt
 create mode 100644 drivers/phy/phy-dm816x-usb.c
 create mode 100644 drivers/phy/phy-sun9i-usb.c
 delete mode 100644 include/dt-bindings/phy/phy-miphy365x.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/20 phy: berlin-usb: Use PTR_ERR_OR_ZERO

From: Axel Lin <[email protected]>

PTR_ERR_OR_ZERO simplifies the code.

---
 drivers/phy/phy-berlin-usb.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/phy/phy-berlin-usb.c +1 -4
index c8a8d53..9f7cc7e 100644
@@ -202,10 +202,7 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)
 
 	phy_provider =
 		devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate);
-	if (IS_ERR(phy_provider))
-		return PTR_ERR(phy_provider);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
 static struct platform_driver phy_berlin_usb_driver = {
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/20 phy: xgene: Use PTR_ERR_OR_ZERO

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

Also remove unneeded goto and rc variable.

---
 drivers/phy/phy-xgene.c |   23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)
drivers/phy/phy-xgene.c +5 -18
index 29214a3..bae9ccc 100644
@@ -1657,7 +1657,6 @@ static int xgene_phy_probe(struct platform_device *pdev)
 	struct phy_provider *phy_provider;
 	struct xgene_phy_ctx *ctx;
 	struct resource *res;
-	int rc = 0;
 	u32 default_spd[] = DEFAULT_SATA_SPD_SEL;
 	u32 default_txboost_gain[] = DEFAULT_SATA_TXBOOST_GAIN;
 	u32 default_txeye_direction[] = DEFAULT_SATA_TXEYEDIRECTION;
@@ -1676,10 +1675,8 @@ static int xgene_phy_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	ctx->sds_base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(ctx->sds_base)) {
-		rc = PTR_ERR(ctx->sds_base);
-		goto error;
-	}
+	if (IS_ERR(ctx->sds_base))
+		return PTR_ERR(ctx->sds_base);
 
 	/* Retrieve optional clock */
 	ctx->clk = clk_get(&pdev->dev, NULL);
@@ -1710,22 +1707,12 @@ static int xgene_phy_probe(struct platform_device *pdev)
 	ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops);
 	if (IS_ERR(ctx->phy)) {
 		dev_dbg(&pdev->dev, "Failed to create PHY\n");
-		rc = PTR_ERR(ctx->phy);
-		goto error;
+		return PTR_ERR(ctx->phy);
 	}
 	phy_set_drvdata(ctx->phy, ctx);
 
-	phy_provider = devm_of_phy_provider_register(ctx->dev,
-						     xgene_phy_xlate);
-	if (IS_ERR(phy_provider)) {
-		rc = PTR_ERR(phy_provider);
-		goto error;
-	}
-
-	return 0;
-
-error:
-	return rc;
+	phy_provider = devm_of_phy_provider_register(ctx->dev, xgene_phy_xlate);
+	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
 static const struct of_device_id xgene_phy_of_match[] = {
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/20 phy: berlin-sata: Use devm_kcalloc at appropriate place

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

Prefer devm_kcalloc over devm_kzalloc with multiply.

---
 drivers/phy/phy-berlin-sata.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-berlin-sata.c +1 -1
index 099eee8..6f3e06d 100644
@@ -218,7 +218,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
 	if (priv->nphys == 0)
 		return -ENODEV;
 
-	priv->phys = devm_kzalloc(dev, priv->nphys * sizeof(*priv->phys),
+	priv->phys = devm_kcalloc(dev, priv->nphys, sizeof(*priv->phys),
 				  GFP_KERNEL);
 	if (!priv->phys)
 		return -ENOMEM;
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/20 phy: miphy28lp: Use PTR_ERR_OR_ZERO

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

PTR_ERR_OR_ZERO simplifies the code.

---
 drivers/phy/phy-miphy28lp.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/phy/phy-miphy28lp.c +1 -4
index 9b2848e..174ffd0 100644
@@ -1258,10 +1258,7 @@ static int miphy28lp_probe(struct platform_device *pdev)
 	}
 
 	provider = devm_of_phy_provider_register(&pdev->dev, miphy28lp_xlate);
-	if (IS_ERR(provider))
-		return PTR_ERR(provider);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(provider);
 }
 
 static const struct of_device_id miphy28lp_of_match[] = {
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 5/20 phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

if !CONFIG_OF, the probe fails.
This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are not needed.

---
 drivers/phy/phy-omap-control.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/phy/phy-omap-control.c +2 -8
index efe724f..a7653d9 100644
@@ -216,7 +216,6 @@ void omap_control_usb_set_mode(struct device *dev,
 		return;
 
 	ctrl_phy = dev_get_drvdata(dev);
-
 	if (!ctrl_phy) {
 		dev_err(dev, "Invalid control phy device\n");
 		return;
@@ -241,8 +240,6 @@ void omap_control_usb_set_mode(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(omap_control_usb_set_mode);
 
-#ifdef CONFIG_OF
-
 static const enum omap_control_phy_type otghs_data = OMAP_CTRL_TYPE_OTGHS;
 static const enum omap_control_phy_type usb2_data = OMAP_CTRL_TYPE_USB2;
 static const enum omap_control_phy_type pipe3_data = OMAP_CTRL_TYPE_PIPE3;
@@ -278,8 +275,6 @@ static const struct of_device_id omap_control_phy_id_table[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, omap_control_phy_id_table);
-#endif
-
 
 static int omap_control_phy_probe(struct platform_device *pdev)
 {
@@ -287,8 +282,7 @@ static int omap_control_phy_probe(struct platform_device *pdev)
 	const struct of_device_id *of_id;
 	struct omap_control_phy *control_phy;
 
-	of_id = of_match_device(of_match_ptr(omap_control_phy_id_table),
-				&pdev->dev);
+	of_id = of_match_device(omap_control_phy_id_table, &pdev->dev);
 	if (!of_id)
 		return -EINVAL;
 
@@ -344,7 +338,7 @@ static struct platform_driver omap_control_phy_driver = {
 	.probe		= omap_control_phy_probe,
 	.driver		= {
 		.name	= "omap-control-phy",
-		.of_match_table = of_match_ptr(omap_control_phy_id_table),
+		.of_match_table = omap_control_phy_id_table,
 	},
 };
 
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 6/20 phy: omap-usb2: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

if !CONFIG_OF, the probe fails.
This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are not needed.

---
 drivers/phy/phy-omap-usb2.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/phy-omap-usb2.c +2 -4
index 6f4aef3..18b33ce 100644
@@ -144,7 +144,6 @@ static struct phy_ops ops = {
 	.owner		= THIS_MODULE,
 };
 
-#ifdef CONFIG_OF
 static const struct usb_phy_data omap_usb2_data = {
 	.label = "omap_usb2",
 	.flags = OMAP_USB2_HAS_START_SRP | OMAP_USB2_HAS_SET_VBUS,
@@ -185,7 +184,6 @@ static const struct of_device_id omap_usb2_id_table[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, omap_usb2_id_table);
-#endif
 
 static int omap_usb2_probe(struct platform_device *pdev)
 {
@@ -200,7 +198,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
 	const struct of_device_id *of_id;
 	struct usb_phy_data *phy_data;
 
-	of_id = of_match_device(of_match_ptr(omap_usb2_id_table), &pdev->dev);
+	of_id = of_match_device(omap_usb2_id_table, &pdev->dev);
 
 	if (!of_id)
 		return -EINVAL;
@@ -377,7 +375,7 @@ static struct platform_driver omap_usb2_driver = {
 	.driver		= {
 		.name	= "omap-usb2",
 		.pm	= DEV_PM_OPS,
-		.of_match_table = of_match_ptr(omap_usb2_id_table),
+		.of_match_table = omap_usb2_id_table,
 	},
 };
 
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 7/20 phy: ti-pipe3: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

if !CONFIG_OF, the probe fails.
This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are not needed.

---
 drivers/phy/phy-ti-pipe3.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/phy/phy-ti-pipe3.c +2 -7
index 95c88f9..ad3fbc8 100644
@@ -291,9 +291,7 @@ static struct phy_ops ops = {
 	.owner		= THIS_MODULE,
 };
 
-#ifdef CONFIG_OF
 static const struct of_device_id ti_pipe3_id_table[];
-#endif
 
 static int ti_pipe3_probe(struct platform_device *pdev)
 {
@@ -315,8 +313,7 @@ static int ti_pipe3_probe(struct platform_device *pdev)
 	spin_lock_init(&phy->lock);
 
 	if (!of_device_is_compatible(node, "ti,phy-pipe3-pcie")) {
-		match = of_match_device(of_match_ptr(ti_pipe3_id_table),
-					&pdev->dev);
+		match = of_match_device(ti_pipe3_id_table, &pdev->dev);
 		if (!match)
 			return -EINVAL;
 
@@ -574,7 +571,6 @@ static const struct dev_pm_ops ti_pipe3_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ti_pipe3_suspend, ti_pipe3_resume)
 };
 
-#ifdef CONFIG_OF
 static const struct of_device_id ti_pipe3_id_table[] = {
 	{
 		.compatible = "ti,phy-usb3",
@@ -594,7 +590,6 @@ static const struct of_device_id ti_pipe3_id_table[] = {
 	{}
 };
 MODULE_DEVICE_TABLE(of, ti_pipe3_id_table);
-#endif
 
 static struct platform_driver ti_pipe3_driver = {
 	.probe		= ti_pipe3_probe,
@@ -602,7 +597,7 @@ static struct platform_driver ti_pipe3_driver = {
 	.driver		= {
 		.name	= "ti-pipe3",
 		.pm	= &ti_pipe3_pm_ops,
-		.of_match_table = of_match_ptr(ti_pipe3_id_table),
+		.of_match_table = ti_pipe3_id_table,
 	},
 };
 
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 8/20 phy: berlin-usb: Set drvdata for phy and use it

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

At the context where we have pointer to struct phy, it's useful to call phy_get_drvdata() to get the address of priv. With this change, we can remove the to_phy_berlin_usb_priv() macro and remove *phy from struct phy_berlin_usb_priv.

---
 drivers/phy/phy-berlin-usb.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/phy/phy-berlin-usb.c +6 -8
index 9f7cc7e..c6fc95b 100644
@@ -103,9 +103,6 @@
 #define MODE_TEST_EN		BIT(11)
 #define ANA_TEST_DC_CTRL(x)	((x) << 12)
 
-#define to_phy_berlin_usb_priv(p)	\
-	container_of((p), struct phy_berlin_usb_priv, phy)
-
 static const u32 phy_berlin_pll_dividers[] = {
 	/* Berlin 2 */
 	CLK_REF_DIV(0xc) | FEEDBACK_CLK_DIV(0x54),
@@ -115,14 +112,13 @@ static const u32 phy_berlin_pll_dividers[] = {
 
 struct phy_berlin_usb_priv {
 	void __iomem		*base;
-	struct phy		*phy;
 	struct reset_control	*rst_ctrl;
 	u32			pll_divider;
 };
 
 static int phy_berlin_usb_power_on(struct phy *phy)
 {
-	struct phy_berlin_usb_priv *priv = dev_get_drvdata(phy->dev.parent);
+	struct phy_berlin_usb_priv *priv = phy_get_drvdata(phy);
 
 	reset_control_reset(priv->rst_ctrl);
 
@@ -175,6 +171,7 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)
 		of_match_device(phy_berlin_sata_of_match, &pdev->dev);
 	struct phy_berlin_usb_priv *priv;
 	struct resource *res;
+	struct phy *phy;
 	struct phy_provider *phy_provider;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -192,13 +189,14 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)
 
 	priv->pll_divider = *((u32 *)match->data);
 
-	priv->phy = devm_phy_create(&pdev->dev, NULL, &phy_berlin_usb_ops);
-	if (IS_ERR(priv->phy)) {
+	phy = devm_phy_create(&pdev->dev, NULL, &phy_berlin_usb_ops);
+	if (IS_ERR(phy)) {
 		dev_err(&pdev->dev, "failed to create PHY\n");
-		return PTR_ERR(priv->phy);
+		return PTR_ERR(phy);
 	}
 
 	platform_set_drvdata(pdev, priv);
+	phy_set_drvdata(phy, priv);
 
 	phy_provider =
 		devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate);
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH 9/20 phy: stih41x-usb: Fixup stih41x_usb_phy_power_on failure path

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

If stih41x_usb_phy_power_on() fails, we need to call clk_disable_unprepare() before return error. This is to ensure we have balanced clk_enable/disable calls.

---
 drivers/phy/phy-stih41x-usb.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/phy-stih41x-usb.c +6 -2
index a603801..c093b47 100644
@@ -87,8 +87,12 @@ static int stih41x_usb_phy_power_on(struct phy *phy)
 		return ret;
 	}
 
-	return regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
-			phy_dev->cfg->oscok, phy_dev->cfg->oscok);
+	ret = regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
+				 phy_dev->cfg->oscok, phy_dev->cfg->oscok);
+	if (ret)
+		clk_disable_unprepare(phy_dev->clk);
+
+	return ret;
 }
 
 static int stih41x_usb_phy_power_off(struct phy *phy)
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 10/20 phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

Current code does NULL test against return value of ufs_qcom_phy_generic_probe. However, in the case of devm_phy_create() failure, ufs_qcom_phy_generic_probe does not return NULL. Fix it.

---
 drivers/phy/phy-qcom-ufs.c |    1 +
 1 file changed, 1 insertion(+)
drivers/phy/phy-qcom-ufs.c +1 -0
index 44ee983..d95effe 100644
@@ -101,6 +101,7 @@ struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
 	if (IS_ERR(generic_phy)) {
 		err =  PTR_ERR(generic_phy);
 		dev_err(dev, "%s: failed to create phy %d\n", __func__, err);
+		generic_phy = NULL;
 		goto out;
 	}
 
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH 11/20 phy: exynos5-usbdrd: Add to support for Exynos5433 SoC

In reply to Kishon Vijay Abraham I

From: Jaewon Kim <[email protected]>

This patch adds driver data to support for Exynos5433 SoC. The Exynos5433 has one USB3.0 Host and USB3.0 DRD(Dual Role Device). Exynos5433 is simplar to Eyxnos7 but Exynos5433 have
one more USB3.0 Host controller.

---
 .../devicetree/bindings/phy/samsung-phy.txt        |    3 ++-
 drivers/phy/phy-exynos5-usbdrd.c                   |   10 ++++++++++
 include/linux/mfd/syscon/exynos5-pmu.h             |    3 +++
 3 files changed, 15 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/phy/samsung-phy.txt +2 -1
index 91e38cf..60c6f2a 100644
@@ -128,6 +128,7 @@ Required properties:
 - compatible : Should be set to one of the following supported values:
 	- "samsung,exynos5250-usbdrd-phy" - for exynos5250 SoC,
 	- "samsung,exynos5420-usbdrd-phy" - for exynos5420 SoC.
+	- "samsung,exynos5433-usbdrd-phy" - for exynos5433 SoC.
 	- "samsung,exynos7-usbdrd-phy" - for exynos7 SoC.
 - reg : Register offset and length of USB DRD PHY register set;
 - clocks: Clock IDs array as required by the controller
@@ -139,7 +140,7 @@ Required properties:
 	       PHY operations, associated by phy name. It is used to
 	       determine bit values for clock settings register.
 	       For Exynos5420 this is given as 'sclk_usbphy30' in CMU.
-	- optional clocks: Exynos7 SoC has now following additional
+	- optional clocks: Exynos5433 & Exynos7 SoC has now following additional
 			   gate clocks available:
 			   - phy_pipe: for PIPE3 phy
 			   - phy_utmi: for UTMI+ phy
drivers/phy/phy-exynos5-usbdrd.c +10 -0
index 0437401..597e7dd 100644
@@ -624,6 +624,13 @@ static const struct exynos5_usbdrd_phy_drvdata exynos5250_usbdrd_phy = {
 	.has_common_clk_gate	= true,
 };
 
+static const struct exynos5_usbdrd_phy_drvdata exynos5433_usbdrd_phy = {
+	.phy_cfg		= phy_cfg_exynos5,
+	.pmu_offset_usbdrd0_phy	= EXYNOS5_USBDRD_PHY_CONTROL,
+	.pmu_offset_usbdrd1_phy	= EXYNOS5433_USBHOST30_PHY_CONTROL,
+	.has_common_clk_gate	= false,
+};
+
 static const struct exynos5_usbdrd_phy_drvdata exynos7_usbdrd_phy = {
 	.phy_cfg		= phy_cfg_exynos5,
 	.pmu_offset_usbdrd0_phy	= EXYNOS5_USBDRD_PHY_CONTROL,
@@ -638,6 +645,9 @@ static const struct of_device_id exynos5_usbdrd_phy_of_match[] = {
 		.compatible = "samsung,exynos5420-usbdrd-phy",
 		.data = &exynos5420_usbdrd_phy
 	}, {
+		.compatible = "samsung,exynos5433-usbdrd-phy",
+		.data = &exynos5433_usbdrd_phy
+	}, {
 		.compatible = "samsung,exynos7-usbdrd-phy",
 		.data = &exynos7_usbdrd_phy
 	},
include/linux/mfd/syscon/exynos5-pmu.h +3 -0
index 00ef24b..9352adc 100644
@@ -36,6 +36,9 @@
 #define EXYNOS5420_MTCADC_PHY_CONTROL		(0x724)
 #define EXYNOS5420_DPTX_PHY_CONTROL		(0x728)
 
+/* Exynos5433 specific register definitions */
+#define EXYNOS5433_USBHOST30_PHY_CONTROL	(0x728)
+
 #define EXYNOS5_PHY_ENABLE			BIT(0)
 
 #define EXYNOS5_MIPI_PHY_S_RESETN		BIT(1)
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH 12/20 phy: samsung_usb2: Fixup samsung_usb2_phy_power_on/off paths

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

Ensure we have balanced clk_prepare_enable/clk_disable_unprepare calls if .power_on or .power_off callbacks return error.

---
 drivers/phy/phy-samsung-usb2.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/phy/phy-samsung-usb2.c +8 -2
index 4a12f66..55b6994 100644
@@ -37,10 +37,14 @@ static int samsung_usb2_phy_power_on(struct phy *phy)
 		spin_lock(&drv->lock);
 		ret = inst->cfg->power_on(inst);
 		spin_unlock(&drv->lock);
+		if (ret)
+			goto err_power_on;
 	}
 
 	return 0;
 
+err_power_on:
+	clk_disable_unprepare(drv->ref_clk);
 err_instance_clk:
 	clk_disable_unprepare(drv->clk);
 err_main_clk:
@@ -51,7 +55,7 @@ static int samsung_usb2_phy_power_off(struct phy *phy)
 {
 	struct samsung_usb2_phy_instance *inst = phy_get_drvdata(phy);
 	struct samsung_usb2_phy_driver *drv = inst->drv;
-	int ret = 0;
+	int ret;
 
 	dev_dbg(drv->dev, "Request to power_off \"%s\" usb phy\n",
 		inst->cfg->label);
@@ -59,10 +63,12 @@ static int samsung_usb2_phy_power_off(struct phy *phy)
 		spin_lock(&drv->lock);
 		ret = inst->cfg->power_off(inst);
 		spin_unlock(&drv->lock);
+		if (ret)
+			return ret;
 	}
 	clk_disable_unprepare(drv->ref_clk);
 	clk_disable_unprepare(drv->clk);
-	return ret;
+	return 0;
 }
 
 static struct phy_ops samsung_usb2_phy_ops = {
Signature · 1 line
1.7.9.5
#13 lore raw

PATCH 13/20 phy: qcom-ufs: Fix build error due to missing export symbols

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

Fix below build error when compile the driver as a module.

ERROR: "ufs_qcom_phy_power_off" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_power_on" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_exit" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_calibrate" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_generic_probe" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_init_vregulators" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_init_clks" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_remove" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "get_ufs_qcom_phy" [drivers/phy/phy-qcom-ufs-qmp-20nm.ko] undefined!
ERROR: "ufs_qcom_phy_power_off" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_power_on" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_exit" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_generic_probe" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_init_vregulators" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_init_clks" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_calibrate" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "ufs_qcom_phy_remove" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined!
ERROR: "get_ufs_qcom_phy" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

---
 drivers/phy/phy-qcom-ufs.c |    9 +++++++++
 1 file changed, 9 insertions(+)
drivers/phy/phy-qcom-ufs.c +9 -0
index d95effe..a149d92 100644
@@ -73,6 +73,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
 out:
 	return ret;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate);
 
 struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
 				struct ufs_qcom_phy *common_cfg,
@@ -111,6 +112,7 @@ struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
 out:
 	return generic_phy;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_generic_probe);
 
 /*
  * This assumes the embedded phy structure inside generic_phy is of type
@@ -122,6 +124,7 @@ struct ufs_qcom_phy *get_ufs_qcom_phy(struct phy *generic_phy)
 {
 	return (struct ufs_qcom_phy *)phy_get_drvdata(generic_phy);
 }
+EXPORT_SYMBOL_GPL(get_ufs_qcom_phy);
 
 static
 int ufs_qcom_phy_base_init(struct platform_device *pdev,
@@ -229,6 +232,7 @@ ufs_qcom_phy_init_clks(struct phy *generic_phy,
 out:
 	return err;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_init_clks);
 
 int
 ufs_qcom_phy_init_vregulators(struct phy *generic_phy,
@@ -253,6 +257,7 @@ ufs_qcom_phy_init_vregulators(struct phy *generic_phy,
 out:
 	return err;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_init_vregulators);
 
 static int __ufs_qcom_phy_init_vreg(struct phy *phy,
 		struct ufs_qcom_phy_vreg *vreg, const char *name, bool optional)
@@ -648,6 +653,7 @@ int ufs_qcom_phy_remove(struct phy *generic_phy,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_remove);
 
 int ufs_qcom_phy_exit(struct phy *generic_phy)
 {
@@ -658,6 +664,7 @@ int ufs_qcom_phy_exit(struct phy *generic_phy)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_exit);
 
 int ufs_qcom_phy_is_pcs_ready(struct phy *generic_phy)
 {
@@ -726,6 +733,7 @@ out_disable_phy:
 out:
 	return err;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_power_on);
 
 int ufs_qcom_phy_power_off(struct phy *generic_phy)
 {
@@ -744,3 +752,4 @@ int ufs_qcom_phy_power_off(struct phy *generic_phy)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(ufs_qcom_phy_power_off);
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH 14/20 phy: qcom-ufs: Don't return error if fail to get optional resource

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

"dev_ref_clk_ctrl_mem" is optional resource, so don't return error if fail to get the resource. Since it's an optional resource, don't emit error if fail to get dev_ref_clk_ctrl_mem.

Also remove redundant test for res, it's done by devm_ioremap_resource().

---
 drivers/phy/phy-qcom-ufs.c |   23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)
drivers/phy/phy-qcom-ufs.c +3 -20
index a149d92..c4199e6 100644
@@ -135,40 +135,23 @@ int ufs_qcom_phy_base_init(struct platform_device *pdev,
 	int err = 0;
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_mem");
-	if (!res) {
-		dev_err(dev, "%s: phy_mem resource not found\n", __func__);
-		err = -ENOMEM;
-		goto out;
-	}
-
 	phy_common->mmio = devm_ioremap_resource(dev, res);
 	if (IS_ERR((void const *)phy_common->mmio)) {
 		err = PTR_ERR((void const *)phy_common->mmio);
 		phy_common->mmio = NULL;
 		dev_err(dev, "%s: ioremap for phy_mem resource failed %d\n",
 			__func__, err);
-		goto out;
+		return err;
 	}
 
 	/* "dev_ref_clk_ctrl_mem" is optional resource */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 					   "dev_ref_clk_ctrl_mem");
-	if (!res) {
-		dev_dbg(dev, "%s: dev_ref_clk_ctrl_mem resource not found\n",
-			__func__);
-		goto out;
-	}
-
 	phy_common->dev_ref_clk_ctrl_mmio = devm_ioremap_resource(dev, res);
-	if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio)) {
-		err = PTR_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio);
+	if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio))
 		phy_common->dev_ref_clk_ctrl_mmio = NULL;
-		dev_err(dev, "%s: ioremap for dev_ref_clk_ctrl_mem resource failed %d\n",
-			__func__, err);
-	}
 
-out:
-	return err;
+	return 0;
 }
 
 static int __ufs_qcom_phy_clk_get(struct phy *phy,
Signature · 1 line
1.7.9.5
#15 lore raw

PATCH 15/20 phy: Add a driver for dm816x USB PHY

In reply to Kishon Vijay Abraham I

From: Tony Lindgren <[email protected]>

Add a minimal driver for dm816x USB. This makes USB work on dm816x without any other changes needed as it can use the existing musb_dsps glue layer for the USB controller.

Note that this phy is different from dm814x and am335x.

Cc Bin Liu <[email protected]>
Cc Brian Hutchinson <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Matthijs van Duin <[email protected]>
Cc Paul Bolle <[email protected]>
Cc Rusty Russell <[email protected]>
---
 .../devicetree/bindings/phy/dm816x-phy.txt         |   24 ++
 drivers/phy/Kconfig                                |    7 +
 drivers/phy/Makefile                               |    1 +
 drivers/phy/phy-dm816x-usb.c                       |  290 ++++++++++++++++++++
 4 files changed, 322 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/dm816x-phy.txt
 create mode 100644 drivers/phy/phy-dm816x-usb.c
Documentation/devicetree/bindings/phy/dm816x-phy.txt new file +24 -0
new file mode 100644
index 0000000..2fe3d11
@@ -0,0 +1,24 @@
+Device tree binding documentation for am816x USB PHY
+=========================
+
+Required properties:
+- compatible : should be "ti,dm816x-usb-phy"
+- reg : offset and length of the PHY register set.
+- reg-names : name for the phy registers
+- clocks : phandle to the clock
+- clock-names : name of the clock
+- syscon: phandle for the syscon node to access misc registers
+- #phy-cells : from the generic PHY bindings, must be 1
+- syscon: phandle for the syscon node to access misc registers
+
+Example:
+
+usb_phy0: usb-phy@20 {
+	compatible = "ti,dm8168-usb-phy";
+	reg = <0x20 0x8>;
+	reg-names = "phy";
+	clocks = <&main_fapll 6>;
+	clock-names = "refclk";
+	#phy-cells = <0>;
+	syscon = <&scm_conf>;
+};
drivers/phy/Kconfig +7 -0
index 2962de2..885c39c 100644
@@ -35,6 +35,13 @@ config ARMADA375_USBCLUSTER_PHY
 	depends on OF
 	select GENERIC_PHY
 
+config PHY_DM816X_USB
+	tristate "TI dm816x USB PHY driver"
+	depends on ARCH_OMAP2PLUS
+	select GENERIC_PHY
+	help
+	  Enable this for dm816x USB to work.
+
 config PHY_EXYNOS_MIPI_VIDEO
 	tristate "S5P/EXYNOS SoC series MIPI CSI-2/DSI PHY driver"
 	depends on HAS_IOMEM
drivers/phy/Makefile +1 -0
index f080e1b..dab6665 100644
@@ -5,6 +5,7 @@
 obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
 obj-$(CONFIG_PHY_BERLIN_USB)		+= phy-berlin-usb.o
 obj-$(CONFIG_PHY_BERLIN_SATA)		+= phy-berlin-sata.o
+obj-$(CONFIG_PHY_DM816X_USB)		+= phy-dm816x-usb.o
 obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY)	+= phy-armada375-usb2.o
 obj-$(CONFIG_BCM_KONA_USB2_PHY)		+= phy-bcm-kona-usb2.o
 obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
drivers/phy/phy-dm816x-usb.c new file +290 -0

290 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#16 lore raw

PATCH 16/20 phy: Add driver to support individual USB PHYs on sun9i

In reply to Kishon Vijay Abraham I

From: Chen-Yu Tsai <[email protected]>

Unlike previous Allwinner SoCs, there is no central PHY control block on the A80. Also, OTG support is completely split off into a different controller.

This adds a new driver to support the regular USB PHYs.

---
 .../devicetree/bindings/phy/sun9i-usb-phy.txt      |   38 ++++
 drivers/phy/Kconfig                                |   11 ++
 drivers/phy/Makefile                               |    1 +
 drivers/phy/phy-sun9i-usb.c                        |  202 ++++++++++++++++++++
 4 files changed, 252 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/sun9i-usb-phy.txt
 create mode 100644 drivers/phy/phy-sun9i-usb.c
Documentation/devicetree/bindings/phy/sun9i-usb-phy.txt new file +38 -0
new file mode 100644
index 0000000..1cca85c
@@ -0,0 +1,38 @@
+Allwinner sun9i USB PHY
+-----------------------
+
+Required properties:
+- compatible : should be one of
+  * allwinner,sun9i-a80-usb-phy
+- reg : a list of offset + length pairs
+- #phy-cells : from the generic phy bindings, must be 0
+- phy_type : "hsic" for HSIC usage;
+	     other values or absence of this property indicates normal USB
+- clocks : phandle + clock specifier for the phy clocks
+- clock-names : depending on the "phy_type" property,
+  * "phy" for normal USB
+  * "hsic_480M", "hsic_12M" for HSIC
+- resets : a list of phandle + reset specifier pairs
+- reset-names : depending on the "phy_type" property,
+  * "phy" for normal USB
+  * "hsic" for HSIC
+
+Optional Properties:
+- phy-supply : from the generic phy bindings, a phandle to a regulator that
+	       provides power to VBUS.
+
+It is recommended to list all clocks and resets available.
+The driver will only use those matching the phy_type.
+
+Example:
+	usbphy1: phy@00a01800 {
+		compatible = "allwinner,sun9i-a80-usb-phy";
+		reg = <0x00a01800 0x4>;
+		clocks = <&usb_phy_clk 2>, <&usb_phy_clk 10>,
+		       <&usb_phy_clk 3>;
+		clock-names = "hsic_480M", "hsic_12M", "phy";
+		resets = <&usb_phy_clk 18>, <&usb_phy_clk 19>;
+		reset-names = "hsic", "phy";
+		status = "disabled";
+		#phy-cells = <0>;
+	};
drivers/phy/Kconfig +11 -0
index 885c39c..a53bd5b 100644
@@ -181,6 +181,17 @@ config PHY_SUN4I_USB
 	  This driver controls the entire USB PHY block, both the USB OTG
 	  parts, as well as the 2 regular USB 2 host PHYs.
 
+config PHY_SUN9I_USB
+	tristate "Allwinner sun9i SoC USB PHY driver"
+	depends on ARCH_SUNXI && HAS_IOMEM && OF
+	depends on RESET_CONTROLLER
+	select GENERIC_PHY
+	help
+	  Enable this to support the transceiver that is part of Allwinner
+	  sun9i SoCs.
+
+	  This driver controls each individual USB 2 host PHY.
+
 config PHY_SAMSUNG_USB2
 	tristate "Samsung USB 2.0 PHY driver"
 	depends on HAS_IOMEM
drivers/phy/Makefile +1 -0
index dab6665..f126251 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_TWL4030_USB)		+= phy-twl4030-usb.o
 obj-$(CONFIG_PHY_EXYNOS5250_SATA)	+= phy-exynos5250-sata.o
 obj-$(CONFIG_PHY_HIX5HD2_SATA)		+= phy-hix5hd2-sata.o
 obj-$(CONFIG_PHY_SUN4I_USB)		+= phy-sun4i-usb.o
+obj-$(CONFIG_PHY_SUN9I_USB)		+= phy-sun9i-usb.o
 obj-$(CONFIG_PHY_SAMSUNG_USB2)		+= phy-exynos-usb2.o
 phy-exynos-usb2-y			+= phy-samsung-usb2.o
 phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4210_USB2)	+= phy-exynos4210-usb2.o
drivers/phy/phy-sun9i-usb.c new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#17 lore raw

PATCH 17/20 phy: miphy365x: Use the generic phy type constants in dt-bindings/phy/phy.h

In reply to Kishon Vijay Abraham I

From: Peter Griffin <[email protected]>

Now there are generic phy type constants declared in phy.h, migrate over to using them rather than defining our own. This change has been done as one atomic commit to be bisectable.

Note: The values of the defines are the same, so there is no ABI breakage with this patch.

---
 .../devicetree/bindings/phy/phy-miphy365x.txt      |    8 ++++----
 arch/arm/boot/dts/stih416.dtsi                     |    4 ++--
 drivers/phy/phy-miphy365x.c                        |   14 +++++++-------
 include/dt-bindings/phy/phy-miphy365x.h            |   14 --------------
 4 files changed, 13 insertions(+), 27 deletions(-)
 delete mode 100644 include/dt-bindings/phy/phy-miphy365x.h
Documentation/devicetree/bindings/phy/phy-miphy365x.txt +4 -4
index 9802d5d..8772900 100644
@@ -20,8 +20,8 @@ Required nodes	:  A sub-node is required for each channel the controller
 Required properties (port (child) node):
 - #phy-cells 	: Should be 1 (See second example)
 		  Cell after port phandle is device type from:
-			- MIPHY_TYPE_SATA
-			- MIPHY_TYPE_PCI
+			- PHY_TYPE_SATA
+			- PHY_TYPE_PCI
 - reg        	: Address and length of register sets for each device in
 		  "reg-names"
 - reg-names     : The names of the register addresses corresponding to the
@@ -68,10 +68,10 @@ property, containing a phandle to the phy port node and a device type.
 
 Example:
 
-#include <dt-bindings/phy/phy-miphy365x.h>
+#include <dt-bindings/phy/phy.h>
 
 	sata0: sata@fe380000 {
 		...
-		phys	  = <&phy_port0 MIPHY_TYPE_SATA>;
+		phys	  = <&phy_port0 PHY_TYPE_SATA>;
 		...
 	};
arch/arm/boot/dts/stih416.dtsi +2 -2
index ea28eba..eeb7afe 100644
@@ -10,7 +10,7 @@
 #include "stih416-clock.dtsi"
 #include "stih416-pinctrl.dtsi"
 
-#include <dt-bindings/phy/phy-miphy365x.h>
+#include <dt-bindings/phy/phy.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset-controller/stih416-resets.h>
 / {
@@ -306,7 +306,7 @@
 			reg             = <0xfe380000 0x1000>;
 			interrupts      = <GIC_SPI 157 IRQ_TYPE_NONE>;
 			interrupt-names = "hostc";
-			phys	        = <&phy_port0 MIPHY_TYPE_SATA>;
+			phys	        = <&phy_port0 PHY_TYPE_SATA>;
 			phy-names       = "sata-phy";
 			resets	        = <&powerdown STIH416_SATA0_POWERDOWN>,
 					  <&softreset STIH416_SATA0_SOFTRESET>;
drivers/phy/phy-miphy365x.c +7 -7
index 6c80154..98bffbc 100644
@@ -25,7 +25,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 
-#include <dt-bindings/phy/phy-miphy365x.h>
+#include <dt-bindings/phy/phy.h>
 
 #define HFC_TIMEOUT		100
 
@@ -176,7 +176,7 @@ static u8 rx_tx_spd[] = {
 static int miphy365x_set_path(struct miphy365x_phy *miphy_phy,
 			      struct miphy365x_dev *miphy_dev)
 {
-	bool sata = (miphy_phy->type == MIPHY_TYPE_SATA);
+	bool sata = (miphy_phy->type == PHY_TYPE_SATA);
 
 	return regmap_update_bits(miphy_dev->regmap,
 				  miphy_phy->ctrlreg,
@@ -430,7 +430,7 @@ static int miphy365x_init(struct phy *phy)
 	}
 
 	/* Initialise Miphy for PCIe or SATA */
-	if (miphy_phy->type == MIPHY_TYPE_PCIE)
+	if (miphy_phy->type == PHY_TYPE_PCIE)
 		ret = miphy365x_init_pcie_port(miphy_phy, miphy_dev);
 	else
 		ret = miphy365x_init_sata_port(miphy_phy, miphy_dev);
@@ -454,8 +454,8 @@ int miphy365x_get_addr(struct device *dev, struct miphy365x_phy *miphy_phy,
 		return ret;
 	}
 
-	if (!((!strncmp(name, "sata", 4) && type == MIPHY_TYPE_SATA) ||
-	      (!strncmp(name, "pcie", 4) && type == MIPHY_TYPE_PCIE)))
+	if (!((!strncmp(name, "sata", 4) && type == PHY_TYPE_SATA) ||
+	      (!strncmp(name, "pcie", 4) && type == PHY_TYPE_PCIE)))
 		return 0;
 
 	miphy_phy->base = of_iomap(phynode, index);
@@ -498,8 +498,8 @@ static struct phy *miphy365x_xlate(struct device *dev,
 
 	miphy_phy->type = args->args[0];
 
-	if (!(miphy_phy->type == MIPHY_TYPE_SATA ||
-	      miphy_phy->type == MIPHY_TYPE_PCIE)) {
+	if (!(miphy_phy->type == PHY_TYPE_SATA ||
+	      miphy_phy->type == PHY_TYPE_PCIE)) {
 		dev_err(dev, "Unsupported device type: %d\n", miphy_phy->type);
 		return ERR_PTR(-EINVAL);
 	}
include/dt-bindings/phy/phy-miphy365x.h deleted +0 -14
deleted file mode 100644
index 8ef8aba..0000000
@@ -1,14 +0,0 @@
-/*
- * This header provides constants for the phy framework
- * based on the STMicroelectronics MiPHY365x.
- *
- * Author: Lee Jones <[email protected]>
- */
-#ifndef _DT_BINDINGS_PHY_MIPHY
-#define _DT_BINDINGS_PHY_MIPHY
-
-#define MIPHY_TYPE_SATA		1
-#define MIPHY_TYPE_PCIE		2
-#define MIPHY_TYPE_USB		3
-
-#endif /* _DT_BINDINGS_PHY_MIPHY */
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH 18/20 phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

The of_xlate callback should return ERR_PTR on error.

---
 drivers/phy/phy-spear1310-miphy.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/phy-spear1310-miphy.c +2 -2
index 9f47fae..65ae640 100644
@@ -192,14 +192,14 @@ static struct phy *spear1310_miphy_xlate(struct device *dev,
 
 	if (args->args_count < 1) {
 		dev_err(dev, "DT did not pass correct no of args\n");
-		return NULL;
+		return ERR_PTR(-ENODEV);
 	}
 
 	priv->mode = args->args[0];
 
 	if (priv->mode != SATA && priv->mode != PCIE) {
 		dev_err(dev, "DT did not pass correct phy mode\n");
-		return NULL;
+		return ERR_PTR(-ENODEV);
 	}
 
 	return priv->phy;
Signature · 1 line
1.7.9.5
#19 lore raw

PATCH 19/20 phy: spear1340-miphy: Return proper error for spear1340_miphy_xlate

In reply to Kishon Vijay Abraham I

From: Axel Lin <[email protected]>

The of_xlate callback should return ERR_PTR on error.

---
 drivers/phy/phy-spear1340-miphy.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/phy-spear1340-miphy.c +2 -2
index e42bc20..1a00c28 100644
@@ -229,14 +229,14 @@ static struct phy *spear1340_miphy_xlate(struct device *dev,
 
 	if (args->args_count < 1) {
 		dev_err(dev, "DT did not pass correct no of args\n");
-		return NULL;
+		return ERR_PTR(-ENODEV);
 	}
 
 	priv->mode = args->args[0];
 
 	if (priv->mode != SATA && priv->mode != PCIE) {
 		dev_err(dev, "DT did not pass correct phy mode\n");
-		return NULL;
+		return ERR_PTR(-ENODEV);
 	}
 
 	return priv->phy;
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH 20/20 MAINTAINERS: Add phy-miphy28lp.c and phy-miphy365x.c to ARCH/STI architecture

In reply to Kishon Vijay Abraham I

From: Peter Griffin <[email protected]>

This patch adds the phy-miphy28lp.c and phy-miphy365x.c phy drivers found on STMicroelectronics stih407 family SoC's into the STI arch section of the maintainers file.

---
 MAINTAINERS |    2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index ddc5a8c..daddc00 100644
@@ -1457,6 +1457,8 @@ F:	drivers/clocksource/arm_global_timer.c
 F:	drivers/i2c/busses/i2c-st.c
 F:	drivers/media/rc/st_rc.c
 F:	drivers/mmc/host/sdhci-st.c
+F:	drivers/phy/phy-miphy28lp.c
+F:	drivers/phy/phy-miphy365x.c
 F:	drivers/phy/phy-stih407-usb.c
 F:	drivers/phy/phy-stih41x-usb.c
 F:	drivers/pinctrl/pinctrl-st.c
Signature · 1 line
1.7.9.5
#21 lore raw
In reply to Kishon Vijay Abraham I

Hi Greg,

Quoted 16 lines · Kishon Vijay Abraham I

Hi Greg,

Please find the pull request for 4.1 merge window. This includes two new PHY driver, bug fixes and few cleanups.

A patch to add MAINTAINER for miphy PHY drivers has also been included. There is also a patch that modifies stih416.dtsi to use the generic phy type constants for which I have got Acked by from the st device tree maintainer (Maxime Coquelin) and there shouldn't be conflicts when it gets merged to linus tree.

Let me know if you want me to change something.

Cheers
Kishon

Quoted 7 lines

The following changes since commit c517d838eb7d07bbe9507871fab3931deccff539:

   Linux 4.0-rc1 (2015-02-22 18:21:14 -0800)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/for-4.1

Can you take this for the next merge window?

Thanks
Kishon

Quoted 91 lines

for you to fetch changes up to e95cf393d2097a7744f98de1c7936fcbde0843e3:

   MAINTAINERS: Add phy-miphy28lp.c and phy-miphy365x.c to ARCH/STI architecture (2015-04-03 18:16:22 +0530)

----------------------------------------------------------------
New Features
============
*) Add driver for USB PHYs on sun9i
*) Add driver for USB PHY on dm816x
*) Modified exynos5-usbdrd driver to add support for Exynos5433 SoC

Fixes
=====
*) Fix power_on/power_off failure paths in some drivers *) Make miphy365x use generic PHY type constants
*) Fix build errors due to missing export symbols in qcom-ufs driver *) Make all the functions return proper error values

Cleanups
========
*) use PTR_ERR_OR_ZERO to simplify code
*) use devm_kcalloc instead of devm_kzalloc with multiply *) remove un-necessary ifdef CONFIG_OF

----------------------------------------------------------------
Axel Lin (15):
phy: berlin-usb: Use PTR_ERR_OR_ZERO
phy: xgene: Use PTR_ERR_OR_ZERO
phy: berlin-sata: Use devm_kcalloc at appropriate place
phy: miphy28lp: Use PTR_ERR_OR_ZERO
phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
phy: omap-usb2: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
phy: ti-pipe3: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
phy: berlin-usb: Set drvdata for phy and use it
phy: stih41x-usb: Fixup stih41x_usb_phy_power_on failure path
phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe
phy: samsung_usb2: Fixup samsung_usb2_phy_power_on/off paths
phy: qcom-ufs: Fix build error due to missing export symbols
phy: samsung_usb2: Fixup samsung_usb2_phy_power_on/off paths
phy: qcom-ufs: Fix build error due to missing export symbols
phy: qcom-ufs: Don't return error if fail to get optional resource
phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate
phy: spear1340-miphy: Return proper error for spear1340_miphy_xlate

Chen-Yu Tsai (1):
phy: Add driver to support individual USB PHYs on sun9i

Jaewon Kim (1):
phy: exynos5-usbdrd: Add to support for Exynos5433 SoC

Peter Griffin (2):
phy: miphy365x: Use the generic phy type constants in dt-bindings/phy/phy.h
MAINTAINERS: Add phy-miphy28lp.c and phy-miphy365x.c to ARCH/STI architecture

Tony Lindgren (1):
phy: Add a driver for dm816x USB PHY

  .../devicetree/bindings/phy/dm816x-phy.txt         |   24 ++
  .../devicetree/bindings/phy/phy-miphy365x.txt      |    8 +-
  .../devicetree/bindings/phy/samsung-phy.txt        |    3 +-
  .../devicetree/bindings/phy/sun9i-usb-phy.txt      |   38 +++
  MAINTAINERS                                        |    2 +
  arch/arm/boot/dts/stih416.dtsi                     |    4 +-
  drivers/phy/Kconfig                                |   18 ++
  drivers/phy/Makefile                               |    2 +
  drivers/phy/phy-berlin-sata.c                      |    2 +-
  drivers/phy/phy-berlin-usb.c                       |   19 +-
  drivers/phy/phy-dm816x-usb.c                       |  290 ++++++++++++++++++++
  drivers/phy/phy-exynos5-usbdrd.c                   |   10 +
  drivers/phy/phy-miphy28lp.c                        |    5 +-
  drivers/phy/phy-miphy365x.c                        |   14 +-
  drivers/phy/phy-omap-control.c                     |   10 +-
  drivers/phy/phy-omap-usb2.c                        |    6 +-
  drivers/phy/phy-qcom-ufs.c                         |   33 +--
  drivers/phy/phy-samsung-usb2.c                     |   10 +-
  drivers/phy/phy-spear1310-miphy.c                  |    4 +-
  drivers/phy/phy-spear1340-miphy.c                  |    4 +-
  drivers/phy/phy-stih41x-usb.c                      |    8 +-
  drivers/phy/phy-sun9i-usb.c                        |  202 ++++++++++++++
  drivers/phy/phy-ti-pipe3.c                         |    9 +-
  drivers/phy/phy-xgene.c                            |   23 +-
  include/dt-bindings/phy/phy-miphy365x.h            |   14 -
  include/linux/mfd/syscon/exynos5-pmu.h             |    3 +
  26 files changed, 655 insertions(+), 110 deletions(-)

create mode 100644 Documentation/devicetree/bindings/phy/dm816x-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/sun9i-usb-phy.txt create mode 100644 drivers/phy/phy-dm816x-usb.c
create mode 100644 drivers/phy/phy-sun9i-usb.c
delete mode 100644 include/dt-bindings/phy/phy-miphy365x.h

#22 lore raw
In reply to Kishon Vijay Abraham I
Quoted 16 lines · Kishon Vijay Abraham I

Hi Greg,

Please find the pull request for 4.1 merge window. This includes two new PHY driver, bug fixes and few cleanups.

A patch to add MAINTAINER for miphy PHY drivers has also been included. There is also a patch that modifies stih416.dtsi to use the generic phy type constants for which I have got Acked by from the st device tree maintainer (Maxime Coquelin) and there shouldn't be conflicts when it gets merged to linus tree.

Let me know if you want me to change something.

Cheers
Kishon

Quoted 7 lines

The following changes since commit c517d838eb7d07bbe9507871fab3931deccff539:

Linux 4.0-rc1 (2015-02-22 18:21:14 -0800)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/for-4.1

Pulled and pushed out, thanks.

greg k-h