Hi Felipe, Here is my second attempt at this. I think I incorporated most of your suggested changes. But: - I found that the cleanest way to handle the HAPS oddities was to add the HAPS-specific stuff to the dwc3 module, instead of to the glue layer. This is mainly because the HAPS PME controls are in the same PCI BAR space as the standard DWC USB3 registers. The way the interface between the bus glue and the dwc3 module is designed, that BAR space is only accessible to the dwc3 module. Also, the HAPS PME interrupt is piggy-backed on top of the standard DWC USB3 interrupt, so that means the interrupt handling is intertwined, and can't be handled easily by separate modules. - I left the hibernation-specific variables as part of struct dwc3, instead of putting them in a separately-allocated struct. It just seems cleaner that way, it means the code can be e.g. dwc->hibernate instead of dwc->hiber->state. It also saves a null pointer check in some cases if hibernation is not enabled. But if you really want it separated, let me know and I will reimplement it that way. - I left the hibernation-specific function prototypes in a separate hibernation.h file instead of combining them into core.h. That's easy enough to change if you want. Paul Zimmerman (7): usb: dwc3: clean up whitespace damage, typos, missing parens, etc. usb: dwc3: a few fixes/improvements usb: dwc3: add definitions for new registers usb: dwc3: support new/changed functionality of latest controllers usb: dwc3: add two gadget functions needed for hibernation support usb: dwc3: refactor some existing routines for hibernation support usb: dwc3: add the hibernation code itself drivers/usb/dwc3/Kconfig | 7 + drivers/usb/dwc3/Makefile | 2 + drivers/usb/dwc3/core.c | 133 ++++++- drivers/usb/dwc3/core.h | 176 ++++++-- drivers/usb/dwc3/dwc3-pci.c | 21 +- drivers/usb/dwc3/ep0.c | 8 +- drivers/usb/dwc3/gadget.c | 474 ++++++++++++++++----- drivers/usb/dwc3/gadget.h | 15 + drivers/usb/dwc3/haps-pwrctl.c | 200 +++++++++ drivers/usb/dwc3/haps-pwrctl.h | 46 ++ drivers/usb/dwc3/hibernate.c | 930 ++++++++++++++++++++++++++++++++++++++++ drivers/usb/dwc3/hibernate.h | 112 +++++ 12 files changed, 1965 insertions(+), 159 deletions(-) create mode 100644 drivers/usb/dwc3/haps-pwrctl.c create mode 100644 drivers/usb/dwc3/haps-pwrctl.h create mode 100644 drivers/usb/dwc3/hibernate.c create mode 100644 drivers/usb/dwc3/hibernate.h -- 1.7.4.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html