Skip to content

Commit

Permalink
Merge tag 'sound-6.14-rc7' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of last-minute fixes.

  Most of them are for ASoC, and the only one core fix is for reverting
  the previous change, while the rest are all device-specific quirks and
  fixes, which should be relatively safe to apply"

* tag 'sound-6.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: cs42l43: convert to SYSTEM_SLEEP_PM_OPS
  ALSA: hda/realtek: Add mute LED quirk for HP Pavilion x360 14-dy1xxx
  ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
  ASoC: rt722-sdca: add missing readable registers
  ASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model
  ASoC: cs42l43: Fix maximum ADC Volume
  ASoC: ops: Consistently treat platform_max as control value
  ASoC: rt1320: set wake_capable = 0 explicitly
  ASoC: cs42l43: Add jack delay debounce after suspend
  ASoC: tegra: Fix ADX S24_LE audio format
  ASoC: codecs: wsa884x: report temps to hwmon in millidegree of Celsius
  ASoC: Intel: sof_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
  • Loading branch information
Linus Torvalds committed Mar 14, 2025
2 parents ef92486 + de69d56 commit b1144bc
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 21 deletions.
5 changes: 4 additions & 1 deletion include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,10 @@ void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);

/* mixer control */
struct soc_mixer_control {
int min, max, platform_max;
/* Minimum and maximum specified as written to the hardware */
int min, max;
/* Limited maximum value specified as presented through the control */
int platform_max;
int reg, rreg;
unsigned int shift, rshift;
unsigned int sign_bit;
Expand Down
21 changes: 21 additions & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -4790,6 +4790,21 @@ static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
}
}

static void alc295_fixup_hp_mute_led_coefbit11(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;

if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->mute_led_polarity = 0;
spec->mute_led_coef.idx = 0xb;
spec->mute_led_coef.mask = 3 << 3;
spec->mute_led_coef.on = 1 << 3;
spec->mute_led_coef.off = 1 << 4;
snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
}
}

static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
Expand Down Expand Up @@ -7656,6 +7671,7 @@ enum {
ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
ALC290_FIXUP_SUBWOOFER,
ALC290_FIXUP_SUBWOOFER_HSJACK,
ALC295_FIXUP_HP_MUTE_LED_COEFBIT11,
ALC269_FIXUP_THINKPAD_ACPI,
ALC269_FIXUP_LENOVO_XPAD_ACPI,
ALC269_FIXUP_DMIC_THINKPAD_ACPI,
Expand Down Expand Up @@ -9401,6 +9417,10 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC283_FIXUP_INT_MIC,
},
[ALC295_FIXUP_HP_MUTE_LED_COEFBIT11] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc295_fixup_hp_mute_led_coefbit11,
},
[ALC298_FIXUP_SAMSUNG_AMP] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc298_fixup_samsung_amp,
Expand Down Expand Up @@ -10451,6 +10471,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
SND_PCI_QUIRK(0x103c, 0x85c6, "HP Pavilion x360 Convertible 14-dy1xxx", ALC295_FIXUP_HP_MUTE_LED_COEFBIT11),
SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/amd/yc/acp6x-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "21M5"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "21M6"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
Expand Down
13 changes: 10 additions & 3 deletions sound/soc/codecs/cs42l43-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ int cs42l43_set_jack(struct snd_soc_component *component,
autocontrol |= 0x3 << CS42L43_JACKDET_MODE_SHIFT;

ret = cs42l43_find_index(priv, "cirrus,tip-fall-db-ms", 500,
NULL, cs42l43_accdet_db_ms,
&priv->tip_fall_db_ms, cs42l43_accdet_db_ms,
ARRAY_SIZE(cs42l43_accdet_db_ms));
if (ret < 0)
goto error;

tip_deb |= ret << CS42L43_TIPSENSE_FALLING_DB_TIME_SHIFT;

ret = cs42l43_find_index(priv, "cirrus,tip-rise-db-ms", 500,
NULL, cs42l43_accdet_db_ms,
&priv->tip_rise_db_ms, cs42l43_accdet_db_ms,
ARRAY_SIZE(cs42l43_accdet_db_ms));
if (ret < 0)
goto error;
Expand Down Expand Up @@ -764,21 +764,28 @@ void cs42l43_tip_sense_work(struct work_struct *work)
error:
mutex_unlock(&priv->jack_lock);

priv->suspend_jack_debounce = false;

pm_runtime_mark_last_busy(priv->dev);
pm_runtime_put_autosuspend(priv->dev);
}

irqreturn_t cs42l43_tip_sense(int irq, void *data)
{
struct cs42l43_codec *priv = data;
unsigned int db_delay = priv->tip_debounce_ms;

cancel_delayed_work(&priv->bias_sense_timeout);
cancel_delayed_work(&priv->tip_sense_work);
cancel_delayed_work(&priv->button_press_work);
cancel_work(&priv->button_release_work);

// Ensure delay after suspend is long enough to avoid false detection
if (priv->suspend_jack_debounce)
db_delay += priv->tip_fall_db_ms + priv->tip_rise_db_ms;

queue_delayed_work(system_long_wq, &priv->tip_sense_work,
msecs_to_jiffies(priv->tip_debounce_ms));
msecs_to_jiffies(db_delay));

return IRQ_HANDLED;
}
Expand Down
17 changes: 15 additions & 2 deletions sound/soc/codecs/cs42l43.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ static const struct snd_kcontrol_new cs42l43_controls[] = {

SOC_DOUBLE_R_SX_TLV("ADC Volume", CS42L43_ADC_B_CTRL1, CS42L43_ADC_B_CTRL2,
CS42L43_ADC_PGA_GAIN_SHIFT,
0xF, 5, cs42l43_adc_tlv),
0xF, 4, cs42l43_adc_tlv),

SOC_DOUBLE("PDM1 Invert Switch", CS42L43_DMIC_PDM_CTRL,
CS42L43_PDM1L_INV_SHIFT, CS42L43_PDM1R_INV_SHIFT, 1, 0),
Expand Down Expand Up @@ -2402,9 +2402,22 @@ static int cs42l43_codec_runtime_resume(struct device *dev)
return 0;
}

static int cs42l43_codec_runtime_force_suspend(struct device *dev)
{
struct cs42l43_codec *priv = dev_get_drvdata(dev);

dev_dbg(priv->dev, "Runtime suspend\n");

priv->suspend_jack_debounce = true;

pm_runtime_force_suspend(dev);

return 0;
}

static const struct dev_pm_ops cs42l43_codec_pm_ops = {
RUNTIME_PM_OPS(NULL, cs42l43_codec_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
SYSTEM_SLEEP_PM_OPS(cs42l43_codec_runtime_force_suspend, pm_runtime_force_resume)
};

static const struct platform_device_id cs42l43_codec_id_table[] = {
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/cs42l43.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ struct cs42l43_codec {

bool use_ring_sense;
unsigned int tip_debounce_ms;
unsigned int tip_fall_db_ms;
unsigned int tip_rise_db_ms;
unsigned int bias_low;
unsigned int bias_sense_ua;
unsigned int bias_ramp_ms;
Expand All @@ -95,6 +97,7 @@ struct cs42l43_codec {
bool button_detect_running;
bool jack_present;
int jack_override;
bool suspend_jack_debounce;

struct work_struct hp_ilimit_work;
struct delayed_work hp_ilimit_clear_work;
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/rt1320-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ static int rt1320_read_prop(struct sdw_slave *slave)
/* set the timeout values */
prop->clk_stop_timeout = 64;

/* BIOS may set wake_capable. Make sure it is 0 as wake events are disabled. */
prop->wake_capable = 0;

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/rt722-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ static bool rt722_sdca_mbq_readable_register(struct device *dev, unsigned int re
case 0x6100067:
case 0x6100070 ... 0x610007c:
case 0x6100080:
case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN,
CH_01) ...
SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN,
CH_04):
case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_USER_FU1E, RT722_SDCA_CTL_FU_VOLUME,
CH_01):
case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_USER_FU1E, RT722_SDCA_CTL_FU_VOLUME,
Expand Down
13 changes: 11 additions & 2 deletions sound/soc/codecs/wm0010.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ static int wm0010_spi_probe(struct spi_device *spi)
if (ret) {
dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n",
irq, ret);
return ret;
goto free_irq;
}

if (spi->max_speed_hz)
Expand All @@ -932,9 +932,18 @@ static int wm0010_spi_probe(struct spi_device *spi)
&soc_component_dev_wm0010, wm0010_dai,
ARRAY_SIZE(wm0010_dai));
if (ret < 0)
return ret;
goto disable_irq_wake;

return 0;

disable_irq_wake:
irq_set_irq_wake(wm0010->irq, 0);

free_irq:
if (wm0010->irq)
free_irq(wm0010->irq, wm0010);

return ret;
}

static void wm0010_spi_remove(struct spi_device *spi)
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/codecs/wsa884x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ static int wsa884x_get_temp(struct wsa884x_priv *wsa884x, long *temp)
* Reading temperature is possible only when Power Amplifier is
* off. Report last cached data.
*/
*temp = wsa884x->temperature;
*temp = wsa884x->temperature * 1000;
return 0;
}

Expand Down Expand Up @@ -1934,7 +1934,7 @@ static int wsa884x_get_temp(struct wsa884x_priv *wsa884x, long *temp)
if ((val > WSA884X_LOW_TEMP_THRESHOLD) &&
(val < WSA884X_HIGH_TEMP_THRESHOLD)) {
wsa884x->temperature = val;
*temp = val;
*temp = val * 1000;
ret = 0;
} else {
ret = -EAGAIN;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/sof_sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card,

/* generate DAI links by each sdw link */
while (sof_dais->initialised) {
int current_be_id;
int current_be_id = 0;

ret = create_sdw_dailink(card, sof_dais, dai_links,
&current_be_id, codec_conf);
Expand Down
15 changes: 7 additions & 8 deletions sound/soc/soc-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[0] < 0)
return -EINVAL;
val = ucontrol->value.integer.value[0];
if (mc->platform_max && ((int)val + min) > mc->platform_max)
if (mc->platform_max && val > mc->platform_max)
return -EINVAL;
if (val > max - min)
return -EINVAL;
Expand All @@ -350,7 +350,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[1] < 0)
return -EINVAL;
val2 = ucontrol->value.integer.value[1];
if (mc->platform_max && ((int)val2 + min) > mc->platform_max)
if (mc->platform_max && val2 > mc->platform_max)
return -EINVAL;
if (val2 > max - min)
return -EINVAL;
Expand Down Expand Up @@ -503,17 +503,16 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int platform_max;
int min = mc->min;
int max;

if (!mc->platform_max)
mc->platform_max = mc->max;
platform_max = mc->platform_max;
max = mc->max - mc->min;
if (mc->platform_max && mc->platform_max < max)
max = mc->platform_max;

uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = platform_max - min;
uinfo->value.integer.max = max;

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/tegra/tegra210_adx.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static const struct snd_soc_dai_ops tegra210_adx_out_dai_ops = {
.rates = SNDRV_PCM_RATE_8000_192000, \
.formats = SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.capture = { \
Expand All @@ -274,7 +274,7 @@ static const struct snd_soc_dai_ops tegra210_adx_out_dai_ops = {
.rates = SNDRV_PCM_RATE_8000_192000, \
.formats = SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.ops = &tegra210_adx_out_dai_ops, \
Expand Down

0 comments on commit b1144bc

Please sign in to comment.