Unverified Commit b0a31a78 authored by Mark Brown's avatar Mark Brown
Browse files

Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis...

Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This patchset adds:

a) fixes for missing .owner = THIS_MODULE initializations for
snd_soc_card structures

b) extensions for TigerLake and JasperLake reusing the same machine
drivers.

c) Max98373 support for SoundWire machine driver.

d) cleanups (use-after-free, quirks, etc).

Bard Liao (1):
  ASoC: intel: cml_rt1011_rt5682: use for_each_card_prelinks

Dharageswari R (3):
  ASoC: Intel: Boards: tgl_max98373: add dai_trigger function
  ASoC: Intel: Boards: tgl_max98373: Fix the comment for
    max_98373_components
  ASoC: Intel: Boards: tgl_max98373: Update TDM configuration in
    hw_params

Fred Oh (3):
  ASoC: Intel: Boards: cml_rt1011_rt5682: reduce log level for printing
    quirk
  ASoC: Intel: Boards: cml_rt1011_rt5682: use statically define codec
    config
  ASoc: Intel: cml_rt1011_rt5682: explicitly access first codec

Naveen Manohar (2):
  ASoC: Intel: sof_sdw: Add MAX98373 support
  ASoC: Intel: common: add match table for TGL MAX98373 + RT5682
    SoundWire driver

Pierre-Louis Bossart (6):
  ASoC: SOF: nocodec: add missing .owner field
  ASoC: Intel: cml_rt1011_rt5682: add missing .owner field
  ASoC: Intel: sof_sdw: add missing .owner field
  ASoC: Intel: bxt_rt298: add missing .owner field
  ASoC: Intel: sof_sdw: add quirk override with kernel parameter
  ASoC: Intel: boards: byt*.c: remove cast in dev_info quirk log

Yong Zhi (1):
  ASoC: intel: sof_rt5682: Add support for jsl-max98360a-rt5682

randerwang (1):
  ASoC: Intel: sdw_max98373: add card_late_probe support

 sound/soc/intel/boards/Kconfig                |  3 +-
 sound/soc/intel/boards/Makefile               |  2 +
 sound/soc/intel/boards/bxt_rt298.c            |  2 +
 sound/soc/intel/boards/bytcht_es8316.c        |  5 +-
 sound/soc/intel/boards/bytcr_rt5640.c         |  4 +-
 sound/soc/intel/boards/bytcr_rt5651.c         |  4 +-
 sound/soc/intel/boards/cml_rt1011_rt5682.c    | 90 ++++++-------------
 sound/soc/intel/boards/sof_maxim_common.c     | 55 ++++++++++--
 sound/soc/intel/boards/sof_maxim_common.h     |  3 +
 sound/soc/intel/boards/sof_rt5682.c           | 32 +++++++
 sound/soc/intel/boards/sof_sdw.c              | 72 ++++++++++++++-
 sound/soc/intel/boards/sof_sdw_common.h       | 15 ++++
 sound/soc/intel/boards/sof_sdw_max98373.c     | 86 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-jsl-match.c   | 13 +++
 .../intel/common/soc-acpi-intel-tgl-match.c   | 25 ++++++
 sound/soc/sof/nocodec.c                       |  1 +
 16 files changed, 332 insertions(+), 80 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_sdw_max98373.c

base-commit: 6f81e520
--
2.20.1
parents b6d6e9ea bc7477fc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -565,6 +565,7 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
/* broxton audio machine driver for SPT + RT298S */
static struct snd_soc_card broxton_rt298 = {
	.name = "broxton-rt298",
	.owner = THIS_MODULE,
	.dai_link = broxton_rt298_dais,
	.num_links = ARRAY_SIZE(broxton_rt298_dais),
	.controls = broxton_controls,
@@ -580,6 +581,7 @@ static struct snd_soc_card broxton_rt298 = {

static struct snd_soc_card geminilake_rt298 = {
	.name = "geminilake-rt298",
	.owner = THIS_MODULE,
	.dai_link = broxton_rt298_dais,
	.num_links = ARRAY_SIZE(broxton_rt298_dais),
	.controls = broxton_controls,
+2 −3
Original line number Diff line number Diff line
@@ -525,9 +525,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
			BYT_CHT_ES8316_MONO_SPEAKER;
	}
	if (quirk_override != -1) {
		dev_info(dev, "Overriding quirk 0x%x => 0x%x\n",
			 (unsigned int)quirk,
			 quirk_override);
		dev_info(dev, "Overriding quirk 0x%lx => 0x%x\n",
			 quirk, quirk_override);
		quirk = quirk_override;
	}
	log_quirks(dev);
+2 −2
Original line number Diff line number Diff line
@@ -1265,8 +1265,8 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
	if (dmi_id)
		byt_rt5640_quirk = (unsigned long)dmi_id->driver_data;
	if (quirk_override != -1) {
		dev_info(&pdev->dev, "Overriding quirk 0x%x => 0x%x\n",
			 (unsigned int)byt_rt5640_quirk, quirk_override);
		dev_info(&pdev->dev, "Overriding quirk 0x%lx => 0x%x\n",
			 byt_rt5640_quirk, quirk_override);
		byt_rt5640_quirk = quirk_override;
	}

+2 −2
Original line number Diff line number Diff line
@@ -977,8 +977,8 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
	dmi_check_system(byt_rt5651_quirk_table);

	if (quirk_override != -1) {
		dev_info(&pdev->dev, "Overriding quirk 0x%x => 0x%x\n",
			 (unsigned int)byt_rt5651_quirk, quirk_override);
		dev_info(&pdev->dev, "Overriding quirk 0x%lx => 0x%x\n",
			 byt_rt5651_quirk, quirk_override);
		byt_rt5651_quirk = quirk_override;
	}

+27 −63
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
#define SOF_RT1011_SPEAKER_WR		BIT(1)
#define SOF_RT1011_SPEAKER_TL		BIT(2)
#define SOF_RT1011_SPEAKER_TR		BIT(3)
#define SPK_CH 4

/* Default: Woofer speakers  */
static unsigned long sof_rt1011_quirk = SOF_RT1011_SPEAKER_WL |
@@ -383,10 +382,17 @@ SND_SOC_DAILINK_DEF(ssp0_codec,

SND_SOC_DAILINK_DEF(ssp1_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin")));
SND_SOC_DAILINK_DEF(ssp1_codec,
SND_SOC_DAILINK_DEF(ssp1_codec_2spk,
	DAILINK_COMP_ARRAY(
	/* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI),
	/* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI)));
SND_SOC_DAILINK_DEF(ssp1_codec_4spk,
	DAILINK_COMP_ARRAY(
	/* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI),
	/* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI),
	/* TL */ COMP_CODEC("i2c-10EC1011:02", CML_RT1011_CODEC_DAI),
	/* TR */ COMP_CODEC("i2c-10EC1011:03", CML_RT1011_CODEC_DAI)));


SND_SOC_DAILINK_DEF(dmic_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin")));
@@ -483,7 +489,7 @@ static struct snd_soc_dai_link cml_rt1011_rt5682_dailink[] = {
		.no_pcm = 1,
		.init = cml_rt1011_spk_init,
		.ops = &cml_rt1011_ops,
		SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec, platform),
		SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec_2spk, platform),
	},
};

@@ -496,11 +502,21 @@ static struct snd_soc_codec_conf rt1011_conf[] = {
		.dlc = COMP_CODEC_CONF("i2c-10EC1011:01"),
		.name_prefix = "WR",
	},
	/* single configuration structure for 2 and 4 channels */
	{
		.dlc = COMP_CODEC_CONF("i2c-10EC1011:02"),
		.name_prefix = "TL",
	},
	{
		.dlc = COMP_CODEC_CONF("i2c-10EC1011:03"),
		.name_prefix = "TR",
	},
};

/* Cometlake audio machine driver for RT1011 and RT5682 */
static struct snd_soc_card snd_soc_card_cml = {
	.name = "cml_rt1011_rt5682",
	.owner = THIS_MODULE,
	.dai_link = cml_rt1011_rt5682_dailink,
	.num_links = ARRAY_SIZE(cml_rt1011_rt5682_dailink),
	.codec_conf = rt1011_conf,
@@ -517,8 +533,7 @@ static struct snd_soc_card snd_soc_card_cml = {

static int snd_cml_rt1011_probe(struct platform_device *pdev)
{
	struct snd_soc_dai_link_component *rt1011_dais_components;
	struct snd_soc_codec_conf *rt1011_dais_confs;
	struct snd_soc_dai_link *dai_link;
	struct card_private *ctx;
	struct snd_soc_acpi_mach *mach;
	const char *platform_name;
@@ -535,67 +550,16 @@ static int snd_cml_rt1011_probe(struct platform_device *pdev)

	dmi_check_system(sof_rt1011_quirk_table);

	dev_info(&pdev->dev, "sof_rt1011_quirk = %lx\n", sof_rt1011_quirk);
	dev_dbg(&pdev->dev, "sof_rt1011_quirk = %lx\n", sof_rt1011_quirk);

	/* when 4 speaker is available, update codec config */
	if (sof_rt1011_quirk & (SOF_RT1011_SPEAKER_TL |
				SOF_RT1011_SPEAKER_TR)) {
		rt1011_dais_confs = devm_kzalloc(&pdev->dev,
					sizeof(struct snd_soc_codec_conf) *
					SPK_CH, GFP_KERNEL);

		if (!rt1011_dais_confs)
			return -ENOMEM;

		rt1011_dais_components = devm_kzalloc(&pdev->dev,
					sizeof(struct snd_soc_dai_link_component) *
					SPK_CH, GFP_KERNEL);

		if (!rt1011_dais_components)
			return -ENOMEM;

		for (i = 0; i < SPK_CH; i++) {
			rt1011_dais_confs[i].dlc.name = devm_kasprintf(&pdev->dev,
								GFP_KERNEL,
								"i2c-10EC1011:0%d",
								i);

			if (!rt1011_dais_confs[i].dlc.name)
				return -ENOMEM;

			switch (i) {
			case 0:
				rt1011_dais_confs[i].name_prefix = "WL";
				break;
			case 1:
				rt1011_dais_confs[i].name_prefix = "WR";
				break;
			case 2:
				rt1011_dais_confs[i].name_prefix = "TL";
				break;
			case 3:
				rt1011_dais_confs[i].name_prefix = "TR";
				break;
			default:
				return -EINVAL;
			}
			rt1011_dais_components[i].name = devm_kasprintf(&pdev->dev,
								GFP_KERNEL,
								"i2c-10EC1011:0%d",
								i);
			if (!rt1011_dais_components[i].name)
				return -ENOMEM;

			rt1011_dais_components[i].dai_name = CML_RT1011_CODEC_DAI;
		}

		snd_soc_card_cml.codec_conf = rt1011_dais_confs;
		snd_soc_card_cml.num_configs = SPK_CH;

		for (i = 0; i < ARRAY_SIZE(cml_rt1011_rt5682_dailink); i++) {
			if (!strcmp(cml_rt1011_rt5682_dailink[i].codecs->dai_name,
		for_each_card_prelinks(&snd_soc_card_cml, i, dai_link) {
			if (!strcmp(dai_link->codecs->dai_name,
				    CML_RT1011_CODEC_DAI)) {
				cml_rt1011_rt5682_dailink[i].codecs = rt1011_dais_components;
				cml_rt1011_rt5682_dailink[i].num_codecs = SPK_CH;
				dai_link->codecs = ssp1_codec_4spk;
				dai_link->num_codecs = ARRAY_SIZE(ssp1_codec_4spk);
			}
		}
	}
Loading