ASoC: hdac_hdmi: Update to HDMI driver
Subsystems (3)
v7 cover ASoC: hdac_hdmi: Update to HDMI driver
This is remaining patches of v6 and appended platform changes for enumerating HDMI codec
Jeeja KP (1):
ASoC: hdac_hdmi: Add PM support
Ramesh Babu (1):
ASoC: hdac_hdmi: Fix to keep codec power active during enumeration.
Subhransu S. Prusty (6):
ASoC: hdac_hdmi: Fix possible memory leak in hw_params
ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy
ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resume
ASoC: hdac_hdmi: Fix to wait for D3 before powering off codec
ASoC: Intel: Skylake: Fix possible memory corruption in codec dai dma
params
ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais
Vinod Koul (1):
ASoC: Intel: Skylake: Add i915 enabling in skl probe
sound/soc/codecs/hdac_hdmi.c | 178 +++++++++++++++++++++++++++++++------- sound/soc/intel/Kconfig | 1 + sound/soc/intel/skylake/skl-pcm.c | 84 ++++++++++++++++-- sound/soc/intel/skylake/skl.c | 51 +++++++++++ 4 files changed, 275 insertions(+), 39 deletions(-)
Signature · 1 line
1.9.1
PATCH v7 1/9 ASoC: hdac_hdmi: Fix possible memory leak in hw_params
It's possible for hw_params to be called two times. So add NULL check to prevent memory leak.
--- sound/soc/codecs/hdac_hdmi.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
sound/soc/codecs/hdac_hdmi.c +11 -5
@@ -405,9 +405,13 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,return -ENODEV ; } - dd =kzalloc (sizeof (*dd),GFP_KERNEL ); -if (!dd) -return -ENOMEM ; + dd =snd_soc_dai_get_dma_data (dai, substream); +if (!dd) { + dd =kzalloc (sizeof (*dd),GFP_KERNEL ); +if (!dd) +return -ENOMEM ; + } + dd->format =snd_hdac_calc_stream_format (params_rate (hparams),params_channels (hparams),params_format (hparams),24 ,0 );
@@ -433,9 +437,11 @@ static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream, AC_VERB_SET_STREAM_FORMAT, 0); dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data (dai, substream); -snd_soc_dai_set_dma_data (dai, substream,NULL ); -kfree (dd); +if (dd) { +snd_soc_dai_set_dma_data (dai, substream,NULL ); +kfree (dd); + }return 0 ; }
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: hdac_hdmi: Fix possible memory leak in hw_params" to the asoc tree
The patch
ASoC: hdac_hdmi: Fix possible memory leak in hw_params
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
6793a3d70676c6f3d2ec0ce4e1e241617541702cMon Sep 17 00:00:00 2001
From: "Subhransu S. Prusty" <[email protected]>
Date: Wed, 17 Feb 2016 21:33:59 +0530
Subject: [PATCH] ASoC: hdac_hdmi: Fix possible memory leak in hw_params
It's possible for hw_params to be called two times. So add NULL check to prevent memory leak.
--- sound/soc/codecs/hdac_hdmi.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
sound/soc/codecs/hdac_hdmi.c +11 -5
@@ -405,9 +405,13 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,return -ENODEV ; } - dd =kzalloc (sizeof (*dd),GFP_KERNEL ); -if (!dd) -return -ENOMEM ; + dd =snd_soc_dai_get_dma_data (dai, substream); +if (!dd) { + dd =kzalloc (sizeof (*dd),GFP_KERNEL ); +if (!dd) +return -ENOMEM ; + } + dd->format =snd_hdac_calc_stream_format (params_rate (hparams),params_channels (hparams),params_format (hparams),24 ,0 );
@@ -433,9 +437,11 @@ static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream, AC_VERB_SET_STREAM_FORMAT, 0); dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data (dai, substream); -snd_soc_dai_set_dma_data (dai, substream,NULL ); -kfree (dd); +if (dd) { +snd_soc_dai_set_dma_data (dai, substream,NULL ); +kfree (dd); + }return 0 ; }
Signature · 1 line
2.7.0
PATCH v7 2/9 ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy
In reply to Subhransu S. PrustyIn dai startup, driver was checking for ELD and would fail if no monitor is connected. This causes userland like PA, CRAS to be unhappy as they scan the device list at bootup.
So move the ELD check to hw_params and fail if valid ELD is not found.
--- sound/soc/codecs/hdac_hdmi.c | 48 ++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 13 deletions(-)
sound/soc/codecs/hdac_hdmi.c +35 -13
@@ -398,10 +398,20 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hparams, struct snd_soc_dai *dai) { struct hdac_ext_device *hdac = snd_soc_dai_get_drvdata(dai); +struct hdac_hdmi_priv *hdmi = hdac->private_data; +struct hdac_hdmi_dai_pin_map *dai_map; +struct hdac_hdmi_pin *pin;struct hdac_ext_dma_params *dd; -if (dai->id >0 ) { -dev_err (&hdac->hdac.dev,"Only one dai supported as of now\n" ); + dai_map = &hdmi->dai_map[dai->id]; + pin = dai_map->pin; + +if (!pin) +return -ENODEV ; + +if ((!pin->eld.monitor_present) || (!pin->eld.eld_valid)) { +dev_err (&hdac->hdac.dev,"device is not configured for this pin: %d\n" , + pin->nid);return -ENODEV ; }
@@ -431,11 +441,6 @@ static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream, dai_map = &hdmi->dai_map[dai->id]; -snd_hdac_codec_write (&edev->hdac, dai_map->cvt->nid,0 , -AC_VERB_SET_CHANNEL_STREAMID ,0 ); -snd_hdac_codec_write (&edev->hdac, dai_map->cvt->nid,0 , -AC_VERB_SET_STREAM_FORMAT ,0 ); - dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data (dai, substream);if (dd) {
@@ -536,6 +541,11 @@ static struct hdac_hdmi_pin *hdac_hdmi_get_pin_from_cvt(return NULL ; } +/* +* This tries to get a valid pin and set the HW constraints based on the +* ELD. Even if a valid pin is not found return success so that device open +* doesn't fail. +*/ static int hdac_hdmi_pcm_open (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {
@@ -550,17 +560,22 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream, cvt = dai_map->cvt; pin =hdac_hdmi_get_pin_from_cvt (hdac, hdmi, cvt); + +/* +* To make PA and other userland happy. +* userland scans devices so returning error does not help. +*/ if (!pin) -return -EIO ; +return 0 ;if ((!pin->eld.monitor_present) || (!pin->eld.eld_valid)) { -dev_err (&hdac->hdac.dev, +dev_warn (&hdac->hdac.dev,"Failed: montior present? %d ELD valid?: %d for pin: %d\n" , pin->eld.monitor_present, pin->eld.eld_valid, pin->nid); -return -ENODEV ; +return 0 ; } dai_map->pin = pin;
@@ -587,12 +602,19 @@ static void hdac_hdmi_pcm_close(struct snd_pcm_substream *substream, dai_map = &hdmi->dai_map[dai->id]; -hdac_hdmi_set_power_state (hdac, dai_map,AC_PWRST_D3 ); +if (dai_map->pin) { +snd_hdac_codec_write (&hdac->hdac, dai_map->cvt->nid,0 , +AC_VERB_SET_CHANNEL_STREAMID ,0 ); +snd_hdac_codec_write (&hdac->hdac, dai_map->cvt->nid,0 , +AC_VERB_SET_STREAM_FORMAT ,0 ); + +hdac_hdmi_set_power_state (hdac, dai_map,AC_PWRST_D3 ); -snd_hdac_codec_write (&hdac->hdac, dai_map->pin->nid,0 , +snd_hdac_codec_write (&hdac->hdac, dai_map->pin->nid,0 ,AC_VERB_SET_AMP_GAIN_MUTE ,AMP_OUT_MUTE ); - dai_map->pin =NULL ; + dai_map->pin =NULL ; + } } static int
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy" to the asoc tree
The patch
ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
54dfa1eaf4f8222811900922c67f539e60cc69c2Mon Sep 17 00:00:00 2001
From: "Subhransu S. Prusty" <[email protected]>
Date: Wed, 17 Feb 2016 21:34:00 +0530
Subject: [PATCH] ASoC: hdac_hdmi: Don't fail in dai startup to make userland
happy
In dai startup, driver was checking for ELD and would fail if no monitor is connected. This causes userland like PA, CRAS to be unhappy as they scan the device list at bootup.
So move the ELD check to hw_params and fail if valid ELD is not found.
--- sound/soc/codecs/hdac_hdmi.c | 48 ++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 13 deletions(-)
sound/soc/codecs/hdac_hdmi.c +35 -13
@@ -398,10 +398,20 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hparams, struct snd_soc_dai *dai) { struct hdac_ext_device *hdac = snd_soc_dai_get_drvdata(dai); +struct hdac_hdmi_priv *hdmi = hdac->private_data; +struct hdac_hdmi_dai_pin_map *dai_map; +struct hdac_hdmi_pin *pin;struct hdac_ext_dma_params *dd; -if (dai->id >0 ) { -dev_err (&hdac->hdac.dev,"Only one dai supported as of now\n" ); + dai_map = &hdmi->dai_map[dai->id]; + pin = dai_map->pin; + +if (!pin) +return -ENODEV ; + +if ((!pin->eld.monitor_present) || (!pin->eld.eld_valid)) { +dev_err (&hdac->hdac.dev,"device is not configured for this pin: %d\n" , + pin->nid);return -ENODEV ; }
@@ -431,11 +441,6 @@ static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream, dai_map = &hdmi->dai_map[dai->id]; -snd_hdac_codec_write (&edev->hdac, dai_map->cvt->nid,0 , -AC_VERB_SET_CHANNEL_STREAMID ,0 ); -snd_hdac_codec_write (&edev->hdac, dai_map->cvt->nid,0 , -AC_VERB_SET_STREAM_FORMAT ,0 ); - dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data (dai, substream);if (dd) {
@@ -536,6 +541,11 @@ static struct hdac_hdmi_pin *hdac_hdmi_get_pin_from_cvt(return NULL ; } +/* +* This tries to get a valid pin and set the HW constraints based on the +* ELD. Even if a valid pin is not found return success so that device open +* doesn't fail. +*/ static int hdac_hdmi_pcm_open (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {
@@ -550,17 +560,22 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream, cvt = dai_map->cvt; pin =hdac_hdmi_get_pin_from_cvt (hdac, hdmi, cvt); + +/* +* To make PA and other userland happy. +* userland scans devices so returning error does not help. +*/ if (!pin) -return -EIO ; +return 0 ;if ((!pin->eld.monitor_present) || (!pin->eld.eld_valid)) { -dev_err (&hdac->hdac.dev, +dev_warn (&hdac->hdac.dev,"Failed: montior present? %d ELD valid?: %d for pin: %d\n" , pin->eld.monitor_present, pin->eld.eld_valid, pin->nid); -return -ENODEV ; +return 0 ; } dai_map->pin = pin;
@@ -587,12 +602,19 @@ static void hdac_hdmi_pcm_close(struct snd_pcm_substream *substream, dai_map = &hdmi->dai_map[dai->id]; -hdac_hdmi_set_power_state (hdac, dai_map,AC_PWRST_D3 ); +if (dai_map->pin) { +snd_hdac_codec_write (&hdac->hdac, dai_map->cvt->nid,0 , +AC_VERB_SET_CHANNEL_STREAMID ,0 ); +snd_hdac_codec_write (&hdac->hdac, dai_map->cvt->nid,0 , +AC_VERB_SET_STREAM_FORMAT ,0 ); + +hdac_hdmi_set_power_state (hdac, dai_map,AC_PWRST_D3 ); -snd_hdac_codec_write (&hdac->hdac, dai_map->pin->nid,0 , +snd_hdac_codec_write (&hdac->hdac, dai_map->pin->nid,0 ,AC_VERB_SET_AMP_GAIN_MUTE ,AMP_OUT_MUTE ); - dai_map->pin =NULL ; + dai_map->pin =NULL ; + } } static int
Signature · 1 line
2.7.0
PATCH v7 3/9 ASoC: hdac_hdmi: Fix to keep codec power active during enumeration.
In reply to Subhransu S. PrustyFrom: Ramesh Babu <[email protected]>
The codec power is turned OFF in the first explicit call to pm_runtime_suspend to keep the i915 refcount balanced. During regular operation, the power is turned ON/OFF in runtime PM handlers.
--- sound/soc/codecs/hdac_hdmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/codecs/hdac_hdmi.c +12 -0
@@ -1426,6 +1426,18 @@ static int hdac_hdmi_dev_probe(struct hdac_ext_device *edev)INIT_LIST_HEAD (&hdmi_priv->pcm_list);mutex_init (&hdmi_priv->pin_mutex); +/* +* Turned off in the runtime_suspend during the first explicit +* pm_runtime_suspend call. +*/ + ret =snd_hdac_display_power (edev->hdac.bus, true); +if (ret <0 ) { +dev_err (&edev->hdac.dev, +"Cannot turn on display power on i915 err: %d\n" , + ret); +return ret; + } + ret =hdac_hdmi_parse_and_map_nid (edev, &hdmi_dais, &num_dais);if (ret <0 ) { dev_err(&codec->dev,
Signature · 1 line
1.9.1
PATCH v7 4/9 ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resume
In reply to Subhransu S. PrustyThe register are reset during the D3 to D0 transition. So reconfigure them.
Also as all DAIs are now supported, remove the dai id check in prepare.
--- sound/soc/codecs/hdac_hdmi.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
sound/soc/codecs/hdac_hdmi.c +16 -13
@@ -374,11 +374,6 @@ static int hdac_hdmi_playback_prepare(struct snd_pcm_substream *substream,struct hdac_ext_dma_params *dd;int ret; -if (dai->id >0 ) { -dev_err (&hdac->hdac.dev,"Only one dai supported as of now\n" ); -return -ENODEV ; - } - dai_map = &hdmi->dai_map[dai->id]; dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data (dai, substream);
@@ -451,6 +446,18 @@ static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream,return 0 ; } +static void hdac_hdmi_enable_cvt (struct hdac_ext_device *edev, +struct hdac_hdmi_dai_pin_map *dai_map) +{ +/* Enable transmission */ +snd_hdac_codec_write (&edev->hdac, dai_map->cvt->nid,0 , +AC_VERB_SET_DIGI_CONVERT_1 ,1 ); + +/* Category Code (CC) to zero */ +snd_hdac_codec_write (&edev->hdac, dai_map->cvt->nid,0 , +AC_VERB_SET_DIGI_CONVERT_2 ,0 ); +} +static int hdac_hdmi_enable_pin (struct hdac_ext_device *hdac,struct hdac_hdmi_dai_pin_map *dai_map) {
@@ -580,6 +587,7 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream, dai_map->pin = pin; +hdac_hdmi_enable_cvt (hdac, dai_map); ret =hdac_hdmi_enable_pin (hdac, dai_map);if (ret <0 )return ret;
@@ -949,14 +957,6 @@ static int hdac_hdmi_init_dai_map(struct hdac_ext_device *edev) dai_map->dai_id = dai_id; dai_map->cvt = cvt; -/* Enable transmission */ -snd_hdac_codec_write (&edev->hdac, cvt->nid,0 , -AC_VERB_SET_DIGI_CONVERT_1 ,1 ); - -/* Category Code (CC) to zero */ -snd_hdac_codec_write (&edev->hdac, cvt->nid,0 , -AC_VERB_SET_DIGI_CONVERT_2 ,0 ); - dai_id++;if (dai_id ==HDA_MAX_CVTS ) {
@@ -1527,6 +1527,9 @@ static int hdac_hdmi_runtime_resume(struct device *dev)return err; } +hdac_hdmi_skl_enable_all_pins (&edev->hdac); +hdac_hdmi_skl_enable_dp12 (&edev->hdac); +/* Power up afg */ if (!snd_hdac_check_power_state (hdac, hdac->afg,AC_PWRST_D0 )) snd_hdac_codec_write(hdac, hdac->afg, 0,
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH v7 4/9] ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resume
Quoted 4 lines · Subhransu S. Prusty
The register are reset during the D3 to D0 transition. So reconfigure them.
Also as all DAIs are now supported, remove the dai id check in prepare.
This looks like two unrelated changes and so should be two patches.
PATCH v7 5/9 ASoC: hdac_hdmi: Fix to wait for D3 before powering off codec
In reply to Subhransu S. PrustyPowering off codec immediately after sending D3 verb may not set the node to D3 state. So wait for a confirmation response before shutting down codec.
--- sound/soc/codecs/hdac_hdmi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
sound/soc/codecs/hdac_hdmi.c +11 -1
@@ -1486,6 +1486,7 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)struct hdac_ext_device *edev =to_hda_ext_device (dev);struct hdac_device *hdac = &edev->hdac;struct hdac_bus *bus = hdac->bus; +unsigned long timeout;int err;dev_dbg (dev,"Enter: %s\n" , __func__);
@@ -1495,10 +1496,19 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)return 0 ;/* Power down afg */ -if (!snd_hdac_check_power_state (hdac, hdac->afg,AC_PWRST_D3 )) +if (!snd_hdac_check_power_state (hdac, hdac->afg,AC_PWRST_D3 )) {snd_hdac_codec_write (hdac, hdac->afg,0 ,AC_VERB_SET_POWER_STATE ,AC_PWRST_D3 ); +/* Wait till power state is set to D3 */ + timeout = jiffies +msecs_to_jiffies (1000 ); +while (!snd_hdac_check_power_state (hdac, hdac->afg,AC_PWRST_D3 ) + &&time_before (jiffies, timeout)) { + +msleep (50 ); + } + } + err =snd_hdac_display_power (bus, false);if (err <0 ) {dev_err (bus->dev,"Cannot turn on display power on i915\n" );
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH v7 5/9] ASoC: hdac_hdmi: Fix to wait for D3 before powering off codec
sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_runtime_suspend(struct device *dev) · line 1505
Quoted 3 lines · Subhransu S. Prusty
sound/soc/codecs/hdac_hdmi.c +3
-0+/* Wait till power state is set to D3 */ + timeout = jiffies +msecs_to_jiffies (1000 ); + while(!snd_hdac_check_power_state(hdac, hdac->afg, AC_PWRST_D3)
Please follow the kernel coding style - space after the while.
PATCH v7 6/9 ASoC: hdac_hdmi: Add PM support
In reply to Subhransu S. PrustyFrom: Jeeja KP <[email protected]>
The codec registers are reset during S3. So need to reconfigure all pins and DP1.2 feature again after resume from S3. Also reprogram the required registers if the S3 was triggered during playback.
In suspended state ELD notify callback is not processed, So add ELD check for all pins as well.
Also turn the codec power domain OFF which is kept ON during controller resequencing and codec reenumeration.
--- sound/soc/codecs/hdac_hdmi.c | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+)
sound/soc/codecs/hdac_hdmi.c +61 -0
@@ -601,6 +601,26 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream, pin->eld.eld_buffer); } +static int hdac_hdmi_trigger (struct snd_pcm_substream *substream,int cmd, +struct snd_soc_dai *dai) +{ +struct hdac_hdmi_dai_pin_map *dai_map; +struct hdac_ext_device *hdac =snd_soc_dai_get_drvdata (dai); +struct hdac_hdmi_priv *hdmi = hdac->private_data; +int ret; + + dai_map = &hdmi->dai_map[dai->id]; +if (cmd ==SNDRV_PCM_TRIGGER_RESUME ) { + ret =hdac_hdmi_enable_pin (hdac, dai_map); +if (ret <0 ) +return ret; + +return hdac_hdmi_playback_prepare (substream, dai); + } + +return 0 ; +} +static void hdac_hdmi_pcm_close (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {
@@ -1154,6 +1174,7 @@ static struct snd_soc_dai_ops hdmi_dai_ops = { .shutdown = hdac_hdmi_pcm_close, .hw_params = hdac_hdmi_set_hw_params, .prepare = hdac_hdmi_playback_prepare, + .trigger = hdac_hdmi_trigger, .hw_free = hdac_hdmi_playback_cleanup, };
@@ -1399,9 +1420,49 @@ static int hdmi_codec_remove(struct snd_soc_codec *codec)return 0 ; } +#ifdef CONFIG_PM +static int hdmi_codec_resume (struct snd_soc_codec *codec) +{ +struct hdac_ext_device *edev =snd_soc_codec_get_drvdata (codec); +struct hdac_hdmi_priv *hdmi = edev->private_data; +struct hdac_hdmi_pin *pin; +struct hdac_device *hdac = &edev->hdac; +struct hdac_bus *bus = hdac->bus; +int err; + +hdac_hdmi_skl_enable_all_pins (&edev->hdac); +hdac_hdmi_skl_enable_dp12 (&edev->hdac); + +/* Power up afg */ +if (!snd_hdac_check_power_state (hdac, hdac->afg,AC_PWRST_D0 )) +snd_hdac_codec_write (hdac, hdac->afg,0 , +AC_VERB_SET_POWER_STATE ,AC_PWRST_D0 ); + +/* +* As the ELD notify callback request is not entertained while the +* device is in suspend state. Need to manually check detection of +* all pins here. +*/ +list_for_each_entry (pin, &hdmi->pin_list, head) +hdac_hdmi_present_sense (pin,1 ); + +/* Codec power is turned ON during controller resume */ + err =snd_hdac_display_power (bus, false); +if (err <0 ) { +dev_err (bus->dev,"Cannot turn on display power on i915\n" ); +return err; + } + +return 0 ; +} +#else +#define hdmi_codec_resume NULL +#endif +static struct snd_soc_codec_driver hdmi_hda_codec = { .probe = hdmi_codec_probe, .remove = hdmi_codec_remove, + .resume = hdmi_codec_resume, .idle_bias_off = true, };
Signature · 1 line
1.9.1
PATCH v7 7/9 ASoC: Intel: Skylake: Fix possible memory corruption in codec dai dma params
In reply to Subhransu S. PrustySet required parameters for hdac_ext_dma_params object instead of skl_dma_params.
--- sound/soc/intel/skylake/skl-pcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +2 -4
@@ -475,7 +475,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream,struct hdac_ext_bus *ebus =dev_get_drvdata (dai->dev);struct hdac_ext_stream *link_dev;struct snd_soc_pcm_runtime *rtd =snd_pcm_substream_chip (substream); -struct skl_dma_params *dma_params; +struct hdac_ext_dma_params *dma_params;struct snd_soc_dai *codec_dai = rtd->codec_dai;struct skl_pipe_params p_params = {0 };
@@ -487,11 +487,9 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream,snd_soc_dai_set_dma_data (dai, substream, (void *)link_dev);/* set the stream tag in the codec dai dma params */ - dma_params = (struct skl_dma_params *) -snd_soc_dai_get_dma_data (codec_dai, substream); + dma_params =snd_soc_dai_get_dma_data (codec_dai, substream);if (dma_params) dma_params->stream_tag =hdac_stream (link_dev)->stream_tag; -snd_soc_dai_set_dma_data (codec_dai, substream, (void *)dma_params); p_params.s_fmt =snd_pcm_format_width (params_format (params)); p_params.ch =params_channels (params);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Fix possible memory corruption in codec dai dma params" to the asoc tree
The patch
ASoC: Intel: Skylake: Fix possible memory corruption in codec dai dma params
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
aceb5d20d725fdc9c9d42522944baed3370b472cMon Sep 17 00:00:00 2001
From: "Subhransu S. Prusty" <[email protected]>
Date: Wed, 17 Feb 2016 21:34:05 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix possible memory corruption in codec
dai dma params
Set required parameters for hdac_ext_dma_params object instead of skl_dma_params.
--- sound/soc/intel/skylake/skl-pcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +2 -4
@@ -475,7 +475,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream,struct hdac_ext_bus *ebus =dev_get_drvdata (dai->dev);struct hdac_ext_stream *link_dev;struct snd_soc_pcm_runtime *rtd =snd_pcm_substream_chip (substream); -struct skl_dma_params *dma_params; +struct hdac_ext_dma_params *dma_params;struct snd_soc_dai *codec_dai = rtd->codec_dai;struct skl_pipe_params p_params = {0 };
@@ -487,11 +487,9 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream,snd_soc_dai_set_dma_data (dai, substream, (void *)link_dev);/* set the stream tag in the codec dai dma params */ - dma_params = (struct skl_dma_params *) -snd_soc_dai_get_dma_data (codec_dai, substream); + dma_params =snd_soc_dai_get_dma_data (codec_dai, substream);if (dma_params) dma_params->stream_tag =hdac_stream (link_dev)->stream_tag; -snd_soc_dai_set_dma_data (codec_dai, substream, (void *)dma_params); p_params.s_fmt =snd_pcm_format_width (params_format (params)); p_params.ch =params_channels (params);
Signature · 1 line
2.7.0
PATCH v7 8/9 ASoC: Intel: Skylake: Add i915 enabling in skl probe
In reply to Subhransu S. PrustyFrom: Vinod Koul <[email protected]>
The SKL also supports HDMI output so in probe we need to enable the HDMI using common i915 APIs to ensure it gets probed on the bus
After S3 during the controller resequencing the codec domain need to be kept ON for successful reconfiguration of Codec. Once configured it will be turned OFF in codec driver.
--- sound/soc/intel/Kconfig | 1 + sound/soc/intel/skylake/skl.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)
sound/soc/intel/Kconfig +1 -0
@@ -163,6 +163,7 @@ config SND_SOC_INTEL_SKYLAKE tristate select SND_HDA_EXT_CORE select SND_SOC_TOPOLOGY + select SND_HDA_I915 select SND_SOC_INTEL_SST config SND_SOC_INTEL_SKL_RT286_MACH
sound/soc/intel/skylake/skl.c +51 -0
87 lines not on this page · raw message
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Add i915 enabling in skl probe" to the asoc tree
The patch
ASoC: Intel: Skylake: Add i915 enabling in skl probe
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
6980c057ea1bca145e8fef39ddf541254f7c8747Mon Sep 17 00:00:00 2001
From: Vinod Koul <[email protected]>
Date: Wed, 17 Feb 2016 21:34:06 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add i915 enabling in skl probe
The SKL also supports HDMI output so in probe we need to enable the HDMI using common i915 APIs to ensure it gets probed on the bus
After S3 during the controller resequencing the codec domain need to be kept ON for successful reconfiguration of Codec. Once configured it will be turned OFF in codec driver.
--- sound/soc/intel/Kconfig | 1 + sound/soc/intel/skylake/skl.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)
sound/soc/intel/Kconfig +1 -0
@@ -154,6 +154,7 @@ config SND_SOC_INTEL_SKYLAKE tristate select SND_HDA_EXT_CORE select SND_SOC_TOPOLOGY + select SND_HDA_I915 select SND_SOC_INTEL_SST config SND_SOC_INTEL_SKL_RT286_MACH
sound/soc/intel/skylake/skl.c +51 -0
87 lines not on this page · raw message
Signature · 1 line
2.7.0
PATCH v7 9/9 ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais
In reply to Subhransu S. PrustyThis patch enables HDMI support in passthrough mode in skylake. Skylake supports 3 pin widgets in HDMI codec, so add 3 FE and 3 BE dais
Add required hw info, formats, rates to support HDMI.
--- sound/soc/intel/skylake/skl-pcm.c | 78 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +75 -3
@@ -676,6 +676,51 @@ static struct snd_soc_dai_driver skl_platform_dai[] = { .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, }, }, +{ + .name = "HDMI1 Pin", + .ops = &skl_pcm_dai_ops, + .playback = { + .stream_name = "HDMI1 Playback", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + }, +}, +{ + .name = "HDMI2 Pin", + .ops = &skl_pcm_dai_ops, + .playback = { + .stream_name = "HDMI2 Playback", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + }, +}, +{ + .name = "HDMI3 Pin", + .ops = &skl_pcm_dai_ops, + .playback = { + .stream_name = "HDMI3 Playback", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + }, +}, /* BE CPU Dais */ {
@@ -715,14 +760,41 @@ static struct snd_soc_dai_driver skl_platform_dai[] = { }, }, { - .name = "iDisp Pin", + .name = "iDisp1 Pin", .ops = &skl_link_dai_ops, .playback = { - .stream_name = "iDisp Tx", + .stream_name = "iDisp1 Tx", .channels_min = HDA_STEREO, .channels_max = HDA_STEREO, .rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S32_LE | + SNDRV_PCM_FMTBIT_S24_LE, + }, +}, +{ + .name = "iDisp2 Pin", + .ops = &skl_link_dai_ops, + .playback = { + .stream_name = "iDisp2 Tx", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_8000 |SNDRV_PCM_RATE_16000 | + SNDRV_PCM_RATE_48000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S32_LE | + SNDRV_PCM_FMTBIT_S24_LE, + }, +}, +{ + .name = "iDisp3 Pin", + .ops = &skl_link_dai_ops, + .playback = { + .stream_name = "iDisp3 Tx", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_8000 |SNDRV_PCM_RATE_16000 | + SNDRV_PCM_RATE_48000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S32_LE | + SNDRV_PCM_FMTBIT_S24_LE, }, }, {
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais" to the asoc tree
The patch
ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
8cca87c073ac38c7866fb86205fc9ff312a3a575Mon Sep 17 00:00:00 2001
From: "Subhransu S. Prusty" <[email protected]>
Date: Wed, 17 Feb 2016 21:34:07 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais
This patch enables HDMI support in passthrough mode in skylake. Skylake supports 3 pin widgets in HDMI codec, so add 3 FE and 3 BE dais
Add required hw info, formats, rates to support HDMI.
--- sound/soc/intel/skylake/skl-pcm.c | 78 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +75 -3
@@ -676,6 +676,51 @@ static struct snd_soc_dai_driver skl_platform_dai[] = { .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, }, }, +{ + .name = "HDMI1 Pin", + .ops = &skl_pcm_dai_ops, + .playback = { + .stream_name = "HDMI1 Playback", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + }, +}, +{ + .name = "HDMI2 Pin", + .ops = &skl_pcm_dai_ops, + .playback = { + .stream_name = "HDMI2 Playback", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + }, +}, +{ + .name = "HDMI3 Pin", + .ops = &skl_pcm_dai_ops, + .playback = { + .stream_name = "HDMI3 Playback", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_32000 |SNDRV_PCM_RATE_44100 | +SNDRV_PCM_RATE_48000 |SNDRV_PCM_RATE_88200 | +SNDRV_PCM_RATE_96000 |SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + }, +}, /* BE CPU Dais */ {
@@ -715,14 +760,41 @@ static struct snd_soc_dai_driver skl_platform_dai[] = { }, }, { - .name = "iDisp Pin", + .name = "iDisp1 Pin", .ops = &skl_link_dai_ops, .playback = { - .stream_name = "iDisp Tx", + .stream_name = "iDisp1 Tx", .channels_min = HDA_STEREO, .channels_max = HDA_STEREO, .rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S32_LE | + SNDRV_PCM_FMTBIT_S24_LE, + }, +}, +{ + .name = "iDisp2 Pin", + .ops = &skl_link_dai_ops, + .playback = { + .stream_name = "iDisp2 Tx", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_8000 |SNDRV_PCM_RATE_16000 | + SNDRV_PCM_RATE_48000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S32_LE | + SNDRV_PCM_FMTBIT_S24_LE, + }, +}, +{ + .name = "iDisp3 Pin", + .ops = &skl_link_dai_ops, + .playback = { + .stream_name = "iDisp3 Tx", + .channels_min = HDA_STEREO, + .channels_max = HDA_STEREO, + .rates =SNDRV_PCM_RATE_8000 |SNDRV_PCM_RATE_16000 | + SNDRV_PCM_RATE_48000, + .formats =SNDRV_PCM_FMTBIT_S16_LE |SNDRV_PCM_FMTBIT_S32_LE | + SNDRV_PCM_FMTBIT_S24_LE, }, }, {
Signature · 1 line
2.7.0