[linux-joule][PATCH 1/9] Add HDMI audio support to bxt_florida board driver
Wen-chien Jesse Sung
jesse.sung at canonical.com
Tue Jun 20 13:35:08 UTC 2017
From: Jukka Laitinen <jukka.laitinen at intel.com>
BugLink: https://launchpad.net/bugs/1698051
Signed-off-by: Jukka Laitinen <jukka.laitinen at intel.com>
Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>
---
sound/soc/codecs/hdac_hdmi.c | 2 +-
sound/soc/intel/boards/bxt_florida.c | 185 ++++++++++++++++++++++++++++++++---
2 files changed, 173 insertions(+), 14 deletions(-)
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 3043120..d38df9e 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -210,7 +210,7 @@ static int hdac_hdmi_get_eld(struct hdac_device *codec, hda_nid_t nid,
size = hdac_hdmi_get_eld_size(codec, nid);
if (size < ELD_FIXED_BYTES || size > ELD_MAX_SIZE) {
- dev_err(&codec->dev, "HDMI: invalid ELD buf size %d\n", size);
+ dev_dbg(&codec->dev, "HDMI: invalid ELD buf size %d\n", size);
return -ERANGE;
}
diff --git a/sound/soc/intel/boards/bxt_florida.c b/sound/soc/intel/boards/bxt_florida.c
index 4ab0635..80f8cba 100644
--- a/sound/soc/intel/boards/bxt_florida.c
+++ b/sound/soc/intel/boards/bxt_florida.c
@@ -36,7 +36,14 @@
#include <linux/mfd/arizona/registers.h>
#include "../../codecs/wm5110.h"
#include "../../codecs/wm8998.h"
+#include "../../codecs/hdac_hdmi.h"
+enum {
+ BXT_DPCM_AUDIO_PB = 0,
+ BXT_DPCM_AUDIO_HDMI1_PB,
+ BXT_DPCM_AUDIO_HDMI2_PB,
+ BXT_DPCM_AUDIO_HDMI3_PB,
+};
/* Codec PLL output clk rate */
#define CODEC_SYSCLK_RATE 49152000
@@ -363,6 +370,13 @@ static struct snd_soc_ops mrgfld_florida_ops = {
.startup = mrgfld_florida_startup,
};
+static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_soc_dai *dai = rtd->codec_dai;
+
+ return hdac_hdmi_jack_init(dai, BXT_DPCM_AUDIO_HDMI1_PB + dai->id);
+}
+
static int mrgfld_florida_codec_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
@@ -428,22 +442,62 @@ static struct snd_soc_ops mrgfld_ssp_florida_ops = {
};
struct snd_soc_dai_link mrgfld_florida_msic_dailink[] = {
+ /* Front End DAI links */
+ [BXT_DPCM_AUDIO_PB] =
{
.name = "Bxtn Audio Port",
.stream_name = "Audio",
.cpu_dai_name = "System Pin",
- .codec_name = "snd-soc-dummy",
- .codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
- .init = mrgfld_florida_init,
.nonatomic = 1,
.dynamic = 1,
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .init = mrgfld_florida_init,
.dpcm_playback = 1,
.dpcm_capture = 1,
.ops = &mrgfld_florida_ops,
},
-
- /* back ends */
+ [BXT_DPCM_AUDIO_HDMI1_PB] =
+ {
+ .name = "Bxt HDMI Port1",
+ .stream_name = "Hdmi1",
+ .cpu_dai_name = "HDMI1 Pin",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "0000:00:0e.0",
+ .dpcm_playback = 1,
+ .init = NULL,
+ .nonatomic = 1,
+ .dynamic = 1,
+ },
+ [BXT_DPCM_AUDIO_HDMI2_PB] =
+ {
+ .name = "Bxt HDMI Port2",
+ .stream_name = "Hdmi2",
+ .cpu_dai_name = "HDMI2 Pin",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "0000:00:0e.0",
+ .dpcm_playback = 1,
+ .init = NULL,
+ .nonatomic = 1,
+ .dynamic = 1,
+ },
+ [BXT_DPCM_AUDIO_HDMI3_PB] =
+ {
+ .name = "Bxt HDMI Port3",
+ .stream_name = "Hdmi3",
+ .cpu_dai_name = "HDMI3 Pin",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "0000:00:0e.0",
+ .dpcm_playback = 1,
+ .init = NULL,
+ .nonatomic = 1,
+ .dynamic = 1,
+ },
+ /* Back End DAI links */
{
.name = "SSP0-Codec",
.be_id = 1,
@@ -457,7 +511,6 @@ struct snd_soc_dai_link mrgfld_florida_msic_dailink[] = {
.dpcm_playback = 1,
.dpcm_capture = 1,
},
-
{
.name = "dmic01",
.be_id = 2,
@@ -465,10 +518,10 @@ struct snd_soc_dai_link mrgfld_florida_msic_dailink[] = {
.codec_name = "dmic-codec",
.codec_dai_name = "dmic-hifi",
.platform_name = "0000:00:0e.0",
+ .be_hw_params_fixup = bxt_dmic_fixup,
.ignore_suspend = 1,
.dpcm_capture = 1,
.no_pcm = 1,
- .be_hw_params_fixup = bxt_dmic_fixup,
},
{
@@ -482,36 +535,109 @@ struct snd_soc_dai_link mrgfld_florida_msic_dailink[] = {
.dpcm_capture = 1,
.no_pcm = 1,
},
-
+ {
+ .name = "iDisp1",
+ .be_id = 4,
+ .cpu_dai_name = "iDisp1 Pin",
+ .codec_name = "ehdaudio0D1",
+ .codec_dai_name = "intel-hdmi-hifi1",
+ .platform_name = "0000:00:0e.0",
+ .init = broxton_hdmi_init,
+ .dpcm_playback = 1,
+ .no_pcm = 1,
+ },
+ {
+ .name = "iDisp2",
+ .be_id = 5,
+ .cpu_dai_name = "iDisp2 Pin",
+ .codec_name = "ehdaudio0D1",
+ .codec_dai_name = "intel-hdmi-hifi2",
+ .platform_name = "0000:00:0e.0",
+ .init = broxton_hdmi_init,
+ .dpcm_playback = 1,
+ .no_pcm = 1,
+ },
+ {
+ .name = "iDisp3",
+ .be_id = 6,
+ .cpu_dai_name = "iDisp3 Pin",
+ .codec_name = "ehdaudio0D1",
+ .codec_dai_name = "intel-hdmi-hifi3",
+ .platform_name = "0000:00:0e.0",
+ .init = broxton_hdmi_init,
+ .dpcm_playback = 1,
+ .no_pcm = 1,
+ },
};
struct snd_soc_dai_link mrgfld_wm8998_msic_dailink[] = {
+ /* Front End DAI links */
+ [BXT_DPCM_AUDIO_PB] =
{
.name = "Bxtn Audio Port",
.stream_name = "Audio",
.cpu_dai_name = "System Pin",
- .codec_name = "snd-soc-dummy",
- .codec_dai_name = "snd-soc-dummy-dai",
.platform_name = "0000:00:0e.0",
- .init = mrgfld_florida_init,
.nonatomic = 1,
.dynamic = 1,
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .init = mrgfld_florida_init,
.dpcm_playback = 1,
.dpcm_capture = 1,
.ops = &mrgfld_florida_ops,
},
+ [BXT_DPCM_AUDIO_HDMI1_PB] =
+ {
+ .name = "Bxt HDMI Port1",
+ .stream_name = "Hdmi1",
+ .cpu_dai_name = "HDMI1 Pin",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "0000:00:0e.0",
+ .dpcm_playback = 1,
+ .init = NULL,
+ .nonatomic = 1,
+ .dynamic = 1,
+ },
+ [BXT_DPCM_AUDIO_HDMI2_PB] =
+ {
+ .name = "Bxt HDMI Port2",
+ .stream_name = "Hdmi2",
+ .cpu_dai_name = "HDMI2 Pin",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "0000:00:0e.0",
+ .dpcm_playback = 1,
+ .init = NULL,
+ .nonatomic = 1,
+ .dynamic = 1,
+ },
+ [BXT_DPCM_AUDIO_HDMI3_PB] =
+ {
+ .name = "Bxt HDMI Port3",
+ .stream_name = "Hdmi3",
+ .cpu_dai_name = "HDMI3 Pin",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "0000:00:0e.0",
+ .dpcm_playback = 1,
+ .init = NULL,
+ .nonatomic = 1,
+ .dynamic = 1,
+ },
/* back ends */
{
.name = "SSP0-Codec",
.be_id = 1,
.cpu_dai_name = "SSP0 Pin",
.platform_name = "0000:00:0e.0",
+ .no_pcm = 1,
.codec_name = "wm8998-codec",
.codec_dai_name = "wm8998-aif1",
.be_hw_params_fixup = mrgfld_florida_codec_fixup,
.ops = &mrgfld_ssp_florida_ops,
- .no_pcm = 1,
.dpcm_playback = 1,
.dpcm_capture = 1,
},
@@ -523,10 +649,10 @@ struct snd_soc_dai_link mrgfld_wm8998_msic_dailink[] = {
.codec_name = "dmic-codec",
.codec_dai_name = "dmic-hifi",
.platform_name = "0000:00:0e.0",
+ .be_hw_params_fixup = bxt_dmic_fixup,
.ignore_suspend = 1,
.dpcm_capture = 1,
.no_pcm = 1,
- .be_hw_params_fixup = bxt_dmic_fixup,
},
{
@@ -541,6 +667,39 @@ struct snd_soc_dai_link mrgfld_wm8998_msic_dailink[] = {
.be_hw_params_fixup = bxt_dmic_fixup,
},
+ {
+ .name = "iDisp1",
+ .be_id = 4,
+ .cpu_dai_name = "iDisp1 Pin",
+ .codec_name = "ehdaudio0D1",
+ .codec_dai_name = "intel-hdmi-hifi1",
+ .platform_name = "0000:00:0e.0",
+ .init = broxton_hdmi_init,
+ .dpcm_playback = 1,
+ .no_pcm = 1,
+ },
+ {
+ .name = "iDisp2",
+ .be_id = 5,
+ .cpu_dai_name = "iDisp2 Pin",
+ .codec_name = "ehdaudio0D1",
+ .codec_dai_name = "intel-hdmi-hifi2",
+ .platform_name = "0000:00:0e.0",
+ .init = broxton_hdmi_init,
+ .dpcm_playback = 1,
+ .no_pcm = 1,
+ },
+ {
+ .name = "iDisp3",
+ .be_id = 6,
+ .cpu_dai_name = "iDisp3 Pin",
+ .codec_name = "ehdaudio0D1",
+ .codec_dai_name = "intel-hdmi-hifi3",
+ .platform_name = "0000:00:0e.0",
+ .init = broxton_hdmi_init,
+ .dpcm_playback = 1,
+ .no_pcm = 1,
+ },
};
#ifdef CONFIG_PM_SLEEP
--
2.7.4
More information about the kernel-team
mailing list