File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -682,55 +682,6 @@ static int intel_free_stream(struct sdw_intel *sdw,
682682 return 0 ;
683683}
684684
685- /*
686- * bank switch routines
687- */
688-
689- static int intel_pre_bank_switch (struct sdw_intel * sdw )
690- {
691- struct sdw_cdns * cdns = & sdw -> cdns ;
692- struct sdw_bus * bus = & cdns -> bus ;
693-
694- /* Write to register only for multi-link */
695- if (!bus -> multi_link )
696- return 0 ;
697-
698- sdw_intel_sync_arm (sdw );
699-
700- return 0 ;
701- }
702-
703- static int intel_post_bank_switch (struct sdw_intel * sdw )
704- {
705- struct sdw_cdns * cdns = & sdw -> cdns ;
706- struct sdw_bus * bus = & cdns -> bus ;
707- int ret = 0 ;
708-
709- /* Write to register only for multi-link */
710- if (!bus -> multi_link )
711- return 0 ;
712-
713- mutex_lock (sdw -> link_res -> shim_lock );
714-
715- /*
716- * post_bank_switch() ops is called from the bus in loop for
717- * all the Masters in the steam with the expectation that
718- * we trigger the bankswitch for the only first Master in the list
719- * and do nothing for the other Masters
720- *
721- * So, set the SYNCGO bit only if CMDSYNC bit is set for any Master.
722- */
723- if (sdw_intel_sync_check_cmdsync_unlocked (sdw ))
724- ret = sdw_intel_sync_go_unlocked (sdw );
725-
726- mutex_unlock (sdw -> link_res -> shim_lock );
727-
728- if (ret < 0 )
729- dev_err (sdw -> cdns .dev , "Post bank switch failed: %d\n" , ret );
730-
731- return ret ;
732- }
733-
734685/*
735686 * DAI routines
736687 */
Original file line number Diff line number Diff line change @@ -201,4 +201,8 @@ void intel_check_clock_stop(struct sdw_intel *sdw);
201201int intel_start_bus_after_clock_stop (struct sdw_intel * sdw );
202202int intel_stop_bus (struct sdw_intel * sdw , bool clock_stop );
203203
204+ /* common bank switch routines */
205+ int intel_pre_bank_switch (struct sdw_intel * sdw );
206+ int intel_post_bank_switch (struct sdw_intel * sdw );
207+
204208#endif /* __SDW_INTEL_LOCAL_H */
Original file line number Diff line number Diff line change @@ -208,3 +208,52 @@ int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
208208
209209 return 0 ;
210210}
211+
212+ /*
213+ * bank switch routines
214+ */
215+
216+ int intel_pre_bank_switch (struct sdw_intel * sdw )
217+ {
218+ struct sdw_cdns * cdns = & sdw -> cdns ;
219+ struct sdw_bus * bus = & cdns -> bus ;
220+
221+ /* Write to register only for multi-link */
222+ if (!bus -> multi_link )
223+ return 0 ;
224+
225+ sdw_intel_sync_arm (sdw );
226+
227+ return 0 ;
228+ }
229+
230+ int intel_post_bank_switch (struct sdw_intel * sdw )
231+ {
232+ struct sdw_cdns * cdns = & sdw -> cdns ;
233+ struct sdw_bus * bus = & cdns -> bus ;
234+ int ret = 0 ;
235+
236+ /* Write to register only for multi-link */
237+ if (!bus -> multi_link )
238+ return 0 ;
239+
240+ mutex_lock (sdw -> link_res -> shim_lock );
241+
242+ /*
243+ * post_bank_switch() ops is called from the bus in loop for
244+ * all the Masters in the steam with the expectation that
245+ * we trigger the bankswitch for the only first Master in the list
246+ * and do nothing for the other Masters
247+ *
248+ * So, set the SYNCGO bit only if CMDSYNC bit is set for any Master.
249+ */
250+ if (sdw_intel_sync_check_cmdsync_unlocked (sdw ))
251+ ret = sdw_intel_sync_go_unlocked (sdw );
252+
253+ mutex_unlock (sdw -> link_res -> shim_lock );
254+
255+ if (ret < 0 )
256+ dev_err (sdw -> cdns .dev , "Post bank switch failed: %d\n" , ret );
257+
258+ return ret ;
259+ }
You can’t perform that action at this time.
0 commit comments