Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sound/soc/intel/boards/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ snd-soc-sst-bdw-rt5677-mach-objs := bdw-rt5677.o
snd-soc-sst-broadwell-objs := broadwell.o
snd-soc-sst-bxt-da7219_max98357a-objs := bxt_da7219_max98357a.o hda_dsp_common.o
snd-soc-sst-bxt-rt298-objs := bxt_rt298.o hda_dsp_common.o
snd-soc-sst-bxt-pcm512x-objs := bxt_pcm512x.o
snd-soc-sst-bxt-pcm512x-objs := bxt_pcm512x.o hda_dsp_common.o
snd-soc-sst-bxt-wm8804-objs := bxt_wm8804.o
snd-soc-sst-glk-rt5682_max98357a-objs := glk_rt5682_max98357a.o hda_dsp_common.o
snd-soc-sst-bytcr-rt5640-objs := bytcr_rt5640.o
Expand All @@ -20,7 +20,7 @@ snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o
snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o
snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o
snd-soc-sof_rt5682-objs := sof_rt5682.o hda_dsp_common.o
snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o
snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o hda_dsp_common.o
snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o
snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o
snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o
Expand All @@ -30,7 +30,7 @@ snd-soc-skl_rt286-objs := skl_rt286.o
snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_common.o
snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o
snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o
snd-soc-tgl-rt1308-objs := tgl_rt1308.o
snd-soc-tgl-rt1308-objs := tgl_rt1308.o hda_dsp_common.o

obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o
obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
Expand All @@ -53,7 +53,7 @@ obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH) += snd-soc-sst-byt-cht-cx2072x.
obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH) += snd-soc-sst-byt-cht-da7213.o
obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH) += snd-soc-sst-byt-cht-es8316.o
obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) += snd-soc-sst-byt-cht-nocodec.o
obj-$(CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH) += cml_rt1011_rt5682.o
obj-$(CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH) += snd-soc-cml_rt1011_rt5682.o
obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH) += snd-soc-kbl_da7219_max98357a.o
obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH) += snd-soc-kbl_da7219_max98927.o
obj-$(CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH) += snd-soc-kbl_rt5663_max98927.o
Expand Down
49 changes: 41 additions & 8 deletions sound/soc/intel/boards/bxt_pcm512x.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/jack.h>
#include "../../codecs/hdac_hdmi.h"
#include "../../codecs/pcm512x.h"
#include "../atom/sst-atom-controls.h"

struct bxt_card_private {
struct list_head hdmi_pcm_list;
bool common_hdmi_codec_drv;
};

#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \
IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)

#include "../../codecs/hdac_hdmi.h"
#include "../atom/sst-atom-controls.h"
#include "hda_dsp_common.h"

static struct snd_soc_jack broxton_hdmi[3];

struct bxt_hdmi_pcm {
Expand Down Expand Up @@ -57,12 +62,12 @@ static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd)
}

#define NAME_SIZE 32
static int bxt_card_late_probe(struct snd_soc_card *card)
static int hdmi_jack_create_controls(struct snd_soc_card *card)
{
struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card);
struct bxt_hdmi_pcm *pcm;
struct snd_soc_component *component = NULL;
int err, i = 0;
int err = 0, i = 0;
char jack_name[NAME_SIZE];

list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
Expand All @@ -72,7 +77,6 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
err = snd_soc_card_jack_new(card, jack_name,
SND_JACK_AVOUT, &broxton_hdmi[i],
NULL, 0);

if (err)
return err;

Expand All @@ -84,9 +88,29 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
i++;
}

return err;
}

static int bxt_card_late_probe(struct snd_soc_card *card)
{
struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card);
struct snd_soc_component *component;
struct bxt_hdmi_pcm *pcm;
int err;

pcm = list_first_entry(&ctx->hdmi_pcm_list, struct bxt_hdmi_pcm,
head);
component = pcm->codec_dai->component;
if (!component)
return -EINVAL;

if (ctx->common_hdmi_codec_drv)
return hda_dsp_hdmi_build_controls(card, component);

err = hdmi_jack_create_controls(card);
if (err < 0)
return err;

return hdac_hdmi_jack_port_init(component, &card->dapm);
}
#else
Expand Down Expand Up @@ -175,6 +199,9 @@ SND_SOC_DAILINK_DEF(ssp5_codec,
SND_SOC_DAILINK_DEF(platform,
DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:0e.0")));

#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \
IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)

SND_SOC_DAILINK_DEF(idisp1_pin,
DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin")));
SND_SOC_DAILINK_DEF(idisp1_codec,
Expand All @@ -190,6 +217,8 @@ SND_SOC_DAILINK_DEF(idisp3_pin,
SND_SOC_DAILINK_DEF(idisp3_codec,
DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3")));

#endif

static struct snd_soc_dai_link dailink[] = {
/* CODEC<->CODEC link */
/* back ends */
Expand All @@ -206,7 +235,8 @@ static struct snd_soc_dai_link dailink[] = {
.dpcm_capture = 1,
SND_SOC_DAILINK_REG(ssp5_pin, ssp5_codec, platform),
},
#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) || \
IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC)
{
.name = "iDisp1",
.id = 1,
Expand Down Expand Up @@ -264,7 +294,8 @@ static int bxt_pcm512x_probe(struct platform_device *pdev)
if (!ctx)
return -ENOMEM;

if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
if (IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) ||
IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);

mach = (&pdev->dev)->platform_data;
Expand All @@ -277,6 +308,8 @@ static int bxt_pcm512x_probe(struct platform_device *pdev)
if (ret_val)
return ret_val;

ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;

/* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(dailink); i++) {
if (!strcmp(dailink[i].codecs->name, "i2c-104C5122:00")) {
Expand Down
12 changes: 12 additions & 0 deletions sound/soc/intel/boards/cml_rt1011_rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "../../codecs/rt1011.h"
#include "../../codecs/rt5682.h"
#include "../../codecs/hdac_hdmi.h"
#include "hda_dsp_common.h"

/* The platform clock outputs 24Mhz clock to codec as I2S MCLK */
#define CML_PLAT_CLK 24000000
Expand All @@ -42,6 +43,7 @@ struct card_private {
char codec_name[SND_ACPI_I2C_ID_LEN];
struct snd_soc_jack headset;
struct list_head hdmi_pcm_list;
bool common_hdmi_codec_drv;
};

static const struct snd_kcontrol_new cml_controls[] = {
Expand Down Expand Up @@ -240,6 +242,13 @@ static int sof_card_late_probe(struct snd_soc_card *card)
struct hdmi_pcm *pcm;
int ret, i = 0;

pcm = list_first_entry(&ctx->hdmi_pcm_list, struct hdmi_pcm,
head);
component = pcm->codec_dai->component;

if (ctx->common_hdmi_codec_drv)
return hda_dsp_hdmi_build_controls(card, component);

list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name),
Expand Down Expand Up @@ -452,6 +461,9 @@ static int snd_cml_rt1011_probe(struct platform_device *pdev)
platform_name);
if (ret)
return ret;

ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;

snd_soc_card_set_drvdata(&snd_soc_card_cml, ctx);

return devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cml);
Expand Down
11 changes: 11 additions & 0 deletions sound/soc/intel/boards/tgl_rt1308.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@

#include "../../codecs/rt1308.h"
#include "../../codecs/hdac_hdmi.h"
#include "hda_dsp_common.h"

struct tgl_card_private {
struct list_head hdmi_pcm_list;
bool common_hdmi_codec_drv;
};

#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
Expand Down Expand Up @@ -63,6 +65,13 @@ static int tgl_card_late_probe(struct snd_soc_card *card)
int err, i = 0;
char jack_name[NAME_SIZE];

pcm = list_first_entry(&ctx->hdmi_pcm_list, struct tgl_hdmi_pcm,
head);
component = pcm->codec_dai->component;

if (ctx->common_hdmi_codec_drv)
return hda_dsp_hdmi_build_controls(card, component);

list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name),
Expand Down Expand Up @@ -284,6 +293,8 @@ static int tgl_rt1308_probe(struct platform_device *pdev)
if (ret)
return ret;

ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;

snd_soc_card_set_drvdata(card, ctx);

return devm_snd_soc_register_card(&pdev->dev, card);
Expand Down