[3/7] usb: dwc3: pci: Store device properties dynamically
From: Andy Shevchenko <hidden>
Date: 2018-02-21 14:45:49
On Tue, Feb 20, 2018 at 11:12 PM, Thinh Nguyen [off-list ref] wrote:
On 2/17/2018 7:29 AM, Andy Shevchenko wrote:quoted
On Fri, Feb 16, 2018 at 11:55 PM, Thinh Nguyen [off-list ref] wrote:quoted
Add the ability to add device properties dynamically. Currently, device properties are added to platform device using platform_device_add_properties(). However, this function does not allow adding properties incrementally. It is useful to have this ability when the driver needs to set common device properties across different HWI'm not sure it's useful anyhow.quoted
or if IP and FPGA validation test different configurations for different HW.Shouldn't be a separate stuff for FPGA exclusively?Can you clarify/expand your question?
FPGA is the one which might have different properties at run time for the same device. So, why do we care on driver / generic level of it? Shouldn't be FPGA manager take care of it (via DT overlays, for example)?
quoted
quoted
To address this issue, update dwc3_pci to store device properties to an array and dynamically manage them here. Introduce two new functions to do so: * dwc3_pci_add_one_property() - this function adds one property to dwc->properties array and increase its size as needed * dwc3_pci_add_properties() - this function takes a null terminated array of device properties and add them to dwc->propertiesSo, why you can't use ACPI / DT here?dwc3_pci_add_properties() is a convenient function that takes statically allocated array of (quirks) properties for different HW and store them to dwc->properties. The idea is to add more properties on top of these required quirks.
Yes, I understand that. What's wrong with DT? The built-in device properties have the same nature as usual properties for DT. Whenever driver calls device_property_read_uXX() or alike it would check all property provides for asked one. Other than that, quirks esp. for FPGA sounds so wrong. Why in the first place not to make non-broken hardware?!