Commit 64b9f311 authored by Brent Lu's avatar Brent Lu Committed by Mark Brown

ASoC: Intel: sof_ssp_amp: remove hdac-hdmi support

Remove hdac-hdmi support code since we are now using
snd-hda-codec-hdmi codec driver for hdmi.
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarBrent Lu <brent.lu@intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-12-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3de206a4
...@@ -634,7 +634,6 @@ config SND_SOC_INTEL_SOF_SSP_AMP_MACH ...@@ -634,7 +634,6 @@ config SND_SOC_INTEL_SOF_SSP_AMP_MACH
select SND_SOC_RT1308 select SND_SOC_RT1308
select SND_SOC_CS35L41_I2C select SND_SOC_CS35L41_I2C
select SND_SOC_DMIC select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI
select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_HDA_DSP_COMMON
select SND_SOC_INTEL_SOF_REALTEK_COMMON select SND_SOC_INTEL_SOF_REALTEK_COMMON
select SND_SOC_INTEL_SOF_CIRRUS_COMMON select SND_SOC_INTEL_SOF_CIRRUS_COMMON
......
...@@ -17,14 +17,11 @@ ...@@ -17,14 +17,11 @@
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/sof.h> #include <sound/sof.h>
#include "../../codecs/hdac_hdmi.h"
#include "hda_dsp_common.h" #include "hda_dsp_common.h"
#include "sof_realtek_common.h" #include "sof_realtek_common.h"
#include "sof_cirrus_common.h" #include "sof_cirrus_common.h"
#include "sof_ssp_common.h" #include "sof_ssp_common.h"
#define NAME_SIZE 32
/* SSP port ID for speaker amplifier */ /* SSP port ID for speaker amplifier */
#define SOF_AMPLIFIER_SSP(quirk) ((quirk) & GENMASK(3, 0)) #define SOF_AMPLIFIER_SSP(quirk) ((quirk) & GENMASK(3, 0))
#define SOF_AMPLIFIER_SSP_MASK (GENMASK(3, 0)) #define SOF_AMPLIFIER_SSP_MASK (GENMASK(3, 0))
...@@ -65,14 +62,11 @@ static unsigned long sof_ssp_amp_quirk = SOF_AMPLIFIER_SSP(2); ...@@ -65,14 +62,11 @@ static unsigned long sof_ssp_amp_quirk = SOF_AMPLIFIER_SSP(2);
struct sof_hdmi_pcm { struct sof_hdmi_pcm {
struct list_head head; struct list_head head;
struct snd_soc_jack sof_hdmi;
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
int device;
}; };
struct sof_card_private { struct sof_card_private {
struct list_head hdmi_pcm_list; struct list_head hdmi_pcm_list;
bool common_hdmi_codec_drv;
bool idisp_codec; bool idisp_codec;
enum sof_ssp_codec amp_type; enum sof_ssp_codec amp_type;
}; };
...@@ -100,9 +94,7 @@ static int sof_card_late_probe(struct snd_soc_card *card) ...@@ -100,9 +94,7 @@ static int sof_card_late_probe(struct snd_soc_card *card)
{ {
struct sof_card_private *ctx = snd_soc_card_get_drvdata(card); struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);
struct snd_soc_component *component = NULL; struct snd_soc_component *component = NULL;
char jack_name[NAME_SIZE];
struct sof_hdmi_pcm *pcm; struct sof_hdmi_pcm *pcm;
int err;
if (!(sof_ssp_amp_quirk & SOF_HDMI_PLAYBACK_PRESENT)) if (!(sof_ssp_amp_quirk & SOF_HDMI_PLAYBACK_PRESENT))
return 0; return 0;
...@@ -114,30 +106,9 @@ static int sof_card_late_probe(struct snd_soc_card *card) ...@@ -114,30 +106,9 @@ static int sof_card_late_probe(struct snd_soc_card *card)
if (list_empty(&ctx->hdmi_pcm_list)) if (list_empty(&ctx->hdmi_pcm_list))
return -EINVAL; return -EINVAL;
if (ctx->common_hdmi_codec_drv) { pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, head);
pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, component = pcm->codec_dai->component;
head); return hda_dsp_hdmi_build_controls(card, component);
component = pcm->codec_dai->component;
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),
"HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name,
SND_JACK_AVOUT, &pcm->sof_hdmi);
if (err)
return err;
err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device,
&pcm->sof_hdmi);
if (err < 0)
return err;
}
return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
static struct snd_soc_card sof_ssp_amp_card = { static struct snd_soc_card sof_ssp_amp_card = {
...@@ -175,8 +146,6 @@ static int sof_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -175,8 +146,6 @@ static int sof_hdmi_init(struct snd_soc_pcm_runtime *rtd)
if (!pcm) if (!pcm)
return -ENOMEM; return -ENOMEM;
/* dai_link id is 1:1 mapped to the PCM device */
pcm->device = rtd->dai_link->id;
pcm->codec_dai = dai; pcm->codec_dai = dai;
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
...@@ -348,7 +317,7 @@ sof_card_dai_links_create(struct device *dev, enum sof_ssp_codec amp_type, ...@@ -348,7 +317,7 @@ sof_card_dai_links_create(struct device *dev, enum sof_ssp_codec amp_type,
links[id].num_codecs = 1; links[id].num_codecs = 1;
links[id].platforms = platform_component; links[id].platforms = platform_component;
links[id].num_platforms = ARRAY_SIZE(platform_component); links[id].num_platforms = ARRAY_SIZE(platform_component);
links[id].init = sof_hdmi_init; links[id].init = (i == 1) ? sof_hdmi_init : NULL;
links[id].dpcm_playback = 1; links[id].dpcm_playback = 1;
links[id].no_pcm = 1; links[id].no_pcm = 1;
id++; id++;
...@@ -387,8 +356,8 @@ sof_card_dai_links_create(struct device *dev, enum sof_ssp_codec amp_type, ...@@ -387,8 +356,8 @@ sof_card_dai_links_create(struct device *dev, enum sof_ssp_codec amp_type,
static int sof_ssp_amp_probe(struct platform_device *pdev) static int sof_ssp_amp_probe(struct platform_device *pdev)
{ {
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
struct snd_soc_dai_link *dai_links; struct snd_soc_dai_link *dai_links;
struct snd_soc_acpi_mach *mach;
struct sof_card_private *ctx; struct sof_card_private *ctx;
int dmic_be_num = 0, hdmi_num = 0; int dmic_be_num = 0, hdmi_num = 0;
int ret, ssp_codec; int ret, ssp_codec;
...@@ -400,8 +369,6 @@ static int sof_ssp_amp_probe(struct platform_device *pdev) ...@@ -400,8 +369,6 @@ static int sof_ssp_amp_probe(struct platform_device *pdev)
if (pdev->id_entry && pdev->id_entry->driver_data) if (pdev->id_entry && pdev->id_entry->driver_data)
sof_ssp_amp_quirk = (unsigned long)pdev->id_entry->driver_data; sof_ssp_amp_quirk = (unsigned long)pdev->id_entry->driver_data;
mach = pdev->dev.platform_data;
ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev); ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev);
if (dmi_check_system(chromebook_platforms) || mach->mach_params.dmic_num > 0) if (dmi_check_system(chromebook_platforms) || mach->mach_params.dmic_num > 0)
...@@ -467,8 +434,6 @@ static int sof_ssp_amp_probe(struct platform_device *pdev) ...@@ -467,8 +434,6 @@ static int sof_ssp_amp_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;
snd_soc_card_set_drvdata(&sof_ssp_amp_card, ctx); snd_soc_card_set_drvdata(&sof_ssp_amp_card, ctx);
return devm_snd_soc_register_card(&pdev->dev, &sof_ssp_amp_card); return devm_snd_soc_register_card(&pdev->dev, &sof_ssp_amp_card);
......
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