On Fri, Feb 16, 2018 at 11:55 PM, Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx> wrote: > Add the ability for PCI platforms to customize device properties via > debugfs attributes. For IP and FPGA validation purposes, this feature is > useful to test against various HW configurations that are normally > statically configured in a real HW. It allows changing of the device > properties while using the same PID and VID without recompiling the > driver with a different set of properties every time. > > Overview of this feature: > * dwc3_pci_probe() will not immediately create and add platform device > (That is, nothing will happen when dwc3-pci module is first loaded) > * The user initiates platform device creation and addition to device > hierarchy by writing to 'start' debugfs attribute > * dwc3-pci creates debugfs attributes for device properties > * The user can set these properties via those attributes > * dwc3-pci stores the properties that the user set (they are added to > platform device when user initiates 'start') > * Device properties cannot be changed after the platform device has > been added to device hierarchy > > This feature is not enabled by default, the user must enable > CONFIG_USB_DWC3_PCI_DEBUGFS in order to use this feature. Currently > there is only one property -- maximum_speed. I dunno if Felipe likes the idea, but I would rather convert PCI glue driver from being parent device to being the device (by using dwc3 platform driver as a library). I also don't know if it's possible with regard to multiple quirks the driver might have. > Thinh Nguyen (7): > usb: dwc3: pci: Properly cleanup resource > usb: dwc3: pci: Set an easily recognizable device name > usb: dwc3: pci: Store device properties dynamically > usb: dwc3: pci: Move platform creation from probe function > usb: dwc3: Rename dwc3-pci.c to pci.c > usb: dwc3: pci: Create header file > usb: dwc3: pci: Add debugfs for device properties > > drivers/usb/dwc3/Kconfig | 11 ++ > drivers/usb/dwc3/Makefile | 5 + > drivers/usb/dwc3/dwc3-pci.h | 72 +++++++++++ > drivers/usb/dwc3/pci-debugfs.c | 144 ++++++++++++++++++++++ > drivers/usb/dwc3/{dwc3-pci.c => pci.c} | 214 ++++++++++++++++++++++++--------- > 5 files changed, 392 insertions(+), 54 deletions(-) > create mode 100644 drivers/usb/dwc3/dwc3-pci.h > create mode 100644 drivers/usb/dwc3/pci-debugfs.c > rename drivers/usb/dwc3/{dwc3-pci.c => pci.c} (77%) > > -- > 2.11.0 > > -- > 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 -- With Best Regards, Andy Shevchenko -- 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