diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-05-29 12:30:37 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-05-29 12:34:57 +0200 |
commit | 5192ee82af6580a62c63d57461f4a16ff644cde5 (patch) | |
tree | 88cba0be4c9ddc7cc99c35cae014425c555fc14b | |
parent | 20aa20122d2fa9874600c97c23b28d0413abbca4 (diff) | |
download | hda-emu-5192ee82af6580a62c63d57461f4a16ff644cde5.tar.gz |
Fix the missing jack support
It's still incomplete, the duplicated ctls need to be resolved later.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | include/sound/jack.h | 4 | ||||
-rw-r--r-- | snd-wrapper.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/sound/jack.h b/include/sound/jack.h index 0e8ed57..91ccacf 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h @@ -28,6 +28,7 @@ enum snd_jack_types { struct snd_jack { /*struct input_dev *input_dev;*/ + struct snd_card *card; int registered; int type; const char *id; @@ -35,6 +36,9 @@ struct snd_jack { unsigned int key[6]; /* Keep in sync with definitions above */ void *private_data; void (*private_free)(struct snd_jack *); +#ifdef NEW_JACK_API + struct snd_kcontrol *kctl; /* XXX assuming 1:1 mapping */ +#endif }; struct device; diff --git a/snd-wrapper.c b/snd-wrapper.c index 1bd629e..c5bb3f3 100644 --- a/snd-wrapper.c +++ b/snd-wrapper.c @@ -369,9 +369,14 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, jp->id = strdup(id); if (!jp->id) return -ENOMEM; + jp->card = card; jp->type = type; hda_log(HDA_LOG_INFO, "JACK created %s, type %d\n", id, type); *jack = jp; +#ifdef NEW_JACK_API + jp->kctl = snd_kctl_jack_new(id, 0, NULL); + snd_ctl_add(card, jp->kctl); +#endif return 0; } @@ -383,6 +388,9 @@ void snd_jack_set_parent(struct snd_jack *jack, struct device *parent) void snd_jack_report(struct snd_jack *jack, int status) { hda_log(HDA_LOG_INFO, "JACK report %s, status %d\n", jack->id, status); +#ifdef NEW_JACK_API + snd_kctl_jack_report(jack->card, jack->kctl, status); +#endif } /* |