File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1667,14 +1667,21 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
16671667 dwc3_set_prtcap (dwc , DWC3_GCTL_PRTCAP_DEVICE , true);
16681668}
16691669
1670- static void dwc3_get_software_properties (struct dwc3 * dwc )
1670+ static void dwc3_get_software_properties (struct dwc3 * dwc ,
1671+ const struct dwc3_properties * properties )
16711672{
16721673 struct device * tmpdev ;
16731674 u16 gsbuscfg0_reqinfo ;
16741675 int ret ;
16751676
16761677 dwc -> gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED ;
16771678
1679+ if (properties -> gsbuscfg0_reqinfo !=
1680+ DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED ) {
1681+ dwc -> gsbuscfg0_reqinfo = properties -> gsbuscfg0_reqinfo ;
1682+ return ;
1683+ }
1684+
16781685 /*
16791686 * Iterate over all parent nodes for finding swnode properties
16801687 * and non-DT (non-ABI) properties.
@@ -2207,7 +2214,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
22072214
22082215 dwc3_get_properties (dwc );
22092216
2210- dwc3_get_software_properties (dwc );
2217+ dwc3_get_software_properties (dwc , & data -> properties );
22112218
22122219 dwc -> usb_psy = dwc3_get_usb_power_supply (dwc );
22132220 if (IS_ERR (dwc -> usb_psy ))
@@ -2357,6 +2364,7 @@ static int dwc3_probe(struct platform_device *pdev)
23572364
23582365 probe_data .dwc = dwc ;
23592366 probe_data .res = res ;
2367+ probe_data .properties = DWC3_DEFAULT_PROPERTIES ;
23602368
23612369 return dwc3_core_probe (& probe_data );
23622370}
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ static int dwc3_generic_probe(struct platform_device *pdev)
7575 probe_data .dwc = & dwc3g -> dwc ;
7676 probe_data .res = res ;
7777 probe_data .ignore_clocks_and_resets = true;
78+ probe_data .properties = DWC3_DEFAULT_PROPERTIES ;
7879 ret = dwc3_core_probe (& probe_data );
7980 if (ret )
8081 return dev_err_probe (dev , ret , "failed to register DWC3 Core\n" );
Original file line number Diff line number Diff line change @@ -704,6 +704,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
704704 probe_data .dwc = & qcom -> dwc ;
705705 probe_data .res = & res ;
706706 probe_data .ignore_clocks_and_resets = true;
707+ probe_data .properties = DWC3_DEFAULT_PROPERTIES ;
707708 ret = dwc3_core_probe (& probe_data );
708709 if (ret ) {
709710 ret = dev_err_probe (dev , ret , "failed to register DWC3 Core\n" );
Original file line number Diff line number Diff line change 99#include <linux/types.h>
1010#include "core.h"
1111
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+
1224/**
1325 * dwc3_probe_data: Initialization parameters passed to dwc3_core_probe()
1426 * @dwc: Reference to dwc3 context structure
1527 * @res: resource for the DWC3 core mmio region
1628 * @ignore_clocks_and_resets: clocks and resets defined for the device should
1729 * be ignored by the DWC3 core, as they are managed by the glue
30+ * @properties: dwc3 software manage properties
1831 */
1932struct dwc3_probe_data {
2033 struct dwc3 * dwc ;
2134 struct resource * res ;
2235 bool ignore_clocks_and_resets ;
36+ struct dwc3_properties properties ;
2337};
2438
2539int dwc3_core_probe (const struct dwc3_probe_data * data );
You can’t perform that action at this time.
0 commit comments