Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: dwc3: Add software-managed properties for flattened model

Add software-managed properties for the flattened model, which does not
need to use device tree properties to pass down information to the
common DWC3 core.

Add 'properties' in dwc3_probe_data and set default values for existing
users (dwc3-qcom, dwc3-generic-plat).

No functional changes.

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250929-ls_dma_coherence-v5-2-2ebee578eb7e@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Frank Li and committed by
Greg Kroah-Hartman
7298c06d b9f1c762

+26 -2
+10 -2
drivers/usb/dwc3/core.c
··· 1666 1666 dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE, true); 1667 1667 } 1668 1668 1669 - static void dwc3_get_software_properties(struct dwc3 *dwc) 1669 + static void dwc3_get_software_properties(struct dwc3 *dwc, 1670 + const struct dwc3_properties *properties) 1670 1671 { 1671 1672 struct device *tmpdev; 1672 1673 u16 gsbuscfg0_reqinfo; 1673 1674 int ret; 1674 1675 1675 1676 dwc->gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED; 1677 + 1678 + if (properties->gsbuscfg0_reqinfo != 1679 + DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED) { 1680 + dwc->gsbuscfg0_reqinfo = properties->gsbuscfg0_reqinfo; 1681 + return; 1682 + } 1676 1683 1677 1684 /* 1678 1685 * Iterate over all parent nodes for finding swnode properties ··· 2213 2206 2214 2207 dwc3_get_properties(dwc); 2215 2208 2216 - dwc3_get_software_properties(dwc); 2209 + dwc3_get_software_properties(dwc, &data->properties); 2217 2210 2218 2211 dwc->usb_psy = dwc3_get_usb_power_supply(dwc); 2219 2212 if (IS_ERR(dwc->usb_psy)) ··· 2363 2356 2364 2357 probe_data.dwc = dwc; 2365 2358 probe_data.res = res; 2359 + probe_data.properties = DWC3_DEFAULT_PROPERTIES; 2366 2360 2367 2361 return dwc3_core_probe(&probe_data); 2368 2362 }
+1
drivers/usb/dwc3/dwc3-generic-plat.c
··· 75 75 probe_data.dwc = &dwc3g->dwc; 76 76 probe_data.res = res; 77 77 probe_data.ignore_clocks_and_resets = true; 78 + probe_data.properties = DWC3_DEFAULT_PROPERTIES; 78 79 ret = dwc3_core_probe(&probe_data); 79 80 if (ret) 80 81 return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
+1
drivers/usb/dwc3/dwc3-qcom.c
··· 704 704 probe_data.dwc = &qcom->dwc; 705 705 probe_data.res = &res; 706 706 probe_data.ignore_clocks_and_resets = true; 707 + probe_data.properties = DWC3_DEFAULT_PROPERTIES; 707 708 ret = dwc3_core_probe(&probe_data); 708 709 if (ret) { 709 710 ret = dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
+14
drivers/usb/dwc3/glue.h
··· 10 10 #include "core.h" 11 11 12 12 /** 13 + * dwc3_properties: DWC3 core properties 14 + * @gsbuscfg0_reqinfo: Value to be programmed in the GSBUSCFG0.REQINFO field 15 + */ 16 + struct dwc3_properties { 17 + u32 gsbuscfg0_reqinfo; 18 + }; 19 + 20 + #define DWC3_DEFAULT_PROPERTIES ((struct dwc3_properties){ \ 21 + .gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED, \ 22 + }) 23 + 24 + /** 13 25 * dwc3_probe_data: Initialization parameters passed to dwc3_core_probe() 14 26 * @dwc: Reference to dwc3 context structure 15 27 * @res: resource for the DWC3 core mmio region 16 28 * @ignore_clocks_and_resets: clocks and resets defined for the device should 17 29 * be ignored by the DWC3 core, as they are managed by the glue 30 + * @properties: dwc3 software manage properties 18 31 */ 19 32 struct dwc3_probe_data { 20 33 struct dwc3 *dwc; 21 34 struct resource *res; 22 35 bool ignore_clocks_and_resets; 36 + struct dwc3_properties properties; 23 37 }; 24 38 25 39 int dwc3_core_probe(const struct dwc3_probe_data *data);