Skip to content

Commit

Permalink
ASoC: Intel: skl_hda_dsp_generic: remove hdac-hdmi support
Browse files Browse the repository at this point in the history
Since this machine driver has no longer been enumerated by SKL
platform driver, we could remove hdac-hdmi support code just like
what we did to other SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
  • Loading branch information
brentlu authored and bardliao committed Aug 9, 2024
1 parent e003317 commit 421983f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 58 deletions.
1 change: 0 additions & 1 deletion sound/soc/intel/boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC
config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
tristate "Skylake+ with HDA Codecs"
depends on SND_HDA_CODEC_HDMI
select SND_SOC_HDAC_HDMI
select SND_SOC_INTEL_HDA_DSP_COMMON
select SND_SOC_DMIC
# SND_SOC_HDAC_HDA is already selected
Expand Down
32 changes: 8 additions & 24 deletions sound/soc/intel/boards/skl_hda_dsp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include "../../codecs/hdac_hdmi.h"
#include "skl_hda_dsp_common.h"

#include <sound/hda_codec.h>
Expand All @@ -35,7 +34,6 @@ int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device)
if (!pcm->codec_dai)
return -EINVAL;

pcm->device = device;
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);

return 0;
Expand Down Expand Up @@ -150,32 +148,18 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = {
int skl_hda_hdmi_jack_init(struct snd_soc_card *card)
{
struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card);
struct snd_soc_component *component = NULL;
struct snd_soc_component *component;
struct skl_hda_hdmi_pcm *pcm;
char jack_name[NAME_SIZE];
int err;

if (ctx->common_hdmi_codec_drv)
return skl_hda_hdmi_build_controls(card);

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->hdmi_jack);

if (err)
return err;

err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device,
&pcm->hdmi_jack);
if (err < 0)
return err;
}
/* HDMI disabled, do not create controls */
if (list_empty(&ctx->hdmi_pcm_list))
return 0;

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

return hdac_hdmi_jack_port_init(component, &card->dapm);
return hda_dsp_hdmi_build_controls(card, component);
}
26 changes: 0 additions & 26 deletions sound/soc/intel/boards/skl_hda_dsp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
struct skl_hda_hdmi_pcm {
struct list_head head;
struct snd_soc_dai *codec_dai;
struct snd_soc_jack hdmi_jack;
int device;
};

struct skl_hda_private {
Expand All @@ -33,7 +31,6 @@ struct skl_hda_private {
int pcm_count;
int dai_index;
const char *platform_name;
bool common_hdmi_codec_drv;
bool idisp_codec;
bool bt_offload_present;
int ssp_bt;
Expand All @@ -43,27 +40,4 @@ extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS];
int skl_hda_hdmi_jack_init(struct snd_soc_card *card);
int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device);

/*
* Search card topology and register HDMI PCM related controls
* to codec driver.
*/
static inline int skl_hda_hdmi_build_controls(struct snd_soc_card *card)
{
struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card);
struct snd_soc_component *component;
struct skl_hda_hdmi_pcm *pcm;

/* HDMI disabled, do not create controls */
if (list_empty(&ctx->hdmi_pcm_list))
return 0;

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

return hda_dsp_hdmi_build_controls(card, component);
}

#endif /* __SOUND_SOC_HDA_DSP_COMMON_H */
8 changes: 1 addition & 7 deletions sound/soc/intel/boards/skl_hda_dsp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "../../codecs/hdac_hdmi.h"
#include "skl_hda_dsp_common.h"

static const struct snd_soc_dapm_widget skl_hda_widgets[] = {
Expand Down Expand Up @@ -208,7 +207,7 @@ static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card)

static int skl_hda_audio_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach;
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
struct skl_hda_private *ctx;
struct snd_soc_card *card;
int ret;
Expand All @@ -221,10 +220,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev)

INIT_LIST_HEAD(&ctx->hdmi_pcm_list);

mach = pdev->dev.platform_data;
if (!mach)
return -EINVAL;

card = &ctx->card;
card->name = "hda-dsp",
card->owner = THIS_MODULE,
Expand All @@ -251,7 +246,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
ctx->pcm_count = card->num_links;
ctx->dai_index = 1; /* hdmi codec dai name starts from index 1 */
ctx->platform_name = mach->mach_params.platform;
ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;

card->dev = &pdev->dev;
if (!snd_soc_acpi_sof_parent(&pdev->dev))
Expand Down

0 comments on commit 421983f

Please sign in to comment.