[alsa-devel] [PATCH v2 00/12] ASoC: intel: add device_link to HDMI audio
From: Libin Yang libin.yang@intel.com
This patchset add the device_link between the machine devices of intel boards and HDMI audio codec. This can make sure that display audio power domain is always turned on before operating on the HDMI audio codecs.
Libin Yang (12): ASoC: intel: skl_hda_dsp_generic: add device_link to HDMI audio ASoC: intel: boards: define some general functions for hdac_hdmi ASoC: intel: bxt_da7219_max98357a: add device_link to HDMI audio ASoC: intel: bxt_rt298: add device_link to HDMI audio ASoC: intel: glk_rt5682_max98357a: add device_link to HDMI audio ASoC: intel: kbl_da7219_max98357a: add device_link to HDMI audio ASoC: intel: kbl_da7219_max98927: add device_link to HDMI audio ASoC: intel: kbl_rt5660: add device_link to HDMI audio ASoC: intel: kbl_rt5663_max98927 add device_link to HDMI audio ASoC: intel: kbl_rt5663_rt5514_max98927 add device_link to HDMI audio ASoC: intel: skl_nau88l25_max98357a add device_link to HDMI audio ASoC: intel: skl_nau88l25_ssm4567 add device_link to HDMI audio
sound/soc/intel/boards/bxt_da7219_max98357a.c | 14 +++++++ sound/soc/intel/boards/bxt_rt298.c | 14 ++++++- sound/soc/intel/boards/glk_rt5682_max98357a.c | 14 +++++++ sound/soc/intel/boards/hdac_hdmi_common.h | 46 ++++++++++++++++++++++ sound/soc/intel/boards/kbl_da7219_max98357a.c | 14 +++++++ sound/soc/intel/boards/kbl_da7219_max98927.c | 14 +++++++ sound/soc/intel/boards/kbl_rt5660.c | 14 ++++++- sound/soc/intel/boards/kbl_rt5663_max98927.c | 14 ++++++- .../soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 14 ++++++- sound/soc/intel/boards/skl_hda_dsp_common.c | 22 +++++++++++ sound/soc/intel/boards/skl_hda_dsp_common.h | 1 + sound/soc/intel/boards/skl_hda_dsp_generic.c | 12 ++++++ sound/soc/intel/boards/skl_nau88l25_max98357a.c | 36 ++++++++++++++++- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 36 ++++++++++++++++- 14 files changed, 259 insertions(+), 6 deletions(-) create mode 100644 sound/soc/intel/boards/hdac_hdmi_common.h
From: Libin Yang libin.yang@intel.com
Create hdac_hdmi_common.h and define some general functions related to hdac_hdmi codec.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/hdac_hdmi_common.h | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sound/soc/intel/boards/hdac_hdmi_common.h
diff --git a/sound/soc/intel/boards/hdac_hdmi_common.h b/sound/soc/intel/boards/hdac_hdmi_common.h new file mode 100644 index 0000000..9e6f07a --- /dev/null +++ b/sound/soc/intel/boards/hdac_hdmi_common.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright(c) 2019 Intel Corporation. + */ + +/* + * This file includes the general functions related to hdac_hdmi codec, + * which is used by the different boards + */ + +#ifndef __SOUND_SOC_HDAC_HDMI_COMMON +#define __SOUND_SOC_HDAC_HDMI_COMMON + +static int hdac_hdmi_add_device_link(struct device *consumer, + struct device *supplier, + struct device_link **link) +{ + /* + * Setup a device_link between machine device and HDMI codec device. + * The machine device is the consumer and the HDMI codec device is + * the supplier. With this setting, we can make sure that the audio + * domain in display power will be always turned on before operating + * on the HDMI audio codec registers. + */ + if (!(*link)) + *link = device_link_add(consumer, supplier, DL_FLAG_RPM_ACTIVE | \ + DL_FLAG_AUTOREMOVE_CONSUMER); + + if (!(*link)) + dev_warn(consumer, + "failed creating device_link for HDMI codec\n"); + + return 0; +} + +#endif /* __SOUND_SOC_HDAC_HDMI_COMMON */
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between cAVS generic machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/skl_hda_dsp_common.c | 13 +++++++++++++ sound/soc/intel/boards/skl_hda_dsp_common.h | 1 + 2 files changed, 14 insertions(+)
diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c index 3fdbf23..2a66ac8 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.c +++ b/sound/soc/intel/boards/skl_hda_dsp_common.c @@ -14,9 +14,19 @@ #include "../../codecs/hdac_hdmi.h" #include "../skylake/skl.h" #include "skl_hda_dsp_common.h" +#include "hdac_hdmi_common.h"
#define NAME_SIZE 32
+static int skl_hdmi_init(struct snd_soc_pcm_runtime *rtd) +{ + struct skl_hda_private *ctx = snd_soc_card_get_drvdata(rtd->card); + struct snd_soc_dai *dai = rtd->codec_dai; + + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); +} + int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device) { struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); @@ -48,6 +58,7 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .cpu_dai_name = "iDisp1 Pin", .codec_name = "ehdaudio0D2", .codec_dai_name = "intel-hdmi-hifi1", + .init = skl_hdmi_init, .dpcm_playback = 1, .no_pcm = 1, }, @@ -57,6 +68,7 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .cpu_dai_name = "iDisp2 Pin", .codec_name = "ehdaudio0D2", .codec_dai_name = "intel-hdmi-hifi2", + .init = skl_hdmi_init, .dpcm_playback = 1, .no_pcm = 1, }, @@ -66,6 +78,7 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .cpu_dai_name = "iDisp3 Pin", .codec_name = "ehdaudio0D2", .codec_dai_name = "intel-hdmi-hifi3", + .init = skl_hdmi_init, .dpcm_playback = 1, .no_pcm = 1, }, diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h index 87c50af..df5cc6b 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ b/sound/soc/intel/boards/skl_hda_dsp_common.h @@ -29,6 +29,7 @@ struct skl_hda_private { int pcm_count; int dai_index; const char *platform_name; + struct device_link *link; };
extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS];
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between bxt_da7219_max98357a machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/bxt_da7219_max98357a.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 5cadb7f..afcebec 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -29,6 +29,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../../codecs/da7219.h" #include "../../codecs/da7219-aad.h" +#include "hdac_hdmi_common.h"
#define BXT_DIALOG_CODEC_DAI "da7219-hifi" #define BXT_MAXIM_CODEC_DAI "HiFi" @@ -46,6 +47,7 @@ struct bxt_hdmi_pcm {
struct bxt_card_private { struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -237,7 +239,8 @@ static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int broxton_da7219_fe_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between bxt_rt298 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/bxt_rt298.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index e91057f..67794c0 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -26,6 +26,7 @@ #include <sound/pcm_params.h> #include "../../codecs/hdac_hdmi.h" #include "../../codecs/rt298.h" +#include "hdac_hdmi_common.h"
/* Headset jack detection DAPM pins */ static struct snd_soc_jack broxton_headset; @@ -39,6 +40,7 @@ struct bxt_hdmi_pcm {
struct bxt_rt286_private { struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -204,7 +206,8 @@ static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int broxton_ssp5_fixup(struct snd_soc_pcm_runtime *rtd,
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between glk_rt5682_max98357a machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/glk_rt5682_max98357a.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/glk_rt5682_max98357a.c b/sound/soc/intel/boards/glk_rt5682_max98357a.c index d17126f..2372dd3 100644 --- a/sound/soc/intel/boards/glk_rt5682_max98357a.c +++ b/sound/soc/intel/boards/glk_rt5682_max98357a.c @@ -20,6 +20,7 @@ #include "../skylake/skl.h" #include "../../codecs/rt5682.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h"
/* The platform clock outputs 19.2Mhz clock to codec as I2S MCLK */ #define GLK_PLAT_CLK_FREQ 19200000 @@ -42,6 +43,7 @@ struct glk_hdmi_pcm { struct glk_card_private { struct snd_soc_jack geminilake_headset; struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -218,7 +220,8 @@ static int geminilake_hdmi_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int geminilake_rt5682_fe_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between kbl_da7219_max98357a machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/kbl_da7219_max98357a.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index 38f6ab7..86cca33 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -21,6 +21,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../skylake/skl.h" #include "../../codecs/da7219-aad.h" +#include "hdac_hdmi_common.h"
#define KBL_DIALOG_CODEC_DAI "da7219-hifi" #define KBL_MAXIM_CODEC_DAI "HiFi" @@ -40,6 +41,7 @@ struct kbl_hdmi_pcm { struct kbl_codec_private { struct snd_soc_jack kabylake_headset; struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -216,7 +218,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between kbl_da7219_max98927 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/kbl_da7219_max98927.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/kbl_da7219_max98927.c b/sound/soc/intel/boards/kbl_da7219_max98927.c index f72a7bf..575c21e 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98927.c +++ b/sound/soc/intel/boards/kbl_da7219_max98927.c @@ -21,6 +21,7 @@ #include "../../codecs/hdac_hdmi.h" #include "../skylake/skl.h" #include "../../codecs/da7219-aad.h" +#include "hdac_hdmi_common.h"
#define KBL_DIALOG_CODEC_DAI "da7219-hifi" #define MAX98927_CODEC_DAI "max98927-aif1" @@ -48,6 +49,7 @@ struct kbl_hdmi_pcm { struct kbl_codec_private { struct snd_soc_jack kabylake_headset; struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -339,7 +341,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between kbl_rt5660 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/kbl_rt5660.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/kbl_rt5660.c b/sound/soc/intel/boards/kbl_rt5660.c index 3255e00..e681984 100644 --- a/sound/soc/intel/boards/kbl_rt5660.c +++ b/sound/soc/intel/boards/kbl_rt5660.c @@ -23,6 +23,7 @@
#include "../../codecs/hdac_hdmi.h" #include "../../codecs/rt5660.h" +#include "hdac_hdmi_common.h"
#define KBL_RT5660_CODEC_DAI "rt5660-aif1" #define DUAL_CHANNEL 2 @@ -41,6 +42,7 @@ struct kbl_hdmi_pcm { struct kbl_codec_private { struct gpio_desc *gpio_lo_mute; struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -222,7 +224,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between kbl_rt5663_max98927 machine device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/kbl_rt5663_max98927.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c index d714752..48b9e08 100644 --- a/sound/soc/intel/boards/kbl_rt5663_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c @@ -31,6 +31,7 @@ #include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/clkdev.h> +#include "hdac_hdmi_common.h"
#define KBL_REALTEK_CODEC_DAI "rt5663-aif" #define KBL_MAXIM_CODEC_DAI "max98927-aif1" @@ -53,6 +54,7 @@ struct kbl_rt5663_private { struct list_head hdmi_pcm_list; struct clk *mclk; struct clk *sclk; + struct device_link *link; };
enum { @@ -336,7 +338,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between kbl_rt5663_rt5514_max98927 machine device(consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c index 879f142..c435767 100644 --- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c @@ -30,6 +30,7 @@ #include "../../codecs/rt5514.h" #include "../../codecs/rt5663.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h"
#define KBL_REALTEK_CODEC_DAI "rt5663-aif" #define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1" @@ -58,6 +59,7 @@ struct kbl_codec_private { struct snd_soc_jack kabylake_headset; struct list_head hdmi_pcm_list; struct snd_soc_jack kabylake_hdmi[2]; + struct device_link *link; };
enum { @@ -224,7 +226,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between skl_nau88l25_max98357a machine device(consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c index 0922106..8685a5b 100644 --- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c +++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c @@ -24,6 +24,7 @@ #include <sound/soc-acpi.h> #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h"
#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" #define SKL_MAXIM_CODEC_DAI "HiFi" @@ -42,6 +43,7 @@ struct skl_hdmi_pcm {
struct skl_nau8825_private { struct list_head hdmi_pcm_list; + struct device_link *link; };
enum { @@ -202,7 +204,8 @@ static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) @@ -220,7 +223,8 @@ static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd) @@ -238,7 +242,8 @@ static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
From: Libin Yang libin.yang@intel.com
In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver.
This patch adds the device_link between skl_nau88l25_ssm4567 machine device(consumer) and hdmi codec device (supplier) to make sure the sequence is always correct.
Signed-off-by: Libin Yang libin.yang@intel.com --- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c index 8433c52..9958e6a 100644 --- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c +++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c @@ -28,6 +28,7 @@ #include <sound/pcm_params.h> #include "../../codecs/nau8825.h" #include "../../codecs/hdac_hdmi.h" +#include "hdac_hdmi_common.h"
#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" #define SKL_SSM_CODEC_DAI "ssm4567-hifi" @@ -46,6 +47,7 @@ struct skl_hdmi_pcm {
struct skl_nau88125_private { struct list_head hdmi_pcm_list; + struct device_link *link; }; enum { SKL_DPCM_AUDIO_PB = 0, @@ -232,7 +234,8 @@ static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) @@ -250,7 +253,8 @@ static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
@@ -269,7 +273,8 @@ static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
- return 0; + /* Setup a device_link between machine device and HDMI codec device. */ + return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link); }
static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
participants (1)
-
libin.yang@intel.com