diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2018-11-18 17:38:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-11-20 11:52:19 -0500 |
commit | 8c4e7c2ee8096b5ca8214418f287b3878d578cc0 (patch) | |
tree | 13cc04a8cd6a3e43d38d0e32df29ad1ab2950ba7 | |
parent | 5bb9b84b0796336b18c8b8651628009eace70202 (diff) |
ASoC: Intel: Skylake: fix Kconfigs, make HDaudio codec optional
The Skylake driver currently has a set of problems supporting
load/unload modules. We need to make the HDaudio codec support
optional to help narrow down the issues.
Support for HDaudio codecs also leads to a Kconfig issue. We want the
hdac_hda codec to be compilable independently of Skylake (e.g. with
ALL_CODECS) but when Skylake is selected as built-in the hdac_hda
codec needs to use the same option due a a code dependency
Solve both problems by adding a user-selectable boolean Kconfig,
select HDAC_HDA as needed and make the HDaudio codec support in the
Skylake driver optional. Tests on a Chell Chromebook device without
HDaudio show no regression for speaker and HDMI playback.
This is submitted as an RFC to allow for comments and more validation.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/Kconfig | 26 | ||||
-rw-r--r-- | sound/soc/intel/boards/Kconfig | 24 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 20 |
3 files changed, 55 insertions, 15 deletions
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index 0caa1f4eb94d..18e717703685 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig | |||
@@ -101,22 +101,42 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI | |||
101 | codec, then enable this option by saying Y or m. This is a | 101 | codec, then enable this option by saying Y or m. This is a |
102 | recommended option | 102 | recommended option |
103 | 103 | ||
104 | config SND_SOC_INTEL_SKYLAKE_SSP_CLK | ||
105 | tristate | ||
106 | |||
107 | config SND_SOC_INTEL_SKYLAKE | 104 | config SND_SOC_INTEL_SKYLAKE |
108 | tristate "SKL/BXT/KBL/GLK/CNL... Platforms" | 105 | tristate "SKL/BXT/KBL/GLK/CNL... Platforms" |
109 | depends on PCI && ACPI | 106 | depends on PCI && ACPI |
107 | select SND_SOC_INTEL_SKYLAKE_COMMON | ||
108 | help | ||
109 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ | ||
110 | GeminiLake or CannonLake platform with the DSP enabled in the BIOS | ||
111 | then enable this option by saying Y or m. | ||
112 | |||
113 | if SND_SOC_INTEL_SKYLAKE | ||
114 | |||
115 | config SND_SOC_INTEL_SKYLAKE_SSP_CLK | ||
116 | tristate | ||
117 | |||
118 | config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
119 | bool "HDAudio codec support" | ||
120 | help | ||
121 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ | ||
122 | GeminiLake or CannonLake platform with an HDaudio codec | ||
123 | then enable this option by saying Y | ||
124 | |||
125 | config SND_SOC_INTEL_SKYLAKE_COMMON | ||
126 | tristate | ||
110 | select SND_HDA_EXT_CORE | 127 | select SND_HDA_EXT_CORE |
111 | select SND_HDA_DSP_LOADER | 128 | select SND_HDA_DSP_LOADER |
112 | select SND_SOC_TOPOLOGY | 129 | select SND_SOC_TOPOLOGY |
113 | select SND_SOC_INTEL_SST | 130 | select SND_SOC_INTEL_SST |
131 | select SND_SOC_HDAC_HDA if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
114 | select SND_SOC_ACPI_INTEL_MATCH | 132 | select SND_SOC_ACPI_INTEL_MATCH |
115 | help | 133 | help |
116 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ | 134 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ |
117 | GeminiLake or CannonLake platform with the DSP enabled in the BIOS | 135 | GeminiLake or CannonLake platform with the DSP enabled in the BIOS |
118 | then enable this option by saying Y or m. | 136 | then enable this option by saying Y or m. |
119 | 137 | ||
138 | endif ## SND_SOC_INTEL_SKYLAKE | ||
139 | |||
120 | config SND_SOC_ACPI_INTEL_MATCH | 140 | config SND_SOC_ACPI_INTEL_MATCH |
121 | tristate | 141 | tristate |
122 | select SND_SOC_ACPI if ACPI | 142 | select SND_SOC_ACPI if ACPI |
diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 73ca1350aa31..b177db2a0dbb 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig | |||
@@ -293,16 +293,6 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH | |||
293 | Say Y if you have such a device. | 293 | Say Y if you have such a device. |
294 | If unsure select "N". | 294 | If unsure select "N". |
295 | 295 | ||
296 | config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH | ||
297 | tristate "SKL/KBL/BXT/APL with HDA Codecs" | ||
298 | select SND_SOC_HDAC_HDMI | ||
299 | select SND_SOC_HDAC_HDA | ||
300 | help | ||
301 | This adds support for ASoC machine driver for Intel platforms | ||
302 | SKL/KBL/BXT/APL with iDisp, HDA audio codecs. | ||
303 | Say Y or m if you have such a device. This is a recommended option. | ||
304 | If unsure select "N". | ||
305 | |||
306 | config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH | 296 | config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH |
307 | tristate "GLK with RT5682 and MAX98357A in I2S Mode" | 297 | tristate "GLK with RT5682 and MAX98357A in I2S Mode" |
308 | depends on MFD_INTEL_LPSS && I2C && ACPI | 298 | depends on MFD_INTEL_LPSS && I2C && ACPI |
@@ -319,4 +309,18 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH | |||
319 | 309 | ||
320 | endif ## SND_SOC_INTEL_SKYLAKE | 310 | endif ## SND_SOC_INTEL_SKYLAKE |
321 | 311 | ||
312 | if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
313 | |||
314 | config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH | ||
315 | tristate "SKL/KBL/BXT/APL with HDA Codecs" | ||
316 | select SND_SOC_HDAC_HDMI | ||
317 | # SND_SOC_HDAC_HDA is already selected | ||
318 | help | ||
319 | This adds support for ASoC machine driver for Intel platforms | ||
320 | SKL/KBL/BXT/APL with iDisp, HDA audio codecs. | ||
321 | Say Y or m if you have such a device. This is a recommended option. | ||
322 | If unsure select "N". | ||
323 | |||
324 | endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
325 | |||
322 | endif ## SND_SOC_INTEL_MACH | 326 | endif ## SND_SOC_INTEL_MACH |
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 1586c97d9450..7487f388e65d 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -37,7 +37,9 @@ | |||
37 | #include "skl.h" | 37 | #include "skl.h" |
38 | #include "skl-sst-dsp.h" | 38 | #include "skl-sst-dsp.h" |
39 | #include "skl-sst-ipc.h" | 39 | #include "skl-sst-ipc.h" |
40 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
40 | #include "../../../soc/codecs/hdac_hda.h" | 41 | #include "../../../soc/codecs/hdac_hda.h" |
42 | #endif | ||
41 | 43 | ||
42 | /* | 44 | /* |
43 | * initialize the PCI registers | 45 | * initialize the PCI registers |
@@ -658,6 +660,8 @@ static void skl_clock_device_unregister(struct skl *skl) | |||
658 | platform_device_unregister(skl->clk_dev); | 660 | platform_device_unregister(skl->clk_dev); |
659 | } | 661 | } |
660 | 662 | ||
663 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
664 | |||
661 | #define IDISP_INTEL_VENDOR_ID 0x80860000 | 665 | #define IDISP_INTEL_VENDOR_ID 0x80860000 |
662 | 666 | ||
663 | /* | 667 | /* |
@@ -676,6 +680,8 @@ static void load_codec_module(struct hda_codec *codec) | |||
676 | #endif | 680 | #endif |
677 | } | 681 | } |
678 | 682 | ||
683 | #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ | ||
684 | |||
679 | /* | 685 | /* |
680 | * Probe the given codec address | 686 | * Probe the given codec address |
681 | */ | 687 | */ |
@@ -685,9 +691,11 @@ static int probe_codec(struct hdac_bus *bus, int addr) | |||
685 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; | 691 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; |
686 | unsigned int res = -1; | 692 | unsigned int res = -1; |
687 | struct skl *skl = bus_to_skl(bus); | 693 | struct skl *skl = bus_to_skl(bus); |
694 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
688 | struct hdac_hda_priv *hda_codec; | 695 | struct hdac_hda_priv *hda_codec; |
689 | struct hdac_device *hdev; | ||
690 | int err; | 696 | int err; |
697 | #endif | ||
698 | struct hdac_device *hdev; | ||
691 | 699 | ||
692 | mutex_lock(&bus->cmd_mutex); | 700 | mutex_lock(&bus->cmd_mutex); |
693 | snd_hdac_bus_send_cmd(bus, cmd); | 701 | snd_hdac_bus_send_cmd(bus, cmd); |
@@ -697,6 +705,7 @@ static int probe_codec(struct hdac_bus *bus, int addr) | |||
697 | return -EIO; | 705 | return -EIO; |
698 | dev_dbg(bus->dev, "codec #%d probed OK: %x\n", addr, res); | 706 | dev_dbg(bus->dev, "codec #%d probed OK: %x\n", addr, res); |
699 | 707 | ||
708 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
700 | hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec), | 709 | hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec), |
701 | GFP_KERNEL); | 710 | GFP_KERNEL); |
702 | if (!hda_codec) | 711 | if (!hda_codec) |
@@ -715,6 +724,13 @@ static int probe_codec(struct hdac_bus *bus, int addr) | |||
715 | load_codec_module(&hda_codec->codec); | 724 | load_codec_module(&hda_codec->codec); |
716 | } | 725 | } |
717 | return 0; | 726 | return 0; |
727 | #else | ||
728 | hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL); | ||
729 | if (!hdev) | ||
730 | return -ENOMEM; | ||
731 | |||
732 | return snd_hdac_ext_bus_device_init(bus, addr, hdev); | ||
733 | #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ | ||
718 | } | 734 | } |
719 | 735 | ||
720 | /* Codec initialization */ | 736 | /* Codec initialization */ |
@@ -870,7 +886,7 @@ static int skl_create(struct pci_dev *pci, | |||
870 | hbus = skl_to_hbus(skl); | 886 | hbus = skl_to_hbus(skl); |
871 | bus = skl_to_bus(skl); | 887 | bus = skl_to_bus(skl); |
872 | 888 | ||
873 | #if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA) | 889 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) |
874 | ext_ops = snd_soc_hdac_hda_get_ops(); | 890 | ext_ops = snd_soc_hdac_hda_get_ops(); |
875 | #endif | 891 | #endif |
876 | snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, ext_ops); | 892 | snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, ext_ops); |