Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	alsa-devel@alsa-project.org,  tiwai@suse.de
Cc: libin.yang@intel.com
Subject: Re: [alsa-devel] [PATCH v6 5/9] ASoC: SOF: Intel: add support for snd-hda-codec-hdmi
Date: Fri, 11 Oct 2019 09:00:28 -0500	[thread overview]
Message-ID: <cf6a8edb-689d-e068-a9c4-d728b7741fec@linux.intel.com> (raw)
In-Reply-To: <20191011112745.25800-6-kai.vehmanen@linux.intel.com>



On 10/11/19 6:27 AM, Kai Vehmanen wrote:
> Add support to implement HDMI/DP audio by using the common
> snd-hda-codec-hdmi driver.
> 
> Change of codec driver affects user-space as the two
> drivers expose different mixer controls. A new kernel
> module option "use_common_hdmi" is added to user-space
> to indicate which interface should be used. The default
> driver can be selected via a Kconfig option.
> 
> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> ---
>   sound/soc/sof/intel/Kconfig     | 10 ++++++++++
>   sound/soc/sof/intel/hda-codec.c | 22 ++++++++++++++++++----
>   sound/soc/sof/intel/hda.c       |  6 ++++++
>   sound/soc/sof/intel/hda.h       |  6 ++++--
>   4 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig
> index 18c41fdc47c8..31d9222e45aa 100644
> --- a/sound/soc/sof/intel/Kconfig
> +++ b/sound/soc/sof/intel/Kconfig
> @@ -273,6 +273,16 @@ config SND_SOC_SOF_HDA_AUDIO_CODEC
>   	  Say Y if you want to enable HDAudio codecs with SOF.
>   	  If unsure select "N".
>   
> +config SND_SOC_SOF_HDA_COMMON_HDMI_CODEC
> +	bool "SOF common HDA HDMI codec driver"
> +	depends on SND_SOC_SOF_HDA_LINK
> +	depends on SND_HDA_CODEC_HDMI
> +	help
> +	  This adds support for HDMI audio by using the common HDA
> +	  HDMI/DisplayPort codec driver.
> +	  Say Y if you want to use the common codec driver with SOF.
> +	  If unsure select "Y".
> +
>   endif ## SND_SOC_SOF_HDA_COMMON

Kai, I get a conflict when I try to apply these patches on Mark's tree? 
You probably want to rebase?
Or was the intent to go through Takashi's tree?

diff --cc sound/soc/sof/intel/Kconfig
index d62f51d33be1,31d9222e45aa..000000000000
--- a/sound/soc/sof/intel/Kconfig
+++ b/sound/soc/sof/intel/Kconfig
@@@ -273,15 -273,15 +273,27 @@@ config SND_SOC_SOF_HDA_AUDIO_CODE
           Say Y if you want to enable HDAudio codecs with SOF.
           If unsure select "N".

++<<<<<<< HEAD
  +config SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1
  +      bool "SOF enable DMI Link L1"
  +      help
  +        This option enables DMI L1 for both playback and capture
  +        and disables known workarounds for specific HDaudio platforms.
  +        Only use to look into power optimizations on platforms not
  +        affected by DMI L1 issues. This option is not recommended.
  +        Say Y if you want to enable DMI Link L1
  +        If unsure, select "N".
++=======
+ config SND_SOC_SOF_HDA_COMMON_HDMI_CODEC
+       bool "SOF common HDA HDMI codec driver"
+       depends on SND_SOC_SOF_HDA_LINK
+       depends on SND_HDA_CODEC_HDMI
+       help
+         This adds support for HDMI audio by using the common HDA
+         HDMI/DisplayPort codec driver.
+         Say Y if you want to use the common codec driver with SOF.
+         If unsure select "Y".
++>>>>>>> ASoC: SOF: Intel: add support for snd-hda-codec-hdmi

   endif ## SND_SOC_SOF_HDA_COMMON
>   
>   config SND_SOC_SOF_HDA_LINK_BASELINE
> diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
> index 3ca6795a89ba..9ad36e14072c 100644
> --- a/sound/soc/sof/intel/hda-codec.c
> +++ b/sound/soc/sof/intel/hda-codec.c
> @@ -84,6 +84,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
>   {
>   #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
>   	struct hdac_hda_priv *hda_priv;
> +	struct snd_soc_acpi_mach_params *mach_params = 0;
> +	struct snd_sof_pdata *pdata = sdev->pdata;
>   #endif
>   	struct hda_bus *hbus = sof_to_hbus(sdev);
>   	struct hdac_device *hdev;
> @@ -113,8 +115,19 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
>   	if (ret < 0)
>   		return ret;
>   
> -	/* use legacy bus only for HDA codecs, idisp uses ext bus */
> -	if ((resp & 0xFFFF0000) != IDISP_VID_INTEL) {
> +	if (pdata->machine)
> +		mach_params = (struct snd_soc_acpi_mach_params *)
> +			&pdata->machine->mach_params;
> +
> +	if ((resp & 0xFFFF0000) == IDISP_VID_INTEL)
> +		hda_priv->need_display_power = true;
> +
> +	/*
> +	 * if common HDMI codec driver is not used, codec load
> +	 * is skipped here and hdac_hdmi is used instead
> +	 */
> +	if ((mach_params && mach_params->common_hdmi_codec_drv) ||
> +	    (resp & 0xFFFF0000) != IDISP_VID_INTEL) {
>   		hdev->type = HDA_DEV_LEGACY;
>   		hda_codec_load_module(&hda_priv->codec);
>   	}
> @@ -155,7 +168,8 @@ int hda_codec_probe_bus(struct snd_sof_dev *sdev)
>   }
>   EXPORT_SYMBOL(hda_codec_probe_bus);
>   
> -#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
> +#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \
> +	IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
>   
>   void hda_codec_i915_get(struct snd_sof_dev *sdev)
>   {
> @@ -204,6 +218,6 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
>   }
>   EXPORT_SYMBOL(hda_codec_i915_exit);
>   
> -#endif /* CONFIG_SND_SOC_HDAC_HDMI */
> +#endif
>   
>   MODULE_LICENSE("Dual BSD/GPL");
> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
> index c72e9a09eee1..ee742157516e 100644
> --- a/sound/soc/sof/intel/hda.c
> +++ b/sound/soc/sof/intel/hda.c
> @@ -54,6 +54,11 @@ MODULE_PARM_DESC(use_msi, "SOF HDA use PCI MSI mode");
>   static int hda_dmic_num = -1;
>   module_param_named(dmic_num, hda_dmic_num, int, 0444);
>   MODULE_PARM_DESC(dmic_num, "SOF HDA DMIC number");
> +
> +static bool hda_codec_use_common_hdmi =
> +	IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC);
> +module_param_named(use_common_hdmi, hda_codec_use_common_hdmi, bool, 0444);
> +MODULE_PARM_DESC(use_common_hdmi, "SOF HDA use common HDMI codec driver");
>   #endif
>   
>   static const struct hda_dsp_msg_code hda_dsp_rom_msg[] = {
> @@ -458,6 +463,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
>   			&pdata->machine->mach_params;
>   		mach_params->codec_mask = bus->codec_mask;
>   		mach_params->platform = dev_name(sdev->dev);
> +		mach_params->common_hdmi_codec_drv = hda_codec_use_common_hdmi;
>   	}
>   
>   	/* create codec instances */
> diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h
> index 5591841a1b6f..28640a29e1b6 100644
> --- a/sound/soc/sof/intel/hda.h
> +++ b/sound/soc/sof/intel/hda.h
> @@ -562,7 +562,9 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev);
>   
>   #endif /* CONFIG_SND_SOC_SOF_HDA */
>   
> -#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) && IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
> +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) && \
> +	(IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \
> +	 IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
>   
>   void hda_codec_i915_get(struct snd_sof_dev *sdev);
>   void hda_codec_i915_put(struct snd_sof_dev *sdev);
> @@ -576,7 +578,7 @@ static inline void hda_codec_i915_put(struct snd_sof_dev *sdev)  { }
>   static inline int hda_codec_i915_init(struct snd_sof_dev *sdev) { return 0; }
>   static inline int hda_codec_i915_exit(struct snd_sof_dev *sdev) { return 0; }
>   
> -#endif /* CONFIG_SND_SOC_SOF_HDA && CONFIG_SND_SOC_HDAC_HDMI */
> +#endif
>   
>   /*
>    * Trace Control.
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-10-11 14:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 11:27 [alsa-devel] [PATCH v6 0/9] adapt SOF to use snd-hda-codec-hdmi Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 1/9] ALSA: hda/hdmi - implement mst_no_extra_pcms flag Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 2/9] ASoC: hdac_hda: add support for HDMI/DP as a HDA codec Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 3/9] ASoC: Intel: skl-hda-dsp-generic: use snd-hda-codec-hdmi Kai Vehmanen
2019-10-17  8:06   ` Takashi Iwai
2019-10-22 11:15     ` Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 4/9] ASoC: Intel: skl-hda-dsp-generic: fix include guard name Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 5/9] ASoC: SOF: Intel: add support for snd-hda-codec-hdmi Kai Vehmanen
2019-10-11 14:00   ` Pierre-Louis Bossart [this message]
2019-10-11 14:10     ` Kai Vehmanen
2019-10-17  7:58       ` Takashi Iwai
2019-10-17 13:20         ` Pierre-Louis Bossart
2019-10-22 11:19           ` Kai Vehmanen
2019-10-22 13:17             ` Pierre-Louis Bossart
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 6/9] ASoC: Intel: bxt-da7219-max98357a: common hdmi codec support Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 7/9] ASoC: Intel: glk_rt5682_max98357a: " Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 8/9] ASoC: intel: sof_rt5682: " Kai Vehmanen
2019-10-11 11:27 ` [alsa-devel] [PATCH v6 9/9] ASoC: Intel: bxt_rt298: " Kai Vehmanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf6a8edb-689d-e068-a9c4-d728b7741fec@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=libin.yang@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox