greybus: audio: Remove unnecessary num_jack field from module_info
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Thu, 1 Sep 2016 06:08:38 +0000 (11:38 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 2 Sep 2016 12:13:39 +0000 (14:13 +0200)
snd_jack will be registered based on real capabilities shared by
module's FW instead of parsing widgets and register it with fixed
capabilities. Remove module_info->num_jack, since it is no more
required.

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 6ebde18..810ac62 100644 (file)
@@ -707,15 +707,6 @@ static int gbaudio_init_jack(struct gbaudio_module_info *module,
 {
        int ret;
 
-       if (!module->num_jacks)
-               return 0;
-
-       /* register jack(s) in case any */
-       if (module->num_jacks > 1) {
-               dev_err(module->dev, "Currently supports max=1 jack\n");
-               return -EINVAL;
-       }
-
        snprintf(module->jack_name, NAME_SIZE, "GB %d Headset Jack",
                 module->dev_id);
        ret = snd_soc_jack_new(codec, module->jack_name, GBCODEC_JACK_MASK,
index 0153809..5a397b0 100644 (file)
@@ -175,7 +175,6 @@ struct gbaudio_module_info {
        /* jack related */
        char jack_name[NAME_SIZE];
        char button_name[NAME_SIZE];
-       int num_jacks;
        int jack_type;
        int button_status;
        struct snd_soc_jack headset_jack;
index e54078a..e2fc186 100644 (file)
@@ -1065,7 +1065,6 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module,
        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;