aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-01 13:38:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-01 13:38:00 -0400
commit381cce59a9d937d686f0b205fa2641499c81c6e6 (patch)
treedd35c8c0f253aa6d0f56bb94bd12a2cd9d2594c9
parentbba2a5b8221850418846d62887d5de311df335f9 (diff)
parent83b033bd33a8b7b16f568e3432d3e27d03ef9c82 (diff)
Merge tag 'sound-4.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
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
-rw-r--r--sound/core/pcm_native.c6
-rw-r--r--sound/soc/codecs/rt5670.c2
-rw-r--r--sound/soc/generic/simple-card-utils.c2
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5672.c10
4 files changed, 17 insertions, 3 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 22995cb3bd44..cf0433f80067 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3064,6 +3064,7 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
3064{ 3064{
3065 snd_pcm_uframes_t *frames = arg; 3065 snd_pcm_uframes_t *frames = arg;
3066 snd_pcm_sframes_t result; 3066 snd_pcm_sframes_t result;
3067 int err;
3067 3068
3068 switch (cmd) { 3069 switch (cmd) {
3069 case SNDRV_PCM_IOCTL_FORWARD: 3070 case SNDRV_PCM_IOCTL_FORWARD:
@@ -3083,7 +3084,10 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
3083 case SNDRV_PCM_IOCTL_START: 3084 case SNDRV_PCM_IOCTL_START:
3084 return snd_pcm_start_lock_irq(substream); 3085 return snd_pcm_start_lock_irq(substream);
3085 case SNDRV_PCM_IOCTL_DRAIN: 3086 case SNDRV_PCM_IOCTL_DRAIN:
3086 return snd_pcm_drain(substream, NULL); 3087 snd_power_lock(substream->pcm->card);
3088 err = snd_pcm_drain(substream, NULL);
3089 snd_power_unlock(substream->pcm->card);
3090 return err;
3087 case SNDRV_PCM_IOCTL_DROP: 3091 case SNDRV_PCM_IOCTL_DROP:
3088 return snd_pcm_drop(substream); 3092 return snd_pcm_drop(substream);
3089 case SNDRV_PCM_IOCTL_DELAY: 3093 case SNDRV_PCM_IOCTL_DELAY:
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
index 0ec7985ed306..054b613cb0d0 100644
--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
@@ -567,7 +567,7 @@ int rt5670_set_jack_detect(struct snd_soc_codec *codec,
567 567
568 rt5670->jack = jack; 568 rt5670->jack = jack;
569 rt5670->hp_gpio.gpiod_dev = codec->dev; 569 rt5670->hp_gpio.gpiod_dev = codec->dev;
570 rt5670->hp_gpio.name = "headphone detect"; 570 rt5670->hp_gpio.name = "headset";
571 rt5670->hp_gpio.report = SND_JACK_HEADSET | 571 rt5670->hp_gpio.report = SND_JACK_HEADSET |
572 SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2; 572 SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2;
573 rt5670->hp_gpio.debounce_time = 150; 573 rt5670->hp_gpio.debounce_time = 150;
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 7d7ab4aee42e..d72f7d58102f 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -132,7 +132,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
132 132
133 /* Parse the card name from DT */ 133 /* Parse the card name from DT */
134 ret = snd_soc_of_parse_card_name(card, "label"); 134 ret = snd_soc_of_parse_card_name(card, "label");
135 if (ret < 0) { 135 if (ret < 0 || !card->name) {
136 char prop[128]; 136 char prop[128];
137 137
138 snprintf(prop, sizeof(prop), "%sname", prefix); 138 snprintf(prop, sizeof(prop), "%sname", prefix);
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c
index bc2a52de06a3..f597d5582223 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -184,6 +184,13 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream,
184 return 0; 184 return 0;
185} 185}
186 186
187static const struct acpi_gpio_params headset_gpios = { 0, 0, false };
188
189static const struct acpi_gpio_mapping cht_rt5672_gpios[] = {
190 { "headset-gpios", &headset_gpios, 1 },
191 {},
192};
193
187static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) 194static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
188{ 195{
189 int ret; 196 int ret;
@@ -191,6 +198,9 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
191 struct snd_soc_codec *codec = codec_dai->codec; 198 struct snd_soc_codec *codec = codec_dai->codec;
192 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); 199 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card);
193 200
201 if (devm_acpi_dev_add_driver_gpios(codec->dev, cht_rt5672_gpios))
202 dev_warn(runtime->dev, "Unable to add GPIO mapping table\n");
203
194 /* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */ 204 /* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
195 ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24); 205 ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24);
196 if (ret < 0) { 206 if (ret < 0) {