Skip to content

Commit

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

Pull sound fixes from Takashi Iwai:
 "Here is a collection of fixes that have been gathered since the
  previous pull request.

  All about device-specific fixes and quirks, and most of them are
  pretty small and trivial"

* tag 'sound-fix-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (25 commits)
  ALSA: hda/realtek: Workaround for resume on Dell Venue 11 Pro 7130
  ALSA: hda: Fix headset detection failure due to unstable sort
  ALSA: pcm: use new array-copying-wrapper
  ASoC: codec: es8316: "DAC Soft Ramp Rate" is just a 2 bit control
  ASoC: amd: acp: Fix possible deadlock
  firmware: cs_dsp: FW_CS_DSP_KUNIT_TEST should not select REGMAP
  ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro
  ALSA: hda/realtek: Fix quirk matching for Legion Pro 7
  ASoC: renesas: SND_SIU_MIGOR should depend on DMADEVICES
  ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet 5V
  ASoC: da7213: Initialize the mutex
  ASoC: use to_platform_device() instead of container_of()
  ASoC: acp: Support microphone from Lenovo Go S
  ASoC: SOF: imx8m: Add entry for new 8M Plus revision
  ASoC: SOF: imx8: Add entries for new 8QM and 8QXP revisions
  ASoC: SOF: imx: Add mach entry to select cs42888 topology
  dt-bindings: arm: imx: Add board revisions for i.MX8MP, i.MX8QM and i.MX8QXP
  ASoC: fsl_asrc_m2m: select CONFIG_DMA_SHARED_BUFFER
  ASoC: audio-graph-card2: use correct endpoint when getting link parameters
  ASoC: SOF: imx8m: add SAI2,5,6,7
  ...
  • Loading branch information
torvalds committed Jan 31, 2025
2 parents 69e858e + 8c2fa44 commit 8f08ed0
Show file tree
Hide file tree
Showing 27 changed files with 233 additions and 71 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/arm/fsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ properties:
- dmo,imx8mp-data-modul-edm-sbc # i.MX8MP eDM SBC
- emcraft,imx8mp-navqp # i.MX8MP Emcraft Systems NavQ+ Kit
- fsl,imx8mp-evk # i.MX8MP EVK Board
- fsl,imx8mp-evk-revb4 # i.MX8MP EVK Rev B4 Board
- gateworks,imx8mp-gw71xx-2x # i.MX8MP Gateworks Board
- gateworks,imx8mp-gw72xx-2x # i.MX8MP Gateworks Board
- gateworks,imx8mp-gw73xx-2x # i.MX8MP Gateworks Board
Expand Down Expand Up @@ -1271,6 +1272,7 @@ properties:
items:
- enum:
- fsl,imx8qm-mek # i.MX8QM MEK Board
- fsl,imx8qm-mek-revd # i.MX8QM MEK Rev D Board
- toradex,apalis-imx8 # Apalis iMX8 Modules
- toradex,apalis-imx8-v1.1 # Apalis iMX8 V1.1 Modules
- const: fsl,imx8qm
Expand Down Expand Up @@ -1299,6 +1301,7 @@ properties:
- enum:
- einfochips,imx8qxp-ai_ml # i.MX8QXP AI_ML Board
- fsl,imx8qxp-mek # i.MX8QXP MEK Board
- fsl,imx8qxp-mek-wcpu # i.MX8QXP MEK WCPU Board
- const: fsl,imx8qxp

- description: i.MX8DXL based Boards
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/sound/ti,pcm1681.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/sound/ti,pcm1681.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments PCM1681 8-channel PWM Processor
title: Texas Instruments PCM1681 8-channel Digital-to-Analog Converter

maintainers:
- Shenghao Ding <[email protected]>
Expand Down
6 changes: 2 additions & 4 deletions drivers/firmware/cirrus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ config FW_CS_DSP

config FW_CS_DSP_KUNIT_TEST_UTILS
tristate
depends on KUNIT
select REGMAP
depends on KUNIT && REGMAP
select FW_CS_DSP

config FW_CS_DSP_KUNIT_TEST
tristate "KUnit tests for Cirrus Logic cs_dsp" if !KUNIT_ALL_TESTS
depends on KUNIT
depends on KUNIT && REGMAP
default KUNIT_ALL_TESTS
select REGMAP
select FW_CS_DSP
select FW_CS_DSP_KUNIT_TEST_UTILS
help
Expand Down
2 changes: 1 addition & 1 deletion sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -3245,7 +3245,7 @@ static int snd_pcm_xfern_frames_ioctl(struct snd_pcm_substream *substream,
if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
return -EFAULT;

bufs = memdup_user(xfern.bufs, sizeof(void *) * runtime->channels);
bufs = memdup_array_user(xfern.bufs, runtime->channels, sizeof(void *));
if (IS_ERR(bufs))
return PTR_ERR(bufs);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
Expand Down
8 changes: 7 additions & 1 deletion sound/pci/hda/hda_auto_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ static int compare_input_type(const void *ap, const void *bp)

/* In case one has boost and the other one has not,
pick the one with boost first. */
return (int)(b->has_boost_on_pin - a->has_boost_on_pin);
if (a->has_boost_on_pin != b->has_boost_on_pin)
return (int)(b->has_boost_on_pin - a->has_boost_on_pin);

/* Keep the original order */
return a->order - b->order;
}

/* Reorder the surround channels
Expand Down Expand Up @@ -400,6 +404,8 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
reorder_outputs(cfg->speaker_outs, cfg->speaker_pins);

/* sort inputs in the order of AUTO_PIN_* type */
for (i = 0; i < cfg->num_inputs; i++)
cfg->inputs[i].order = i;
sort(cfg->inputs, cfg->num_inputs, sizeof(cfg->inputs[0]),
compare_input_type, NULL);

Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/hda_auto_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct auto_pin_cfg_item {
unsigned int is_headset_mic:1;
unsigned int is_headphone_mic:1; /* Mic-only in headphone jack */
unsigned int has_boost_on_pin:1;
int order;
};

struct auto_pin_cfg;
Expand Down
18 changes: 17 additions & 1 deletion sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -7497,6 +7497,16 @@ static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
}

/*
* Clear COEF 0x0d (PCBEEP passthrough) bit 0x40 where BIOS sets it wrongly
* at PM resume
*/
static void alc283_fixup_dell_hp_resume(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
if (action == HDA_FIXUP_ACT_INIT)
alc_write_coef_idx(codec, 0xd, 0x2800);
}

enum {
ALC269_FIXUP_GPIO2,
Expand Down Expand Up @@ -7799,6 +7809,7 @@ enum {
ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
ALC233_FIXUP_MEDION_MTL_SPK,
ALC294_FIXUP_BASS_SPEAKER_15,
ALC283_FIXUP_DELL_HP_RESUME,
};

/* A special fixup for Lenovo C940 and Yoga Duet 7;
Expand Down Expand Up @@ -10143,6 +10154,10 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc294_fixup_bass_speaker_15,
},
[ALC283_FIXUP_DELL_HP_RESUME] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc283_fixup_dell_hp_resume,
},
};

static const struct hda_quirk alc269_fixup_tbl[] = {
Expand Down Expand Up @@ -10203,6 +10218,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0604, "Dell Venue 11 Pro 7130", ALC283_FIXUP_DELL_HP_RESUME),
SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
Expand Down Expand Up @@ -10918,7 +10934,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
HDA_CODEC_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x17aa, 0x386e, "Yoga Pro 7 14ARP8", ALC285_FIXUP_SPEAKER2_TO_DAC1),
HDA_CODEC_QUIRK(0x17aa, 0x386f, "Legion Pro 7 16ARX8H", ALC287_FIXUP_TAS2781_I2C),
HDA_CODEC_QUIRK(0x17aa, 0x38a8, "Legion Pro 7 16ARX8H", ALC287_FIXUP_TAS2781_I2C), /* this must match before PCI SSID 17aa:386f below */
SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
Expand Down
1 change: 1 addition & 0 deletions sound/soc/amd/acp/acp-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ static int acp_i2s_set_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, u32 rx_mas
break;
default:
dev_err(dev, "Unknown chip revision %d\n", chip->acp_rev);
spin_unlock_irq(&adata->acp_lock);
return -EINVAL;
}
}
Expand Down
28 changes: 28 additions & 0 deletions sound/soc/amd/yc/acp6x-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,34 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "83AS"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "83L3"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "83N6"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "83Q2"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/da7213.c
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,8 @@ static int da7213_i2c_probe(struct i2c_client *i2c)
return ret;
}

mutex_init(&da7213->ctrl_lock);

pm_runtime_set_autosuspend_delay(&i2c->dev, 100);
pm_runtime_use_autosuspend(&i2c->dev);
pm_runtime_set_active(&i2c->dev);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/es8316.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static const struct snd_kcontrol_new es8316_snd_controls[] = {
SOC_DOUBLE_R_TLV("DAC Playback Volume", ES8316_DAC_VOLL,
ES8316_DAC_VOLR, 0, 0xc0, 1, dac_vol_tlv),
SOC_SINGLE("DAC Soft Ramp Switch", ES8316_DAC_SET1, 4, 1, 1),
SOC_SINGLE("DAC Soft Ramp Rate", ES8316_DAC_SET1, 2, 4, 0),
SOC_SINGLE("DAC Soft Ramp Rate", ES8316_DAC_SET1, 2, 3, 0),
SOC_SINGLE("DAC Notch Filter Switch", ES8316_DAC_SET2, 6, 1, 0),
SOC_SINGLE("DAC Double Fs Switch", ES8316_DAC_SET2, 7, 1, 0),
SOC_SINGLE("DAC Stereo Enhancement", ES8316_DAC_SET3, 0, 7, 0),
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/codecs/es8326.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ static void es8326_jack_detect_handler(struct work_struct *work)
regmap_write(es8326->regmap, ES8326_INT_SOURCE,
(ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON));
regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x1f);
regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x08);
regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x0d);
queue_delayed_work(system_wq, &es8326->jack_detect_work,
msecs_to_jiffies(400));
es8326->hp = 1;
Expand Down Expand Up @@ -1023,7 +1023,7 @@ static void es8326_init(struct snd_soc_component *component)
struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);

regmap_write(es8326->regmap, ES8326_RESET, 0x1f);
regmap_write(es8326->regmap, ES8326_VMIDSEL, 0x0E);
regmap_write(es8326->regmap, ES8326_VMIDSEL, 0x3E);
regmap_write(es8326->regmap, ES8326_ANA_LP, 0xf0);
usleep_range(10000, 15000);
regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xd9);
Expand Down
3 changes: 1 addition & 2 deletions sound/soc/codecs/rt5514.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,7 @@ static int rt5514_set_bias_level(struct snd_soc_component *component,
static int rt5514_probe(struct snd_soc_component *component)
{
struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
struct platform_device *pdev = container_of(component->dev,
struct platform_device, dev);
struct platform_device *pdev = to_platform_device(component->dev);

rt5514->mclk = devm_clk_get_optional(component->dev, "mclk");
if (IS_ERR(rt5514->mclk))
Expand Down
1 change: 1 addition & 0 deletions sound/soc/fsl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ comment "Common SoC Audio options for Freescale CPUs:"
config SND_SOC_FSL_ASRC
tristate "Asynchronous Sample Rate Converter (ASRC) module support"
depends on HAS_DMA
select DMA_SHARED_BUFFER
select REGMAP_MMIO
select SND_SOC_GENERIC_DMAENGINE_PCM
select SND_COMPRESS_ACCEL
Expand Down
16 changes: 9 additions & 7 deletions sound/soc/fsl/fsl_asrc_m2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static int asrc_dmaconfig(struct fsl_asrc_pair *pair,
}

/* main function of converter */
static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task_runtime *task)
static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task_runtime *task)
{
struct fsl_asrc *asrc = pair->asrc;
struct device *dev = &asrc->pdev->dev;
Expand All @@ -193,7 +193,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas
unsigned int out_dma_len;
unsigned int width;
u32 fifo_addr;
int ret;
int ret = 0;

/* set ratio mod */
if (asrc->m2m_set_ratio_mod) {
Expand All @@ -215,6 +215,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas
in_buf_len > ASRC_M2M_BUFFER_SIZE ||
in_buf_len % (width * pair->channels / 8)) {
dev_err(dev, "out buffer size is error: [%d]\n", in_buf_len);
ret = -EINVAL;
goto end;
}

Expand Down Expand Up @@ -245,6 +246,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas
}
} else if (out_dma_len > ASRC_M2M_BUFFER_SIZE) {
dev_err(dev, "cap buffer size error\n");
ret = -EINVAL;
goto end;
}

Expand All @@ -263,12 +265,14 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas

if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
dev_err(dev, "out DMA task timeout\n");
ret = -ETIMEDOUT;
goto end;
}

if (out_dma_len > 0) {
if (!wait_for_completion_interruptible_timeout(&pair->complete[OUT], 10 * HZ)) {
dev_err(dev, "cap DMA task timeout\n");
ret = -ETIMEDOUT;
goto end;
}
}
Expand All @@ -278,7 +282,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas
/* update payload length for capture */
task->output_size = out_dma_len;
end:
return;
return ret;
}

static int fsl_asrc_m2m_comp_open(struct snd_compr_stream *stream)
Expand Down Expand Up @@ -525,9 +529,7 @@ static int fsl_asrc_m2m_comp_task_start(struct snd_compr_stream *stream,
struct snd_compr_runtime *runtime = stream->runtime;
struct fsl_asrc_pair *pair = runtime->private_data;

asrc_m2m_device_run(pair, task);

return 0;
return asrc_m2m_device_run(pair, task);
}

static int fsl_asrc_m2m_comp_task_stop(struct snd_compr_stream *stream,
Expand Down Expand Up @@ -633,7 +635,7 @@ int fsl_asrc_m2m_suspend(struct fsl_asrc *asrc)

for (i = 0; i < PAIR_CTX_NUM; i++) {
pair = asrc->pair[i];
if (!pair)
if (!pair || !pair->dma_buffer[IN].area || !pair->dma_buffer[OUT].area)
continue;
if (!completion_done(&pair->complete[IN])) {
if (pair->dma_chan[IN])
Expand Down
Loading

0 comments on commit 8f08ed0

Please sign in to comment.