aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/audio_topology.c
diff options
context:
space:
mode:
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>2016-03-30 13:23:56 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-04-05 09:39:22 -0400
commit89de9a06213240b9266f9f368a867cf90d0024bf (patch)
tree4b32edc0f63e07638a3581b827d4c58fa3ccef44 /drivers/staging/greybus/audio_topology.c
parentgreybus: audio_manager: Split device type into i/p & o/p devices (diff)
downloadlinux-dev-89de9a06213240b9266f9f368a867cf90d0024bf.tar.xz
linux-dev-89de9a06213240b9266f9f368a867cf90d0024bf.zip
greybus: audio: Update device type based on widget types
Device type info shared to above HAL is currently hard coded to SPK only. Actual device type is identifed while parsing widget types from topology FW shared by codec module. 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>
Diffstat (limited to 'drivers/staging/greybus/audio_topology.c')
-rw-r--r--drivers/staging/greybus/audio_topology.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c
index 79161c1b74ce..e423e6d16a25 100644
--- a/drivers/staging/greybus/audio_topology.c
+++ b/drivers/staging/greybus/audio_topology.c
@@ -665,15 +665,20 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module,
case snd_soc_dapm_spk:
*dw = (struct snd_soc_dapm_widget)
SND_SOC_DAPM_SPK(w->name, gbcodec_event_spk);
+ module->op_devices |= GBAUDIO_DEVICE_OUT_SPEAKER;
break;
case snd_soc_dapm_hp:
*dw = (struct snd_soc_dapm_widget)
SND_SOC_DAPM_HP(w->name, gbcodec_event_hp);
module->num_jacks++;
+ module->op_devices |= (GBAUDIO_DEVICE_OUT_WIRED_HEADSET
+ | GBAUDIO_DEVICE_OUT_WIRED_HEADPHONE);
+ module->ip_devices |= GBAUDIO_DEVICE_IN_WIRED_HEADSET;
break;
case snd_soc_dapm_mic:
*dw = (struct snd_soc_dapm_widget)
SND_SOC_DAPM_MIC(w->name, gbcodec_event_int_mic);
+ module->ip_devices |= GBAUDIO_DEVICE_IN_BUILTIN_MIC;
break;
case snd_soc_dapm_output:
*dw = (struct snd_soc_dapm_widget)SND_SOC_DAPM_OUTPUT(w->name);