Intel SST fixes for Chromebooks/HDaudio platorms
Subsystems (3)
cover Intel SST fixes for Chromebooks/HDaudio platorms
While testing Mark's for-next branch on Chromebooks, 3 problems were exposed
a. the search loop for ACPI IDs is broken on SKL/KBL which are the most advanced users of quirks. This is embarrassing since it's been broken for a very very long time and those platforms have been stuck in time with 3.18 and 4.4 kernels.
b. the change I personally made to use a common interface for machine driver didn't work either for all the Chromebooks using information on dmic number. My bad.
c. the change to use the common interface also missed the fact that the Skylake driver passed the information using drv_data instead of platform_data as done by the Atom and SOF drivers. The third patch aligns the Skylake driver with the two others. We should now have no dependencies between machine and platform drivers, which will help reuse the same code.
These patches were tested on HDaudio platforms (ApolloLake and Whisky Lake) as well as Chell (SKL) and Soraka (KBL) Chromebooks - for the latter case we are still investigating DSP IPC errors that are unrelated to these changes
Keyon Jie (1):
ASoC: acpi: fix: continue searching when machine is ignored
Pierre-Louis Bossart (2):
ASoC: Intel: fix interface for Chromebook machine drivers
ASoC: Intel: use platform_data for machine drivers
include/sound/soc-acpi.h | 1 + sound/soc/intel/boards/kbl_rt5663_max98927.c | 10 +++++----- .../soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 10 +++++----- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 10 +++++----- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 10 +++++----- sound/soc/intel/skylake/skl.c | 15 +++++++++++---- sound/soc/intel/skylake/skl.h | 3 --- sound/soc/soc-acpi.c | 10 ++++++++-- 9 files changed, 41 insertions(+), 30 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 ASoC: acpi: fix: continue searching when machine is ignored
From: Keyon Jie <[email protected]>
The machine_quirk may return NULL which means the acpi entries should be skipped and search for next matched entry is needed, here add return check here and continue for NULL case.
--- sound/soc/soc-acpi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/soc-acpi.c +8 -2
@@ -10,11 +10,17 @@ struct snd_soc_acpi_mach * snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) {struct snd_soc_acpi_mach *mach; +struct snd_soc_acpi_mach *mach_alt;for (mach = machines; mach->id[0 ]; mach++) {if (acpi_dev_present (mach->id,NULL ,-1 )) { -if (mach->machine_quirk) - mach = mach->machine_quirk (mach); +if (mach->machine_quirk) { + mach_alt = mach->machine_quirk (mach); +if (!mach_alt) +continue ;/* not full match, ignore */ + mach = mach_alt; + } +return mach; } }
Signature · 1 line
2.17.1
Mark Brown
maintainerApplied "ASoC: acpi: fix: continue searching when machine is ignored" to the asoc tree
The patch
ASoC: acpi: fix: continue searching when machine is ignored
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
a3e620f8422832afd832ad5e20aa97d0c72bada8Mon Sep 17 00:00:00 2001
From: Keyon Jie <[email protected]>
Date: Fri, 16 Nov 2018 18:47:04 -0600
Subject: [PATCH] ASoC: acpi: fix: continue searching when machine is ignored
The machine_quirk may return NULL which means the acpi entries should be skipped and search for next matched entry is needed, here add return check here and continue for NULL case.
--- sound/soc/soc-acpi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/soc-acpi.c +8 -2
@@ -10,11 +10,17 @@ struct snd_soc_acpi_mach * snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) {struct snd_soc_acpi_mach *mach; +struct snd_soc_acpi_mach *mach_alt;for (mach = machines; mach->id[0 ]; mach++) {if (acpi_dev_present (mach->id,NULL ,-1 )) { -if (mach->machine_quirk) - mach = mach->machine_quirk (mach); +if (mach->machine_quirk) { + mach_alt = mach->machine_quirk (mach); +if (!mach_alt) +continue ;/* not full match, ignore */ + mach = mach_alt; + } +return mach; } }
Signature · 1 line
2.19.0.rc2
PATCH 2/3 ASoC: Intel: fix interface for Chromebook machine drivers
In reply to Pierre-Louis BossartThe changes for HDaudio overlooked the fact that the machine drivers used for Chromebooks rely on the dmic number information passed as pdata.
Add dmic_num field to standard interface and use standard interface instead of SKL-specific one.
Also clean-up pdata definition to remove fields that are no longer used.
--- include/sound/soc-acpi.h | 1 + sound/soc/intel/boards/kbl_rt5663_max98927.c | 10 +++++----- sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 10 +++++----- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 10 +++++----- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 10 +++++----- sound/soc/intel/skylake/skl.c | 2 +- sound/soc/intel/skylake/skl.h | 3 --- 7 files changed, 22 insertions(+), 24 deletions(-)
include/sound/soc-acpi.h +1 -0
@@ -48,6 +48,7 @@ struct snd_soc_acpi_mach_params {u32 acpi_ipc_irq_index;const char *platform;u32 codec_mask; +u32 dmic_num; };/**
sound/soc/intel/boards/kbl_rt5663_max98927.c +5 -5
@@ -25,9 +25,9 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/rt5663.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/clkdev.h>
@@ -969,7 +969,7 @@ static struct snd_soc_card kabylake_audio_card_rt5663 = {static int kabylake_audio_probe (struct platform_device *pdev) {struct kbl_rt5663_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach;int ret; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );
@@ -984,9 +984,9 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card->dev = &pdev->dev;snd_soc_card_set_drvdata (kabylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels; ctx->mclk =devm_clk_get (&pdev->dev,"ssp1_mclk" );
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +5 -5
@@ -26,10 +26,10 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/rt5514.h" #include "../../codecs/rt5663.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #define KBL_REALTEK_CODEC_DAI "rt5663-aif"#define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1"
@@ -648,7 +648,7 @@ static struct snd_soc_card kabylake_audio_card = {static int kabylake_audio_probe (struct platform_device *pdev) {struct kbl_codec_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)
@@ -659,9 +659,9 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&kabylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;return devm_snd_soc_register_card (&pdev->dev, &kabylake_audio_card);
sound/soc/intel/boards/skl_nau88l25_max98357a.c +5 -5
@@ -21,9 +21,9 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"#define SKL_MAXIM_CODEC_DAI "HiFi"
@@ -641,7 +641,7 @@ static struct snd_soc_card skylake_audio_card = {static int skylake_audio_probe (struct platform_device *pdev) {struct skl_nau8825_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)
@@ -652,9 +652,9 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;return devm_snd_soc_register_card (&pdev->dev, &skylake_audio_card);
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +5 -5
@@ -23,11 +23,11 @@#include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include <sound/jack.h> #include <sound/pcm_params.h> #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"#define SKL_SSM_CODEC_DAI "ssm4567-hifi"
@@ -694,7 +694,7 @@ static struct snd_soc_card skylake_audio_card = {static int skylake_audio_probe (struct platform_device *pdev) {struct skl_nau88125_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)
@@ -705,9 +705,9 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;return devm_snd_soc_register_card (&pdev->dev, &skylake_audio_card);
sound/soc/intel/skylake/skl.c +1 -1
@@ -515,7 +515,7 @@ static int skl_find_machine(struct skl *skl, void *driver_data)if (pdata) { skl->use_tplg_pcm = pdata->use_tplg_pcm; - pdata->dmic_num =skl_get_dmic_geo (skl); + mach->mach_params.dmic_num =skl_get_dmic_geo (skl); }return 0 ;
sound/soc/intel/skylake/skl.h +0 -3
@@ -119,10 +119,7 @@ struct skl_dma_params { };struct skl_machine_pdata { -u32 dmic_num;bool use_tplg_pcm;/* use dais and dai links from topology */ -const char *platform; -u32 codec_mask; };struct skl_dsp_ops {
Signature · 1 line
2.17.1
Mark Brown
maintainerApplied "ASoC: Intel: fix interface for Chromebook machine drivers" to the asoc tree
The patch
ASoC: Intel: fix interface for Chromebook machine drivers
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
b92826fa8c5a423edf6c9e385b5d433c61375cc8Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <[email protected]>
Date: Fri, 16 Nov 2018 18:47:05 -0600
Subject: [PATCH] ASoC: Intel: fix interface for Chromebook machine drivers
The changes for HDaudio overlooked the fact that the machine drivers used for Chromebooks rely on the dmic number information passed as pdata.
Add dmic_num field to standard interface and use standard interface instead of SKL-specific one.
Also clean-up pdata definition to remove fields that are no longer used.
--- include/sound/soc-acpi.h | 1 + sound/soc/intel/boards/kbl_rt5663_max98927.c | 10 +++++----- sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 10 +++++----- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 10 +++++----- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 10 +++++----- sound/soc/intel/skylake/skl.c | 2 +- sound/soc/intel/skylake/skl.h | 3 --- 7 files changed, 22 insertions(+), 24 deletions(-)
include/sound/soc-acpi.h +1 -0
@@ -48,6 +48,7 @@ struct snd_soc_acpi_mach_params {u32 acpi_ipc_irq_index;const char *platform;u32 codec_mask; +u32 dmic_num; };/**
sound/soc/intel/boards/kbl_rt5663_max98927.c +5 -5
@@ -25,9 +25,9 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/rt5663.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/clkdev.h>
@@ -969,7 +969,7 @@ static struct snd_soc_card kabylake_audio_card_rt5663 = {static int kabylake_audio_probe (struct platform_device *pdev) {struct kbl_rt5663_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach;int ret; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );
@@ -984,9 +984,9 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card->dev = &pdev->dev;snd_soc_card_set_drvdata (kabylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels; ctx->mclk =devm_clk_get (&pdev->dev,"ssp1_mclk" );
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +5 -5
@@ -26,10 +26,10 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/rt5514.h" #include "../../codecs/rt5663.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #define KBL_REALTEK_CODEC_DAI "rt5663-aif"#define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1"
@@ -648,7 +648,7 @@ static struct snd_soc_card kabylake_audio_card = {static int kabylake_audio_probe (struct platform_device *pdev) {struct kbl_codec_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)
@@ -659,9 +659,9 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&kabylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;return devm_snd_soc_register_card (&pdev->dev, &kabylake_audio_card);
sound/soc/intel/boards/skl_nau88l25_max98357a.c +5 -5
@@ -21,9 +21,9 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"#define SKL_MAXIM_CODEC_DAI "HiFi"
@@ -641,7 +641,7 @@ static struct snd_soc_card skylake_audio_card = {static int skylake_audio_probe (struct platform_device *pdev) {struct skl_nau8825_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)
@@ -652,9 +652,9 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;return devm_snd_soc_register_card (&pdev->dev, &skylake_audio_card);
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +5 -5
@@ -23,11 +23,11 @@#include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include <sound/jack.h> #include <sound/pcm_params.h> #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"#define SKL_SSM_CODEC_DAI "ssm4567-hifi"
@@ -694,7 +694,7 @@ static struct snd_soc_card skylake_audio_card = {static int skylake_audio_probe (struct platform_device *pdev) {struct skl_nau88125_private *ctx; -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach; ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)
@@ -705,9 +705,9 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - pdata =dev_get_drvdata (&pdev->dev); -if (pdata) - dmic_constraints = pdata->dmic_num ==2 ? + mach =dev_get_drvdata (&pdev->dev); +if (mach) + dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;return devm_snd_soc_register_card (&pdev->dev, &skylake_audio_card);
sound/soc/intel/skylake/skl.c +1 -1
@@ -515,7 +515,7 @@ static int skl_find_machine(struct skl *skl, void *driver_data)if (pdata) { skl->use_tplg_pcm = pdata->use_tplg_pcm; - pdata->dmic_num =skl_get_dmic_geo (skl); + mach->mach_params.dmic_num =skl_get_dmic_geo (skl); }return 0 ;
sound/soc/intel/skylake/skl.h +0 -3
@@ -119,10 +119,7 @@ struct skl_dma_params { };struct skl_machine_pdata { -u32 dmic_num;bool use_tplg_pcm;/* use dais and dai links from topology */ -const char *platform; -u32 codec_mask; };struct skl_dsp_ops {
Signature · 1 line
2.19.0.rc2
PATCH 3/3 ASoC: Intel: use platform_data for machine drivers
In reply to Pierre-Louis BossartFor some reason we have different mechanisms for passing data to machine drivers. Use the solution used by Atom/SST and SOF instead of using drv_data as done by Skylake.
--- sound/soc/intel/boards/kbl_rt5663_max98927.c | 2 +- sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 2 +- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 2 +- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 2 +- sound/soc/intel/skylake/skl.c | 13 ++++++++++--- 6 files changed, 15 insertions(+), 8 deletions(-)
sound/soc/intel/boards/kbl_rt5663_max98927.c +1 -1
@@ -984,7 +984,7 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card->dev = &pdev->dev;snd_soc_card_set_drvdata (kabylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +1 -1
@@ -659,7 +659,7 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&kabylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/boards/skl_hda_dsp_generic.c +1 -1
@@ -146,7 +146,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&ctx->hdmi_pcm_list); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (!mach)return -EINVAL ;
sound/soc/intel/boards/skl_nau88l25_max98357a.c +1 -1
@@ -652,7 +652,7 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +1 -1
@@ -705,7 +705,7 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/skylake/skl.c +10 -3
@@ -534,6 +534,16 @@ static int skl_machine_device_register(struct skl *skl)return -EIO ; } + mach->mach_params.platform =dev_name (bus->dev); + mach->mach_params.codec_mask = bus->codec_mask; + + ret =platform_device_add_data (pdev, (const void *)mach,sizeof (*mach)); +if (ret) { +dev_err (bus->dev,"failed to add machine device platform data\n" ); +platform_device_put (pdev); +return ret; + } + ret =platform_device_add (pdev);if (ret) {dev_err (bus->dev,"failed to add machine device\n" );
@@ -541,9 +551,6 @@ static int skl_machine_device_register(struct skl *skl)return -EIO ; } - mach->mach_params.platform =dev_name (bus->dev); - mach->mach_params.codec_mask = bus->codec_mask; -dev_set_drvdata (&pdev->dev, mach); skl->i2s_dev = pdev;
Signature · 1 line
2.17.1
Mark Brown
maintainerApplied "ASoC: Intel: use platform_data for machine drivers" to the asoc tree
The patch
ASoC: Intel: use platform_data for machine drivers
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
5a619b9e8883a0f9691964d001b8480df44df5b9Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <[email protected]>
Date: Fri, 16 Nov 2018 18:47:06 -0600
Subject: [PATCH] ASoC: Intel: use platform_data for machine drivers
For some reason we have different mechanisms for passing data to machine drivers. Use the solution used by Atom/SST and SOF instead of using drv_data as done by Skylake.
--- sound/soc/intel/boards/kbl_rt5663_max98927.c | 2 +- sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 2 +- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 2 +- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 2 +- sound/soc/intel/skylake/skl.c | 13 ++++++++++--- 6 files changed, 15 insertions(+), 8 deletions(-)
sound/soc/intel/boards/kbl_rt5663_max98927.c +1 -1
@@ -984,7 +984,7 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card->dev = &pdev->dev;snd_soc_card_set_drvdata (kabylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +1 -1
@@ -659,7 +659,7 @@ static int kabylake_audio_probe(struct platform_device *pdev) kabylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&kabylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/boards/skl_hda_dsp_generic.c +1 -1
@@ -146,7 +146,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&ctx->hdmi_pcm_list); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (!mach)return -EINVAL ;
sound/soc/intel/boards/skl_nau88l25_max98357a.c +1 -1
@@ -652,7 +652,7 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +1 -1
@@ -705,7 +705,7 @@ static int skylake_audio_probe(struct platform_device *pdev) skylake_audio_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&skylake_audio_card, ctx); - mach =dev_get_drvdata (&pdev->dev); + mach = (&pdev->dev)->platform_data;if (mach) dmic_constraints = mach->mach_params.dmic_num ==2 ? &constraints_dmic_2ch : &constraints_dmic_channels;
sound/soc/intel/skylake/skl.c +10 -3
@@ -534,6 +534,16 @@ static int skl_machine_device_register(struct skl *skl)return -EIO ; } + mach->mach_params.platform =dev_name (bus->dev); + mach->mach_params.codec_mask = bus->codec_mask; + + ret =platform_device_add_data (pdev, (const void *)mach,sizeof (*mach)); +if (ret) { +dev_err (bus->dev,"failed to add machine device platform data\n" ); +platform_device_put (pdev); +return ret; + } + ret =platform_device_add (pdev);if (ret) {dev_err (bus->dev,"failed to add machine device\n" );
@@ -541,9 +551,6 @@ static int skl_machine_device_register(struct skl *skl)return -EIO ; } - mach->mach_params.platform =dev_name (bus->dev); - mach->mach_params.codec_mask = bus->codec_mask; -dev_set_drvdata (&pdev->dev, mach); skl->i2s_dev = pdev;
Signature · 1 line
2.19.0.rc2