@@ -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{
@@ -1331,7 +1334,7 @@ static void dwc3_config_threshold(struct dwc3 *dwc)
13311334 *
13321335 * Returns 0 on success otherwise negative errno.
13331336 */
1334- static int dwc3_core_init (struct dwc3 * dwc )
1337+ int dwc3_core_init (struct dwc3 * dwc )
13351338{
13361339 unsigned int hw_mode ;
13371340 u32 reg ;
@@ -1531,6 +1534,7 @@ static int dwc3_core_init(struct dwc3 *dwc)
15311534
15321535 return ret ;
15331536}
1537+ EXPORT_SYMBOL_GPL (dwc3_core_init );
15341538
15351539static int dwc3_core_get_phy (struct dwc3 * dwc )
15361540{
@@ -1669,14 +1673,21 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
16691673 dwc3_set_prtcap (dwc , DWC3_GCTL_PRTCAP_DEVICE , true);
16701674}
16711675
1672- static void dwc3_get_software_properties (struct dwc3 * dwc )
1676+ static void dwc3_get_software_properties (struct dwc3 * dwc ,
1677+ const struct dwc3_properties * properties )
16731678{
16741679 struct device * tmpdev ;
16751680 u16 gsbuscfg0_reqinfo ;
16761681 int ret ;
16771682
16781683 dwc -> gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED ;
16791684
1685+ if (properties -> gsbuscfg0_reqinfo !=
1686+ DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED ) {
1687+ dwc -> gsbuscfg0_reqinfo = properties -> gsbuscfg0_reqinfo ;
1688+ return ;
1689+ }
1690+
16801691 /*
16811692 * Iterate over all parent nodes for finding swnode properties
16821693 * and non-DT (non-ABI) properties.
@@ -2209,7 +2220,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
22092220
22102221 dwc3_get_properties (dwc );
22112222
2212- dwc3_get_software_properties (dwc );
2223+ dwc3_get_software_properties (dwc , & data -> properties );
22132224
22142225 dwc -> usb_psy = dwc3_get_usb_power_supply (dwc );
22152226 if (IS_ERR (dwc -> usb_psy ))
@@ -2302,9 +2313,11 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
23022313 dwc3_check_params (dwc );
23032314 dwc3_debugfs_init (dwc );
23042315
2305- ret = dwc3_core_init_mode (dwc );
2306- if (ret )
2307- goto err_exit_debugfs ;
2316+ if (!data -> skip_core_init_mode ) {
2317+ ret = dwc3_core_init_mode (dwc );
2318+ if (ret )
2319+ goto err_exit_debugfs ;
2320+ }
23082321
23092322 pm_runtime_put (dev );
23102323
@@ -2359,6 +2372,7 @@ static int dwc3_probe(struct platform_device *pdev)
23592372
23602373 probe_data .dwc = dwc ;
23612374 probe_data .res = res ;
2375+ probe_data .properties = DWC3_DEFAULT_PROPERTIES ;
23622376
23632377 return dwc3_core_probe (& probe_data );
23642378}
0 commit comments