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: 842bb5135f
('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>
This commit is contained in:
Родитель
4647598cde
Коммит
b92826fa8c
|
@ -48,6 +48,7 @@ struct snd_soc_acpi_mach_params {
|
|||
u32 acpi_ipc_irq_index;
|
||||
const char *platform;
|
||||
u32 codec_mask;
|
||||
u32 dmic_num;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче