Hi, On Thu, May 15, 2014 at 02:04:39PM +0530, Pratyush Anand wrote: > All dwc3 based xhci host controller supports USB3.0 LPM functionality. > Therefore enable it in platform data for all dwc3 based xhci device if > DWC3_HOST_USB3_LPM_ENABLE is selected in Kconfig. > > Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx> > --- > drivers/usb/dwc3/Kconfig | 6 ++++++ > drivers/usb/dwc3/host.c | 16 ++++++++++++++++ > 2 files changed, 22 insertions(+) > > diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig > index 8eb996e..e27abae 100644 > --- a/drivers/usb/dwc3/Kconfig > +++ b/drivers/usb/dwc3/Kconfig > @@ -92,4 +92,10 @@ config USB_DWC3_VERBOSE > help > Say Y here to enable verbose debugging messages on DWC3 Driver. > > +config DWC3_HOST_USB3_LPM_ENABLE > + bool "Enable USB3 LPM Capability" default n ? > + depends on USB_DWC3_HOST=y || USB_DWC3_DUAL_ROLE=y > + help > + Select this when you want to enable USB3 LPM with dwc3 xhci host. > + > endif > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c > index 32db328..068c3d1 100644 > --- a/drivers/usb/dwc3/host.c > +++ b/drivers/usb/dwc3/host.c > @@ -16,6 +16,7 @@ > */ > > #include <linux/platform_device.h> > +#include <linux/usb/xhci_pdriver.h> > > #include "core.h" > > @@ -23,6 +24,9 @@ int dwc3_host_init(struct dwc3 *dwc) > { > struct platform_device *xhci; > int ret; > +#ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE > + struct usb_xhci_pdata pdata; > +#endif oh no, the pdata you can always define, it's ok... > goto err1; > } > > +#ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE > + memset(&pdata, 0, sizeof(pdata)); > + > + pdata.usb3_lpm_capable = 1; just this line needs to be wrapped: #ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE pdata.usb3_lpm_capable = true; #endif everything else can be defined unconditionally. cheers -- balbi
Attachment:
signature.asc
Description: Digital signature