Skip to content

Commit 2848551

Browse files
committed
Merge tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small patches, mostly for old and new regressions and device-specific fixes. - Regression fixes regarding ALSA core SG-buffer helpers - Regression fix for Realtek HD-audio mutex deadlock - Regression fix for USB-audio PM resume error - More coverage of ASoC core control API notification fixes - Old regression fixes for HD-audio probe mask - Fixes for ASoC Realtek codec work handling - Other device-specific quirks / fixes" * tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits) ASoC: intel: skylake: Set max DMA segment size ASoC: SOF: hda: Set max DMA segment size ALSA: hda: Set max DMA segment size ALSA: hda/realtek: Fix deadlock by COEF mutex ALSA: usb-audio: Don't abort resume upon errors ALSA: hda: Fix missing codec probe on Shenker Dock 15 ALSA: hda: Fix regression on forced probe mask option ALSA: hda/realtek: Add quirk for Legion Y9000X 2019 ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra ASoC: wm_adsp: Correct control read size when parsing compressed buffer ASoC: qcom: Actually clear DMA interrupt register for HDMI ALSA: memalloc: invalidate SG pages before sync ALSA: memalloc: Fix dma_need_sync() checks MAINTAINERS: update cros_ec_codec maintainers ASoC: rt5682: do not block workqueue if card is unbound ASoC: rt5668: do not block workqueue if card is unbound ASoC: rt5682s: do not block workqueue if card is unbound ASoC: tas2770: Insert post reset delay ASoC: Revert "ASoC: mediatek: Check for error clk pointer" ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver ...
2 parents 45a98a7 + c22a808 commit 2848551

19 files changed

Lines changed: 118 additions & 75 deletions

File tree

Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: Audio codec controlled by ChromeOS EC
88

99
maintainers:
1010
- Cheng-Yi Chiang <cychiang@chromium.org>
11+
- Tzung-Bi Shih <tzungbi@google.com>
1112

1213
description: |
1314
Google's ChromeOS EC codec is a digital mic codec provided by the

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,6 +4547,7 @@ F: drivers/platform/chrome/
45474547

45484548
CHROMEOS EC CODEC DRIVER
45494549
M: Cheng-Yi Chiang <cychiang@chromium.org>
4550+
M: Tzung-Bi Shih <tzungbi@google.com>
45504551
R: Guenter Roeck <groeck@chromium.org>
45514552
S: Maintained
45524553
F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

drivers/soc/mediatek/mtk-scpsys.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
411411
return ret;
412412
}
413413

414-
static int init_clks(struct platform_device *pdev, struct clk **clk)
414+
static void init_clks(struct platform_device *pdev, struct clk **clk)
415415
{
416416
int i;
417417

418-
for (i = CLK_NONE + 1; i < CLK_MAX; i++) {
418+
for (i = CLK_NONE + 1; i < CLK_MAX; i++)
419419
clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
420-
if (IS_ERR(clk[i]))
421-
return PTR_ERR(clk[i]);
422-
}
423-
424-
return 0;
425420
}
426421

427422
static struct scp *init_scp(struct platform_device *pdev,
@@ -431,7 +426,7 @@ static struct scp *init_scp(struct platform_device *pdev,
431426
{
432427
struct genpd_onecell_data *pd_data;
433428
struct resource *res;
434-
int i, j, ret;
429+
int i, j;
435430
struct scp *scp;
436431
struct clk *clk[CLK_MAX];
437432

@@ -486,9 +481,7 @@ static struct scp *init_scp(struct platform_device *pdev,
486481

487482
pd_data->num_domains = num;
488483

489-
ret = init_clks(pdev, clk);
490-
if (ret)
491-
return ERR_PTR(ret);
484+
init_clks(pdev, clk);
492485

493486
for (i = 0; i < num; i++) {
494487
struct scp_domain *scpd = &scp->domains[i];

sound/core/memalloc.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
511511
DEFAULT_GFP, 0);
512512
if (!sgt)
513513
return NULL;
514-
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir);
514+
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev,
515+
sg_dma_address(sgt->sgl));
515516
p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt);
516517
if (p)
517518
dmab->private_data = sgt;
@@ -540,9 +541,9 @@ static void snd_dma_noncontig_sync(struct snd_dma_buffer *dmab,
540541
if (mode == SNDRV_DMA_SYNC_CPU) {
541542
if (dmab->dev.dir == DMA_TO_DEVICE)
542543
return;
544+
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
543545
dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data,
544546
dmab->dev.dir);
545-
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
546547
} else {
547548
if (dmab->dev.dir == DMA_FROM_DEVICE)
548549
return;
@@ -671,9 +672,13 @@ static const struct snd_malloc_ops snd_dma_sg_wc_ops = {
671672
*/
672673
static void *snd_dma_noncoherent_alloc(struct snd_dma_buffer *dmab, size_t size)
673674
{
674-
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir);
675-
return dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
676-
dmab->dev.dir, DEFAULT_GFP);
675+
void *p;
676+
677+
p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
678+
dmab->dev.dir, DEFAULT_GFP);
679+
if (p)
680+
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr);
681+
return p;
677682
}
678683

679684
static void snd_dma_noncoherent_free(struct snd_dma_buffer *dmab)

sound/pci/hda/hda_intel.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,7 @@ static const struct snd_pci_quirk probe_mask_list[] = {
16151615
/* forced codec slots */
16161616
SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103),
16171617
SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103),
1618+
SND_PCI_QUIRK(0x1558, 0x0351, "Schenker Dock 15", 0x105),
16181619
/* WinFast VP200 H (Teradici) user reported broken communication */
16191620
SND_PCI_QUIRK(0x3a21, 0x040d, "WinFast VP200 H", 0x101),
16201621
{}
@@ -1798,8 +1799,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
17981799

17991800
assign_position_fix(chip, check_position_fix(chip, position_fix[dev]));
18001801

1801-
check_probe_mask(chip, dev);
1802-
18031802
if (single_cmd < 0) /* allow fallback to single_cmd at errors */
18041803
chip->fallback_to_single_cmd = 1;
18051804
else /* explicitly set to single_cmd or not */
@@ -1825,6 +1824,8 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
18251824
chip->bus.core.needs_damn_long_delay = 1;
18261825
}
18271826

1827+
check_probe_mask(chip, dev);
1828+
18281829
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
18291830
if (err < 0) {
18301831
dev_err(card->dev, "Error creating device [card]!\n");
@@ -1940,6 +1941,7 @@ static int azx_first_init(struct azx *chip)
19401941
dma_bits = 32;
19411942
if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(dma_bits)))
19421943
dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
1944+
dma_set_max_seg_size(&pci->dev, UINT_MAX);
19431945

19441946
/* read number of streams from GCAP register instead of using
19451947
* hardcoded value

sound/pci/hda/patch_realtek.c

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@ struct alc_spec {
138138
* COEF access helper functions
139139
*/
140140

141+
static void coef_mutex_lock(struct hda_codec *codec)
142+
{
143+
struct alc_spec *spec = codec->spec;
144+
145+
snd_hda_power_up_pm(codec);
146+
mutex_lock(&spec->coef_mutex);
147+
}
148+
149+
static void coef_mutex_unlock(struct hda_codec *codec)
150+
{
151+
struct alc_spec *spec = codec->spec;
152+
153+
mutex_unlock(&spec->coef_mutex);
154+
snd_hda_power_down_pm(codec);
155+
}
156+
141157
static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
142158
unsigned int coef_idx)
143159
{
@@ -151,12 +167,11 @@ static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
151167
static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
152168
unsigned int coef_idx)
153169
{
154-
struct alc_spec *spec = codec->spec;
155170
unsigned int val;
156171

157-
mutex_lock(&spec->coef_mutex);
172+
coef_mutex_lock(codec);
158173
val = __alc_read_coefex_idx(codec, nid, coef_idx);
159-
mutex_unlock(&spec->coef_mutex);
174+
coef_mutex_unlock(codec);
160175
return val;
161176
}
162177

@@ -173,11 +188,9 @@ static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
173188
static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
174189
unsigned int coef_idx, unsigned int coef_val)
175190
{
176-
struct alc_spec *spec = codec->spec;
177-
178-
mutex_lock(&spec->coef_mutex);
191+
coef_mutex_lock(codec);
179192
__alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
180-
mutex_unlock(&spec->coef_mutex);
193+
coef_mutex_unlock(codec);
181194
}
182195

183196
#define alc_write_coef_idx(codec, coef_idx, coef_val) \
@@ -198,11 +211,9 @@ static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
198211
unsigned int coef_idx, unsigned int mask,
199212
unsigned int bits_set)
200213
{
201-
struct alc_spec *spec = codec->spec;
202-
203-
mutex_lock(&spec->coef_mutex);
214+
coef_mutex_lock(codec);
204215
__alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
205-
mutex_unlock(&spec->coef_mutex);
216+
coef_mutex_unlock(codec);
206217
}
207218

208219
#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
@@ -235,17 +246,15 @@ struct coef_fw {
235246
static void alc_process_coef_fw(struct hda_codec *codec,
236247
const struct coef_fw *fw)
237248
{
238-
struct alc_spec *spec = codec->spec;
239-
240-
mutex_lock(&spec->coef_mutex);
249+
coef_mutex_lock(codec);
241250
for (; fw->nid; fw++) {
242251
if (fw->mask == (unsigned short)-1)
243252
__alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
244253
else
245254
__alc_update_coefex_idx(codec, fw->nid, fw->idx,
246255
fw->mask, fw->val);
247256
}
248-
mutex_unlock(&spec->coef_mutex);
257+
coef_mutex_unlock(codec);
249258
}
250259

251260
/*
@@ -9170,6 +9179,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
91709179
SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
91719180
SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
91729181
SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9182+
SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
91739183
SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
91749184
SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
91759185
SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),

sound/soc/amd/acp/acp-mach.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/gpio/consumer.h>
2222

2323
#define EN_SPKR_GPIO_GB 0x11F
24-
#define EN_SPKR_GPIO_NK 0x146
2524
#define EN_SPKR_GPIO_NONE -EINVAL
2625

2726
enum be_id {

sound/soc/amd/acp/acp-sof-mach.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = {
3737
.hs_codec_id = RT5682,
3838
.amp_codec_id = MAX98360A,
3939
.dmic_codec_id = DMIC,
40-
.gpio_spkr_en = EN_SPKR_GPIO_NK,
40+
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
4141
};
4242

4343
static struct acp_card_drvdata sof_rt5682s_max_data = {
@@ -47,7 +47,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
4747
.hs_codec_id = RT5682S,
4848
.amp_codec_id = MAX98360A,
4949
.dmic_codec_id = DMIC,
50-
.gpio_spkr_en = EN_SPKR_GPIO_NK,
50+
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
5151
};
5252

5353
static const struct snd_kcontrol_new acp_controls[] = {

sound/soc/codecs/rt5668.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,11 +1022,13 @@ static void rt5668_jack_detect_handler(struct work_struct *work)
10221022
container_of(work, struct rt5668_priv, jack_detect_work.work);
10231023
int val, btn_type;
10241024

1025-
while (!rt5668->component)
1026-
usleep_range(10000, 15000);
1027-
1028-
while (!rt5668->component->card->instantiated)
1029-
usleep_range(10000, 15000);
1025+
if (!rt5668->component || !rt5668->component->card ||
1026+
!rt5668->component->card->instantiated) {
1027+
/* card not yet ready, try later */
1028+
mod_delayed_work(system_power_efficient_wq,
1029+
&rt5668->jack_detect_work, msecs_to_jiffies(15));
1030+
return;
1031+
}
10301032

10311033
mutex_lock(&rt5668->calibrate_mutex);
10321034

sound/soc/codecs/rt5682.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,11 +1092,13 @@ void rt5682_jack_detect_handler(struct work_struct *work)
10921092
struct snd_soc_dapm_context *dapm;
10931093
int val, btn_type;
10941094

1095-
while (!rt5682->component)
1096-
usleep_range(10000, 15000);
1097-
1098-
while (!rt5682->component->card->instantiated)
1099-
usleep_range(10000, 15000);
1095+
if (!rt5682->component || !rt5682->component->card ||
1096+
!rt5682->component->card->instantiated) {
1097+
/* card not yet ready, try later */
1098+
mod_delayed_work(system_power_efficient_wq,
1099+
&rt5682->jack_detect_work, msecs_to_jiffies(15));
1100+
return;
1101+
}
11001102

11011103
dapm = snd_soc_component_get_dapm(rt5682->component);
11021104

0 commit comments

Comments
 (0)