Commit 53c9fac8 authored by Mark Brown's avatar Mark Brown

ASoC: Intel: haswell and broadwell boards update

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

A number of patches improving overall quality and readability of
haswell.c and broadwell.c source files found in sound/soc/intel/boards.
Both files are first renamed and only then actual changes are being
incrementally added. The respective names are: hsw_rt5640 and bdw_rt286
to match the pattern found in more recent boards.

Most patches bring no functional change - the more impactful patches at
are placed the end.  The last patch is removing of FE DAI ops. Given the
existence of platform FE DAI capabilities (either static declaration or
through topology file), this code is redundant.
parents 4d6c2b46 e7f68863
......@@ -41,7 +41,7 @@ config SND_SOC_INTEL_SOF_CIRRUS_COMMON
if SND_SOC_INTEL_CATPT
config SND_SOC_INTEL_HASWELL_MACH
tristate "Haswell Lynxpoint"
tristate "Haswell with RT5640 I2S codec"
depends on I2C
depends on I2C_DESIGNWARE_PLATFORM || COMPILE_TEST
depends on X86_INTEL_LPSS || COMPILE_TEST
......@@ -85,7 +85,7 @@ config SND_SOC_INTEL_BDW_RT5677_MACH
If unsure select "N".
config SND_SOC_INTEL_BROADWELL_MACH
tristate "Broadwell Wildcatpoint"
tristate "Broadwell with RT286 I2S codec"
depends on I2C
depends on I2C_DESIGNWARE_PLATFORM || COMPILE_TEST
depends on X86_INTEL_LPSS || COMPILE_TEST
......
# SPDX-License-Identifier: GPL-2.0-only
snd-soc-sst-haswell-objs := haswell.o
snd-soc-sst-haswell-objs := hsw_rt5640.o
snd-soc-sst-bdw-rt5650-mach-objs := bdw-rt5650.o
snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o
snd-soc-sst-broadwell-objs := broadwell.o
snd-soc-sst-broadwell-objs := bdw_rt286.o
snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o
snd-soc-sst-bxt-rt298-objs := bxt_rt298.o
snd-soc-sst-sof-pcm512x-objs := sof_pcm512x.o
......
// SPDX-License-Identifier: GPL-2.0-only
/*
* Intel Broadwell Wildcatpoint SST Audio
* Sound card driver for Intel Broadwell Wildcat Point with Realtek 286
*
* Copyright (C) 2013, Intel Corporation. All rights reserved.
*/
......@@ -8,17 +8,16 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "../../codecs/rt286.h"
static struct snd_soc_jack broadwell_headset;
/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin broadwell_headset_pins[] = {
static struct snd_soc_jack card_headset;
static struct snd_soc_jack_pin card_headset_pins[] = {
{
.pin = "Mic Jack",
.mask = SND_JACK_MICROPHONE,
......@@ -29,12 +28,12 @@ static struct snd_soc_jack_pin broadwell_headset_pins[] = {
},
};
static const struct snd_kcontrol_new broadwell_controls[] = {
static const struct snd_kcontrol_new card_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
};
static const struct snd_soc_dapm_widget broadwell_widgets[] = {
static const struct snd_soc_dapm_widget card_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
......@@ -43,20 +42,15 @@ static const struct snd_soc_dapm_widget broadwell_widgets[] = {
SND_SOC_DAPM_LINE("Line Jack", NULL),
};
static const struct snd_soc_dapm_route broadwell_rt286_map[] = {
/* speaker */
static const struct snd_soc_dapm_route card_routes[] = {
{"Speaker", NULL, "SPOR"},
{"Speaker", NULL, "SPOL"},
/* HP jack connectors - unknown if we have jack deteck */
{"Headphone Jack", NULL, "HPO Pin"},
/* other jacks */
{"MIC1", NULL, "Mic Jack"},
{"LINE1", NULL, "Line Jack"},
/* digital mics */
{"DMIC1 Pin", NULL, "DMIC1"},
{"DMIC2 Pin", NULL, "DMIC2"},
......@@ -65,111 +59,66 @@ static const struct snd_soc_dapm_route broadwell_rt286_map[] = {
{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
};
static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
int ret = 0;
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset",
SND_JACK_HEADSET | SND_JACK_BTN_0, &broadwell_headset,
broadwell_headset_pins, ARRAY_SIZE(broadwell_headset_pins));
struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component;
int ret;
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0,
&card_headset, card_headset_pins,
ARRAY_SIZE(card_headset_pins));
if (ret)
return ret;
snd_soc_component_set_jack(component, &broadwell_headset, NULL);
return 0;
return snd_soc_component_set_jack(codec, &card_headset, NULL);
}
static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd,
static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
struct snd_interval *rate = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval *chan = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
/* The ADSP will covert the FE rate to 48k, stereo */
/* The ADSP will convert the FE rate to 48kHz, stereo. */
rate->min = rate->max = 48000;
chan->min = chan->max = 2;
/* set SSP0 to 16 bit */
channels->min = channels->max = 2;
/* Set SSP0 to 16 bit. */
params_set_format(params, SNDRV_PCM_FORMAT_S16_LE);
return 0;
}
static int broadwell_rt286_hw_params(struct snd_pcm_substream *substream,
static int codec_link_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
int ret;
ret = snd_soc_dai_set_sysclk(codec_dai, RT286_SCLK_S_PLL, 24000000,
SND_SOC_CLOCK_IN);
ret = snd_soc_dai_set_sysclk(codec_dai, RT286_SCLK_S_PLL, 24000000, SND_SOC_CLOCK_IN);
if (ret < 0) {
dev_err(rtd->dev, "can't set codec sysclk configuration\n");
dev_err(rtd->dev, "set codec sysclk failed: %d\n", ret);
return ret;
}
return ret;
}
static const struct snd_soc_ops broadwell_rt286_ops = {
.hw_params = broadwell_rt286_hw_params,
};
static const unsigned int channels[] = {
2,
};
static const struct snd_pcm_hw_constraint_list constraints_channels = {
.count = ARRAY_SIZE(channels),
.list = channels,
.mask = 0,
};
static int broadwell_fe_startup(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
/* Board supports stereo configuration only */
runtime->hw.channels_max = 2;
return snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
}
static const struct snd_soc_ops broadwell_fe_ops = {
.startup = broadwell_fe_startup,
static const struct snd_soc_ops codec_link_ops = {
.hw_params = codec_link_hw_params,
};
SND_SOC_DAILINK_DEF(system,
DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
SND_SOC_DAILINK_DEF(offload0,
DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin")));
SND_SOC_DAILINK_DEF(offload1,
DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin")));
SND_SOC_DAILINK_DEF(loopback,
DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin")));
SND_SOC_DAILINK_DEF(system, DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
SND_SOC_DAILINK_DEF(offload0, DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin")));
SND_SOC_DAILINK_DEF(offload1, DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin")));
SND_SOC_DAILINK_DEF(loopback, DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin")));
SND_SOC_DAILINK_DEF(dummy,
DAILINK_COMP_ARRAY(COMP_DUMMY()));
SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY()));
SND_SOC_DAILINK_DEF(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio")));
SND_SOC_DAILINK_DEF(codec, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", "rt286-aif1")));
SND_SOC_DAILINK_DEF(ssp0_port, DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
SND_SOC_DAILINK_DEF(platform,
DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio")));
SND_SOC_DAILINK_DEF(codec,
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", "rt286-aif1")));
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
/* broadwell digital audio interface glue - connects codec <--> CPU */
static struct snd_soc_dai_link broadwell_rt286_dais[] = {
static struct snd_soc_dai_link card_dai_links[] = {
/* Front End DAI links */
{
.name = "System PCM",
......@@ -177,7 +126,6 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
.nonatomic = 1,
.dynamic = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.ops = &broadwell_fe_ops,
.dpcm_playback = 1,
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(system, dummy, platform),
......@@ -215,25 +163,23 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
.name = "Codec",
.id = 0,
.no_pcm = 1,
.init = broadwell_rt286_codec_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBC_CFC,
.init = codec_link_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC,
.ignore_pmdown_time = 1,
.be_hw_params_fixup = broadwell_ssp0_fixup,
.ops = &broadwell_rt286_ops,
.be_hw_params_fixup = codec_link_hw_params_fixup,
.ops = &codec_link_ops,
.dpcm_playback = 1,
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(ssp0_port, codec, platform),
},
};
static void broadwell_disable_jack(struct snd_soc_card *card)
static void bdw_rt286_disable_jack(struct snd_soc_card *card)
{
struct snd_soc_component *component;
for_each_card_components(card, component) {
if (!strcmp(component->name, "i2c-INT343A:00")) {
dev_dbg(component->dev, "disabling jack detect before going to suspend.\n");
snd_soc_component_set_jack(component, NULL, NULL);
break;
......@@ -241,98 +187,93 @@ static void broadwell_disable_jack(struct snd_soc_card *card)
}
}
static int broadwell_suspend(struct snd_soc_card *card)
static int bdw_rt286_suspend(struct snd_soc_card *card)
{
broadwell_disable_jack(card);
bdw_rt286_disable_jack(card);
return 0;
}
static int broadwell_resume(struct snd_soc_card *card){
static int bdw_rt286_resume(struct snd_soc_card *card)
{
struct snd_soc_component *component;
for_each_card_components(card, component) {
if (!strcmp(component->name, "i2c-INT343A:00")) {
dev_dbg(component->dev, "enabling jack detect for resume.\n");
snd_soc_component_set_jack(component, &broadwell_headset, NULL);
snd_soc_component_set_jack(component, &card_headset, NULL);
break;
}
}
return 0;
}
/* use space before codec name to simplify card ID, and simplify driver name */
static struct snd_soc_card bdw_rt286_card = {
.owner = THIS_MODULE,
.dai_link = card_dai_links,
.num_links = ARRAY_SIZE(card_dai_links),
.controls = card_controls,
.num_controls = ARRAY_SIZE(card_controls),
.dapm_widgets = card_widgets,
.num_dapm_widgets = ARRAY_SIZE(card_widgets),
.dapm_routes = card_routes,
.num_dapm_routes = ARRAY_SIZE(card_routes),
.fully_routed = true,
.suspend_pre = bdw_rt286_suspend,
.resume_post = bdw_rt286_resume,
};
/* Use space before codec name to simplify card ID, and simplify driver name. */
#define SOF_CARD_NAME "bdw rt286" /* card name will be 'sof-bdw rt286' */
#define SOF_DRIVER_NAME "SOF"
#define CARD_NAME "broadwell-rt286"
#define DRIVER_NAME NULL /* card name will be used for driver name */
/* broadwell audio machine driver for WPT + RT286S */
static struct snd_soc_card broadwell_rt286 = {
.owner = THIS_MODULE,
.dai_link = broadwell_rt286_dais,
.num_links = ARRAY_SIZE(broadwell_rt286_dais),
.controls = broadwell_controls,
.num_controls = ARRAY_SIZE(broadwell_controls),
.dapm_widgets = broadwell_widgets,
.num_dapm_widgets = ARRAY_SIZE(broadwell_widgets),
.dapm_routes = broadwell_rt286_map,
.num_dapm_routes = ARRAY_SIZE(broadwell_rt286_map),
.fully_routed = true,
.suspend_pre = broadwell_suspend,
.resume_post = broadwell_resume,
};
static int broadwell_audio_probe(struct platform_device *pdev)
static int bdw_rt286_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach;
struct device *dev = &pdev->dev;
int ret;
broadwell_rt286.dev = &pdev->dev;
bdw_rt286_card.dev = dev;
mach = dev_get_platdata(dev);
/* override platform name, if required */
mach = pdev->dev.platform_data;
ret = snd_soc_fixup_dai_links_platform_name(&broadwell_rt286,
mach->mach_params.platform);
ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt286_card, mach->mach_params.platform);
if (ret)
return ret;
/* set card and driver name */
if (snd_soc_acpi_sof_parent(&pdev->dev)) {
broadwell_rt286.name = SOF_CARD_NAME;
broadwell_rt286.driver_name = SOF_DRIVER_NAME;
if (snd_soc_acpi_sof_parent(dev)) {
bdw_rt286_card.name = SOF_CARD_NAME;
bdw_rt286_card.driver_name = SOF_DRIVER_NAME;
} else {
broadwell_rt286.name = CARD_NAME;
broadwell_rt286.driver_name = DRIVER_NAME;
bdw_rt286_card.name = CARD_NAME;
}
return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
return devm_snd_soc_register_card(dev, &bdw_rt286_card);
}
static int broadwell_audio_remove(struct platform_device *pdev)
static int bdw_rt286_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
broadwell_disable_jack(card);
bdw_rt286_disable_jack(card);
return 0;
}
static struct platform_driver broadwell_audio = {
.probe = broadwell_audio_probe,
.remove = broadwell_audio_remove,
static struct platform_driver bdw_rt286_driver = {
.probe = bdw_rt286_probe,
.remove = bdw_rt286_remove,
.driver = {
.name = "broadwell-audio",
.name = "bdw_rt286",
.pm = &snd_soc_pm_ops
},
};
module_platform_driver(broadwell_audio)
module_platform_driver(bdw_rt286_driver)
/* Module information */
MODULE_AUTHOR("Liam Girdwood, Xingchao Wang");
MODULE_DESCRIPTION("Intel SST Audio for WPT/Broadwell");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:broadwell-audio");
MODULE_DESCRIPTION("Sound card driver for Intel Broadwell Wildcat Point with Realtek 286");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:bdw_rt286");
// SPDX-License-Identifier: GPL-2.0-only
/*
* Intel Haswell Lynxpoint SST Audio
* Sound card driver for Intel Haswell Lynx Point with Realtek 5640
*
* Copyright (C) 2013, Intel Corporation. All rights reserved.
*/
......@@ -9,20 +9,17 @@
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/pcm_params.h>
#include "../../codecs/rt5640.h"
/* Haswell ULT platforms have a Headphone and Mic jack */
static const struct snd_soc_dapm_widget haswell_widgets[] = {
static const struct snd_soc_dapm_widget card_widgets[] = {
SND_SOC_DAPM_HP("Headphones", NULL),
SND_SOC_DAPM_MIC("Mic", NULL),
};
static const struct snd_soc_dapm_route haswell_rt5640_map[] = {
static const struct snd_soc_dapm_route card_routes[] = {
{"Headphones", NULL, "HPOR"},
{"Headphones", NULL, "HPOL"},
{"IN2P", NULL, "Mic"},
......@@ -32,73 +29,55 @@ static const struct snd_soc_dapm_route haswell_rt5640_map[] = {
{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
};
static int haswell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd,
static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
struct snd_interval *rate = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval *channels = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
/* The ADSP will covert the FE rate to 48k, stereo */
/* 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 */
/* Set SSP0 to 16 bit. */
params_set_format(params, SNDRV_PCM_FORMAT_S16_LE);
return 0;
}
static int haswell_rt5640_hw_params(struct snd_pcm_substream *substream,
static int codec_link_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
int ret;
ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_MCLK, 12288000,
SND_SOC_CLOCK_IN);
ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_MCLK, 12288000, SND_SOC_CLOCK_IN);
if (ret < 0) {
dev_err(rtd->dev, "can't set codec sysclk configuration\n");
dev_err(rtd->dev, "set codec sysclk failed: %d\n", ret);
return ret;
}
/* set correct codec filter for DAI format and clock config */
/* Set correct codec filter for DAI format and clock config. */
snd_soc_component_update_bits(codec_dai->component, 0x83, 0xffff, 0x8000);
return ret;
}
static const struct snd_soc_ops haswell_rt5640_ops = {
.hw_params = haswell_rt5640_hw_params,
static const struct snd_soc_ops codec_link_ops = {
.hw_params = codec_link_hw_params,
};
SND_SOC_DAILINK_DEF(dummy,
DAILINK_COMP_ARRAY(COMP_DUMMY()));
SND_SOC_DAILINK_DEF(system, DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
SND_SOC_DAILINK_DEF(offload0, DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin")));
SND_SOC_DAILINK_DEF(offload1, DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin")));
SND_SOC_DAILINK_DEF(loopback, DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin")));
SND_SOC_DAILINK_DEF(system,
DAILINK_COMP_ARRAY(COMP_CPU("System Pin")));
SND_SOC_DAILINK_DEF(dummy, DAILINK_COMP_ARRAY(COMP_DUMMY()));
SND_SOC_DAILINK_DEF(codec, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT33CA:00", "rt5640-aif1")));
SND_SOC_DAILINK_DEF(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio")));
SND_SOC_DAILINK_DEF(ssp0_port, DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
SND_SOC_DAILINK_DEF(offload0,
DAILINK_COMP_ARRAY(COMP_CPU("Offload0 Pin")));
SND_SOC_DAILINK_DEF(offload1,
DAILINK_COMP_ARRAY(COMP_CPU("Offload1 Pin")));
SND_SOC_DAILINK_DEF(loopback,
DAILINK_COMP_ARRAY(COMP_CPU("Loopback Pin")));
SND_SOC_DAILINK_DEF(codec,
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT33CA:00", "rt5640-aif1")));
SND_SOC_DAILINK_DEF(platform,
DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio")));
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
static struct snd_soc_dai_link haswell_rt5640_dais[] = {
static struct snd_soc_dai_link card_dai_links[] = {
/* Front End DAI links */
{
.name = "System",
......@@ -137,66 +116,61 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = {
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(loopback, dummy, platform),
},
/* Back End DAI links */
{
/* SSP0 - Codec */
.name = "Codec",
.id = 0,
.no_pcm = 1,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBC_CFC,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC,
.ignore_pmdown_time = 1,
.be_hw_params_fixup = haswell_ssp0_fixup,
.ops = &haswell_rt5640_ops,
.be_hw_params_fixup = codec_link_hw_params_fixup,
.ops = &codec_link_ops,
.dpcm_playback = 1,
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(ssp0_port, codec, platform),
},
};
/* audio machine driver for Haswell Lynxpoint DSP + RT5640 */
static struct snd_soc_card haswell_rt5640 = {
static struct snd_soc_card hsw_rt5640_card = {
.name = "haswell-rt5640",
.owner = THIS_MODULE,
.dai_link = haswell_rt5640_dais,
.num_links = ARRAY_SIZE(haswell_rt5640_dais),
.dapm_widgets = haswell_widgets,
.num_dapm_widgets = ARRAY_SIZE(haswell_widgets),
.dapm_routes = haswell_rt5640_map,
.num_dapm_routes = ARRAY_SIZE(haswell_rt5640_map),
.dai_link = card_dai_links,
.num_links = ARRAY_SIZE(card_dai_links),
.dapm_widgets = card_widgets,
.num_dapm_widgets = ARRAY_SIZE(card_widgets),
.dapm_routes = card_routes,
.num_dapm_routes = ARRAY_SIZE(card_routes),
.fully_routed = true,
};
static int haswell_audio_probe(struct platform_device *pdev)
static int hsw_rt5640_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach;
struct device *dev = &pdev->dev;
int ret;
haswell_rt5640.dev = &pdev->dev;
hsw_rt5640_card.dev = dev;
mach = dev_get_platdata(dev);
/* override platform name, if required */
mach = pdev->dev.platform_data;
ret = snd_soc_fixup_dai_links_platform_name(&haswell_rt5640,
mach->mach_params.platform);
ret = snd_soc_fixup_dai_links_platform_name(&hsw_rt5640_card, mach->mach_params.platform);
if (ret)
return ret;
return devm_snd_soc_register_card(&pdev->dev, &haswell_rt5640);
return devm_snd_soc_register_card(dev, &hsw_rt5640_card);
}
static struct platform_driver haswell_audio = {
.probe = haswell_audio_probe,
static struct platform_driver hsw_rt5640_driver = {
.probe = hsw_rt5640_probe,
.driver = {
.name = "haswell-audio",
.name = "hsw_rt5640",
.pm = &snd_soc_pm_ops,
},
};
module_platform_driver(haswell_audio)
module_platform_driver(hsw_rt5640_driver)
/* Module information */
MODULE_AUTHOR("Liam Girdwood, Xingchao Wang");
MODULE_DESCRIPTION("Intel SST Audio for Haswell Lynxpoint");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:haswell-audio");
MODULE_DESCRIPTION("Sound card driver for Intel Haswell Lynx Point with Realtek 5640");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:hsw_rt5640");
......@@ -12,7 +12,7 @@
struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[] = {
{
.id = "INT33CA",
.drv_name = "haswell-audio",
.drv_name = "hsw_rt5640",
.fw_filename = "intel/IntcSST1.bin",
.sof_tplg_filename = "sof-hsw.tplg",
},
......@@ -23,7 +23,7 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_haswell_machines);
struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[] = {
{
.id = "INT343A",
.drv_name = "broadwell-audio",
.drv_name = "bdw_rt286",
.fw_filename = "intel/IntcSST2.bin",
.sof_tplg_filename = "sof-bdw-rt286.tplg",
},
......@@ -41,7 +41,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[] = {
},
{
.id = "INT33CA",
.drv_name = "haswell-audio",
.drv_name = "hsw_rt5640",
.fw_filename = "intel/IntcSST2.bin",
.sof_tplg_filename = "sof-bdw-rt5640.tplg",
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment