@@ -133,6 +133,7 @@ void dwc3_enable_susphy(struct dwc3 *dwc, bool enable)
133133 dwc3_writel (dwc -> regs , DWC3_GUSB2PHYCFG (i ), reg );
134134 }
135135}
136+ EXPORT_SYMBOL_GPL (dwc3_enable_susphy );
136137
137138void dwc3_set_prtcap (struct dwc3 * dwc , u32 mode , bool ignore_susphy )
138139{
@@ -159,6 +160,7 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy)
159160 dwc -> current_dr_role = mode ;
160161 trace_dwc3_set_prtcap (mode );
161162}
163+ EXPORT_SYMBOL_GPL (dwc3_set_prtcap );
162164
163165static void __dwc3_set_mode (struct work_struct * work )
164166{
@@ -976,14 +978,15 @@ static void dwc3_clk_disable(struct dwc3 *dwc)
976978 clk_disable_unprepare (dwc -> bus_clk );
977979}
978980
979- static void dwc3_core_exit (struct dwc3 * dwc )
981+ void dwc3_core_exit (struct dwc3 * dwc )
980982{
981983 dwc3_event_buffers_cleanup (dwc );
982984 dwc3_phy_power_off (dwc );
983985 dwc3_phy_exit (dwc );
984986 dwc3_clk_disable (dwc );
985987 reset_control_assert (dwc -> reset );
986988}
989+ EXPORT_SYMBOL_GPL (dwc3_core_exit );
987990
988991static bool dwc3_core_is_valid (struct dwc3 * dwc )
989992{
@@ -1329,7 +1332,7 @@ static void dwc3_config_threshold(struct dwc3 *dwc)
13291332 *
13301333 * Returns 0 on success otherwise negative errno.
13311334 */
1332- static int dwc3_core_init (struct dwc3 * dwc )
1335+ int dwc3_core_init (struct dwc3 * dwc )
13331336{
13341337 unsigned int hw_mode ;
13351338 u32 reg ;
@@ -1529,6 +1532,7 @@ static int dwc3_core_init(struct dwc3 *dwc)
15291532
15301533 return ret ;
15311534}
1535+ EXPORT_SYMBOL_GPL (dwc3_core_init );
15321536
15331537static int dwc3_core_get_phy (struct dwc3 * dwc )
15341538{
@@ -1667,14 +1671,21 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
16671671 dwc3_set_prtcap (dwc , DWC3_GCTL_PRTCAP_DEVICE , true);
16681672}
16691673
1670- static void dwc3_get_software_properties (struct dwc3 * dwc )
1674+ static void dwc3_get_software_properties (struct dwc3 * dwc ,
1675+ const struct dwc3_properties * properties )
16711676{
16721677 struct device * tmpdev ;
16731678 u16 gsbuscfg0_reqinfo ;
16741679 int ret ;
16751680
16761681 dwc -> gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED ;
16771682
1683+ if (properties -> gsbuscfg0_reqinfo !=
1684+ DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED ) {
1685+ dwc -> gsbuscfg0_reqinfo = properties -> gsbuscfg0_reqinfo ;
1686+ return ;
1687+ }
1688+
16781689 /*
16791690 * Iterate over all parent nodes for finding swnode properties
16801691 * and non-DT (non-ABI) properties.
@@ -2207,7 +2218,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
22072218
22082219 dwc3_get_properties (dwc );
22092220
2210- dwc3_get_software_properties (dwc );
2221+ dwc3_get_software_properties (dwc , & data -> properties );
22112222
22122223 dwc -> usb_psy = dwc3_get_usb_power_supply (dwc );
22132224 if (IS_ERR (dwc -> usb_psy ))
@@ -2300,9 +2311,11 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
23002311 dwc3_check_params (dwc );
23012312 dwc3_debugfs_init (dwc );
23022313
2303- ret = dwc3_core_init_mode (dwc );
2304- if (ret )
2305- goto err_exit_debugfs ;
2314+ if (!data -> skip_core_init_mode ) {
2315+ ret = dwc3_core_init_mode (dwc );
2316+ if (ret )
2317+ goto err_exit_debugfs ;
2318+ }
23062319
23072320 pm_runtime_put (dev );
23082321
@@ -2357,6 +2370,7 @@ static int dwc3_probe(struct platform_device *pdev)
23572370
23582371 probe_data .dwc = dwc ;
23592372 probe_data .res = res ;
2373+ probe_data .properties = DWC3_DEFAULT_PROPERTIES ;
23602374
23612375 return dwc3_core_probe (& probe_data );
23622376}
0 commit comments