Skip to content

Commit 963a70b

Browse files
committed
Merge tag 'sound-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "The only significant core change is ASoC DPCM fix for asymmetric setup; other remaining changes are device-specific fixes, including the hardening of string manipulations. One change in platform/x86 is the patch I forgot to apply from a series for CS35L41 codec" * tag 'sound-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits) ALSA: hda/realtek: Add quirk for Clevo NS50PU, NS70PU ALSA: info: Fix llseek return value when using callback ALSA: hda/cs8409: Support new Dolphin Variants platform/x86: serial-multi-instantiate: Add CLSA0101 Laptop ALSA: hda/realtek: Add quirk for Lenovo Yoga7 14IAL7 ALSA: hda: cs35l41: Clarify support for CSC3551 without _DSD Properties ALSA: hda/realtek: Add quirks for ASUS Zenbooks using CS35L41 ASoC: codec: tlv320aic32x4: fix mono playback via I2S ASoC: rt5640: Fix the JD voltage dropping issue ASoC: tas2770: Fix handling of mute/unmute ASoC: tas2770: Drop conflicting set_bias_level power setting ASoC: tas2770: Allow mono streams ASoC: tas2770: Set correct FSYNC polarity ASoC: Intel: fix sof_es8336 probe ASoC: DPCM: Don't pick up BE without substream ASoC: SOF: ipc3-topology: Fix clang -Wformat warning ASoC: sh: rz-ssi: Improve error handling in rz_ssi_probe() error path ASoC: SOF: Intel: hda: Fix potential buffer overflow by snprintf() ASoC: SOF: debug: Fix potential buffer overflow by snprintf() ASoC: Intel: avs: Fix potential buffer overflow by snprintf() ...
2 parents adb67b3 + 90d74fd commit 963a70b

File tree

17 files changed

+133
-79
lines changed

17 files changed

+133
-79
lines changed

drivers/platform/x86/serial-multi-instantiate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ static const struct acpi_device_id smi_acpi_ids[] = {
328328
{ "INT3515", (unsigned long)&int3515_data },
329329
/* Non-conforming _HID for Cirrus Logic already released */
330330
{ "CLSA0100", (unsigned long)&cs35l41_hda },
331+
{ "CLSA0101", (unsigned long)&cs35l41_hda },
331332
{ }
332333
};
333334
MODULE_DEVICE_TABLE(acpi, smi_acpi_ids);

sound/core/info.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
111111
entry = data->entry;
112112
mutex_lock(&entry->access);
113113
if (entry->c.ops->llseek) {
114-
offset = entry->c.ops->llseek(entry,
115-
data->file_private_data,
116-
file, offset, orig);
114+
ret = entry->c.ops->llseek(entry,
115+
data->file_private_data,
116+
file, offset, orig);
117117
goto out;
118118
}
119119

sound/pci/hda/cs35l41_hda.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,11 @@ static int cs35l41_no_acpi_dsd(struct cs35l41_hda *cs35l41, struct device *physd
11631163
hw_cfg->gpio1.func = CS35l41_VSPK_SWITCH;
11641164
hw_cfg->gpio1.valid = true;
11651165
} else {
1166+
/*
1167+
* Note: CLSA010(0/1) are special cases which use a slightly different design.
1168+
* All other HIDs e.g. CSC3551 require valid ACPI _DSD properties to be supported.
1169+
*/
1170+
dev_err(cs35l41->dev, "Error: ACPI _DSD Properties are missing for HID %s.\n", hid);
11661171
hw_cfg->valid = false;
11671172
hw_cfg->gpio1.valid = false;
11681173
hw_cfg->gpio2.valid = false;

sound/pci/hda/patch_cs8409-tables.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ const struct snd_pci_quirk cs8409_fixup_tbl[] = {
546546
SND_PCI_QUIRK(0x1028, 0x0BD6, "Dolphin", CS8409_DOLPHIN),
547547
SND_PCI_QUIRK(0x1028, 0x0BD7, "Dolphin", CS8409_DOLPHIN),
548548
SND_PCI_QUIRK(0x1028, 0x0BD8, "Dolphin", CS8409_DOLPHIN),
549+
SND_PCI_QUIRK(0x1028, 0x0C43, "Dolphin", CS8409_DOLPHIN),
550+
SND_PCI_QUIRK(0x1028, 0x0C50, "Dolphin", CS8409_DOLPHIN),
551+
SND_PCI_QUIRK(0x1028, 0x0C51, "Dolphin", CS8409_DOLPHIN),
552+
SND_PCI_QUIRK(0x1028, 0x0C52, "Dolphin", CS8409_DOLPHIN),
549553
{} /* terminator */
550554
};
551555

sound/pci/hda/patch_realtek.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9283,6 +9283,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
92839283
SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
92849284
SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
92859285
SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9286+
SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
92869287
SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
92879288
SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
92889289
SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
@@ -9303,6 +9304,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
93039304
SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
93049305
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
93059306
SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
9307+
SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
93069308
SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
93079309
SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
93089310
SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
@@ -9389,6 +9391,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
93899391
SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
93909392
SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
93919393
SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9394+
SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
93929395
SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
93939396
SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
93949397
SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -9490,6 +9493,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
94909493
SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
94919494
SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
94929495
SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
9496+
SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
94939497
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
94949498
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
94959499
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,34 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
143143
DMI_MATCH(DMI_PRODUCT_NAME, "21CL"),
144144
}
145145
},
146+
{
147+
.driver_data = &acp6x_card,
148+
.matches = {
149+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
150+
DMI_MATCH(DMI_PRODUCT_NAME, "21EM"),
151+
}
152+
},
153+
{
154+
.driver_data = &acp6x_card,
155+
.matches = {
156+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
157+
DMI_MATCH(DMI_PRODUCT_NAME, "21EN"),
158+
}
159+
},
160+
{
161+
.driver_data = &acp6x_card,
162+
.matches = {
163+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
164+
DMI_MATCH(DMI_PRODUCT_NAME, "21J5"),
165+
}
166+
},
167+
{
168+
.driver_data = &acp6x_card,
169+
.matches = {
170+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
171+
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
172+
}
173+
},
146174
{}
147175
};
148176

sound/soc/codecs/rt5640.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ static int rt5640_set_bias_level(struct snd_soc_component *component,
19861986
snd_soc_component_write(component, RT5640_PWR_MIXER, 0x0000);
19871987
if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER)
19881988
snd_soc_component_write(component, RT5640_PWR_ANLG1,
1989-
0x0018);
1989+
0x2818);
19901990
else
19911991
snd_soc_component_write(component, RT5640_PWR_ANLG1,
19921992
0x0000);
@@ -2600,7 +2600,8 @@ static void rt5640_enable_hda_jack_detect(
26002600
snd_soc_component_update_bits(component, RT5640_DUMMY1, 0x400, 0x0);
26012601

26022602
snd_soc_component_update_bits(component, RT5640_PWR_ANLG1,
2603-
RT5640_PWR_VREF2, RT5640_PWR_VREF2);
2603+
RT5640_PWR_VREF2 | RT5640_PWR_MB | RT5640_PWR_BG,
2604+
RT5640_PWR_VREF2 | RT5640_PWR_MB | RT5640_PWR_BG);
26042605
usleep_range(10000, 15000);
26052606
snd_soc_component_update_bits(component, RT5640_PWR_ANLG1,
26062607
RT5640_PWR_FV2, RT5640_PWR_FV2);

sound/soc/codecs/tas2770.c

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,22 @@ static void tas2770_reset(struct tas2770_priv *tas2770)
4646
usleep_range(1000, 2000);
4747
}
4848

49-
static int tas2770_set_bias_level(struct snd_soc_component *component,
50-
enum snd_soc_bias_level level)
49+
static int tas2770_update_pwr_ctrl(struct tas2770_priv *tas2770)
5150
{
52-
struct tas2770_priv *tas2770 =
53-
snd_soc_component_get_drvdata(component);
51+
struct snd_soc_component *component = tas2770->component;
52+
unsigned int val;
53+
int ret;
5454

55-
switch (level) {
56-
case SND_SOC_BIAS_ON:
57-
snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
58-
TAS2770_PWR_CTRL_MASK,
59-
TAS2770_PWR_CTRL_ACTIVE);
60-
break;
61-
case SND_SOC_BIAS_STANDBY:
62-
case SND_SOC_BIAS_PREPARE:
63-
snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
64-
TAS2770_PWR_CTRL_MASK,
65-
TAS2770_PWR_CTRL_MUTE);
66-
break;
67-
case SND_SOC_BIAS_OFF:
68-
snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
69-
TAS2770_PWR_CTRL_MASK,
70-
TAS2770_PWR_CTRL_SHUTDOWN);
71-
break;
55+
if (tas2770->dac_powered)
56+
val = tas2770->unmuted ?
57+
TAS2770_PWR_CTRL_ACTIVE : TAS2770_PWR_CTRL_MUTE;
58+
else
59+
val = TAS2770_PWR_CTRL_SHUTDOWN;
7260

73-
default:
74-
dev_err(tas2770->dev, "wrong power level setting %d\n", level);
75-
return -EINVAL;
76-
}
61+
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
62+
TAS2770_PWR_CTRL_MASK, val);
63+
if (ret < 0)
64+
return ret;
7765

7866
return 0;
7967
}
@@ -114,9 +102,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component)
114102
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
115103
usleep_range(1000, 2000);
116104
} else {
117-
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
118-
TAS2770_PWR_CTRL_MASK,
119-
TAS2770_PWR_CTRL_ACTIVE);
105+
ret = tas2770_update_pwr_ctrl(tas2770);
120106
if (ret < 0)
121107
return ret;
122108
}
@@ -152,24 +138,19 @@ static int tas2770_dac_event(struct snd_soc_dapm_widget *w,
152138

153139
switch (event) {
154140
case SND_SOC_DAPM_POST_PMU:
155-
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
156-
TAS2770_PWR_CTRL_MASK,
157-
TAS2770_PWR_CTRL_MUTE);
141+
tas2770->dac_powered = 1;
142+
ret = tas2770_update_pwr_ctrl(tas2770);
158143
break;
159144
case SND_SOC_DAPM_PRE_PMD:
160-
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
161-
TAS2770_PWR_CTRL_MASK,
162-
TAS2770_PWR_CTRL_SHUTDOWN);
145+
tas2770->dac_powered = 0;
146+
ret = tas2770_update_pwr_ctrl(tas2770);
163147
break;
164148
default:
165149
dev_err(tas2770->dev, "Not supported evevt\n");
166150
return -EINVAL;
167151
}
168152

169-
if (ret < 0)
170-
return ret;
171-
172-
return 0;
153+
return ret;
173154
}
174155

175156
static const struct snd_kcontrol_new isense_switch =
@@ -203,21 +184,11 @@ static const struct snd_soc_dapm_route tas2770_audio_map[] = {
203184
static int tas2770_mute(struct snd_soc_dai *dai, int mute, int direction)
204185
{
205186
struct snd_soc_component *component = dai->component;
206-
int ret;
207-
208-
if (mute)
209-
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
210-
TAS2770_PWR_CTRL_MASK,
211-
TAS2770_PWR_CTRL_MUTE);
212-
else
213-
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
214-
TAS2770_PWR_CTRL_MASK,
215-
TAS2770_PWR_CTRL_ACTIVE);
216-
217-
if (ret < 0)
218-
return ret;
187+
struct tas2770_priv *tas2770 =
188+
snd_soc_component_get_drvdata(component);
219189

220-
return 0;
190+
tas2770->unmuted = !mute;
191+
return tas2770_update_pwr_ctrl(tas2770);
221192
}
222193

223194
static int tas2770_set_bitwidth(struct tas2770_priv *tas2770, int bitwidth)
@@ -337,7 +308,7 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
337308
struct snd_soc_component *component = dai->component;
338309
struct tas2770_priv *tas2770 =
339310
snd_soc_component_get_drvdata(component);
340-
u8 tdm_rx_start_slot = 0, asi_cfg_1 = 0;
311+
u8 tdm_rx_start_slot = 0, invert_fpol = 0, fpol_preinv = 0, asi_cfg_1 = 0;
341312
int ret;
342313

343314
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
@@ -349,9 +320,15 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
349320
}
350321

351322
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
323+
case SND_SOC_DAIFMT_NB_IF:
324+
invert_fpol = 1;
325+
fallthrough;
352326
case SND_SOC_DAIFMT_NB_NF:
353327
asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_RSING;
354328
break;
329+
case SND_SOC_DAIFMT_IB_IF:
330+
invert_fpol = 1;
331+
fallthrough;
355332
case SND_SOC_DAIFMT_IB_NF:
356333
asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_FALING;
357334
break;
@@ -369,15 +346,19 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
369346
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
370347
case SND_SOC_DAIFMT_I2S:
371348
tdm_rx_start_slot = 1;
349+
fpol_preinv = 0;
372350
break;
373351
case SND_SOC_DAIFMT_DSP_A:
374352
tdm_rx_start_slot = 0;
353+
fpol_preinv = 1;
375354
break;
376355
case SND_SOC_DAIFMT_DSP_B:
377356
tdm_rx_start_slot = 1;
357+
fpol_preinv = 1;
378358
break;
379359
case SND_SOC_DAIFMT_LEFT_J:
380360
tdm_rx_start_slot = 0;
361+
fpol_preinv = 1;
381362
break;
382363
default:
383364
dev_err(tas2770->dev,
@@ -391,6 +372,14 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
391372
if (ret < 0)
392373
return ret;
393374

375+
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG0,
376+
TAS2770_TDM_CFG_REG0_FPOL_MASK,
377+
(fpol_preinv ^ invert_fpol)
378+
? TAS2770_TDM_CFG_REG0_FPOL_RSING
379+
: TAS2770_TDM_CFG_REG0_FPOL_FALING);
380+
if (ret < 0)
381+
return ret;
382+
394383
return 0;
395384
}
396385

@@ -489,7 +478,7 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = {
489478
.id = 0,
490479
.playback = {
491480
.stream_name = "ASI1 Playback",
492-
.channels_min = 2,
481+
.channels_min = 1,
493482
.channels_max = 2,
494483
.rates = TAS2770_RATES,
495484
.formats = TAS2770_FORMATS,
@@ -537,7 +526,6 @@ static const struct snd_soc_component_driver soc_component_driver_tas2770 = {
537526
.probe = tas2770_codec_probe,
538527
.suspend = tas2770_codec_suspend,
539528
.resume = tas2770_codec_resume,
540-
.set_bias_level = tas2770_set_bias_level,
541529
.controls = tas2770_snd_controls,
542530
.num_controls = ARRAY_SIZE(tas2770_snd_controls),
543531
.dapm_widgets = tas2770_dapm_widgets,

sound/soc/codecs/tas2770.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
#define TAS2770_TDM_CFG_REG0_31_44_1_48KHZ 0x6
4242
#define TAS2770_TDM_CFG_REG0_31_88_2_96KHZ 0x8
4343
#define TAS2770_TDM_CFG_REG0_31_176_4_192KHZ 0xa
44+
#define TAS2770_TDM_CFG_REG0_FPOL_MASK BIT(0)
45+
#define TAS2770_TDM_CFG_REG0_FPOL_RSING 0
46+
#define TAS2770_TDM_CFG_REG0_FPOL_FALING 1
4447
/* TDM Configuration Reg1 */
4548
#define TAS2770_TDM_CFG_REG1 TAS2770_REG(0X0, 0x0B)
4649
#define TAS2770_TDM_CFG_REG1_MASK GENMASK(5, 1)
@@ -135,6 +138,8 @@ struct tas2770_priv {
135138
struct device *dev;
136139
int v_sense_slot;
137140
int i_sense_slot;
141+
bool dac_powered;
142+
bool unmuted;
138143
};
139144

140145
#endif /* __TAS2770__ */

sound/soc/codecs/tlv320aic32x4.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct aic32x4_priv {
4949
struct aic32x4_setup_data *setup;
5050
struct device *dev;
5151
enum aic32x4_type type;
52+
53+
unsigned int fmt;
5254
};
5355

5456
static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w,
@@ -611,6 +613,7 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
611613
static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
612614
{
613615
struct snd_soc_component *component = codec_dai->component;
616+
struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
614617
u8 iface_reg_1 = 0;
615618
u8 iface_reg_2 = 0;
616619
u8 iface_reg_3 = 0;
@@ -653,6 +656,8 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
653656
return -EINVAL;
654657
}
655658

659+
aic32x4->fmt = fmt;
660+
656661
snd_soc_component_update_bits(component, AIC32X4_IFACE1,
657662
AIC32X4_IFACE1_DATATYPE_MASK |
658663
AIC32X4_IFACE1_MASTER_MASK, iface_reg_1);
@@ -757,6 +762,10 @@ static int aic32x4_setup_clocks(struct snd_soc_component *component,
757762
return -EINVAL;
758763
}
759764

765+
/* PCM over I2S is always 2-channel */
766+
if ((aic32x4->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S)
767+
channels = 2;
768+
760769
madc = DIV_ROUND_UP((32 * adc_resource_class), aosr);
761770
max_dosr = (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) *
762771
dosr_increment;

0 commit comments

Comments
 (0)