From: Vaibhav Agarwal Date: Thu, 4 Aug 2016 09:44:32 +0000 (+0530) Subject: greybus: audio: Update parameters for gbaudio_module_update API X-Git-Tag: v4.14-rc1~2366^2~378^2~21^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ffca62a051c3e1722bcaf6a367b419e6e5e40e0;p=platform%2Fkernel%2Flinux-rpi.git greybus: audio: Update parameters for gbaudio_module_update API 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 Reviewed-by: Mark Greer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index a6f8437..e2a0c163 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -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"); diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index 1646b2c..c5a8808 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -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); diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 3c7c786..9375296 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -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)