snd_soc_daifmt_clock_provider_from_bitmap(                      \
                snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix))
 
+int snd_soc_get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream);
 int snd_soc_get_dai_id(struct device_node *ep);
 int snd_soc_get_dai_name(const struct of_phandle_args *args,
                         const char **dai_name);
 
 }
 EXPORT_SYMBOL_GPL(snd_soc_daifmt_parse_clock_provider_raw);
 
+int snd_soc_get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream)
+{
+       /*
+        * [Normal]
+        *
+        * Playback
+        *      CPU  : SNDRV_PCM_STREAM_PLAYBACK
+        *      Codec: SNDRV_PCM_STREAM_PLAYBACK
+        *
+        * Capture
+        *      CPU  : SNDRV_PCM_STREAM_CAPTURE
+        *      Codec: SNDRV_PCM_STREAM_CAPTURE
+        */
+       if (!dai_link->c2c_params)
+               return stream;
+
+       /*
+        * [Codec2Codec]
+        *
+        * Playback
+        *      CPU  : SNDRV_PCM_STREAM_CAPTURE
+        *      Codec: SNDRV_PCM_STREAM_PLAYBACK
+        *
+        * Capture
+        *      CPU  : SNDRV_PCM_STREAM_PLAYBACK
+        *      Codec: SNDRV_PCM_STREAM_CAPTURE
+        */
+       if (stream == SNDRV_PCM_STREAM_CAPTURE)
+               return SNDRV_PCM_STREAM_PLAYBACK;
+
+       return SNDRV_PCM_STREAM_CAPTURE;
+}
+EXPORT_SYMBOL_GPL(snd_soc_get_stream_cpu);
+
 int snd_soc_get_dai_id(struct device_node *ep)
 {
        struct snd_soc_component *component;
 
        snd_soc_dapm_add_path(dapm, src, sink, NULL, NULL);
 }
 
-static int get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream)
-{
-       /*
-        * [Normal]
-        *
-        * Playback
-        *      CPU  : SNDRV_PCM_STREAM_PLAYBACK
-        *      Codec: SNDRV_PCM_STREAM_PLAYBACK
-        *
-        * Playback
-        *      CPU  : SNDRV_PCM_STREAM_CAPTURE
-        *      Codec: SNDRV_PCM_STREAM_CAPTURE
-        */
-       if (!dai_link->c2c_params)
-               return stream;
-
-       /*
-        * [Codec2Codec]
-        *
-        * Playback
-        *      CPU  : SNDRV_PCM_STREAM_CAPTURE
-        *      Codec: SNDRV_PCM_STREAM_PLAYBACK
-        *
-        * Capture
-        *      CPU  : SNDRV_PCM_STREAM_PLAYBACK
-        *      Codec: SNDRV_PCM_STREAM_CAPTURE
-        */
-       if (stream == SNDRV_PCM_STREAM_CAPTURE)
-               return SNDRV_PCM_STREAM_PLAYBACK;
-
-       return SNDRV_PCM_STREAM_CAPTURE;
-}
-
 static void dapm_connect_dai_pair(struct snd_soc_card *card,
                                  struct snd_soc_pcm_runtime *rtd,
                                  struct snd_soc_dai *codec_dai,
        for_each_pcm_streams(stream) {
                int stream_cpu, stream_codec;
 
-               stream_cpu      = get_stream_cpu(dai_link, stream);
+               stream_cpu      = snd_soc_get_stream_cpu(dai_link, stream);
                stream_codec    = stream;
 
                /* connect BE DAI playback if widgets are valid */
 
                struct snd_soc_dai *codec_dai;
 
                /* Adapt stream for codec2codec links */
-               int cpu_capture = dai_link->c2c_params ?
-                       SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
-               int cpu_playback = dai_link->c2c_params ?
-                       SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
+               int cpu_capture  = snd_soc_get_stream_cpu(dai_link, SNDRV_PCM_STREAM_CAPTURE);
+               int cpu_playback = snd_soc_get_stream_cpu(dai_link, SNDRV_PCM_STREAM_PLAYBACK);
 
                for_each_rtd_codec_dais(rtd, i, codec_dai) {
                        if (dai_link->num_cpus == 1) {