]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'sound-4.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 1 Sep 2017 17:38:00 +0000 (10:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 1 Sep 2017 17:38:00 +0000 (10:38 -0700)
Pull sound fixes from Takashi Iwai:
 "Three regression fixes that should be addressed before the final
  release: a missing mutex call in OSS PCM emulation ioctl, ASoC rt5670
  headset detection breakage, and a regression in simple-card parser
  code"

* tag 'sound-4.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: simple_card_utils: fix fallback when "label" property isn't present
  ALSA: pcm: Fix power lock unbalance via OSS emulation
  ASoC: rt5670: Fix GPIO headset detection regression

sound/core/pcm_native.c
sound/soc/codecs/rt5670.c
sound/soc/generic/simple-card-utils.c
sound/soc/intel/boards/cht_bsw_rt5672.c

index 22995cb3bd447ee0744e142b9a6500b706d85853..cf0433f8006772392061b0cf95514a266a44f948 100644 (file)
@@ -3064,6 +3064,7 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
 {
        snd_pcm_uframes_t *frames = arg;
        snd_pcm_sframes_t result;
+       int err;
        
        switch (cmd) {
        case SNDRV_PCM_IOCTL_FORWARD:
@@ -3083,7 +3084,10 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
        case SNDRV_PCM_IOCTL_START:
                return snd_pcm_start_lock_irq(substream);
        case SNDRV_PCM_IOCTL_DRAIN:
-               return snd_pcm_drain(substream, NULL);
+               snd_power_lock(substream->pcm->card);
+               err = snd_pcm_drain(substream, NULL);
+               snd_power_unlock(substream->pcm->card);
+               return err;
        case SNDRV_PCM_IOCTL_DROP:
                return snd_pcm_drop(substream);
        case SNDRV_PCM_IOCTL_DELAY:
index 0ec7985ed306612db13bd6314ccc94733e835cce..054b613cb0d04c9dabe3e67e647448845708b29e 100644 (file)
@@ -567,7 +567,7 @@ int rt5670_set_jack_detect(struct snd_soc_codec *codec,
 
        rt5670->jack = jack;
        rt5670->hp_gpio.gpiod_dev = codec->dev;
-       rt5670->hp_gpio.name = "headphone detect";
+       rt5670->hp_gpio.name = "headset";
        rt5670->hp_gpio.report = SND_JACK_HEADSET |
                SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2;
        rt5670->hp_gpio.debounce_time = 150;
index 7d7ab4aee42e3ab133926f2dc5b11489b93a28ae..d72f7d58102f7666740866eb3b8b213604df4e54 100644 (file)
@@ -132,7 +132,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 
        /* Parse the card name from DT */
        ret = snd_soc_of_parse_card_name(card, "label");
-       if (ret < 0) {
+       if (ret < 0 || !card->name) {
                char prop[128];
 
                snprintf(prop, sizeof(prop), "%sname", prefix);
index bc2a52de06a39729ac6aae83c38e08e822575445..f597d558222388e0b52302395ecfbf22a5a127d7 100644 (file)
@@ -184,6 +184,13 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
+static const struct acpi_gpio_params headset_gpios = { 0, 0, false };
+
+static const struct acpi_gpio_mapping cht_rt5672_gpios[] = {
+       { "headset-gpios", &headset_gpios, 1 },
+       {},
+};
+
 static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 {
        int ret;
@@ -191,6 +198,9 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
        struct snd_soc_codec *codec = codec_dai->codec;
        struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
 
+       if (devm_acpi_dev_add_driver_gpios(codec->dev, cht_rt5672_gpios))
+               dev_warn(runtime->dev, "Unable to add GPIO mapping table\n");
+
        /* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
        ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24);
        if (ret < 0) {