greybus: audio: Update parameters for gbaudio_module_update API
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Thu, 4 Aug 2016 09:44:32 +0000 (15:14 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 4 Aug 2016 17:07:30 +0000 (19:07 +0200)
Earlier, module path was enabled based on module's control switch e.g.
'SPK Amp switch'.  Thus widget's name was sufficient to parse and
identify the direction. Now individual modules' path will be enabled
based on AIF widget status. So, it is required to get complete widget
details, say w->type is used to identify direction (playback/capture)
and w->sname is used to identify module's DATA connection used for
communication via greybus.

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_codec.c
drivers/staging/greybus/audio_codec.h
drivers/staging/greybus/audio_topology.c

index a6f8437..e2a0c16 100644 (file)
@@ -333,10 +333,11 @@ static int gbaudio_module_disable_rx(struct gbaudio_codec_info *codec,
 }
 
 int gbaudio_module_update(struct gbaudio_codec_info *codec,
-                                const char *w_name,
-                                struct gbaudio_module_info *module, int enable)
+                         struct snd_soc_dapm_widget *w,
+                         struct gbaudio_module_info *module, int enable)
 {
        int stream, ret = 0;
+       const char *w_name = w->name;
 
        dev_dbg(module->dev, "%s:Module update %s sequence\n", w_name,
                enable ? "Enable":"Disable");
index 1646b2c..c5a8808 100644 (file)
@@ -206,9 +206,9 @@ int gbaudio_tplg_parse_data(struct gbaudio_module_info *module,
 void gbaudio_tplg_release(struct gbaudio_module_info *module);
 
 int gbaudio_module_update(struct gbaudio_codec_info *codec,
-                                const char *w_name,
-                                struct gbaudio_module_info *module,
-                                int enable);
+                         struct snd_soc_dapm_widget *w,
+                         struct gbaudio_module_info *module,
+                         int enable);
 int gbaudio_register_module(struct gbaudio_module_info *module);
 void gbaudio_unregister_module(struct gbaudio_module_info *module);
 
index 3c7c786..9375296 100644 (file)
@@ -960,14 +960,12 @@ static int gbaudio_widget_event(struct snd_soc_dapm_widget *w,
        case SND_SOC_DAPM_PRE_PMU:
                ret = gb_audio_gb_enable_widget(module->mgmt_connection, wid);
                if (!ret)
-                       ret = gbaudio_module_update(gbcodec, w->name, module,
-                                                   1);
+                       ret = gbaudio_module_update(gbcodec, w, module, 1);
                break;
        case SND_SOC_DAPM_POST_PMD:
                ret = gb_audio_gb_disable_widget(module->mgmt_connection, wid);
                if (!ret)
-                       ret = gbaudio_module_update(gbcodec, w->name, module,
-                                                   0);
+                       ret = gbaudio_module_update(gbcodec, w, module, 0);
                break;
        }
        if (ret)