Skip to content

Commit e5dbdcb

Browse files
committed
Merge tag 'asoc-fix-v5.5-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.5 This is mostly driver specific fixes, plus an error handling fix in the core. There is a rather large diffstat for the stm32 SAI driver, this is a very large but mostly mechanical update which wraps every register access in the driver to allow a fix to the locking which avoids circular locks, the active change is much smaller and more reasonably sized.
2 parents 60adcfd + 85578bb commit e5dbdcb

File tree

12 files changed

+209
-80
lines changed

12 files changed

+209
-80
lines changed

sound/soc/codecs/cros_ec_codec.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <crypto/hash.h>
1212
#include <crypto/sha.h>
13+
#include <linux/acpi.h>
1314
#include <linux/delay.h>
1415
#include <linux/device.h>
1516
#include <linux/io.h>
@@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = {
10471048
MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);
10481049
#endif
10491050

1051+
static const struct acpi_device_id cros_ec_codec_acpi_id[] = {
1052+
{ "GOOG0013", 0 },
1053+
{ }
1054+
};
1055+
MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id);
1056+
10501057
static struct platform_driver cros_ec_codec_platform_driver = {
10511058
.driver = {
10521059
.name = "cros-ec-codec",
10531060
.of_match_table = of_match_ptr(cros_ec_codec_of_match),
1061+
.acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id),
10541062
},
10551063
.probe = cros_ec_codec_platform_probe,
10561064
};

sound/soc/codecs/hdac_hda.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,9 @@ static int hdac_hda_dev_remove(struct hdac_device *hdev)
588588
struct hdac_hda_priv *hda_pvt;
589589

590590
hda_pvt = dev_get_drvdata(&hdev->dev);
591-
cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
591+
if (hda_pvt && hda_pvt->codec.registered)
592+
cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
593+
592594
return 0;
593595
}
594596

sound/soc/codecs/msm8916-wcd-analog.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component
396396

397397
switch (event) {
398398
case SND_SOC_DAPM_PRE_PMU:
399-
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
400-
MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
401-
MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
402399
snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);
403400
snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,
404401
MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,
@@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct
448445
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
449446
struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
450447

448+
switch (event) {
449+
case SND_SOC_DAPM_PRE_PMU:
450+
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
451+
MICB_1_INT_TX1_INT_RBIAS_EN_MASK,
452+
MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE);
453+
break;
454+
}
455+
451456
return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,
452457
wcd->micbias1_cap_mode);
453458
}
@@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct
558563
struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
559564

560565
switch (event) {
566+
case SND_SOC_DAPM_PRE_PMU:
567+
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
568+
MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
569+
MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
570+
break;
561571
case SND_SOC_DAPM_POST_PMU:
562572
pm8916_mbhc_configure_bias(wcd, true);
563573
break;
@@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
938948

939949
SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,
940950
pm8916_wcd_analog_enable_micbias_ext1,
941-
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
951+
SND_SOC_DAPM_POST_PMU),
942952
SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,
943953
pm8916_wcd_analog_enable_micbias_ext2,
944-
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
954+
SND_SOC_DAPM_POST_PMU),
945955

946956
SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
947957
pm8916_wcd_analog_enable_adc,

sound/soc/codecs/msm8916-wcd-digital.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator(
586586
snd_soc_component_write(component, rx_gain_reg[w->shift],
587587
snd_soc_component_read32(component, rx_gain_reg[w->shift]));
588588
break;
589+
case SND_SOC_DAPM_POST_PMD:
590+
snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
591+
1 << w->shift, 1 << w->shift);
592+
snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
593+
1 << w->shift, 0x0);
594+
break;
589595
}
590596
return 0;
591597
}

sound/soc/codecs/rt5640.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,13 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component)
24322432
{
24332433
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
24342434

2435+
/*
2436+
* soc_remove_component() force-disables jack and thus rt5640->jack
2437+
* could be NULL at the time of driver's module unloading.
2438+
*/
2439+
if (!rt5640->jack)
2440+
return;
2441+
24352442
disable_irq(rt5640->irq);
24362443
rt5640_cancel_work(rt5640);
24372444

sound/soc/intel/boards/bytcht_es8316.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = {
442442
DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
443443
DMI_MATCH(DMI_PRODUCT_NAME, "NB41"),
444444
},
445-
.driver_data = (void *)(BYT_CHT_ES8316_INTMIC_IN2_MAP
445+
.driver_data = (void *)(BYT_CHT_ES8316_SSP0
446+
| BYT_CHT_ES8316_INTMIC_IN2_MAP
446447
| BYT_CHT_ES8316_JD_INVERTED),
447448
},
448449
{ /* Teclast X98 Plus II */

sound/soc/soc-component.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd)
539539
struct snd_soc_rtdcom_list *rtdcom;
540540
struct snd_soc_component *component;
541541

542+
if (!rtd->pcm)
543+
return;
544+
542545
for_each_rtd_components(rtd, rtdcom, component)
543546
if (component->driver->pcm_destruct)
544547
component->driver->pcm_destruct(component, rtd->pcm);

sound/soc/sof/intel/hda-codec.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,18 @@
2424
#define IDISP_VID_INTEL 0x80860000
2525

2626
/* load the legacy HDA codec driver */
27-
#ifdef MODULE
28-
static void hda_codec_load_module(struct hda_codec *codec)
27+
static int hda_codec_load_module(struct hda_codec *codec)
2928
{
29+
#ifdef MODULE
3030
char alias[MODULE_NAME_LEN];
3131
const char *module = alias;
3232

3333
snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias));
3434
dev_dbg(&codec->core.dev, "loading codec module: %s\n", module);
3535
request_module(module);
36-
}
37-
#else
38-
static void hda_codec_load_module(struct hda_codec *codec) {}
3936
#endif
37+
return device_attach(hda_codec_dev(codec));
38+
}
4039

4140
/* enable controller wake up event for all codecs with jack connectors */
4241
void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev)
@@ -129,10 +128,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
129128
if ((mach_params && mach_params->common_hdmi_codec_drv) ||
130129
(resp & 0xFFFF0000) != IDISP_VID_INTEL) {
131130
hdev->type = HDA_DEV_LEGACY;
132-
hda_codec_load_module(&hda_priv->codec);
131+
ret = hda_codec_load_module(&hda_priv->codec);
132+
/*
133+
* handle ret==0 (no driver bound) as an error, but pass
134+
* other return codes without modification
135+
*/
136+
if (ret == 0)
137+
ret = -ENOENT;
133138
}
134139

135-
return 0;
140+
return ret;
136141
#else
137142
hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);
138143
if (!hdev)

sound/soc/sof/intel/hda-loader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
329329
if (!ret)
330330
break;
331331

332-
dev_err(sdev->dev, "error: Error code=0x%x: FW status=0x%x\n",
332+
dev_dbg(sdev->dev, "iteration %d of Core En/ROM load failed: %d\n",
333+
i, ret);
334+
dev_dbg(sdev->dev, "Error code=0x%x: FW status=0x%x\n",
333335
snd_sof_dsp_read(sdev, HDA_DSP_BAR,
334336
HDA_DSP_SRAM_REG_ROM_ERROR),
335337
snd_sof_dsp_read(sdev, HDA_DSP_BAR,
336338
HDA_DSP_SRAM_REG_ROM_STATUS));
337-
dev_err(sdev->dev, "error: iteration %d of Core En/ROM load failed: %d\n",
338-
i, ret);
339339
}
340340

341341
if (i == HDA_FW_BOOT_ATTEMPTS) {

sound/soc/sti/uniperif_player.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ static void uni_player_set_channel_status(struct uniperif *player,
226226
* sampling frequency. If no sample rate is already specified, then
227227
* set one.
228228
*/
229-
mutex_lock(&player->ctrl_lock);
230229
if (runtime) {
231230
switch (runtime->rate) {
232231
case 22050:
@@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player,
303302
player->stream_settings.iec958.status[3 + (n * 4)] << 24;
304303
SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status);
305304
}
306-
mutex_unlock(&player->ctrl_lock);
307305

308306
/* Update the channel status */
309307
if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
@@ -365,8 +363,10 @@ static int uni_player_prepare_iec958(struct uniperif *player,
365363

366364
SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player);
367365

366+
mutex_lock(&player->ctrl_lock);
368367
/* Update the channel status */
369368
uni_player_set_channel_status(player, runtime);
369+
mutex_unlock(&player->ctrl_lock);
370370

371371
/* Clear the user validity user bits */
372372
SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0);
@@ -598,7 +598,6 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol,
598598
iec958->status[1] = ucontrol->value.iec958.status[1];
599599
iec958->status[2] = ucontrol->value.iec958.status[2];
600600
iec958->status[3] = ucontrol->value.iec958.status[3];
601-
mutex_unlock(&player->ctrl_lock);
602601

603602
spin_lock_irqsave(&player->irq_lock, flags);
604603
if (player->substream && player->substream->runtime)
@@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol,
608607
uni_player_set_channel_status(player, NULL);
609608

610609
spin_unlock_irqrestore(&player->irq_lock, flags);
610+
mutex_unlock(&player->ctrl_lock);
611+
611612
return 0;
612613
}
613614

0 commit comments

Comments
 (0)