Skip to content

Commit 092a136

Browse files
committed
Merge tag 'asoc-fix-v6.7-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.7 Quite a big collection of fixes, as ever mostly in drivers. There's one framework fix for the HDMI CODEC where it wasn't handling startup properly for some controllers, and one new x86 quirk, but otherwise all local fixes or dropping things we don't want to see in a release.
2 parents ae53e21 + 8f0f016 commit 092a136

File tree

10 files changed

+115
-39
lines changed

10 files changed

+115
-39
lines changed

sound/soc/codecs/cs35l45-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static struct i2c_driver cs35l45_i2c_driver = {
6262
.driver = {
6363
.name = "cs35l45",
6464
.of_match_table = cs35l45_of_match,
65-
.pm = &cs35l45_pm_ops,
65+
.pm = pm_ptr(&cs35l45_pm_ops),
6666
},
6767
.id_table = cs35l45_id_i2c,
6868
.probe = cs35l45_i2c_probe,

sound/soc/codecs/cs35l45-spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static struct spi_driver cs35l45_spi_driver = {
6464
.driver = {
6565
.name = "cs35l45",
6666
.of_match_table = cs35l45_of_match,
67-
.pm = &cs35l45_pm_ops,
67+
.pm = pm_ptr(&cs35l45_pm_ops),
6868
},
6969
.id_table = cs35l45_id_spi,
7070
.probe = cs35l45_spi_probe,

sound/soc/codecs/cs35l45.c

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ static int cs35l45_enter_hibernate(struct cs35l45_private *cs35l45)
947947

948948
cs35l45_setup_hibernate(cs35l45);
949949

950+
regmap_set_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2, CS35L45_DSP_VIRT2_MBOX_MASK);
951+
950952
// Don't wait for ACK since bus activity would wake the device
951953
regmap_write(cs35l45->regmap, CS35L45_DSP_VIRT1_MBOX_1, CSPL_MBOX_CMD_HIBERNATE);
952954

@@ -967,6 +969,8 @@ static int cs35l45_exit_hibernate(struct cs35l45_private *cs35l45)
967969
CSPL_MBOX_CMD_OUT_OF_HIBERNATE);
968970
if (!ret) {
969971
dev_dbg(cs35l45->dev, "Wake success at cycle: %d\n", j);
972+
regmap_clear_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2,
973+
CS35L45_DSP_VIRT2_MBOX_MASK);
970974
return 0;
971975
}
972976
usleep_range(100, 200);
@@ -982,7 +986,7 @@ static int cs35l45_exit_hibernate(struct cs35l45_private *cs35l45)
982986
return -ETIMEDOUT;
983987
}
984988

985-
static int __maybe_unused cs35l45_runtime_suspend(struct device *dev)
989+
static int cs35l45_runtime_suspend(struct device *dev)
986990
{
987991
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
988992

@@ -999,7 +1003,7 @@ static int __maybe_unused cs35l45_runtime_suspend(struct device *dev)
9991003
return 0;
10001004
}
10011005

1002-
static int __maybe_unused cs35l45_runtime_resume(struct device *dev)
1006+
static int cs35l45_runtime_resume(struct device *dev)
10031007
{
10041008
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
10051009
int ret;
@@ -1026,6 +1030,46 @@ static int __maybe_unused cs35l45_runtime_resume(struct device *dev)
10261030
return ret;
10271031
}
10281032

1033+
static int cs35l45_sys_suspend(struct device *dev)
1034+
{
1035+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1036+
1037+
dev_dbg(cs35l45->dev, "System suspend, disabling IRQ\n");
1038+
disable_irq(cs35l45->irq);
1039+
1040+
return 0;
1041+
}
1042+
1043+
static int cs35l45_sys_suspend_noirq(struct device *dev)
1044+
{
1045+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1046+
1047+
dev_dbg(cs35l45->dev, "Late system suspend, reenabling IRQ\n");
1048+
enable_irq(cs35l45->irq);
1049+
1050+
return 0;
1051+
}
1052+
1053+
static int cs35l45_sys_resume_noirq(struct device *dev)
1054+
{
1055+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1056+
1057+
dev_dbg(cs35l45->dev, "Early system resume, disabling IRQ\n");
1058+
disable_irq(cs35l45->irq);
1059+
1060+
return 0;
1061+
}
1062+
1063+
static int cs35l45_sys_resume(struct device *dev)
1064+
{
1065+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1066+
1067+
dev_dbg(cs35l45->dev, "System resume, reenabling IRQ\n");
1068+
enable_irq(cs35l45->irq);
1069+
1070+
return 0;
1071+
}
1072+
10291073
static int cs35l45_apply_property_config(struct cs35l45_private *cs35l45)
10301074
{
10311075
struct device_node *node = cs35l45->dev->of_node;
@@ -1466,10 +1510,12 @@ void cs35l45_remove(struct cs35l45_private *cs35l45)
14661510
}
14671511
EXPORT_SYMBOL_NS_GPL(cs35l45_remove, SND_SOC_CS35L45);
14681512

1469-
const struct dev_pm_ops cs35l45_pm_ops = {
1470-
SET_RUNTIME_PM_OPS(cs35l45_runtime_suspend, cs35l45_runtime_resume, NULL)
1513+
EXPORT_GPL_DEV_PM_OPS(cs35l45_pm_ops) = {
1514+
RUNTIME_PM_OPS(cs35l45_runtime_suspend, cs35l45_runtime_resume, NULL)
1515+
1516+
SYSTEM_SLEEP_PM_OPS(cs35l45_sys_suspend, cs35l45_sys_resume)
1517+
NOIRQ_SYSTEM_SLEEP_PM_OPS(cs35l45_sys_suspend_noirq, cs35l45_sys_resume_noirq)
14711518
};
1472-
EXPORT_SYMBOL_NS_GPL(cs35l45_pm_ops, SND_SOC_CS35L45);
14731519

14741520
MODULE_DESCRIPTION("ASoC CS35L45 driver");
14751521
MODULE_AUTHOR("James Schulman, Cirrus Logic Inc, <james.schulman@cirrus.com>");

sound/soc/codecs/cs42l43-jack.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ int cs42l43_set_jack(struct snd_soc_component *component,
237237
return ret;
238238
}
239239

240-
static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool force_high)
240+
static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool type_detect)
241241
{
242242
struct cs42l43 *cs42l43 = priv->core;
243243
unsigned int val = 0x3 << CS42L43_HSBIAS_MODE_SHIFT;
@@ -247,16 +247,17 @@ static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool force_high)
247247
regmap_update_bits(cs42l43->regmap, CS42L43_HS2,
248248
CS42L43_HS_CLAMP_DISABLE_MASK, CS42L43_HS_CLAMP_DISABLE_MASK);
249249

250-
if (!force_high && priv->bias_low)
251-
val = 0x2 << CS42L43_HSBIAS_MODE_SHIFT;
252-
253-
if (priv->bias_sense_ua) {
254-
regmap_update_bits(cs42l43->regmap,
255-
CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL,
256-
CS42L43_HSBIAS_SENSE_EN_MASK |
257-
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK,
258-
CS42L43_HSBIAS_SENSE_EN_MASK |
259-
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK);
250+
if (!type_detect) {
251+
if (priv->bias_low)
252+
val = 0x2 << CS42L43_HSBIAS_MODE_SHIFT;
253+
254+
if (priv->bias_sense_ua)
255+
regmap_update_bits(cs42l43->regmap,
256+
CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL,
257+
CS42L43_HSBIAS_SENSE_EN_MASK |
258+
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK,
259+
CS42L43_HSBIAS_SENSE_EN_MASK |
260+
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK);
260261
}
261262

262263
regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1,

sound/soc/codecs/hdmi-codec.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,9 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai)
850850
static void hdmi_codec_jack_report(struct hdmi_codec_priv *hcp,
851851
unsigned int jack_status)
852852
{
853-
if (hcp->jack && jack_status != hcp->jack_status) {
854-
snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT);
853+
if (jack_status != hcp->jack_status) {
854+
if (hcp->jack)
855+
snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT);
855856
hcp->jack_status = jack_status;
856857
}
857858
}
@@ -880,6 +881,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component,
880881

881882
if (hcp->hcd.ops->hook_plugged_cb) {
882883
hcp->jack = jack;
884+
885+
/*
886+
* Report the initial jack status which may have been provided
887+
* by the parent hdmi driver while the hpd hook was registered.
888+
*/
889+
snd_soc_jack_report(jack, hcp->jack_status, SND_JACK_LINEOUT);
890+
883891
return 0;
884892
}
885893

sound/soc/codecs/tas2781-fmwlib.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,11 +2189,11 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no,
21892189
goto out;
21902190
}
21912191

2192-
conf = &(tas_fmw->configs[cfg_no]);
21932192
for (i = 0, prog_status = 0; i < tas_priv->ndev; i++) {
21942193
if (cfg_info[rca_conf_no]->active_dev & (1 << i)) {
2195-
if (tas_priv->tasdevice[i].cur_prog != prm_no
2196-
|| tas_priv->force_fwload_status) {
2194+
if (prm_no >= 0
2195+
&& (tas_priv->tasdevice[i].cur_prog != prm_no
2196+
|| tas_priv->force_fwload_status)) {
21972197
tas_priv->tasdevice[i].cur_conf = -1;
21982198
tas_priv->tasdevice[i].is_loading = true;
21992199
prog_status++;
@@ -2228,7 +2228,8 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no,
22282228
}
22292229

22302230
for (i = 0, status = 0; i < tas_priv->ndev; i++) {
2231-
if (tas_priv->tasdevice[i].cur_conf != cfg_no
2231+
if (cfg_no >= 0
2232+
&& tas_priv->tasdevice[i].cur_conf != cfg_no
22322233
&& (cfg_info[rca_conf_no]->active_dev & (1 << i))
22332234
&& (tas_priv->tasdevice[i].is_loaderr == false)) {
22342235
status++;
@@ -2238,6 +2239,7 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no,
22382239
}
22392240

22402241
if (status) {
2242+
conf = &(tas_fmw->configs[cfg_no]);
22412243
status = 0;
22422244
tasdevice_load_data(tas_priv, &(conf->dev_data));
22432245
for (i = 0; i < tas_priv->ndev; i++) {
@@ -2281,7 +2283,7 @@ int tasdevice_prmg_load(void *context, int prm_no)
22812283
}
22822284

22832285
for (i = 0, prog_status = 0; i < tas_priv->ndev; i++) {
2284-
if (tas_priv->tasdevice[i].cur_prog != prm_no) {
2286+
if (prm_no >= 0 && tas_priv->tasdevice[i].cur_prog != prm_no) {
22852287
tas_priv->tasdevice[i].cur_conf = -1;
22862288
tas_priv->tasdevice[i].is_loading = true;
22872289
prog_status++;
@@ -2326,7 +2328,7 @@ int tasdevice_prmg_calibdata_load(void *context, int prm_no)
23262328
}
23272329

23282330
for (i = 0, prog_status = 0; i < tas_priv->ndev; i++) {
2329-
if (tas_priv->tasdevice[i].cur_prog != prm_no) {
2331+
if (prm_no >= 0 && tas_priv->tasdevice[i].cur_prog != prm_no) {
23302332
tas_priv->tasdevice[i].cur_conf = -1;
23312333
tas_priv->tasdevice[i].is_loading = true;
23322334
prog_status++;

sound/soc/fsl/fsl_sai.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,9 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream,
714714
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
715715
unsigned int ofs = sai->soc_data->reg_offset;
716716

717+
/* Clear xMR to avoid channel swap with mclk_with_tere enabled case */
718+
regmap_write(sai->regmap, FSL_SAI_xMR(tx), 0);
719+
717720
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, ofs),
718721
FSL_SAI_CR3_TRCE_MASK, 0);
719722

sound/soc/intel/boards/bytcr_rt5640.c

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ enum {
8383
#define BYT_RT5640_HSMIC2_ON_IN1 BIT(27)
8484
#define BYT_RT5640_JD_HP_ELITEP_1000G2 BIT(28)
8585
#define BYT_RT5640_USE_AMCR0F28 BIT(29)
86+
#define BYT_RT5640_SWAPPED_SPEAKERS BIT(30)
8687

8788
#define BYTCR_INPUT_DEFAULTS \
8889
(BYT_RT5640_IN3_MAP | \
@@ -157,6 +158,8 @@ static void log_quirks(struct device *dev)
157158
dev_info(dev, "quirk MONO_SPEAKER enabled\n");
158159
if (byt_rt5640_quirk & BYT_RT5640_NO_SPEAKERS)
159160
dev_info(dev, "quirk NO_SPEAKERS enabled\n");
161+
if (byt_rt5640_quirk & BYT_RT5640_SWAPPED_SPEAKERS)
162+
dev_info(dev, "quirk SWAPPED_SPEAKERS enabled\n");
160163
if (byt_rt5640_quirk & BYT_RT5640_LINEOUT)
161164
dev_info(dev, "quirk LINEOUT enabled\n");
162165
if (byt_rt5640_quirk & BYT_RT5640_LINEOUT_AS_HP2)
@@ -894,6 +897,19 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
894897
BYT_RT5640_SSP0_AIF1 |
895898
BYT_RT5640_MCLK_EN),
896899
},
900+
{
901+
/* Medion Lifetab S10346 */
902+
.matches = {
903+
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
904+
DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
905+
/* Above strings are much too generic, also match on BIOS date */
906+
DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
907+
},
908+
.driver_data = (void *)(BYTCR_INPUT_DEFAULTS |
909+
BYT_RT5640_SWAPPED_SPEAKERS |
910+
BYT_RT5640_SSP0_AIF1 |
911+
BYT_RT5640_MCLK_EN),
912+
},
897913
{ /* Mele PCG03 Mini PC */
898914
.matches = {
899915
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Mini PC"),
@@ -1619,11 +1635,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
16191635
const char *platform_name;
16201636
struct acpi_device *adev;
16211637
struct device *codec_dev;
1638+
const char *cfg_spk;
16221639
bool sof_parent;
16231640
int ret_val = 0;
16241641
int dai_index = 0;
1625-
int i, cfg_spk;
1626-
int aif;
1642+
int i, aif;
16271643

16281644
is_bytcr = false;
16291645
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -1783,13 +1799,16 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
17831799
}
17841800

17851801
if (byt_rt5640_quirk & BYT_RT5640_NO_SPEAKERS) {
1786-
cfg_spk = 0;
1802+
cfg_spk = "0";
17871803
spk_type = "none";
17881804
} else if (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) {
1789-
cfg_spk = 1;
1805+
cfg_spk = "1";
17901806
spk_type = "mono";
1807+
} else if (byt_rt5640_quirk & BYT_RT5640_SWAPPED_SPEAKERS) {
1808+
cfg_spk = "swapped";
1809+
spk_type = "swapped";
17911810
} else {
1792-
cfg_spk = 2;
1811+
cfg_spk = "2";
17931812
spk_type = "stereo";
17941813
}
17951814

@@ -1804,7 +1823,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
18041823
headset2_string = " cfg-hs2:in1";
18051824

18061825
snprintf(byt_rt5640_components, sizeof(byt_rt5640_components),
1807-
"cfg-spk:%d cfg-mic:%s aif:%d%s%s", cfg_spk,
1826+
"cfg-spk:%s cfg-mic:%s aif:%d%s%s", cfg_spk,
18081827
map_name[BYT_RT5640_MAP(byt_rt5640_quirk)], aif,
18091828
lineout_string, headset2_string);
18101829
byt_rt5640_card.components = byt_rt5640_components;

sound/soc/intel/common/soc-acpi-intel-mtl-match.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ static const struct snd_soc_acpi_adr_device cs35l56_1_adr[] = {
306306
.adr = 0x00013701FA355601ull,
307307
.num_endpoints = 1,
308308
.endpoints = &spk_r_endpoint,
309-
.name_prefix = "cs35l56-8"
309+
.name_prefix = "AMP8"
310310
},
311311
{
312312
.adr = 0x00013601FA355601ull,
313313
.num_endpoints = 1,
314314
.endpoints = &spk_3_endpoint,
315-
.name_prefix = "cs35l56-7"
315+
.name_prefix = "AMP7"
316316
}
317317
};
318318

@@ -321,13 +321,13 @@ static const struct snd_soc_acpi_adr_device cs35l56_2_adr[] = {
321321
.adr = 0x00023301FA355601ull,
322322
.num_endpoints = 1,
323323
.endpoints = &spk_l_endpoint,
324-
.name_prefix = "cs35l56-1"
324+
.name_prefix = "AMP1"
325325
},
326326
{
327327
.adr = 0x00023201FA355601ull,
328328
.num_endpoints = 1,
329329
.endpoints = &spk_2_endpoint,
330-
.name_prefix = "cs35l56-2"
330+
.name_prefix = "AMP2"
331331
}
332332
};
333333

sound/soc/sof/mediatek/mt8186/mt8186.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,6 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
597597

598598
static struct snd_sof_of_mach sof_mt8186_machs[] = {
599599
{
600-
.compatible = "google,steelix",
601-
.sof_tplg_filename = "sof-mt8186-google-steelix.tplg"
602-
}, {
603600
.compatible = "mediatek,mt8186",
604601
.sof_tplg_filename = "sof-mt8186.tplg",
605602
},

0 commit comments

Comments
 (0)