Skip to content

Commit

Permalink
Merge tag 'sound-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A fair amount of commits at this time due to ASoC PR merge, but all
  look small and easy, mostly device-specific fixes spanned in various
  drivers. Hopefully this should be the last big chunk for 6.1"

* tag 'sound-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
  ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
  ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro
  ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
  ASoC: stm32: dfsdm: manage cb buffers cleanup
  ASoC: sof_es8336: reduce pop noise on speaker
  ASoC: SOF: topology: No need to assign core ID if token parsing failed
  ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
  ASoC: rt5677: fix legacy dai naming
  ASoC: rt5514: fix legacy dai naming
  ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older
  ASoC: hda: intel-dsp-config: add ES83x6 quirk for IceLake
  ASoC: Intel: soc-acpi: add ES83x6 support to IceLake
  ASoC: tas2780: Fix set_tdm_slot in case of single slot
  ASoC: tas2764: Fix set_tdm_slot in case of single slot
  ASoC: tas2770: Fix set_tdm_slot in case of single slot
  ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N
  ASoC: core: Fix use-after-free in snd_soc_exit()
  MAINTAINERS: update Tzung-Bi's email address
  ASoC: Intel: bytcht_es8316: Add quirk for the Nanote UMPC-01
  ASoC: amd: yc: Add Alienware m17 R5 AMD into DMI table
  ...
  • Loading branch information
torvalds committed Nov 18, 2022
2 parents 4ab9ffd + 1abfd71 commit ae55826
Show file tree
Hide file tree
Showing 26 changed files with 176 additions and 98 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ TripleX Chung <[email protected]> <[email protected]>
TripleX Chung <[email protected]> <[email protected]>
Tsuneo Yoshioka <[email protected]>
Tycho Andersen <[email protected]> <[email protected]>
Tzung-Bi Shih <[email protected]> <[email protected]>
Uwe Kleine-König <[email protected]>
Uwe Kleine-König <[email protected]>
Uwe Kleine-König <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: Audio codec controlled by ChromeOS EC

maintainers:
- Cheng-Yi Chiang <[email protected]>
- Tzung-Bi Shih <tzungbi@google.com>
- Tzung-Bi Shih <tzungbi@kernel.org>

description: |
Google's ChromeOS EC codec is a digital mic codec provided by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Realtek rt1015p codec devicetree bindings

maintainers:
- Tzung-Bi Shih <tzungbi@google.com>
- Tzung-Bi Shih <tzungbi@kernel.org>

description: |
Rt1015p is a rt1015 variant which does not support I2C and
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4911,7 +4911,7 @@ F: drivers/platform/chrome/

CHROMEOS EC CODEC DRIVER
M: Cheng-Yi Chiang <[email protected]>
M: Tzung-Bi Shih <tzungbi@google.com>
M: Tzung-Bi Shih <tzungbi@kernel.org>
R: Guenter Roeck <[email protected]>
L: [email protected]
S: Maintained
Expand Down
4 changes: 4 additions & 0 deletions include/sound/sof/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ enum sof_ipc_ext_data {
SOF_IPC_EXT_USER_ABI_INFO = 4,
};

/* Build u32 number in format MMmmmppp */
#define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \
((MAJOR) << 24) | ((MINOR) << 12) | (PATCH)))

/* FW version - SOF_IPC_GLB_VERSION */
struct sof_ipc_fw_version {
struct sof_ipc_hdr hdr;
Expand Down
5 changes: 5 additions & 0 deletions sound/hda/intel-dsp-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ static const struct config_entry config_table[] = {
{}
}
},
{
.flags = FLAG_SOF,
.device = 0x34c8,
.codec_hid = &essx_83x6,
},
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
.device = 0x34c8,
Expand Down
2 changes: 2 additions & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -9436,6 +9436,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
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 @@ -206,6 +206,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"),
}
},
{}
};

Expand Down
15 changes: 8 additions & 7 deletions sound/soc/codecs/rt5514-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,14 @@ static int rt5514_spi_pcm_new(struct snd_soc_component *component,
}

static const struct snd_soc_component_driver rt5514_spi_component = {
.name = DRV_NAME,
.probe = rt5514_spi_pcm_probe,
.open = rt5514_spi_pcm_open,
.hw_params = rt5514_spi_hw_params,
.hw_free = rt5514_spi_hw_free,
.pointer = rt5514_spi_pcm_pointer,
.pcm_construct = rt5514_spi_pcm_new,
.name = DRV_NAME,
.probe = rt5514_spi_pcm_probe,
.open = rt5514_spi_pcm_open,
.hw_params = rt5514_spi_hw_params,
.hw_free = rt5514_spi_hw_free,
.pointer = rt5514_spi_pcm_pointer,
.pcm_construct = rt5514_spi_pcm_new,
.legacy_dai_naming = 1,
};

/**
Expand Down
19 changes: 10 additions & 9 deletions sound/soc/codecs/rt5677-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,16 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
}

static const struct snd_soc_component_driver rt5677_spi_dai_component = {
.name = DRV_NAME,
.probe = rt5677_spi_pcm_probe,
.open = rt5677_spi_pcm_open,
.close = rt5677_spi_pcm_close,
.hw_params = rt5677_spi_hw_params,
.hw_free = rt5677_spi_hw_free,
.prepare = rt5677_spi_prepare,
.pointer = rt5677_spi_pcm_pointer,
.pcm_construct = rt5677_spi_pcm_new,
.name = DRV_NAME,
.probe = rt5677_spi_pcm_probe,
.open = rt5677_spi_pcm_open,
.close = rt5677_spi_pcm_close,
.hw_params = rt5677_spi_hw_params,
.hw_free = rt5677_spi_hw_free,
.prepare = rt5677_spi_prepare,
.pointer = rt5677_spi_pcm_pointer,
.pcm_construct = rt5677_spi_pcm_new,
.legacy_dai_naming = 1,
};

/* Select a suitable transfer command for the next transfer to ensure
Expand Down
19 changes: 6 additions & 13 deletions sound/soc/codecs/tas2764.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,20 +438,13 @@ static int tas2764_set_dai_tdm_slot(struct snd_soc_dai *dai,
if (tx_mask == 0 || rx_mask != 0)
return -EINVAL;

if (slots == 1) {
if (tx_mask != 1)
return -EINVAL;
left_slot = 0;
right_slot = 0;
left_slot = __ffs(tx_mask);
tx_mask &= ~(1 << left_slot);
if (tx_mask == 0) {
right_slot = left_slot;
} else {
left_slot = __ffs(tx_mask);
tx_mask &= ~(1 << left_slot);
if (tx_mask == 0) {
right_slot = left_slot;
} else {
right_slot = __ffs(tx_mask);
tx_mask &= ~(1 << right_slot);
}
right_slot = __ffs(tx_mask);
tx_mask &= ~(1 << right_slot);
}

if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
Expand Down
20 changes: 6 additions & 14 deletions sound/soc/codecs/tas2770.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,13 @@ static int tas2770_set_dai_tdm_slot(struct snd_soc_dai *dai,
if (tx_mask == 0 || rx_mask != 0)
return -EINVAL;

if (slots == 1) {
if (tx_mask != 1)
return -EINVAL;

left_slot = 0;
right_slot = 0;
left_slot = __ffs(tx_mask);
tx_mask &= ~(1 << left_slot);
if (tx_mask == 0) {
right_slot = left_slot;
} else {
left_slot = __ffs(tx_mask);
tx_mask &= ~(1 << left_slot);
if (tx_mask == 0) {
right_slot = left_slot;
} else {
right_slot = __ffs(tx_mask);
tx_mask &= ~(1 << right_slot);
}
right_slot = __ffs(tx_mask);
tx_mask &= ~(1 << right_slot);
}

if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
Expand Down
19 changes: 6 additions & 13 deletions sound/soc/codecs/tas2780.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,20 +380,13 @@ static int tas2780_set_dai_tdm_slot(struct snd_soc_dai *dai,
if (tx_mask == 0 || rx_mask != 0)
return -EINVAL;

if (slots == 1) {
if (tx_mask != 1)
return -EINVAL;
left_slot = 0;
right_slot = 0;
left_slot = __ffs(tx_mask);
tx_mask &= ~(1 << left_slot);
if (tx_mask == 0) {
right_slot = left_slot;
} else {
left_slot = __ffs(tx_mask);
tx_mask &= ~(1 << left_slot);
if (tx_mask == 0) {
right_slot = left_slot;
} else {
right_slot = __ffs(tx_mask);
tx_mask &= ~(1 << right_slot);
}
right_slot = __ffs(tx_mask);
tx_mask &= ~(1 << right_slot);
}

if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/fsl_asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
}

ret = pm_runtime_put_sync(&pdev->dev);
if (ret < 0)
if (ret < 0 && ret != -ENOSYS)
goto err_pm_get_sync;

ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/fsl_esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
regmap_write(esai_priv->regmap, REG_ESAI_RSMB, 0);

ret = pm_runtime_put_sync(&pdev->dev);
if (ret < 0)
if (ret < 0 && ret != -ENOSYS)
goto err_pm_get_sync;

/*
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/fsl_sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
}

ret = pm_runtime_put_sync(dev);
if (ret < 0)
if (ret < 0 && ret != -ENOSYS)
goto err_pm_get_sync;

/*
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/intel/boards/bytcht_es8316.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = {
| BYT_CHT_ES8316_INTMIC_IN2_MAP
| BYT_CHT_ES8316_JD_INVERTED),
},
{ /* Nanote UMPC-01 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "RWC CO.,LTD"),
DMI_MATCH(DMI_PRODUCT_NAME, "UMPC-01"),
},
.driver_data = (void *)BYT_CHT_ES8316_INTMIC_IN1_MAP,
},
{ /* Teclast X98 Plus II */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
Expand Down
60 changes: 46 additions & 14 deletions sound/soc/intel/boards/sof_es8336.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct sof_es8336_private {
struct snd_soc_jack jack;
struct list_head hdmi_pcm_list;
bool speaker_en;
struct delayed_work pcm_pop_work;
};

struct sof_hdmi_pcm {
Expand Down Expand Up @@ -111,6 +112,46 @@ static void log_quirks(struct device *dev)
dev_info(dev, "quirk headset at mic1 port enabled\n");
}

static void pcm_pop_work_events(struct work_struct *work)
{
struct sof_es8336_private *priv =
container_of(work, struct sof_es8336_private, pcm_pop_work.work);

gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en);

if (quirk & SOF_ES8336_HEADPHONE_GPIO)
gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);

}

static int sof_8336_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_card *card = rtd->card;
struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card);

switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
case SNDRV_PCM_TRIGGER_RESUME:
break;

case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_STOP:
if (priv->speaker_en == false)
if (substream->stream == 0) {
cancel_delayed_work(&priv->pcm_pop_work);
gpiod_set_value_cansleep(priv->gpio_speakers, true);
}
break;
default:
return -EINVAL;
}

return 0;
}

static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
Expand All @@ -122,19 +163,7 @@ static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,

priv->speaker_en = !SND_SOC_DAPM_EVENT_ON(event);

if (SND_SOC_DAPM_EVENT_ON(event))
msleep(70);

gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en);

if (!(quirk & SOF_ES8336_HEADPHONE_GPIO))
return 0;

if (SND_SOC_DAPM_EVENT_ON(event))
msleep(70);

gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);

queue_delayed_work(system_wq, &priv->pcm_pop_work, msecs_to_jiffies(70));
return 0;
}

Expand Down Expand Up @@ -344,6 +373,7 @@ static int sof_es8336_hw_params(struct snd_pcm_substream *substream,
/* machine stream operations */
static struct snd_soc_ops sof_es8336_ops = {
.hw_params = sof_es8336_hw_params,
.trigger = sof_8336_trigger,
};

static struct snd_soc_dai_link_component platform_component[] = {
Expand Down Expand Up @@ -723,7 +753,8 @@ static int sof_es8336_probe(struct platform_device *pdev)
}

INIT_LIST_HEAD(&priv->hdmi_pcm_list);

INIT_DELAYED_WORK(&priv->pcm_pop_work,
pcm_pop_work_events);
snd_soc_card_set_drvdata(card, priv);

if (mach->mach_params.dmic_num > 0) {
Expand Down Expand Up @@ -752,6 +783,7 @@ static int sof_es8336_remove(struct platform_device *pdev)
struct snd_soc_card *card = platform_get_drvdata(pdev);
struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card);

cancel_delayed_work(&priv->pcm_pop_work);
gpiod_put(priv->gpio_speakers);
device_remove_software_node(priv->codec_dev);
put_device(priv->codec_dev);
Expand Down
13 changes: 13 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-icl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#include <sound/soc-acpi-intel-match.h>
#include "../skylake/skl.h"

static const struct snd_soc_acpi_codecs essx_83x6 = {
.num_codecs = 3,
.codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
};

static struct skl_machine_pdata icl_pdata = {
.use_tplg_pcm = true,
};
Expand All @@ -27,6 +32,14 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[] = {
.drv_name = "sof_rt5682",
.sof_tplg_filename = "sof-icl-rt5682.tplg",
},
{
.comp_ids = &essx_83x6,
.drv_name = "sof-essx8336",
.sof_tplg_filename = "sof-icl-es8336", /* the tplg suffix is added at run time */
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
},
{},
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_icl_machines);
Expand Down
Loading

0 comments on commit ae55826

Please sign in to comment.