Skip to content

Commit

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

Pull sound fixes from Takashi Iwai:
 "A collection of fixes for 6.6-rc1. All small and easy ones.

   - The corrections of the previous PCM iov_iter transitions

   - Regression fixes in MIDI 2.0 / USB changes

   - Various ASoC codec fixes for Cirrus, Realtek, WCD

   - ASoC AMD quirks and ASoC Intel AVS driver workaround"

* tag 'sound-fix-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
  ALSA: hda/realtek - ALC287 I2S speaker platform support
  ASoC: amd: yc: Fix a non-functional mic on Lenovo 82TL
  ASoC: Intel: avs: Provide support for fallback topology
  ALSA: seq: Fix snd_seq_expand_var_event() call to user-space
  ALSA: usb-audio: Fix potential memory leaks at error path for UMP open
  ALSA: hda/cirrus: Fix broken audio on hardware with two CS42L42 codecs.
  ASoC: rt5645: NULL pointer access when removing jack
  ASoC: amd: yc: Add DMI entries to support Victus by HP Gaming Laptop 15-fb0xxx (8A3E)
  MAINTAINERS: Update the MAINTAINERS enties for TEXAS INSTRUMENTS ASoC DRIVERS
  ALSA: sb: Fix wrong argument in commented code
  ALSA: pcm: Fix error checks of default read/write copy ops
  ASoC: Name iov_iter argument as iterator instead of buffer
  ASoC: dmaengine: Drop unused iov_iter for process callback
  ALSA: hda/tas2781: Use standard clamp() macro
  ASoC: cs35l56: Waiting for firmware to boot must be tolerant of I/O errors
  ASoC: dt-bindings: fsl_easrc: Add support for imx8mp-easrc
  ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe()
  ASoC: cs35l45: Rename DACPCM1 Source control
  ASoC: cs35l45: Fix "Dead assigment" warning
  ASoC: cs35l45: Add support for Chip ID 0x35A460
  ...
  • Loading branch information
torvalds committed Sep 8, 2023
2 parents ca9c7ab + ecc8b4d commit a3d231e
Show file tree
Hide file tree
Showing 25 changed files with 160 additions and 66 deletions.
8 changes: 7 additions & 1 deletion Documentation/devicetree/bindings/sound/fsl,easrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ properties:
pattern: "^easrc@.*"

compatible:
const: fsl,imx8mn-easrc
oneOf:
- enum:
- fsl,imx8mn-easrc
- items:
- enum:
- fsl,imx8mp-easrc
- const: fsl,imx8mn-easrc

reg:
maxItems: 1
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -21244,7 +21244,7 @@ F: sound/soc/ti/
TEXAS INSTRUMENTS AUDIO (ASoC/HDA) DRIVERS
M: Shenghao Ding <[email protected]>
M: Kevin Lu <[email protected]>
M: Baojun Xu <x1077012@ti.com>
M: Baojun Xu <baojun.xu@ti.com>
L: [email protected] (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/sound/tas2552.txt
Expand Down
2 changes: 1 addition & 1 deletion include/sound/dmaengine_pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct snd_dmaengine_pcm_config {
struct snd_pcm_substream *substream);
int (*process)(struct snd_pcm_substream *substream,
int channel, unsigned long hwoff,
struct iov_iter *buf, unsigned long bytes);
unsigned long bytes);
dma_filter_fn compat_filter_fn;
struct device *dma_dev;
const char *chan_names[SNDRV_PCM_STREAM_LAST + 1];
Expand Down
4 changes: 2 additions & 2 deletions include/sound/soc-component.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ struct snd_soc_component_driver {
struct snd_pcm_audio_tstamp_report *audio_tstamp_report);
int (*copy)(struct snd_soc_component *component,
struct snd_pcm_substream *substream, int channel,
unsigned long pos, struct iov_iter *buf,
unsigned long pos, struct iov_iter *iter,
unsigned long bytes);
struct page *(*page)(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
Expand Down Expand Up @@ -511,7 +511,7 @@ int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream);
int snd_soc_pcm_component_copy(struct snd_pcm_substream *substream,
int channel, unsigned long pos,
struct iov_iter *buf, unsigned long bytes);
struct iov_iter *iter, unsigned long bytes);
struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
unsigned long offset);
int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
Expand Down
8 changes: 4 additions & 4 deletions sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,8 +1992,8 @@ static int default_write_copy(struct snd_pcm_substream *substream,
int channel, unsigned long hwoff,
struct iov_iter *iter, unsigned long bytes)
{
if (!copy_from_iter(get_dma_ptr(substream->runtime, channel, hwoff),
bytes, iter))
if (copy_from_iter(get_dma_ptr(substream->runtime, channel, hwoff),
bytes, iter) != bytes)
return -EFAULT;
return 0;
}
Expand Down Expand Up @@ -2025,8 +2025,8 @@ static int default_read_copy(struct snd_pcm_substream *substream,
int channel, unsigned long hwoff,
struct iov_iter *iter, unsigned long bytes)
{
if (!copy_to_iter(get_dma_ptr(substream->runtime, channel, hwoff),
bytes, iter))
if (copy_to_iter(get_dma_ptr(substream->runtime, channel, hwoff),
bytes, iter) != bytes)
return -EFAULT;
return 0;
}
Expand Down
9 changes: 7 additions & 2 deletions sound/core/seq/seq_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,13 @@ int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char
err = expand_var_event(event, 0, len, buf, in_kernel);
if (err < 0)
return err;
if (len != newlen)
memset(buf + len, 0, newlen - len);
if (len != newlen) {
if (in_kernel)
memset(buf + len, 0, newlen - len);
else if (clear_user((__force void __user *)buf + len,
newlen - len))
return -EFAULT;
}
return newlen;
}
EXPORT_SYMBOL(snd_seq_expand_var_event);
Expand Down
2 changes: 1 addition & 1 deletion sound/isa/sb/emu8000_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static int emu8k_pcm_silence(struct snd_pcm_substream *subs,
/* convert to word unit */
pos = (pos << 1) + rec->loop_start[voice];
count <<= 1;
LOOP_WRITE(rec, pos, USER_SOCKPTR(NULL), count);
LOOP_WRITE(rec, pos, NULL, count);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_cs8409.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ static void cs42l42_resume(struct sub_codec *cs42l42)

/* Initialize CS42L42 companion codec */
cs8409_i2c_bulk_write(cs42l42, cs42l42->init_seq, cs42l42->init_seq_num);
usleep_range(30000, 35000);
msleep(CS42L42_INIT_TIMEOUT_MS);

/* Clear interrupts, by reading interrupt status registers */
cs8409_i2c_bulk_read(cs42l42, irq_regs, ARRAY_SIZE(irq_regs));
Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/patch_cs8409.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ enum cs8409_coefficient_index_registers {
#define CS42L42_I2C_SLEEP_US (2000)
#define CS42L42_PDN_TIMEOUT_US (250000)
#define CS42L42_PDN_SLEEP_US (2000)
#define CS42L42_INIT_TIMEOUT_MS (45)
#define CS42L42_FULL_SCALE_VOL_MASK (2)
#define CS42L42_FULL_SCALE_VOL_0DB (1)
#define CS42L42_FULL_SCALE_VOL_MINUS6DB (0)
Expand Down
30 changes: 30 additions & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -7057,6 +7057,27 @@ static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
}
}

/* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
static void alc287_fixup_bind_dacs(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
static const hda_nid_t preferred_pairs[] = {
0x17, 0x02, 0x21, 0x03, 0
};

if (action != HDA_FIXUP_ACT_PRE_PROBE)
return;

snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
spec->gen.preferred_dacs = preferred_pairs;
spec->gen.auto_mute_via_amp = 1;
snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
0x0); /* Make sure 0x14 was disable */
}


enum {
ALC269_FIXUP_GPIO2,
ALC269_FIXUP_SONY_VAIO,
Expand Down Expand Up @@ -7319,6 +7340,7 @@ enum {
ALC287_FIXUP_TAS2781_I2C,
ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
ALC245_FIXUP_HP_X360_MUTE_LEDS,
ALC287_FIXUP_THINKPAD_I2S_SPK,
};

/* A special fixup for Lenovo C940 and Yoga Duet 7;
Expand Down Expand Up @@ -9413,6 +9435,10 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC245_FIXUP_HP_GPIO_LED
},
[ALC287_FIXUP_THINKPAD_I2S_SPK] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc287_fixup_bind_dacs,
},
};

static const struct snd_pci_quirk alc269_fixup_tbl[] = {
Expand Down Expand Up @@ -10544,6 +10570,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
{0x17, 0x90170111},
{0x19, 0x03a11030},
{0x21, 0x03211020}),
SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
{0x17, 0x90170110},
{0x19, 0x03a11030},
{0x21, 0x03211020}),
SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
{0x12, 0x90a60130},
{0x17, 0x90170110},
Expand Down
16 changes: 3 additions & 13 deletions sound/pci/hda/tas2781_hda_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,6 @@ static int tasdevice_get_profile_id(struct snd_kcontrol *kcontrol,
return 0;
}

static int tasdevice_hda_clamp(int val, int max)
{
if (val > max)
val = max;

if (val < 0)
val = 0;
return val;
}

static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
Expand All @@ -191,7 +181,7 @@ static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol,
int max = tas_priv->rcabin.ncfgs - 1;
int val, ret = 0;

val = tasdevice_hda_clamp(nr_profile, max);
val = clamp(nr_profile, 0, max);

if (tas_priv->rcabin.profile_cfg_id != val) {
tas_priv->rcabin.profile_cfg_id = val;
Expand Down Expand Up @@ -248,7 +238,7 @@ static int tasdevice_program_put(struct snd_kcontrol *kcontrol,
int max = tas_fw->nr_programs - 1;
int val, ret = 0;

val = tasdevice_hda_clamp(nr_program, max);
val = clamp(nr_program, 0, max);

if (tas_priv->cur_prog != val) {
tas_priv->cur_prog = val;
Expand Down Expand Up @@ -277,7 +267,7 @@ static int tasdevice_config_put(struct snd_kcontrol *kcontrol,
int max = tas_fw->nr_configurations - 1;
int val, ret = 0;

val = tasdevice_hda_clamp(nr_config, max);
val = clamp(nr_config, 0, max);

if (tas_priv->cur_conf != val) {
tas_priv->cur_conf = val;
Expand Down
14 changes: 14 additions & 0 deletions sound/soc/amd/yc/acp6x-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "82TL"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
Expand Down Expand Up @@ -325,6 +332,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "8A22"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
DMI_MATCH(DMI_BOARD_NAME, "8A3E"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/atmel/mchp-pdmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ static int mchp_pdmc_dt_init(struct mchp_pdmc *dd)
/* used to clean the channel index found on RHR's MSB */
static int mchp_pdmc_process(struct snd_pcm_substream *substream,
int channel, unsigned long hwoff,
struct iov_iter *buf, unsigned long bytes)
unsigned long bytes)
{
struct snd_pcm_runtime *runtime = substream->runtime;
u8 *dma_ptr = runtime->dma_area + hwoff +
Expand Down
6 changes: 6 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1968,11 +1968,15 @@ config SND_SOC_UDA1380
tristate
depends on I2C

config SND_SOC_WCD_CLASSH
tristate

config SND_SOC_WCD9335
tristate "WCD9335 Codec"
depends on SLIMBUS
select REGMAP_SLIMBUS
select REGMAP_IRQ
select SND_SOC_WCD_CLASSH
help
The WCD9335 is a standalone Hi-Fi audio CODEC IC, supports
Qualcomm Technologies, Inc. (QTI) multimedia solutions,
Expand All @@ -1987,6 +1991,7 @@ config SND_SOC_WCD934X
depends on SLIMBUS
select REGMAP_IRQ
select REGMAP_SLIMBUS
select SND_SOC_WCD_CLASSH
select SND_SOC_WCD_MBHC
depends on MFD_WCD934X || COMPILE_TEST
help
Expand All @@ -1997,6 +2002,7 @@ config SND_SOC_WCD938X
depends on SND_SOC_WCD938X_SDW
tristate
depends on SOUNDWIRE || !SOUNDWIRE
select SND_SOC_WCD_CLASSH

config SND_SOC_WCD938X_SDW
tristate "WCD9380/WCD9385 Codec - SDW"
Expand Down
8 changes: 5 additions & 3 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ snd-soc-twl4030-objs := twl4030.o
snd-soc-twl6040-objs := twl6040.o
snd-soc-uda1334-objs := uda1334.o
snd-soc-uda1380-objs := uda1380.o
snd-soc-wcd-classh-objs := wcd-clsh-v2.o
snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o
snd-soc-wcd9335-objs := wcd-clsh-v2.o wcd9335.o
snd-soc-wcd934x-objs := wcd-clsh-v2.o wcd934x.o
snd-soc-wcd938x-objs := wcd938x.o wcd-clsh-v2.o
snd-soc-wcd9335-objs := wcd9335.o
snd-soc-wcd934x-objs := wcd934x.o
snd-soc-wcd938x-objs := wcd938x.o
snd-soc-wcd938x-sdw-objs := wcd938x-sdw.o
snd-soc-wl1273-objs := wl1273.o
snd-soc-wm-adsp-objs := wm_adsp.o
Expand Down Expand Up @@ -685,6 +686,7 @@ obj-$(CONFIG_SND_SOC_TWL4030) += snd-soc-twl4030.o
obj-$(CONFIG_SND_SOC_TWL6040) += snd-soc-twl6040.o
obj-$(CONFIG_SND_SOC_UDA1334) += snd-soc-uda1334.o
obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
obj-$(CONFIG_SND_SOC_WCD_CLASSH) += snd-soc-wcd-classh.o
obj-$(CONFIG_SND_SOC_WCD_MBHC) += snd-soc-wcd-mbhc.o
obj-$(CONFIG_SND_SOC_WCD9335) += snd-soc-wcd9335.o
obj-$(CONFIG_SND_SOC_WCD934X) += snd-soc-wcd934x.o
Expand Down
11 changes: 6 additions & 5 deletions sound/soc/codecs/cs35l45.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static const struct snd_kcontrol_new cs35l45_dsp_muxes[] = {
};

static const struct snd_kcontrol_new cs35l45_dac_muxes[] = {
SOC_DAPM_ENUM("DACPCM1 Source", cs35l45_dacpcm_enums[0]),
SOC_DAPM_ENUM("DACPCM Source", cs35l45_dacpcm_enums[0]),
};

static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = {
Expand Down Expand Up @@ -333,7 +333,7 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = {
SND_SOC_DAPM_MUX("DSP_RX7 Source", SND_SOC_NOPM, 0, 0, &cs35l45_dsp_muxes[6]),
SND_SOC_DAPM_MUX("DSP_RX8 Source", SND_SOC_NOPM, 0, 0, &cs35l45_dsp_muxes[7]),

SND_SOC_DAPM_MUX("DACPCM1 Source", SND_SOC_NOPM, 0, 0, &cs35l45_dac_muxes[0]),
SND_SOC_DAPM_MUX("DACPCM Source", SND_SOC_NOPM, 0, 0, &cs35l45_dac_muxes[0]),

SND_SOC_DAPM_OUT_DRV("AMP", SND_SOC_NOPM, 0, 0, NULL, 0),

Expand Down Expand Up @@ -403,7 +403,7 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = {
{ "ASP_RX1", NULL, "ASP_EN" },
{ "ASP_RX2", NULL, "ASP_EN" },

{ "AMP", NULL, "DACPCM1 Source"},
{ "AMP", NULL, "DACPCM Source"},
{ "AMP", NULL, "GLOBAL_EN"},

CS35L45_DSP_MUX_ROUTE("DSP_RX1"),
Expand All @@ -427,7 +427,7 @@ static const struct snd_soc_dapm_route cs35l45_dapm_routes[] = {
{"DSP1 Preload", NULL, "DSP1 Preloader"},
{"DSP1", NULL, "DSP1 Preloader"},

CS35L45_DAC_MUX_ROUTE("DACPCM1"),
CS35L45_DAC_MUX_ROUTE("DACPCM"),

{ "SPK", NULL, "AMP"},
};
Expand Down Expand Up @@ -969,7 +969,7 @@ static irqreturn_t cs35l45_dsp_virt2_mbox_cb(int irq, void *data)

ret = regmap_read(cs35l45->regmap, CS35L45_DSP_VIRT2_MBOX_3, &mbox_val);
if (!ret && mbox_val)
ret = cs35l45_dsp_virt2_mbox3_irq_handle(cs35l45, mbox_val & CS35L45_MBOX3_CMD_MASK,
cs35l45_dsp_virt2_mbox3_irq_handle(cs35l45, mbox_val & CS35L45_MBOX3_CMD_MASK,
(mbox_val & CS35L45_MBOX3_DATA_MASK) >> CS35L45_MBOX3_DATA_SHIFT);

/* Handle DSP trace log IRQ */
Expand Down Expand Up @@ -1078,6 +1078,7 @@ static int cs35l45_initialize(struct cs35l45_private *cs35l45)

switch (dev_id[0]) {
case 0x35A450:
case 0x35A460:
break;
default:
dev_err(cs35l45->dev, "Bad DEVID 0x%x\n", dev_id[0]);
Expand Down
Loading

0 comments on commit a3d231e

Please sign in to comment.