Skip to content

Commit d3bbc28

Browse files
committed
Merge tag 'asoc-fix-v5.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.8 An awful lot of mostly small fixes here, mainly for x86 based platforms and the CODEC drivers mainly used on them. For the most part this is either minor device specific stuff which seems to come from detailed testing or robustness against errors which comes from people having done some fuzzing runs aginst the topology code.
2 parents 60379ba + fe0a530 commit d3bbc28

File tree

27 files changed

+262
-91
lines changed

27 files changed

+262
-91
lines changed

Documentation/devicetree/bindings/sound/simple-card.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ examples:
380380
- |
381381
sound {
382382
compatible = "simple-audio-card";
383+
#address-cells = <1>;
384+
#size-cells = <0>;
383385
384386
simple-audio-card,name = "rsnd-ak4643";
385387
simple-audio-card,format = "left_j";
@@ -393,10 +395,12 @@ examples:
393395
"ak4642 Playback", "DAI1 Playback";
394396
395397
dpcmcpu: simple-audio-card,cpu@0 {
398+
reg = <0>;
396399
sound-dai = <&rcar_sound 0>;
397400
};
398401
399402
simple-audio-card,cpu@1 {
403+
reg = <1>;
400404
sound-dai = <&rcar_sound 1>;
401405
};
402406
@@ -420,6 +424,8 @@ examples:
420424
- |
421425
sound {
422426
compatible = "simple-audio-card";
427+
#address-cells = <1>;
428+
#size-cells = <0>;
423429
424430
simple-audio-card,routing =
425431
"pcm3168a Playback", "DAI1 Playback",
@@ -428,6 +434,7 @@ examples:
428434
"pcm3168a Playback", "DAI4 Playback";
429435
430436
simple-audio-card,dai-link@0 {
437+
reg = <0>;
431438
format = "left_j";
432439
bitclock-master = <&sndcpu0>;
433440
frame-master = <&sndcpu0>;
@@ -441,22 +448,23 @@ examples:
441448
};
442449
443450
simple-audio-card,dai-link@1 {
451+
reg = <1>;
444452
format = "i2s";
445453
bitclock-master = <&sndcpu1>;
446454
frame-master = <&sndcpu1>;
447455
448456
convert-channels = <8>; /* TDM Split */
449457
450-
sndcpu1: cpu@0 {
458+
sndcpu1: cpu0 {
451459
sound-dai = <&rcar_sound 1>;
452460
};
453-
cpu@1 {
461+
cpu1 {
454462
sound-dai = <&rcar_sound 2>;
455463
};
456-
cpu@2 {
464+
cpu2 {
457465
sound-dai = <&rcar_sound 3>;
458466
};
459-
cpu@3 {
467+
cpu3 {
460468
sound-dai = <&rcar_sound 4>;
461469
};
462470
codec {
@@ -468,6 +476,7 @@ examples:
468476
};
469477
470478
simple-audio-card,dai-link@2 {
479+
reg = <2>;
471480
format = "i2s";
472481
bitclock-master = <&sndcpu2>;
473482
frame-master = <&sndcpu2>;

MAINTAINERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6876,6 +6876,7 @@ M: Timur Tabi <[email protected]>
68766876
M: Nicolin Chen <[email protected]>
68776877
M: Xiubo Li <[email protected]>
68786878
R: Fabio Estevam <[email protected]>
6879+
R: Shengjiu Wang <[email protected]>
68796880
L: [email protected] (moderated for non-subscribers)
68806881
68816882
S: Maintained
@@ -11183,17 +11184,17 @@ F: drivers/iio/adc/at91-sama5d2_adc.c
1118311184
F: include/dt-bindings/iio/adc/at91-sama5d2_adc.h
1118411185

1118511186
MICROCHIP SAMA5D2-COMPATIBLE SHUTDOWN CONTROLLER
11186-
M: Nicolas Ferre <nicolas.ferre@microchip.com>
11187+
M: Claudiu Beznea <claudiu.beznea@microchip.com>
1118711188
S: Supported
1118811189
F: drivers/power/reset/at91-sama5d2_shdwc.c
1118911190

1119011191
MICROCHIP SPI DRIVER
11191-
M: Nicolas Ferre <nicolas.ferre@microchip.com>
11192+
M: Tudor Ambarus <tudor.ambarus@microchip.com>
1119211193
S: Supported
1119311194
F: drivers/spi/spi-atmel.*
1119411195

1119511196
MICROCHIP SSC DRIVER
11196-
M: Nicolas Ferre <nicolas.ferre@microchip.com>
11197+
M: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
1119711198
L: [email protected] (moderated for non-subscribers)
1119811199
S: Supported
1119911200
F: drivers/misc/atmel-ssc.c

include/sound/rt5670.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ struct rt5670_platform_data {
1212
int jd_mode;
1313
bool in2_diff;
1414
bool dev_gpio;
15+
bool gpio1_is_ext_spk_en;
1516

1617
bool dmic_en;
1718
unsigned int dmic1_data_pin;

include/sound/soc-dai.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai);
161161
int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
162162
struct snd_soc_pcm_runtime *rtd, int num);
163163
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream);
164+
void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link);
164165
void snd_soc_dai_action(struct snd_soc_dai *dai,
165166
int stream, int action);
166167
static inline void snd_soc_dai_activate(struct snd_soc_dai *dai,

include/sound/soc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ int devm_snd_soc_register_component(struct device *dev,
444444
const struct snd_soc_component_driver *component_driver,
445445
struct snd_soc_dai_driver *dai_drv, int num_dai);
446446
void snd_soc_unregister_component(struct device *dev);
447+
void snd_soc_unregister_component_by_driver(struct device *dev,
448+
const struct snd_soc_component_driver *component_driver);
447449
struct snd_soc_component *snd_soc_lookup_component_nolocked(struct device *dev,
448450
const char *driver_name);
449451
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,

sound/soc/amd/raven/pci-acp3x.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ static int snd_acp3x_probe(struct pci_dev *pci,
232232
}
233233
pm_runtime_set_autosuspend_delay(&pci->dev, 2000);
234234
pm_runtime_use_autosuspend(&pci->dev);
235-
pm_runtime_set_active(&pci->dev);
236235
pm_runtime_put_noidle(&pci->dev);
237-
pm_runtime_enable(&pci->dev);
238236
pm_runtime_allow(&pci->dev);
239237
return 0;
240238

@@ -303,7 +301,7 @@ static void snd_acp3x_remove(struct pci_dev *pci)
303301
ret = acp3x_deinit(adata->acp3x_base);
304302
if (ret)
305303
dev_err(&pci->dev, "ACP de-init failed\n");
306-
pm_runtime_disable(&pci->dev);
304+
pm_runtime_forbid(&pci->dev);
307305
pm_runtime_get_noresume(&pci->dev);
308306
pci_disable_msi(pci);
309307
pci_release_regions(pci);

sound/soc/codecs/max98373.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -779,13 +779,6 @@ static int max98373_probe(struct snd_soc_component *component)
779779
regmap_write(max98373->regmap,
780780
MAX98373_R202A_PCM_TO_SPK_MONO_MIX_2,
781781
0x1);
782-
/* Set inital volume (0dB) */
783-
regmap_write(max98373->regmap,
784-
MAX98373_R203D_AMP_DIG_VOL_CTRL,
785-
0x00);
786-
regmap_write(max98373->regmap,
787-
MAX98373_R203E_AMP_PATH_GAIN,
788-
0x00);
789782
/* Enable DC blocker */
790783
regmap_write(max98373->regmap,
791784
MAX98373_R203F_AMP_DSP_CFG,
@@ -869,7 +862,6 @@ static const struct snd_soc_component_driver soc_codec_dev_max98373 = {
869862
.num_dapm_widgets = ARRAY_SIZE(max98373_dapm_widgets),
870863
.dapm_routes = max98373_audio_map,
871864
.num_dapm_routes = ARRAY_SIZE(max98373_audio_map),
872-
.idle_bias_on = 1,
873865
.use_pmdown_time = 1,
874866
.endianness = 1,
875867
.non_legacy_dai_naming = 1,

sound/soc/codecs/rt286.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
272272
regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf);
273273
*mic = buf & 0x80000000;
274274
}
275-
if (!*mic) {
275+
276+
if (!*hp) {
276277
snd_soc_dapm_disable_pin(dapm, "HV");
277278
snd_soc_dapm_disable_pin(dapm, "VREF");
278-
}
279-
if (!*hp)
280279
snd_soc_dapm_disable_pin(dapm, "LDO1");
281-
snd_soc_dapm_sync(dapm);
280+
snd_soc_dapm_sync(dapm);
281+
}
282282

283283
return 0;
284284
}

sound/soc/codecs/rt5670.c

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@
3131
#include "rt5670.h"
3232
#include "rt5670-dsp.h"
3333

34-
#define RT5670_DEV_GPIO BIT(0)
35-
#define RT5670_IN2_DIFF BIT(1)
36-
#define RT5670_DMIC_EN BIT(2)
37-
#define RT5670_DMIC1_IN2P BIT(3)
38-
#define RT5670_DMIC1_GPIO6 BIT(4)
39-
#define RT5670_DMIC1_GPIO7 BIT(5)
40-
#define RT5670_DMIC2_INR BIT(6)
41-
#define RT5670_DMIC2_GPIO8 BIT(7)
42-
#define RT5670_DMIC3_GPIO5 BIT(8)
43-
#define RT5670_JD_MODE1 BIT(9)
44-
#define RT5670_JD_MODE2 BIT(10)
45-
#define RT5670_JD_MODE3 BIT(11)
34+
#define RT5670_DEV_GPIO BIT(0)
35+
#define RT5670_IN2_DIFF BIT(1)
36+
#define RT5670_DMIC_EN BIT(2)
37+
#define RT5670_DMIC1_IN2P BIT(3)
38+
#define RT5670_DMIC1_GPIO6 BIT(4)
39+
#define RT5670_DMIC1_GPIO7 BIT(5)
40+
#define RT5670_DMIC2_INR BIT(6)
41+
#define RT5670_DMIC2_GPIO8 BIT(7)
42+
#define RT5670_DMIC3_GPIO5 BIT(8)
43+
#define RT5670_JD_MODE1 BIT(9)
44+
#define RT5670_JD_MODE2 BIT(10)
45+
#define RT5670_JD_MODE3 BIT(11)
46+
#define RT5670_GPIO1_IS_EXT_SPK_EN BIT(12)
4647

4748
static unsigned long rt5670_quirk;
4849
static unsigned int quirk_override;
@@ -602,9 +603,9 @@ int rt5670_set_jack_detect(struct snd_soc_component *component,
602603
EXPORT_SYMBOL_GPL(rt5670_set_jack_detect);
603604

604605
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
605-
static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
606+
static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
606607
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
607-
static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
608+
static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
608609
static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
609610

610611
/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
@@ -1447,6 +1448,33 @@ static int rt5670_hp_event(struct snd_soc_dapm_widget *w,
14471448
return 0;
14481449
}
14491450

1451+
static int rt5670_spk_event(struct snd_soc_dapm_widget *w,
1452+
struct snd_kcontrol *kcontrol, int event)
1453+
{
1454+
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
1455+
struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component);
1456+
1457+
if (!rt5670->pdata.gpio1_is_ext_spk_en)
1458+
return 0;
1459+
1460+
switch (event) {
1461+
case SND_SOC_DAPM_POST_PMU:
1462+
regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL2,
1463+
RT5670_GP1_OUT_MASK, RT5670_GP1_OUT_HI);
1464+
break;
1465+
1466+
case SND_SOC_DAPM_PRE_PMD:
1467+
regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL2,
1468+
RT5670_GP1_OUT_MASK, RT5670_GP1_OUT_LO);
1469+
break;
1470+
1471+
default:
1472+
return 0;
1473+
}
1474+
1475+
return 0;
1476+
}
1477+
14501478
static int rt5670_bst1_event(struct snd_soc_dapm_widget *w,
14511479
struct snd_kcontrol *kcontrol, int event)
14521480
{
@@ -1860,7 +1888,9 @@ static const struct snd_soc_dapm_widget rt5670_specific_dapm_widgets[] = {
18601888
};
18611889

18621890
static const struct snd_soc_dapm_widget rt5672_specific_dapm_widgets[] = {
1863-
SND_SOC_DAPM_PGA("SPO Amp", SND_SOC_NOPM, 0, 0, NULL, 0),
1891+
SND_SOC_DAPM_PGA_E("SPO Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
1892+
rt5670_spk_event, SND_SOC_DAPM_PRE_PMD |
1893+
SND_SOC_DAPM_POST_PMU),
18641894
SND_SOC_DAPM_OUTPUT("SPOLP"),
18651895
SND_SOC_DAPM_OUTPUT("SPOLN"),
18661896
SND_SOC_DAPM_OUTPUT("SPORP"),
@@ -2857,14 +2887,14 @@ static const struct dmi_system_id dmi_platform_intel_quirks[] = {
28572887
},
28582888
{
28592889
.callback = rt5670_quirk_cb,
2860-
.ident = "Lenovo Thinkpad Tablet 10",
2890+
.ident = "Lenovo Miix 2 10",
28612891
.matches = {
28622892
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
28632893
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
28642894
},
28652895
.driver_data = (unsigned long *)(RT5670_DMIC_EN |
28662896
RT5670_DMIC1_IN2P |
2867-
RT5670_DEV_GPIO |
2897+
RT5670_GPIO1_IS_EXT_SPK_EN |
28682898
RT5670_JD_MODE2),
28692899
},
28702900
{
@@ -2924,6 +2954,10 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
29242954
rt5670->pdata.dev_gpio = true;
29252955
dev_info(&i2c->dev, "quirk dev_gpio\n");
29262956
}
2957+
if (rt5670_quirk & RT5670_GPIO1_IS_EXT_SPK_EN) {
2958+
rt5670->pdata.gpio1_is_ext_spk_en = true;
2959+
dev_info(&i2c->dev, "quirk GPIO1 is external speaker enable\n");
2960+
}
29272961
if (rt5670_quirk & RT5670_IN2_DIFF) {
29282962
rt5670->pdata.in2_diff = true;
29292963
dev_info(&i2c->dev, "quirk IN2_DIFF\n");
@@ -3023,6 +3057,13 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
30233057
RT5670_GP1_PF_MASK, RT5670_GP1_PF_OUT);
30243058
}
30253059

3060+
if (rt5670->pdata.gpio1_is_ext_spk_en) {
3061+
regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1,
3062+
RT5670_GP1_PIN_MASK, RT5670_GP1_PIN_GPIO1);
3063+
regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL2,
3064+
RT5670_GP1_PF_MASK, RT5670_GP1_PF_OUT);
3065+
}
3066+
30263067
if (rt5670->pdata.jd_mode) {
30273068
regmap_update_bits(rt5670->regmap, RT5670_GLB_CLK,
30283069
RT5670_SCLK_SRC_MASK, RT5670_SCLK_SRC_RCCLK);

sound/soc/codecs/rt5670.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@
757757
#define RT5670_PWR_VREF2_BIT 4
758758
#define RT5670_PWR_FV2 (0x1 << 3)
759759
#define RT5670_PWR_FV2_BIT 3
760-
#define RT5670_LDO_SEL_MASK (0x3)
760+
#define RT5670_LDO_SEL_MASK (0x7)
761761
#define RT5670_LDO_SEL_SFT 0
762762

763763
/* Power Management for Analog 2 (0x64) */

0 commit comments

Comments
 (0)