Skip to contentSkip to conversation

davinci: ohci: fix usb ohci device name

PATCH Applied Axel Haslam 5 participants 9 messages Nov 3, 2016 – Nov 23, 2016

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

v2 cover davinci: ohci: fix usb ohci device name

The usb ohci clock match is not working because the usb clock is registered as "ohci" instead of "ohci.0"

But since there is only a single ohci instance, lets pass -1 to the platform data id parameter and avoid the extra ".0" matching.

while we are fixing this, rename the driver from "ohci" to "ohci-da8xx" which is less generic and consistent with other usb drivers.

changes form v1 -> v2
*Reword commit messages (David Lechner)

Because of the recently accepted patches on the ARM-davinci side, This patch series is based on:
branch: /v4.10/soc of the linux-davinci tree.

It Depends on two accepted usb patches missing on that branch:
6c21caa USB: OHCI: make ohci-da8xx a separate driver (in next-usb) 6110c42 usb: ohci-da8xx: Remove code that references mach (in linux-next)

A branch with both patches applied + this series can be found here:
https://github.com/axelhaslamx/linux-axel/commits/ti-davinci-ohci-rename

Axel Haslam (3):
ARM: davinci: da8xx: Fix ohci device name
phy: da8xx-usb: rename the ohci device to ohci-da8xx
usb: ohci-da8xx: rename driver to ohci-da8xx

 arch/arm/mach-davinci/da830.c     | 2 +-
 arch/arm/mach-davinci/da850.c     | 2 +-
 arch/arm/mach-davinci/da8xx-dt.c  | 2 +-
 arch/arm/mach-davinci/usb-da8xx.c | 4 ++--
 drivers/phy/phy-da8xx-usb.c       | 5 +++--
 drivers/usb/host/ohci-da8xx.c     | 2 +-
 6 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.10.1
#1 lore raw

PATCH v2 1/3 ARM: davinci: da8xx: Fix ohci device name

While the clk lookup table is making reference to "ohci" other subsystems (such as phy) are trying to match "ohci.0"

Since there is a single ohci instance, instead of changing the clk name, change the dev id to -1, and add the "-da8xx" postfix to match the driver name that will also be changed in a subsequent patch.

---
 arch/arm/mach-davinci/da830.c     | 2 +-
 arch/arm/mach-davinci/da850.c     | 2 +-
 arch/arm/mach-davinci/da8xx-dt.c  | 2 +-
 arch/arm/mach-davinci/usb-da8xx.c | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-davinci/da830.c +1 -1
index 41459bd..073c458 100644
@@ -420,7 +420,7 @@ static struct clk_lookup da830_clks[] = {
 	CLK("davinci_mdio.0",   "fck",          &emac_clk),
 	CLK(NULL,		"gpio",		&gpio_clk),
 	CLK("i2c_davinci.2",	NULL,		&i2c1_clk),
-	CLK("ohci",		"usb11",	&usb11_clk),
+	CLK("ohci-da8xx",	"usb11",	&usb11_clk),
 	CLK(NULL,		"emif3",	&emif3_clk),
 	CLK(NULL,		"arm",		&arm_clk),
 	CLK(NULL,		"rmii",		&rmii_clk),
arch/arm/mach-davinci/da850.c +1 -1
index 196e262..3961556 100644
@@ -503,7 +503,7 @@ static struct clk_lookup da850_clks[] = {
 	CLK("da830-mmc.1",	NULL,		&mmcsd1_clk),
 	CLK("ti-aemif",		NULL,		&aemif_clk),
 	CLK(NULL,		"aemif",	&aemif_clk),
-	CLK("ohci",		"usb11",	&usb11_clk),
+	CLK("ohci-da8xx",	"usb11",	&usb11_clk),
 	CLK("musb-da8xx",	"usb20",	&usb20_clk),
 	CLK("spi_davinci.0",	NULL,		&spi0_clk),
 	CLK("spi_davinci.1",	NULL,		&spi1_clk),
arch/arm/mach-davinci/da8xx-dt.c +1 -1
index 92ae093..2afb067 100644
@@ -39,7 +39,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
 	OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
 	OF_DEV_AUXDATA("ti,da850-tilcdc", 0x01e13000, "da8xx_lcdc.0", NULL),
-	OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci", NULL),
+	OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci-da8xx", NULL),
 	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
 	OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
 	{}
arch/arm/mach-davinci/usb-da8xx.c +2 -2
index b010e5f..c6feecf 100644
@@ -109,8 +109,8 @@ static struct resource da8xx_usb11_resources[] = {
 static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
 
 static struct platform_device da8xx_usb11_device = {
-	.name		= "ohci",
-	.id		= 0,
+	.name		= "ohci-da8xx",
+	.id		= -1,
 	.dev = {
 		.dma_mask		= &da8xx_usb11_dma_mask,
 		.coherent_dma_mask	= DMA_BIT_MASK(32),
Signature · 1 line
2.10.1
#3 lore raw

PATCH v2 2/3 phy: da8xx-usb: rename the ohci device to ohci-da8xx

In reply to Axel Haslam

The ohci device name has changed in the board configuraion files, hence, change the phy lookup table to match the new name.

---
 drivers/phy/phy-da8xx-usb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/phy/phy-da8xx-usb.c +3 -2
index 32ae78c..c85fb0b 100644
@@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
 	} else {
 		int ret;
 
-		ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0");
+		ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy",
+					"ohci-da8xx");
 		if (ret)
 			dev_warn(dev, "Failed to create usb11 phy lookup\n");
 		ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy",
@@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev)
 
 	if (!pdev->dev.of_node) {
 		phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx");
-		phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0");
+		phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci-da8xx");
 	}
 
 	return 0;
Signature · 1 line
2.10.1
#5 lore raw

PATCH v2 3/3 usb: ohci-da8xx: rename driver to ohci-da8xx

In reply to Axel Haslam

The davinci ohci driver name (currently "ohci") is too generic. To be consistent with other usb dirvers, append the "-da8xx" postfix to the name.

---
 drivers/usb/host/ohci-da8xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-da8xx.c +1 -1
index 30c4878..429d58b 100644
@@ -27,7 +27,7 @@
 #include "ohci.h"
 
 #define DRIVER_DESC "DA8XX"
-#define DRV_NAME "ohci"
+#define DRV_NAME "ohci-da8xx"
 
 static struct hc_driver __read_mostly ohci_da8xx_hc_driver;
 
Signature · 1 line
2.10.1
#8 lore raw
In reply to Axel Haslam
Quoted 30 lines · Axel Haslam

The usb ohci clock match is not working because the usb clock is registered as "ohci" instead of "ohci.0"

But since there is only a single ohci instance, lets pass -1 to the platform data id parameter and avoid the extra ".0" matching.

while we are fixing this, rename the driver from "ohci" to "ohci-da8xx" which is less generic and consistent with other usb drivers.

changes form v1 -> v2
*Reword commit messages (David Lechner)

Because of the recently accepted patches on the ARM-davinci side, This patch series is based on:
branch: /v4.10/soc of the linux-davinci tree.

It Depends on two accepted usb patches missing on that branch:
6c21caa USB: OHCI: make ohci-da8xx a separate driver (in next-usb) 6110c42 usb: ohci-da8xx: Remove code that references mach (in linux-next)

A branch with both patches applied + this series can be found here:
https://github.com/axelhaslamx/linux-axel/commits/ti-davinci-ohci-rename

Axel Haslam (3):
ARM: davinci: da8xx: Fix ohci device name
phy: da8xx-usb: rename the ohci device to ohci-da8xx
usb: ohci-da8xx: rename driver to ohci-da8xx

Quoted 8 lines
 arch/arm/mach-davinci/da830.c     | 2 +-
 arch/arm/mach-davinci/da850.c     | 2 +-
 arch/arm/mach-davinci/da8xx-dt.c  | 2 +-
 arch/arm/mach-davinci/usb-da8xx.c | 4 ++--
 drivers/phy/phy-da8xx-usb.c       | 5 +++--
 drivers/usb/host/ohci-da8xx.c     | 2 +-
 6 files changed, 9 insertions(+), 8 deletions(-)

Thanks for making the changes. The commit messages make better sense to me now. :-)

#4 lore raw

Re: [PATCH v2 2/3] phy: da8xx-usb: rename the ohci device to ohci-da8xx

In reply to Axel Haslam
Quoted 4 lines · Axel Haslam

The ohci device name has changed in the board configuraion files, hence, change the phy lookup table to match the new name.

merged, thanks.

-Kishon

Quoted 28 lines
---
 drivers/phy/phy-da8xx-usb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/phy/phy-da8xx-usb.c +3 -2
index 32ae78c..c85fb0b 100644
@@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
 	} else {
 		int ret;
 
-		ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0");
+		ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy",
+					"ohci-da8xx");
 		if (ret)
 			dev_warn(dev, "Failed to create usb11 phy lookup\n");
 		ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy",
@@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev)
 
 	if (!pdev->dev.of_node) {
 		phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx");
-		phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0");
+		phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci-da8xx");
 	}
 
 	return 0;
#6 lore raw

Re: [PATCH v2 3/3] usb: ohci-da8xx: rename driver to ohci-da8xx

In reply to Axel Haslam

Hi Greg,

Quoted 4 lines · Axel Haslam

The davinci ohci driver name (currently "ohci") is too generic. To be consistent with other usb dirvers, append the "-da8xx" postfix to the name.

if there are no objections, would it be possible to pick up this patch? the corresponding phy patch was merged and the platform changes are ack'ed, and will we taken by the davinci maintainer once this patch gets in.

i can resend stand-alone if its preferred.

Regards
Axel

Quoted 21 lines
---
 drivers/usb/host/ohci-da8xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-da8xx.c +1 -2
index 30c4878..429d58b 100644
@@ -27,7 +27,7 @@
 #include "ohci.h"
 
 #define DRIVER_DESC "DA8XX"
-#define DRV_NAME "ohci"
+#define DRV_NAME "ohci-da8xx"
 
 static struct hc_driver __read_mostly ohci_da8xx_hc_driver;
 
--

2.10.1

maintainer
#7 lore raw

Re: [PATCH v2 3/3] usb: ohci-da8xx: rename driver to ohci-da8xx

Quoted 8 lines · Axel Haslam

Hi Greg,

Quoted 4 lines · Axel Haslam

The davinci ohci driver name (currently "ohci") is too generic. To be consistent with other usb dirvers, append the "-da8xx" postfix to the name.

Quoted 4 lines

if there are no objections, would it be possible to pick up this patch? the corresponding phy patch was merged and the platform changes are ack'ed, and will we taken by the davinci maintainer once this patch gets in.

Now applied.

thanks,

greg k-h

Applied
#2 lore raw

Re: [PATCH v2 1/3] ARM: davinci: da8xx: Fix ohci device name

In reply to Axel Haslam
Quoted 9 lines · Axel Haslam

While the clk lookup table is making reference to "ohci" other subsystems (such as phy) are trying to match "ohci.0"

Since there is a single ohci instance, instead of changing the clk name, change the dev id to -1, and add the "-da8xx" postfix to match the driver name that will also be changed in a subsequent patch.

Applied to v4.10/soc

Thanks,
Sekhar