* [PATCH 1/2] usb: musb: un-break davinci glue layer
@ 2017-12-08 19:23 Alejandro Mery
2017-12-08 19:23 ` [PATCH 2/2] usb: musb: davinci: Pass file_mode in platform data Alejandro Mery
2017-12-19 17:22 ` [PATCH 1/2] usb: musb: un-break davinci glue layer Bin Liu
0 siblings, 2 replies; 4+ messages in thread
From: Alejandro Mery @ 2017-12-08 19:23 UTC (permalink / raw)
To: linux-arm-kernel
MUSB's davinci glue was made to depend on BROKEN by Felipe Balbi back in
2013 because of lack of active development. needed changes were actually trivial
Fixes: 787f5627bec8 (usb: musb: make davinci and da8xx glues depend on BROKEN)
Signed-off-by: Alejandro Mery <amery@hanoverdisplays.com>
---
drivers/usb/musb/Kconfig | 1 -
drivers/usb/musb/davinci.c | 20 ++++++++++----------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 5506a9c03c1f..e13320eebbbf 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -76,7 +76,6 @@ config USB_MUSB_DAVINCI
tristate "DaVinci"
depends on ARCH_DAVINCI_DMx
depends on NOP_USB_XCEIV
- depends on BROKEN
config USB_MUSB_DA8XX
tristate "DA8xx/OMAP-L1x"
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 2ad39dcd2f4c..6571f9e59f8f 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -39,6 +39,7 @@
struct davinci_glue {
struct device *dev;
struct platform_device *musb;
+ struct platform_device *phy;
struct clk *clk;
};
@@ -363,10 +364,8 @@ static int davinci_musb_init(struct musb *musb)
int ret = -ENODEV;
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
- if (IS_ERR_OR_NULL(musb->xceiv)) {
- ret = -EPROBE_DEFER;
- goto unregister;
- }
+ if (IS_ERR_OR_NULL(musb->xceiv))
+ return -EPROBE_DEFER;
musb->mregs += DAVINCI_BASE_OFFSET;
@@ -418,8 +417,6 @@ static int davinci_musb_init(struct musb *musb)
fail:
usb_put_phy(musb->xceiv);
-unregister:
- usb_phy_generic_unregister();
return ret;
}
@@ -527,7 +524,9 @@ static int davinci_probe(struct platform_device *pdev)
pdata->platform_ops = &davinci_ops;
- usb_phy_generic_register();
+ glue->phy = usb_phy_generic_register();
+ if (IS_ERR(glue->phy))
+ goto err1;
platform_set_drvdata(pdev, glue);
memset(musb_resources, 0x00, sizeof(*musb_resources) *
@@ -563,14 +562,15 @@ static int davinci_probe(struct platform_device *pdev)
if (IS_ERR(musb)) {
ret = PTR_ERR(musb);
dev_err(&pdev->dev, "failed to register musb device: %d\n", ret);
- goto err1;
+ goto err2;
}
return 0;
+err2:
+ usb_phy_generic_unregister(glue->phy);
err1:
clk_disable(clk);
-
err0:
return ret;
}
@@ -580,7 +580,7 @@ static int davinci_remove(struct platform_device *pdev)
struct davinci_glue *glue = platform_get_drvdata(pdev);
platform_device_unregister(glue->musb);
- usb_phy_generic_unregister();
+ usb_phy_generic_unregister(glue->phy);
clk_disable(glue->clk);
return 0;
--
2.15.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] usb: musb: davinci: Pass file_mode in platform data
2017-12-08 19:23 [PATCH 1/2] usb: musb: un-break davinci glue layer Alejandro Mery
@ 2017-12-08 19:23 ` Alejandro Mery
2017-12-19 17:22 ` [PATCH 1/2] usb: musb: un-break davinci glue layer Bin Liu
1 sibling, 0 replies; 4+ messages in thread
From: Alejandro Mery @ 2017-12-08 19:23 UTC (permalink / raw)
To: linux-arm-kernel
as it was done for glues to allow setting the correct
fifo_mode when multiple MUSB glue layers are built-in
Fixes: 8a77f05aa39b ("usb: musb: Pass fifo_mode in platform data")
Signed-off-by: Alejandro Mery <amery@hanoverdisplays.com>
---
drivers/usb/musb/davinci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 6571f9e59f8f..2632efd3d598 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -472,6 +472,7 @@ static const struct musb_platform_ops davinci_ops = {
.quirks = MUSB_DMA_CPPI,
.init = davinci_musb_init,
.exit = davinci_musb_exit,
+ .fifo_mode = 2,
#ifdef CONFIG_USB_TI_CPPI_DMA
.dma_init = cppi_dma_controller_create,
--
2.15.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/2] usb: musb: un-break davinci glue layer
2017-12-08 19:23 [PATCH 1/2] usb: musb: un-break davinci glue layer Alejandro Mery
2017-12-08 19:23 ` [PATCH 2/2] usb: musb: davinci: Pass file_mode in platform data Alejandro Mery
@ 2017-12-19 17:22 ` Bin Liu
[not found] ` <CF323D845261FD4F9B1E997381250334E344CBEB@maildb.hanover.local>
1 sibling, 1 reply; 4+ messages in thread
From: Bin Liu @ 2017-12-19 17:22 UTC (permalink / raw)
To: linux-arm-kernel
Hi Alejandro,
On Fri, Dec 08, 2017 at 07:23:54PM +0000, Alejandro Mery wrote:
> MUSB's davinci glue was made to depend on BROKEN by Felipe Balbi back in
> 2013 because of lack of active development. needed changes were actually trivial
>
> Fixes: 787f5627bec8 (usb: musb: make davinci and da8xx glues depend on BROKEN)
> Signed-off-by: Alejandro Mery <amery@hanoverdisplays.com>
Thanks for the effort to re-enable this driver. But due to lack of
development, other than the phy and fifo mode which you try to fix with
these two patches, the driver still doesn't fit in the current driver
framework, for example,
- the driver depends on mach/ header for CPU and board type;
- clk control is not separated;
- gpio control vbus should use extcon driver;
So I feel it is not ready to un-broken it yet, unless others have
different opinion.
But I could take these two patches if not remove BROKEN from Kconfig.
Regards,
-Bin.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] usb: musb: un-break davinci glue layer
[not found] ` <CF323D845261FD4F9B1E997381250334E344CBEB@maildb.hanover.local>
@ 2017-12-19 19:33 ` Bin Liu
0 siblings, 0 replies; 4+ messages in thread
From: Bin Liu @ 2017-12-19 19:33 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Dec 19, 2017 at 05:33:14PM +0000, Alejandro Mery wrote:
> Hi Bin,
>
> On 19/12/17 17:22, Bin Liu wrote:
> > Hi Alejandro,
> >
> > On Fri, Dec 08, 2017 at 07:23:54PM +0000, Alejandro Mery wrote:
> >> MUSB's davinci glue was made to depend on BROKEN by Felipe Balbi back in
> >> 2013 because of lack of active development. needed changes were actually trivial
> >>
> >> Fixes: 787f5627bec8 (usb: musb: make davinci and da8xx glues depend on BROKEN)
> >> Signed-off-by: Alejandro Mery <amery@hanoverdisplays.com>
> > Thanks for the effort to re-enable this driver. But due to lack of
> > development, other than the phy and fifo mode which you try to fix with
> > these two patches, the driver still doesn't fit in the current driver
> > framework, for example,
> >
> > - the driver depends on mach/ header for CPU and board type;
> > - clk control is not separated;
> > - gpio control vbus should use extcon driver;
> I'll try to fix these issues but it will take a while. I'm still
> struggling to get USB working at all on the DM365 EVM
Thanks for the effort.
>
> >
> > So I feel it is not ready to un-broken it yet, unless others have
> > different opinion.
> >
> > But I could take these two patches if not remove BROKEN from Kconfig.
>
> do you want a v2 for that?
That will be great!
Thanks,
-Bin.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-19 19:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-08 19:23 [PATCH 1/2] usb: musb: un-break davinci glue layer Alejandro Mery
2017-12-08 19:23 ` [PATCH 2/2] usb: musb: davinci: Pass file_mode in platform data Alejandro Mery
2017-12-19 17:22 ` [PATCH 1/2] usb: musb: un-break davinci glue layer Bin Liu
[not found] ` <CF323D845261FD4F9B1E997381250334E344CBEB@maildb.hanover.local>
2017-12-19 19:33 ` Bin Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).