summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2018-11-16 19:47:05 -0500
committerMark Brown <broonie@kernel.org>2018-11-20 11:56:25 -0500
commitb92826fa8c5a423edf6c9e385b5d433c61375cc8 (patch)
tree6cd079372bee83edc7c34d7536bad5ebaf4448c2
parent4647598cde0e55d5c6d6a3c4223953611a472289 (diff)
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. Fixes: 842bb5135f10 ('ASoC: Intel: use standard interface for Hdaudio machine driver') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc-acpi.h1
-rw-r--r--sound/soc/intel/boards/kbl_rt5663_max98927.c10
-rw-r--r--sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c10
-rw-r--r--sound/soc/intel/boards/skl_nau88l25_max98357a.c10
-rw-r--r--sound/soc/intel/boards/skl_nau88l25_ssm4567.c10
-rw-r--r--sound/soc/intel/skylake/skl.c2
-rw-r--r--sound/soc/intel/skylake/skl.h3
7 files changed, 22 insertions, 24 deletions
diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
index 5154c6359609..266e64e3c24c 100644
--- a/include/sound/soc-acpi.h
+++ b/include/sound/soc-acpi.h
@@ -48,6 +48,7 @@ struct snd_soc_acpi_mach_params {
48 u32 acpi_ipc_irq_index; 48 u32 acpi_ipc_irq_index;
49 const char *platform; 49 const char *platform;
50 u32 codec_mask; 50 u32 codec_mask;
51 u32 dmic_num;
51}; 52};
52 53
53/** 54/**
diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c
index 6ea969c0a5fb..c2a96940f9f2 100644
--- a/sound/soc/intel/boards/kbl_rt5663_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c
@@ -25,9 +25,9 @@
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/pcm_params.h> 26#include <sound/pcm_params.h>
27#include <sound/soc.h> 27#include <sound/soc.h>
28#include <sound/soc-acpi.h>
28#include "../../codecs/rt5663.h" 29#include "../../codecs/rt5663.h"
29#include "../../codecs/hdac_hdmi.h" 30#include "../../codecs/hdac_hdmi.h"
30#include "../skylake/skl.h"
31#include <linux/clk.h> 31#include <linux/clk.h>
32#include <linux/clk-provider.h> 32#include <linux/clk-provider.h>
33#include <linux/clkdev.h> 33#include <linux/clkdev.h>
@@ -969,7 +969,7 @@ static struct snd_soc_card kabylake_audio_card_rt5663 = {
969static int kabylake_audio_probe(struct platform_device *pdev) 969static int kabylake_audio_probe(struct platform_device *pdev)
970{ 970{
971 struct kbl_rt5663_private *ctx; 971 struct kbl_rt5663_private *ctx;
972 struct skl_machine_pdata *pdata; 972 struct snd_soc_acpi_mach *mach;
973 int ret; 973 int ret;
974 974
975 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 975 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
@@ -984,9 +984,9 @@ static int kabylake_audio_probe(struct platform_device *pdev)
984 kabylake_audio_card->dev = &pdev->dev; 984 kabylake_audio_card->dev = &pdev->dev;
985 snd_soc_card_set_drvdata(kabylake_audio_card, ctx); 985 snd_soc_card_set_drvdata(kabylake_audio_card, ctx);
986 986
987 pdata = dev_get_drvdata(&pdev->dev); 987 mach = dev_get_drvdata(&pdev->dev);
988 if (pdata) 988 if (mach)
989 dmic_constraints = pdata->dmic_num == 2 ? 989 dmic_constraints = mach->mach_params.dmic_num == 2 ?
990 &constraints_dmic_2ch : &constraints_dmic_channels; 990 &constraints_dmic_2ch : &constraints_dmic_channels;
991 991
992 ctx->mclk = devm_clk_get(&pdev->dev, "ssp1_mclk"); 992 ctx->mclk = devm_clk_get(&pdev->dev, "ssp1_mclk");
diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
index a737c915d46a..d7df307b406f 100644
--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
@@ -26,10 +26,10 @@
26#include <sound/pcm.h> 26#include <sound/pcm.h>
27#include <sound/pcm_params.h> 27#include <sound/pcm_params.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29#include <sound/soc-acpi.h>
29#include "../../codecs/rt5514.h" 30#include "../../codecs/rt5514.h"
30#include "../../codecs/rt5663.h" 31#include "../../codecs/rt5663.h"
31#include "../../codecs/hdac_hdmi.h" 32#include "../../codecs/hdac_hdmi.h"
32#include "../skylake/skl.h"
33 33
34#define KBL_REALTEK_CODEC_DAI "rt5663-aif" 34#define KBL_REALTEK_CODEC_DAI "rt5663-aif"
35#define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1" 35#define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1"
@@ -648,7 +648,7 @@ static struct snd_soc_card kabylake_audio_card = {
648static int kabylake_audio_probe(struct platform_device *pdev) 648static int kabylake_audio_probe(struct platform_device *pdev)
649{ 649{
650 struct kbl_codec_private *ctx; 650 struct kbl_codec_private *ctx;
651 struct skl_machine_pdata *pdata; 651 struct snd_soc_acpi_mach *mach;
652 652
653 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 653 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
654 if (!ctx) 654 if (!ctx)
@@ -659,9 +659,9 @@ static int kabylake_audio_probe(struct platform_device *pdev)
659 kabylake_audio_card.dev = &pdev->dev; 659 kabylake_audio_card.dev = &pdev->dev;
660 snd_soc_card_set_drvdata(&kabylake_audio_card, ctx); 660 snd_soc_card_set_drvdata(&kabylake_audio_card, ctx);
661 661
662 pdata = dev_get_drvdata(&pdev->dev); 662 mach = dev_get_drvdata(&pdev->dev);
663 if (pdata) 663 if (mach)
664 dmic_constraints = pdata->dmic_num == 2 ? 664 dmic_constraints = mach->mach_params.dmic_num == 2 ?
665 &constraints_dmic_2ch : &constraints_dmic_channels; 665 &constraints_dmic_2ch : &constraints_dmic_channels;
666 666
667 return devm_snd_soc_register_card(&pdev->dev, &kabylake_audio_card); 667 return devm_snd_soc_register_card(&pdev->dev, &kabylake_audio_card);
diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c
index 552958ce736d..931890f9aa74 100644
--- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c
+++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c
@@ -21,9 +21,9 @@
21#include <sound/pcm.h> 21#include <sound/pcm.h>
22#include <sound/pcm_params.h> 22#include <sound/pcm_params.h>
23#include <sound/soc.h> 23#include <sound/soc.h>
24#include <sound/soc-acpi.h>
24#include "../../codecs/nau8825.h" 25#include "../../codecs/nau8825.h"
25#include "../../codecs/hdac_hdmi.h" 26#include "../../codecs/hdac_hdmi.h"
26#include "../skylake/skl.h"
27 27
28#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" 28#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
29#define SKL_MAXIM_CODEC_DAI "HiFi" 29#define SKL_MAXIM_CODEC_DAI "HiFi"
@@ -641,7 +641,7 @@ static struct snd_soc_card skylake_audio_card = {
641static int skylake_audio_probe(struct platform_device *pdev) 641static int skylake_audio_probe(struct platform_device *pdev)
642{ 642{
643 struct skl_nau8825_private *ctx; 643 struct skl_nau8825_private *ctx;
644 struct skl_machine_pdata *pdata; 644 struct snd_soc_acpi_mach *mach;
645 645
646 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 646 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
647 if (!ctx) 647 if (!ctx)
@@ -652,9 +652,9 @@ static int skylake_audio_probe(struct platform_device *pdev)
652 skylake_audio_card.dev = &pdev->dev; 652 skylake_audio_card.dev = &pdev->dev;
653 snd_soc_card_set_drvdata(&skylake_audio_card, ctx); 653 snd_soc_card_set_drvdata(&skylake_audio_card, ctx);
654 654
655 pdata = dev_get_drvdata(&pdev->dev); 655 mach = dev_get_drvdata(&pdev->dev);
656 if (pdata) 656 if (mach)
657 dmic_constraints = pdata->dmic_num == 2 ? 657 dmic_constraints = mach->mach_params.dmic_num == 2 ?
658 &constraints_dmic_2ch : &constraints_dmic_channels; 658 &constraints_dmic_2ch : &constraints_dmic_channels;
659 659
660 return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card); 660 return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card);
diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
index f985b30a1d0e..657c650766fc 100644
--- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
+++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
@@ -23,11 +23,11 @@
23#include <sound/core.h> 23#include <sound/core.h>
24#include <sound/pcm.h> 24#include <sound/pcm.h>
25#include <sound/soc.h> 25#include <sound/soc.h>
26#include <sound/soc-acpi.h>
26#include <sound/jack.h> 27#include <sound/jack.h>
27#include <sound/pcm_params.h> 28#include <sound/pcm_params.h>
28#include "../../codecs/nau8825.h" 29#include "../../codecs/nau8825.h"
29#include "../../codecs/hdac_hdmi.h" 30#include "../../codecs/hdac_hdmi.h"
30#include "../skylake/skl.h"
31 31
32#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" 32#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
33#define SKL_SSM_CODEC_DAI "ssm4567-hifi" 33#define SKL_SSM_CODEC_DAI "ssm4567-hifi"
@@ -694,7 +694,7 @@ static struct snd_soc_card skylake_audio_card = {
694static int skylake_audio_probe(struct platform_device *pdev) 694static int skylake_audio_probe(struct platform_device *pdev)
695{ 695{
696 struct skl_nau88125_private *ctx; 696 struct skl_nau88125_private *ctx;
697 struct skl_machine_pdata *pdata; 697 struct snd_soc_acpi_mach *mach;
698 698
699 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 699 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
700 if (!ctx) 700 if (!ctx)
@@ -705,9 +705,9 @@ static int skylake_audio_probe(struct platform_device *pdev)
705 skylake_audio_card.dev = &pdev->dev; 705 skylake_audio_card.dev = &pdev->dev;
706 snd_soc_card_set_drvdata(&skylake_audio_card, ctx); 706 snd_soc_card_set_drvdata(&skylake_audio_card, ctx);
707 707
708 pdata = dev_get_drvdata(&pdev->dev); 708 mach = dev_get_drvdata(&pdev->dev);
709 if (pdata) 709 if (mach)
710 dmic_constraints = pdata->dmic_num == 2 ? 710 dmic_constraints = mach->mach_params.dmic_num == 2 ?
711 &constraints_dmic_2ch : &constraints_dmic_channels; 711 &constraints_dmic_2ch : &constraints_dmic_channels;
712 712
713 return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card); 713 return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card);
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index ebab04b51bc1..b66d66acbc35 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -515,7 +515,7 @@ static int skl_find_machine(struct skl *skl, void *driver_data)
515 515
516 if (pdata) { 516 if (pdata) {
517 skl->use_tplg_pcm = pdata->use_tplg_pcm; 517 skl->use_tplg_pcm = pdata->use_tplg_pcm;
518 pdata->dmic_num = skl_get_dmic_geo(skl); 518 mach->mach_params.dmic_num = skl_get_dmic_geo(skl);
519 } 519 }
520 520
521 return 0; 521 return 0;
diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h
index 8d48cd7c56c8..85f8bb6687dc 100644
--- a/sound/soc/intel/skylake/skl.h
+++ b/sound/soc/intel/skylake/skl.h
@@ -119,10 +119,7 @@ struct skl_dma_params {
119}; 119};
120 120
121struct skl_machine_pdata { 121struct skl_machine_pdata {
122 u32 dmic_num;
123 bool use_tplg_pcm; /* use dais and dai links from topology */ 122 bool use_tplg_pcm; /* use dais and dai links from topology */
124 const char *platform;
125 u32 codec_mask;
126}; 123};
127 124
128struct skl_dsp_ops { 125struct skl_dsp_ops {