Skip to content

Commit f850a2b

Browse files
committed
Merge tag 'asoc-fix-v6.1-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.1 Quite a few fixes here, a lot driver specific, plus some new quirks. There was a bit of a mess with the runtime PM handling due to some confusion in the API there which resulted in a number of commits and reverts but that should all be stable now.
2 parents 50895a5 + e944167 commit f850a2b

31 files changed

+270
-69
lines changed

include/sound/simple_card_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ void asoc_simple_convert_fixup(struct asoc_simple_data *data,
177177
struct snd_pcm_hw_params *params);
178178
void asoc_simple_parse_convert(struct device_node *np, char *prefix,
179179
struct asoc_simple_data *data);
180+
bool asoc_simple_is_convert_required(const struct asoc_simple_data *data);
180181

181182
int asoc_simple_parse_routing(struct snd_soc_card *card,
182183
char *prefix);

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ static struct snd_soc_card acp6x_card = {
4545
};
4646

4747
static const struct dmi_system_id yc_acp_quirk_table[] = {
48+
{
49+
.driver_data = &acp6x_card,
50+
.matches = {
51+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
52+
DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
53+
}
54+
},
55+
{
56+
.driver_data = &acp6x_card,
57+
.matches = {
58+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
59+
DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
60+
}
61+
},
62+
{
63+
.driver_data = &acp6x_card,
64+
.matches = {
65+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
66+
DMI_MATCH(DMI_PRODUCT_NAME, "21D1"),
67+
}
68+
},
4869
{
4970
.driver_data = &acp6x_card,
5071
.matches = {

sound/soc/codecs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,7 @@ config SND_SOC_TFA989X
16291629
config SND_SOC_TLV320ADC3XXX
16301630
tristate "Texas Instruments TLV320ADC3001/3101 audio ADC"
16311631
depends on I2C
1632+
depends on GPIOLIB
16321633
help
16331634
Enable support for Texas Instruments TLV320ADC3001 and TLV320ADC3101
16341635
ADCs.

sound/soc/codecs/cx2072x.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
#define CX2072X_PLBK_DRC_PARM_LEN 9
178178
#define CX2072X_CLASSD_AMP_LEN 6
179179

180-
/* DAI interfae type */
180+
/* DAI interface type */
181181
#define CX2072X_DAI_HIFI 1
182182
#define CX2072X_DAI_DSP 2
183183
#define CX2072X_DAI_DSP_PWM 3 /* 4 ch, including mic and AEC */

sound/soc/codecs/jz4725b.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,26 +136,29 @@ enum {
136136
#define REG_CGR3_GO1L_OFFSET 0
137137
#define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET)
138138

139+
#define REG_CGR10_GIL_OFFSET 0
140+
#define REG_CGR10_GIR_OFFSET 4
141+
139142
struct jz_icdc {
140143
struct regmap *regmap;
141144
void __iomem *base;
142145
struct clk *clk;
143146
};
144147

145-
static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0);
146-
static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600);
148+
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0);
149+
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);
147150

148151
static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
149152
SOC_DOUBLE_TLV("Master Playback Volume",
150153
JZ4725B_CODEC_REG_CGR1,
151154
REG_CGR1_GODL_OFFSET,
152155
REG_CGR1_GODR_OFFSET,
153156
0xf, 1, jz4725b_dac_tlv),
154-
SOC_DOUBLE_R_TLV("Master Capture Volume",
155-
JZ4725B_CODEC_REG_CGR3,
156-
JZ4725B_CODEC_REG_CGR2,
157-
REG_CGR2_GO1R_OFFSET,
158-
0x1f, 1, jz4725b_line_tlv),
157+
SOC_DOUBLE_TLV("Master Capture Volume",
158+
JZ4725B_CODEC_REG_CGR10,
159+
REG_CGR10_GIL_OFFSET,
160+
REG_CGR10_GIR_OFFSET,
161+
0xf, 0, jz4725b_adc_tlv),
159162

160163
SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1,
161164
REG_CR1_DAC_MUTE_OFFSET, 1, 1),
@@ -180,7 +183,7 @@ static SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
180183
jz4725b_codec_adc_src_texts,
181184
jz4725b_codec_adc_src_values);
182185
static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl =
183-
SOC_DAPM_ENUM("Route", jz4725b_codec_adc_src_enum);
186+
SOC_DAPM_ENUM("ADC Source Capture Route", jz4725b_codec_adc_src_enum);
184187

185188
static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = {
186189
SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1,
@@ -225,7 +228,7 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {
225228
SND_SOC_DAPM_ADC("ADC", "Capture",
226229
JZ4725B_CODEC_REG_PMR1, REG_PMR1_SB_ADC_OFFSET, 1),
227230

228-
SND_SOC_DAPM_MUX("ADC Source", SND_SOC_NOPM, 0, 0,
231+
SND_SOC_DAPM_MUX("ADC Source Capture Route", SND_SOC_NOPM, 0, 0,
229232
&jz4725b_codec_adc_src_ctrl),
230233

231234
/* Mixer */
@@ -236,7 +239,8 @@ static const struct snd_soc_dapm_widget jz4725b_codec_dapm_widgets[] = {
236239
SND_SOC_DAPM_MIXER("DAC to Mixer", JZ4725B_CODEC_REG_CR1,
237240
REG_CR1_DACSEL_OFFSET, 0, NULL, 0),
238241

239-
SND_SOC_DAPM_MIXER("Line In", SND_SOC_NOPM, 0, 0, NULL, 0),
242+
SND_SOC_DAPM_MIXER("Line In", JZ4725B_CODEC_REG_PMR1,
243+
REG_PMR1_SB_LIN_OFFSET, 1, NULL, 0),
240244
SND_SOC_DAPM_MIXER("HP Out", JZ4725B_CODEC_REG_CR1,
241245
REG_CR1_HP_DIS_OFFSET, 1, NULL, 0),
242246

@@ -283,11 +287,11 @@ static const struct snd_soc_dapm_route jz4725b_codec_dapm_routes[] = {
283287
{"Mixer", NULL, "DAC to Mixer"},
284288

285289
{"Mixer to ADC", NULL, "Mixer"},
286-
{"ADC Source", "Mixer", "Mixer to ADC"},
287-
{"ADC Source", "Line In", "Line In"},
288-
{"ADC Source", "Mic 1", "Mic 1"},
289-
{"ADC Source", "Mic 2", "Mic 2"},
290-
{"ADC", NULL, "ADC Source"},
290+
{"ADC Source Capture Route", "Mixer", "Mixer to ADC"},
291+
{"ADC Source Capture Route", "Line In", "Line In"},
292+
{"ADC Source Capture Route", "Mic 1", "Mic 1"},
293+
{"ADC Source Capture Route", "Mic 2", "Mic 2"},
294+
{"ADC", NULL, "ADC Source Capture Route"},
291295

292296
{"Out Stage", NULL, "Mixer"},
293297
{"HP Out", NULL, "Out Stage"},

sound/soc/codecs/mt6660.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,14 @@ static int mt6660_i2c_probe(struct i2c_client *client)
503503
dev_err(chip->dev, "read chip revision fail\n");
504504
goto probe_fail;
505505
}
506+
pm_runtime_set_active(chip->dev);
507+
pm_runtime_enable(chip->dev);
506508

507509
ret = devm_snd_soc_register_component(chip->dev,
508510
&mt6660_component_driver,
509511
&mt6660_codec_dai, 1);
510-
if (!ret) {
511-
pm_runtime_set_active(chip->dev);
512-
pm_runtime_enable(chip->dev);
513-
}
512+
if (ret)
513+
pm_runtime_disable(chip->dev);
514514

515515
return ret;
516516

sound/soc/codecs/rt1019.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,18 +391,18 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
391391
unsigned int rx_mask, int slots, int slot_width)
392392
{
393393
struct snd_soc_component *component = dai->component;
394-
unsigned int val = 0, rx_slotnum;
394+
unsigned int cn = 0, cl = 0, rx_slotnum;
395395
int ret = 0, first_bit;
396396

397397
switch (slots) {
398398
case 4:
399-
val |= RT1019_I2S_TX_4CH;
399+
cn = RT1019_I2S_TX_4CH;
400400
break;
401401
case 6:
402-
val |= RT1019_I2S_TX_6CH;
402+
cn = RT1019_I2S_TX_6CH;
403403
break;
404404
case 8:
405-
val |= RT1019_I2S_TX_8CH;
405+
cn = RT1019_I2S_TX_8CH;
406406
break;
407407
case 2:
408408
break;
@@ -412,16 +412,16 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
412412

413413
switch (slot_width) {
414414
case 20:
415-
val |= RT1019_I2S_DL_20;
415+
cl = RT1019_TDM_CL_20;
416416
break;
417417
case 24:
418-
val |= RT1019_I2S_DL_24;
418+
cl = RT1019_TDM_CL_24;
419419
break;
420420
case 32:
421-
val |= RT1019_I2S_DL_32;
421+
cl = RT1019_TDM_CL_32;
422422
break;
423423
case 8:
424-
val |= RT1019_I2S_DL_8;
424+
cl = RT1019_TDM_CL_8;
425425
break;
426426
case 16:
427427
break;
@@ -470,8 +470,10 @@ static int rt1019_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
470470
goto _set_tdm_err_;
471471
}
472472

473+
snd_soc_component_update_bits(component, RT1019_TDM_1,
474+
RT1019_TDM_CL_MASK, cl);
473475
snd_soc_component_update_bits(component, RT1019_TDM_2,
474-
RT1019_I2S_CH_TX_MASK | RT1019_I2S_DF_MASK, val);
476+
RT1019_I2S_CH_TX_MASK, cn);
475477

476478
_set_tdm_err_:
477479
return ret;

sound/soc/codecs/rt1019.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
#define RT1019_TDM_BCLK_MASK (0x1 << 6)
9696
#define RT1019_TDM_BCLK_NORM (0x0 << 6)
9797
#define RT1019_TDM_BCLK_INV (0x1 << 6)
98+
#define RT1019_TDM_CL_MASK (0x7)
99+
#define RT1019_TDM_CL_8 (0x4)
100+
#define RT1019_TDM_CL_32 (0x3)
101+
#define RT1019_TDM_CL_24 (0x2)
102+
#define RT1019_TDM_CL_20 (0x1)
103+
#define RT1019_TDM_CL_16 (0x0)
98104

99105
/* 0x0401 TDM Control-2 */
100106
#define RT1019_I2S_CH_TX_MASK (0x3 << 6)

sound/soc/codecs/rt1308-sdw.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static bool rt1308_volatile_register(struct device *dev, unsigned int reg)
5050
case 0x3008:
5151
case 0x300a:
5252
case 0xc000:
53+
case 0xc710:
5354
case 0xc860 ... 0xc863:
5455
case 0xc870 ... 0xc873:
5556
return true;
@@ -200,6 +201,7 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
200201
{
201202
struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
202203
int ret = 0;
204+
unsigned int tmp;
203205

204206
if (rt1308->hw_init)
205207
return 0;
@@ -231,6 +233,10 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
231233
/* sw reset */
232234
regmap_write(rt1308->regmap, RT1308_SDW_RESET, 0);
233235

236+
regmap_read(rt1308->regmap, 0xc710, &tmp);
237+
rt1308->hw_ver = tmp;
238+
dev_dbg(dev, "%s, hw_ver=0x%x\n", __func__, rt1308->hw_ver);
239+
234240
/* initial settings */
235241
regmap_write(rt1308->regmap, 0xc103, 0xc0);
236242
regmap_write(rt1308->regmap, 0xc030, 0x17);
@@ -246,8 +252,14 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
246252
regmap_write(rt1308->regmap, 0xc062, 0x05);
247253
regmap_write(rt1308->regmap, 0xc171, 0x07);
248254
regmap_write(rt1308->regmap, 0xc173, 0x0d);
249-
regmap_write(rt1308->regmap, 0xc311, 0x7f);
250-
regmap_write(rt1308->regmap, 0xc900, 0x90);
255+
if (rt1308->hw_ver == RT1308_VER_C) {
256+
regmap_write(rt1308->regmap, 0xc311, 0x7f);
257+
regmap_write(rt1308->regmap, 0xc300, 0x09);
258+
} else {
259+
regmap_write(rt1308->regmap, 0xc311, 0x4f);
260+
regmap_write(rt1308->regmap, 0xc300, 0x0b);
261+
}
262+
regmap_write(rt1308->regmap, 0xc900, 0x5a);
251263
regmap_write(rt1308->regmap, 0xc1a0, 0x84);
252264
regmap_write(rt1308->regmap, 0xc1a1, 0x01);
253265
regmap_write(rt1308->regmap, 0xc360, 0x78);
@@ -257,7 +269,6 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
257269
regmap_write(rt1308->regmap, 0xc070, 0x00);
258270
regmap_write(rt1308->regmap, 0xc100, 0xd7);
259271
regmap_write(rt1308->regmap, 0xc101, 0xd7);
260-
regmap_write(rt1308->regmap, 0xc300, 0x09);
261272

262273
if (rt1308->first_hw_init) {
263274
regcache_cache_bypass(rt1308->regmap, false);

sound/soc/codecs/rt1308-sdw.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ static const struct reg_default rt1308_reg_defaults[] = {
139139
{ 0x3005, 0x23 },
140140
{ 0x3008, 0x02 },
141141
{ 0x300a, 0x00 },
142+
{ 0xc000 | (RT1308_DATA_PATH << 4), 0x00 },
142143
{ 0xc003 | (RT1308_DAC_SET << 4), 0x00 },
143144
{ 0xc000 | (RT1308_POWER << 4), 0x00 },
144145
{ 0xc001 | (RT1308_POWER << 4), 0x00 },
145146
{ 0xc002 | (RT1308_POWER << 4), 0x00 },
147+
{ 0xc000 | (RT1308_POWER_STATUS << 4), 0x00 },
146148
};
147149

148150
#define RT1308_SDW_OFFSET 0xc000
@@ -163,6 +165,7 @@ struct rt1308_sdw_priv {
163165
bool first_hw_init;
164166
int rx_mask;
165167
int slots;
168+
int hw_ver;
166169
};
167170

168171
struct sdw_stream_data {

0 commit comments

Comments
 (0)