Re: [PATCH 3/4] dwc3: host: Set xhci lpm support quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 22, 2014 at 10:46:13AM +0530, Pratyush Anand wrote:
> On Tue, Apr 22, 2014 at 12:43:55PM +0800, Felipe Balbi wrote:
> > On Tue, Apr 22, 2014 at 09:57:29AM +0530, Pratyush Anand wrote:
> > > All dwc3 based xhci host controller supports USB3.0 LPM functionality.
> > > Therefore enable quirk flag to support it for dwc3 xhci host driver.
> > > 
> > > Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
> > > Tested-by: Aymen Bouattay <aymen.bouattay@xxxxxx>
> > > ---
> > >  drivers/usb/dwc3/host.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> > > index a362ed9..b0e4669 100644
> > > --- a/drivers/usb/dwc3/host.c
> > > +++ b/drivers/usb/dwc3/host.c
> > > @@ -86,6 +86,7 @@ int dwc3_host_init(struct dwc3 *dwc)
> > >  	hcd = platform_get_drvdata(xhci);
> > >  	xhci_dev = hcd_to_xhci(hcd);
> > >  	xhci_dev->shared_hcd->phy = dwc->usb3_phy;
> > > +	xhci_dev->quirks |= XHCI_LPM_SUPPORT;
> > 
> > weird... what sort of changes do you have which you didn't send yet ?
> > dwc3/host.c does not create the xHCI device. dwc3_host_init() is
> > basically a wrapper to platform_add_device()
> 
> There is nothing, and it works.
> 
> Adding platform xhci driver in defconfig and selecting dwc3 in DT is sufficient.
> Did I get, what you were asking?

this little hunk below will never apply to dwc3/host.c:

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index a362ed9..b0e4669 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -86,6 +86,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 	hcd = platform_get_drvdata(xhci);
 	xhci_dev = hcd_to_xhci(hcd);
 	xhci_dev->shared_hcd->phy = dwc->usb3_phy;
+	xhci_dev->quirks |= XHCI_LPM_SUPPORT;


here are dwc3/host.c contents as of v3.15-rc2 (removed comments)

#include <linux/platform_device.h>

#include "core.h"

int dwc3_host_init(struct dwc3 *dwc)
{
	struct platform_device	*xhci;
	int			ret;

	xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO);
	if (!xhci) {
		dev_err(dwc->dev, "couldn't allocate xHCI device\n");
		ret = -ENOMEM;
		goto err0;
	}

	dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);

	xhci->dev.parent	= dwc->dev;
	xhci->dev.dma_mask	= dwc->dev->dma_mask;
	xhci->dev.dma_parms	= dwc->dev->dma_parms;

	dwc->xhci = xhci;

	ret = platform_device_add_resources(xhci, dwc->xhci_resources,
						DWC3_XHCI_RESOURCES_NUM);
	if (ret) {
		dev_err(dwc->dev, "couldn't add resources to xHCI device\n");
		goto err1;
	}

	ret = platform_device_add(xhci);
	if (ret) {
		dev_err(dwc->dev, "failed to register xHCI device\n");
		goto err1;
	}

	return 0;

err1:
	platform_device_put(xhci);

err0:
	return ret;
}

void dwc3_host_exit(struct dwc3 *dwc)
{
	platform_device_unregister(dwc->xhci);
}

as you can see, there is no such thing as xhci_dev variable.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux