Skip to content

Commit

Permalink
Merge tag 'sound-6.3-rc3' 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:
 "Nothing surprising, a collection of small device-specific fixes.

  The majority of changes are for ASoC Intel stuff, while a few other
  ASoC and HD-audio fixes are found"

* tag 'sound-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (31 commits)
  ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set()
  ALSA: asihpi: check pao in control_message()
  ASoC: hdmi-codec: only startup/shutdown on supported streams
  ASoC: da7219: Initialize jack_det_mutex
  ALSA: hda: Match only Intel devices with CONTROLLER_IN_GPU()
  ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book2 Pro
  ALSA: hda/realtek: fix speaker, mute/micmute LEDs not work on a HP platform
  ALSA: hda: intel-dsp-config: add MTL PCI id
  ASoC: SOF: IPC4: update gain ipc msg definition to align with fw
  ASoC: SOF: sof-audio: don't squelch errors in WIDGET_SETUP phase
  ASoC: SOF: Intel: hda-ctrl: re-add sleep after entering and exiting reset
  ASoC: SOF: Intel: hda-dsp: harden D0i3 programming sequence
  ASoC: SOF: ipc4-topology: set dmic dai index from copier
  ASoC: SOF: sof-audio: Fix broken early bclk feature for SSP
  ASoC: SOF: Intel: pci-tng: revert invalid bar size setting
  ASoC: SOF: topology: Fix error handling in sof_widget_ready()
  ASoC: Intel: soc-acpi: fix copy-paste issue in topology names
  ASoC: SOF: ipc4-topology: Fix incorrect sample rate print unit
  ASoC: SOF: ipc3: Check for upper size limit for the received message
  ASOC: SOF: Intel: pci-tgl: Fix device description
  ...
  • Loading branch information
torvalds committed Mar 17, 2023
2 parents 2cf5a40 + 98e5eb1 commit 97eb2d9
Show file tree
Hide file tree
Showing 32 changed files with 246 additions and 90 deletions.
9 changes: 9 additions & 0 deletions sound/hda/intel-dsp-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,15 @@ static const struct config_entry config_table[] = {
},
#endif

/* Meteor Lake */
#if IS_ENABLED(CONFIG_SND_SOC_SOF_METEORLAKE)
/* Meteorlake-P */
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
.device = 0x7e28,
},
#endif

};

static const struct config_entry *snd_intel_dsp_find_config
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/asihpi/hpi6205.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void HPI_6205(struct hpi_message *phm, struct hpi_response *phr)
pao = hpi_find_adapter(phm->adapter_index);
} else {
/* subsys messages don't address an adapter */
_HPI_6205(NULL, phm, phr);
phr->error = HPI_ERROR_INVALID_OBJ_INDEX;
return;
}

Expand Down
5 changes: 3 additions & 2 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,15 @@ enum {
#define needs_eld_notify_link(chip) false
#endif

#define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \
#define CONTROLLER_IN_GPU(pci) (((pci)->vendor == 0x8086) && \
(((pci)->device == 0x0a0c) || \
((pci)->device == 0x0c0c) || \
((pci)->device == 0x0d0c) || \
((pci)->device == 0x160c) || \
((pci)->device == 0x490d) || \
((pci)->device == 0x4f90) || \
((pci)->device == 0x4f91) || \
((pci)->device == 0x4f92))
((pci)->device == 0x4f92)))

#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)

Expand Down
4 changes: 3 additions & 1 deletion sound/pci/hda/patch_ca0132.c
Original file line number Diff line number Diff line change
Expand Up @@ -4228,8 +4228,10 @@ static int tuning_ctl_set(struct hda_codec *codec, hda_nid_t nid,

for (i = 0; i < TUNING_CTLS_COUNT; i++)
if (nid == ca0132_tuning_ctls[i].nid)
break;
goto found;

return -EINVAL;
found:
snd_hda_power_up(codec);
dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20,
ca0132_tuning_ctls[i].req,
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 @@ -9447,6 +9447,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
Expand Down Expand Up @@ -9539,6 +9540,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/da7219-aad.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,8 @@ int da7219_aad_init(struct snd_soc_component *component)
INIT_WORK(&da7219_aad->hptest_work, da7219_aad_hptest_work);
INIT_WORK(&da7219_aad->jack_det_work, da7219_aad_jack_det_work);

mutex_init(&da7219_aad->jack_det_mutex);

ret = request_threaded_irq(da7219_aad->irq, da7219_aad_pre_irq_thread,
da7219_aad_irq_thread,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
Expand Down
11 changes: 11 additions & 0 deletions sound/soc/codecs/hdmi-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,13 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
{
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
bool has_capture = !hcp->hcd.no_i2s_capture;
bool has_playback = !hcp->hcd.no_i2s_playback;
int ret = 0;

if (!((has_playback && tx) || (has_capture && !tx)))
return 0;

mutex_lock(&hcp->lock);
if (hcp->busy) {
dev_err(dai->dev, "Only one simultaneous stream supported!\n");
Expand Down Expand Up @@ -468,6 +473,12 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
bool has_capture = !hcp->hcd.no_i2s_capture;
bool has_playback = !hcp->hcd.no_i2s_playback;

if (!((has_playback && tx) || (has_capture && !tx)))
return;

hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);
Expand Down
11 changes: 6 additions & 5 deletions sound/soc/codecs/lpass-tx-macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ enum {

struct tx_mute_work {
struct tx_macro *tx;
u32 decimator;
u8 decimator;
struct delayed_work dwork;
};

Expand Down Expand Up @@ -635,7 +635,7 @@ static int tx_macro_mclk_enable(struct tx_macro *tx,
return 0;
}

static bool is_amic_enabled(struct snd_soc_component *component, int decimator)
static bool is_amic_enabled(struct snd_soc_component *component, u8 decimator)
{
u16 adc_mux_reg, adc_reg, adc_n;

Expand Down Expand Up @@ -849,7 +849,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
unsigned int decimator;
u8 decimator;
u16 tx_vol_ctl_reg, dec_cfg_reg, hpf_gate_reg, tx_gain_ctl_reg;
u8 hpf_cut_off_freq;
int hpf_delay = TX_MACRO_DMIC_HPF_DELAY_MS;
Expand Down Expand Up @@ -1064,7 +1064,8 @@ static int tx_macro_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
u32 decimator, sample_rate;
u32 sample_rate;
u8 decimator;
int tx_fs_rate;
struct tx_macro *tx = snd_soc_component_get_drvdata(component);

Expand Down Expand Up @@ -1128,7 +1129,7 @@ static int tx_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
{
struct snd_soc_component *component = dai->component;
struct tx_macro *tx = snd_soc_component_get_drvdata(component);
u16 decimator;
u8 decimator;

/* active decimator not set yet */
if (tx->active_decimator[dai->id] == -1)
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/fsl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ config SND_SOC_IMX_SGTL5000
Say Y if you want to add support for SoC audio on an i.MX board with
a sgtl5000 codec.

Note that this is an old driver. Consider enabling
SND_SOC_FSL_ASOC_CARD and SND_SOC_SGTL5000 to use the newer
driver.

config SND_SOC_IMX_SPDIF
tristate "SoC Audio support for i.MX boards with S/PDIF"
select SND_SOC_IMX_PCM_DMA
Expand Down
21 changes: 21 additions & 0 deletions sound/soc/intel/avs/boards/da7219.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
}

static int
avs_da7219_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_params *params)
{
struct snd_interval *rate, *channels;
struct snd_mask *fmt;

rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);

/* The ADSP will convert the FE rate to 48k, stereo */
rate->min = rate->max = 48000;
channels->min = channels->max = 2;

/* set SSP0 to 24 bit */
snd_mask_none(fmt);
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
return 0;
}

static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
struct snd_soc_dai_link **dai_link)
{
Expand Down Expand Up @@ -148,6 +168,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
dl->num_platforms = 1;
dl->id = 0;
dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS;
dl->be_hw_params_fixup = avs_da7219_be_fixup;
dl->init = avs_da7219_codec_init;
dl->exit = avs_da7219_codec_exit;
dl->nonatomic = 1;
Expand Down
22 changes: 22 additions & 0 deletions sound/soc/intel/avs/boards/max98357a.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <linux/module.h>
#include <linux/platform_device.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/soc-dapm.h>
Expand All @@ -24,6 +25,26 @@ static const struct snd_soc_dapm_route card_base_routes[] = {
{ "Spk", NULL, "Speaker" },
};

static int
avs_max98357a_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_params *params)
{
struct snd_interval *rate, *channels;
struct snd_mask *fmt;

rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);

/* The ADSP will convert the FE rate to 48k, stereo */
rate->min = rate->max = 48000;
channels->min = channels->max = 2;

/* set SSP0 to 16 bit */
snd_mask_none(fmt);
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
return 0;
}

static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
struct snd_soc_dai_link **dai_link)
{
Expand Down Expand Up @@ -55,6 +76,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
dl->num_platforms = 1;
dl->id = 0;
dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS;
dl->be_hw_params_fixup = avs_max98357a_be_fixup;
dl->nonatomic = 1;
dl->no_pcm = 1;
dl->dpcm_playback = 1;
Expand Down
14 changes: 7 additions & 7 deletions sound/soc/intel/avs/boards/nau8825.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ avs_nau8825_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *co
return -EINVAL;
}

if (!SND_SOC_DAPM_EVENT_ON(event)) {
if (SND_SOC_DAPM_EVENT_ON(event))
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000,
SND_SOC_CLOCK_IN);
else
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
if (ret < 0) {
dev_err(card->dev, "set sysclk err = %d\n", ret);
return ret;
}
}
if (ret < 0)
dev_err(card->dev, "Set sysclk failed: %d\n", ret);

return 0;
return ret;
}

static const struct snd_kcontrol_new card_controls[] = {
Expand Down
22 changes: 22 additions & 0 deletions sound/soc/intel/avs/boards/rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,27 @@ static const struct snd_soc_ops avs_rt5682_ops = {
.hw_params = avs_rt5682_hw_params,
};

static int
avs_rt5682_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
{
struct snd_interval *rate, *channels;
struct snd_mask *fmt;

rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);

/* The ADSP will convert the FE rate to 48k, stereo */
rate->min = rate->max = 48000;
channels->min = channels->max = 2;

/* set SSPN to 24 bit */
snd_mask_none(fmt);
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);

return 0;
}

static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
struct snd_soc_dai_link **dai_link)
{
Expand Down Expand Up @@ -201,6 +222,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
dl->id = 0;
dl->init = avs_rt5682_codec_init;
dl->exit = avs_rt5682_codec_exit;
dl->be_hw_params_fixup = avs_rt5682_be_fixup;
dl->ops = &avs_rt5682_ops;
dl->nonatomic = 1;
dl->no_pcm = 1;
Expand Down
31 changes: 0 additions & 31 deletions sound/soc/intel/avs/boards/ssm4567.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <sound/soc-acpi.h>
#include "../../../codecs/nau8825.h"

#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
#define SKL_SSM_CODEC_DAI "ssm4567-hifi"

static struct snd_soc_codec_conf card_codec_conf[] = {
Expand All @@ -34,41 +33,11 @@ static const struct snd_kcontrol_new card_controls[] = {
SOC_DAPM_PIN_SWITCH("Right Speaker"),
};

static int
platform_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *control, int event)
{
struct snd_soc_dapm_context *dapm = w->dapm;
struct snd_soc_card *card = dapm->card;
struct snd_soc_dai *codec_dai;
int ret;

codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI);
if (!codec_dai) {
dev_err(card->dev, "Codec dai not found\n");
return -EINVAL;
}

if (SND_SOC_DAPM_EVENT_ON(event)) {
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000,
SND_SOC_CLOCK_IN);
if (ret < 0)
dev_err(card->dev, "set sysclk err = %d\n", ret);
} else {
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
if (ret < 0)
dev_err(card->dev, "set sysclk err = %d\n", ret);
}

return ret;
}

static const struct snd_soc_dapm_widget card_widgets[] = {
SND_SOC_DAPM_SPK("Left Speaker", NULL),
SND_SOC_DAPM_SPK("Right Speaker", NULL),
SND_SOC_DAPM_SPK("DP1", NULL),
SND_SOC_DAPM_SPK("DP2", NULL),
SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, platform_clock_control,
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
};

static const struct snd_soc_dapm_route card_base_routes[] = {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/common/soc-acpi-intel-adl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
{
.comp_ids = &essx_83x6,
.drv_name = "sof-essx8336",
.sof_tplg_filename = "sof-adl-es83x6", /* the tplg suffix is added at run time */
.sof_tplg_filename = "sof-adl-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,
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/qcom/qdsp6/q6prm.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, int clk_
unsigned int freq)
{
if (freq)
return q6prm_request_lpass_clock(dev, clk_id, clk_attr, clk_attr, freq);
return q6prm_request_lpass_clock(dev, clk_id, clk_attr, clk_root, freq);

return q6prm_release_lpass_clock(dev, clk_id, clk_attr, clk_attr, freq);
return q6prm_release_lpass_clock(dev, clk_id, clk_attr, clk_root, freq);
}
EXPORT_SYMBOL_GPL(q6prm_set_lpass_clock);

Expand Down
3 changes: 3 additions & 0 deletions sound/soc/sof/intel/hda-ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,15 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev)
goto err;
}

usleep_range(500, 1000);

/* exit HDA controller reset */
ret = hda_dsp_ctrl_link_reset(sdev, false);
if (ret < 0) {
dev_err(sdev->dev, "error: failed to exit HDA controller reset\n");
goto err;
}
usleep_range(1000, 1200);

hda_codec_detect_mask(sdev);

Expand Down
Loading

0 comments on commit 97eb2d9

Please sign in to comment.