Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ffca62a authored by Vaibhav Agarwal's avatar Vaibhav Agarwal Committed by Greg Kroah-Hartman
Browse files

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: default avatarVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: default avatarMark Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 15681598
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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 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");
+3 −3
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ 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 snd_soc_dapm_widget *w,
			  struct gbaudio_module_info *module,
			  int enable);
int gbaudio_register_module(struct gbaudio_module_info *module);
+2 −4
Original line number Diff line number Diff line
@@ -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)