]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda: Move codec drivers into sound/hda/codecs directory
authorTakashi Iwai <tiwai@suse.de>
Wed, 9 Jul 2025 16:04:09 +0000 (18:04 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:55:37 +0000 (09:55 +0200)
Now move the all remaining codec drivers from sound/pci/hda to
sound/hda/codecs subdirectory.  Some drivers are put under the further
vendor subdirectory, and the vendor helper code (*_helper.c) are put
under helpers subdirectory.  Also the sub-codec drivers are moved under
a different subdirectory, sound/hda/codecs/sub-codecs, for
distinguishing from the main HD-audio codec drivers.

The prefix patch_ and hda_ as well as the suffix _helper are dropped
from file names as they are mostly superfluous.

No functional changes but just file path shuffling.

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-7-tiwai@suse.de
54 files changed:
sound/hda/Kconfig
sound/hda/Makefile
sound/hda/codecs/Kconfig [moved from sound/pci/hda/Kconfig with 55% similarity]
sound/hda/codecs/Makefile [new file with mode: 0644]
sound/hda/codecs/analog.c [moved from sound/pci/hda/patch_analog.c with 99% similarity]
sound/hda/codecs/ca0110.c [moved from sound/pci/hda/patch_ca0110.c with 98% similarity]
sound/hda/codecs/ca0132.c [moved from sound/pci/hda/patch_ca0132.c with 99% similarity]
sound/hda/codecs/ca0132_regs.h [moved from sound/pci/hda/ca0132_regs.h with 100% similarity]
sound/hda/codecs/cirrus/Kconfig [new file with mode: 0644]
sound/hda/codecs/cirrus/Makefile [new file with mode: 0644]
sound/hda/codecs/cirrus/cirrus.c [moved from sound/pci/hda/patch_cirrus.c with 99% similarity]
sound/hda/codecs/cirrus/cs8409-tables.c [moved from sound/pci/hda/patch_cs8409-tables.c with 99% similarity]
sound/hda/codecs/cirrus/cs8409.c [moved from sound/pci/hda/patch_cs8409.c with 99% similarity]
sound/hda/codecs/cirrus/cs8409.h [moved from sound/pci/hda/patch_cs8409.h with 99% similarity]
sound/hda/codecs/cmedia.c [moved from sound/pci/hda/patch_cmedia.c with 99% similarity]
sound/hda/codecs/conexant.c [moved from sound/pci/hda/patch_conexant.c with 99% similarity]
sound/hda/codecs/generic.c [moved from sound/pci/hda/hda_generic.c with 99% similarity]
sound/hda/codecs/generic.h [moved from sound/pci/hda/hda_generic.h with 100% similarity]
sound/hda/codecs/hdmi/Makefile [new file with mode: 0644]
sound/hda/codecs/hdmi/eld.c [moved from sound/pci/hda/hda_eld.c with 100% similarity]
sound/hda/codecs/hdmi/hdmi.c [moved from sound/pci/hda/patch_hdmi.c with 99% similarity]
sound/hda/codecs/helpers/hp_x360.c [moved from sound/pci/hda/hp_x360_helper.c with 100% similarity]
sound/hda/codecs/helpers/ideapad_hotkey_led.c [moved from sound/pci/hda/ideapad_hotkey_led_helper.c with 100% similarity]
sound/hda/codecs/helpers/ideapad_s740.c [moved from sound/pci/hda/ideapad_s740_helper.c with 100% similarity]
sound/hda/codecs/helpers/thinkpad.c [moved from sound/pci/hda/thinkpad_helper.c with 100% similarity]
sound/hda/codecs/realtek.c [moved from sound/pci/hda/patch_realtek.c with 99% similarity]
sound/hda/codecs/senarytech.c [moved from sound/pci/hda/patch_senarytech.c with 98% similarity]
sound/hda/codecs/si3054.c [moved from sound/pci/hda/patch_si3054.c with 100% similarity]
sound/hda/codecs/side-codecs/Kconfig [new file with mode: 0644]
sound/hda/codecs/side-codecs/Makefile [new file with mode: 0644]
sound/hda/codecs/side-codecs/cirrus_scodec.c [moved from sound/pci/hda/cirrus_scodec.c with 100% similarity]
sound/hda/codecs/side-codecs/cirrus_scodec.h [moved from sound/pci/hda/cirrus_scodec.h with 100% similarity]
sound/hda/codecs/side-codecs/cirrus_scodec_test.c [moved from sound/pci/hda/cirrus_scodec_test.c with 100% similarity]
sound/hda/codecs/side-codecs/cs35l41_hda.c [moved from sound/pci/hda/cs35l41_hda.c with 99% similarity]
sound/hda/codecs/side-codecs/cs35l41_hda.h [moved from sound/pci/hda/cs35l41_hda.h with 100% similarity]
sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c [moved from sound/pci/hda/cs35l41_hda_i2c.c with 100% similarity]
sound/hda/codecs/side-codecs/cs35l41_hda_property.c [moved from sound/pci/hda/cs35l41_hda_property.c with 100% similarity]
sound/hda/codecs/side-codecs/cs35l41_hda_property.h [moved from sound/pci/hda/cs35l41_hda_property.h with 100% similarity]
sound/hda/codecs/side-codecs/cs35l41_hda_spi.c [moved from sound/pci/hda/cs35l41_hda_spi.c with 100% similarity]
sound/hda/codecs/side-codecs/cs35l56_hda.c [moved from sound/pci/hda/cs35l56_hda.c with 99% similarity]
sound/hda/codecs/side-codecs/cs35l56_hda.h [moved from sound/pci/hda/cs35l56_hda.h with 100% similarity]
sound/hda/codecs/side-codecs/cs35l56_hda_i2c.c [moved from sound/pci/hda/cs35l56_hda_i2c.c with 100% similarity]
sound/hda/codecs/side-codecs/cs35l56_hda_spi.c [moved from sound/pci/hda/cs35l56_hda_spi.c with 100% similarity]
sound/hda/codecs/side-codecs/hda_component.c [moved from sound/pci/hda/hda_component.c with 100% similarity]
sound/hda/codecs/side-codecs/hda_component.h [moved from sound/pci/hda/hda_component.h with 100% similarity]
sound/hda/codecs/side-codecs/tas2781_hda.c [moved from sound/pci/hda/tas2781_hda.c with 100% similarity]
sound/hda/codecs/side-codecs/tas2781_hda.h [moved from sound/pci/hda/tas2781_hda.h with 100% similarity]
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c [moved from sound/pci/hda/tas2781_hda_i2c.c with 99% similarity]
sound/hda/codecs/side-codecs/tas2781_hda_spi.c [moved from sound/pci/hda/tas2781_hda_spi.c with 99% similarity]
sound/hda/codecs/sigmatel.c [moved from sound/pci/hda/patch_sigmatel.c with 99% similarity]
sound/hda/codecs/via.c [moved from sound/pci/hda/patch_via.c with 99% similarity]
sound/pci/Kconfig
sound/pci/Makefile
sound/pci/hda/Makefile [deleted file]

index d360c884bd6d09cc939a075743e727b041e4282a..7797f44b3d0c497d57dd3e4dfc182e632431cfd0 100644 (file)
@@ -3,6 +3,7 @@ menu "HD-Audio"
 
 source "sound/hda/common/Kconfig"
 source "sound/hda/controllers/Kconfig"
+source "sound/hda/codecs/Kconfig"
 source "sound/hda/core/Kconfig"
 
 endmenu
index fc76086a1f5ede7dd863f7e8377c806afa72e18e..31b9fbedaa77ee275ba6ab25d85e58b43eed0f07 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-y += core/
 obj-$(CONFIG_SND_HDA) += common/
+obj-$(CONFIG_SND_HDA) += codecs/
 # this must be the last entry after codec drivers;
 # otherwise the codec patches won't be hooked before the PCI probe
 # when built in kernel
similarity index 55%
rename from sound/pci/hda/Kconfig
rename to sound/hda/codecs/Kconfig
index a5d345514cf3f02b27b9c9643ba49f72a19d6335..bac19a664be0f52b0e5b9d1e5cde77015773ac05 100644 (file)
@@ -1,140 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0-only
-menu "HD-Audio"
+if SND_HDA
 
 config SND_HDA_GENERIC_LEDS
        bool
 
-if SND_HDA
-
-config SND_HDA_CIRRUS_SCODEC
-       tristate
-
-config SND_HDA_CIRRUS_SCODEC_KUNIT_TEST
-       tristate "KUnit test for Cirrus side-codec library" if !KUNIT_ALL_TESTS
-       depends on SND_HDA_CIRRUS_SCODEC && GPIOLIB && KUNIT
-       default KUNIT_ALL_TESTS
-       help
-         This builds KUnit tests for the cirrus side-codec library.
-         For more information on KUnit and unit tests in general,
-         please refer to the KUnit documentation in
-         Documentation/dev-tools/kunit/.
-         If in doubt, say "N".
-
-config SND_HDA_SCODEC_CS35L41
-       tristate
-       select SND_HDA_GENERIC
-       select REGMAP_IRQ
-       select FW_CS_DSP
-
-config SND_HDA_SCODEC_COMPONENT
-       tristate
-
-config SND_HDA_SCODEC_CS35L41_I2C
-       tristate "Build CS35L41 HD-audio side codec support for I2C Bus"
-       depends on I2C
-       depends on ACPI
-       depends on EFI
-       depends on SND_SOC
-       select SND_SOC_CS35L41_LIB
-       select SND_HDA_SCODEC_CS35L41
-       select SND_SOC_CS_AMP_LIB
-       help
-         Say Y or M here to include CS35L41 I2C HD-audio side codec support
-         in snd-hda-intel driver, such as ALC287.
-
-comment "Set to Y if you want auto-loading the side codec driver"
-       depends on SND_HDA=y && SND_HDA_SCODEC_CS35L41_I2C=m
-
-config SND_HDA_SCODEC_CS35L41_SPI
-       tristate "Build CS35L41 HD-audio codec support for SPI Bus"
-       depends on SPI_MASTER
-       depends on ACPI
-       depends on EFI
-       depends on SND_SOC
-       select SND_SOC_CS35L41_LIB
-       select SND_HDA_SCODEC_CS35L41
-       select SND_SOC_CS_AMP_LIB
-       help
-         Say Y or M here to include CS35L41 SPI HD-audio side codec support
-         in snd-hda-intel driver, such as ALC287.
-
-comment "Set to Y if you want auto-loading the side codec driver"
-       depends on SND_HDA=y && SND_HDA_SCODEC_CS35L41_SPI=m
-
-config SND_HDA_SCODEC_CS35L56
-       tristate
-
-config SND_HDA_SCODEC_CS35L56_I2C
-       tristate "Build CS35L56 HD-audio side codec support for I2C Bus"
-       depends on I2C
-       depends on ACPI
-       depends on SND_SOC
-       select FW_CS_DSP
-       imply SERIAL_MULTI_INSTANTIATE
-       select SND_HDA_GENERIC
-       select SND_SOC_CS35L56_SHARED
-       select SND_HDA_SCODEC_CS35L56
-       select SND_HDA_CIRRUS_SCODEC
-       select SND_SOC_CS_AMP_LIB
-       help
-         Say Y or M here to include CS35L56 amplifier support with
-         I2C control.
-
-config SND_HDA_SCODEC_CS35L56_SPI
-       tristate "Build CS35L56 HD-audio side codec support for SPI Bus"
-       depends on SPI_MASTER
-       depends on ACPI
-       depends on SND_SOC
-       select FW_CS_DSP
-       imply SERIAL_MULTI_INSTANTIATE
-       select SND_HDA_GENERIC
-       select SND_SOC_CS35L56_SHARED
-       select SND_HDA_SCODEC_CS35L56
-       select SND_HDA_CIRRUS_SCODEC
-       select SND_SOC_CS_AMP_LIB
-       help
-         Say Y or M here to include CS35L56 amplifier support with
-         SPI control.
-
-config SND_HDA_SCODEC_TAS2781
-       tristate
-       select SND_HDA_GENERIC
-
-config SND_HDA_SCODEC_TAS2781_I2C
-       tristate "Build TAS2781 HD-audio side codec support for I2C Bus"
-       depends on I2C
-       depends on ACPI
-       depends on EFI
-       depends on SND_SOC
-       select SND_HDA_SCODEC_TAS2781
-       select SND_SOC_TAS2781_COMLIB_I2C
-       select SND_SOC_TAS2781_FMWLIB
-       select CRC32
-       help
-         Say Y or M here to include TAS2781 I2C HD-audio side codec support
-         in snd-hda-intel driver, such as ALC287.
-
-comment "Set to Y if you want auto-loading the side codec driver"
-       depends on SND_HDA=y && SND_HDA_SCODEC_TAS2781_I2C=m
-
-config SND_HDA_SCODEC_TAS2781_SPI
-       tristate "Build TAS2781 HD-audio side codec support for SPI Bus"
-       depends on SPI_MASTER
-       depends on ACPI
-       depends on EFI
-       depends on SND_SOC
-       select SND_HDA_SCODEC_TAS2781
-       select SND_SOC_TAS2781_COMLIB
-       select SND_SOC_TAS2781_FMWLIB
-       select CRC8
-       select CRC32
-       help
-         Say Y or M here to include TAS2781 SPI HD-audio side codec support
-         in snd-hda-intel driver, such as ALC287.
-
-comment "Set to Y if you want auto-loading the side codec driver"
-       depends on SND_HDA=y && SND_HDA_SCODEC_TAS2781_SPI=m
-
 config SND_HDA_CODEC_REALTEK
        tristate "Build Realtek HD-audio codec support"
        depends on INPUT
@@ -194,26 +63,6 @@ config SND_HDA_CODEC_HDMI
 comment "Set to Y if you want auto-loading the codec driver"
        depends on SND_HDA=y && SND_HDA_CODEC_HDMI=m
 
-config SND_HDA_CODEC_CIRRUS
-       tristate "Build Cirrus Logic codec support"
-       select SND_HDA_GENERIC
-       help
-         Say Y or M here to include Cirrus Logic codec support in
-         snd-hda-intel driver, such as CS4206.
-
-comment "Set to Y if you want auto-loading the codec driver"
-       depends on SND_HDA=y && SND_HDA_CODEC_CIRRUS=m
-
-config SND_HDA_CODEC_CS8409
-       tristate "Build Cirrus Logic HDA bridge support"
-       select SND_HDA_GENERIC
-       help
-         Say Y or M here to include Cirrus Logic HDA bridge support in
-         snd-hda-intel driver, such as CS8409.
-
-comment "Set to Y if you want auto-loading the codec driver"
-       depends on SND_HDA=y && SND_HDA_CODEC_CS8409=m
-
 config SND_HDA_CODEC_CONEXANT
        tristate "Build Conexant HD-audio codec support"
        select SND_HDA_GENERIC
@@ -313,6 +162,7 @@ config SND_HDA_INTEL_HDMI_SILENT_STREAM
          This feature can impact power consumption as resources
          are kept reserved both at transmitter and receiver.
 
-endif
+source "sound/hda/codecs/cirrus/Kconfig"
+source "sound/hda/codecs/side-codecs/Kconfig"
 
-endmenu
+endif # SND_HDA
diff --git a/sound/hda/codecs/Makefile b/sound/hda/codecs/Makefile
new file mode 100644 (file)
index 0000000..205cd13
--- /dev/null
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-ccflags-y += -I$(src)/../common
+
+snd-hda-codec-generic-y :=     generic.o
+snd-hda-codec-analog-y :=      analog.o
+snd-hda-codec-ca0110-y :=      ca0110.o
+snd-hda-codec-ca0132-y :=      ca0132.o
+snd-hda-codec-cmedia-y :=      cmedia.o
+snd-hda-codec-conexant-y :=    conexant.o
+snd-hda-codec-idt-y :=         sigmatel.o
+snd-hda-codec-realtek-y :=     realtek.o
+snd-hda-codec-senarytech-y :=  senarytech.o
+snd-hda-codec-si3054-y :=      si3054.o
+snd-hda-codec-via-y :=         via.o
+
+obj-y += cirrus/
+obj-y += hdmi/
+obj-y += side-codecs/
+
+# codec drivers
+obj-$(CONFIG_SND_HDA_GENERIC) += snd-hda-codec-generic.o
+obj-$(CONFIG_SND_HDA_CODEC_ANALOG) += snd-hda-codec-analog.o
+obj-$(CONFIG_SND_HDA_CODEC_CA0110) += snd-hda-codec-ca0110.o
+obj-$(CONFIG_SND_HDA_CODEC_CA0132) += snd-hda-codec-ca0132.o
+obj-$(CONFIG_SND_HDA_CODEC_CMEDIA) += snd-hda-codec-cmedia.o
+obj-$(CONFIG_SND_HDA_CODEC_CONEXANT) += snd-hda-codec-conexant.o
+obj-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += snd-hda-codec-idt.o
+obj-$(CONFIG_SND_HDA_CODEC_REALTEK) += snd-hda-codec-realtek.o
+obj-$(CONFIG_SND_HDA_CODEC_SENARYTECH) += snd-hda-codec-senarytech.o
+obj-$(CONFIG_SND_HDA_CODEC_SI3054) += snd-hda-codec-si3054.o
+obj-$(CONFIG_SND_HDA_CODEC_VIA) += snd-hda-codec-via.o
similarity index 99%
rename from sound/pci/hda/patch_analog.c
rename to sound/hda/codecs/analog.c
index 56354fe060a1aa64fe433fea0e8ac382e1966cdd..3557e06c6d2b3eef23a7ebea41c000af3b6b1b36 100644 (file)
@@ -16,7 +16,7 @@
 #include "hda_auto_parser.h"
 #include "hda_beep.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 
 struct ad198x_spec {
similarity index 98%
rename from sound/pci/hda/patch_ca0110.c
rename to sound/hda/codecs/ca0110.c
index 1818ce67f7613d862f8ef1d01b6e50396e226f59..0353544435b9ade1a9cff70d59dab69be2e5401d 100644 (file)
@@ -13,7 +13,7 @@
 #include "hda_local.h"
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 
 static const struct hda_codec_ops ca0110_patch_ops = {
similarity index 99%
rename from sound/pci/hda/patch_ca0132.c
rename to sound/hda/codecs/ca0132.c
index 686ce0947131bc62af43851ace76f0400363af41..35a979465c7511d710e7dbffa90ed73aca2db9c0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (c) 2011, Creative Technology Ltd.
  *
- * Based on patch_ca0110.c
+ * Based on ca0110.c
  * Copyright (c) 2008 Takashi Iwai <tiwai@suse.de>
  */
 
diff --git a/sound/hda/codecs/cirrus/Kconfig b/sound/hda/codecs/cirrus/Kconfig
new file mode 100644 (file)
index 0000000..f6cefb6
--- /dev/null
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config SND_HDA_CODEC_CIRRUS
+       tristate "Build Cirrus Logic codec support"
+       select SND_HDA_GENERIC
+       help
+         Say Y or M here to include Cirrus Logic codec support in
+         snd-hda-intel driver, such as CS4206.
+
+comment "Set to Y if you want auto-loading the codec driver"
+       depends on SND_HDA=y && SND_HDA_CODEC_CIRRUS=m
+
+config SND_HDA_CODEC_CS8409
+       tristate "Build Cirrus Logic HDA bridge support"
+       select SND_HDA_GENERIC
+       help
+         Say Y or M here to include Cirrus Logic HDA bridge support in
+         snd-hda-intel driver, such as CS8409.
+
+comment "Set to Y if you want auto-loading the codec driver"
+       depends on SND_HDA=y && SND_HDA_CODEC_CS8409=m
diff --git a/sound/hda/codecs/cirrus/Makefile b/sound/hda/codecs/cirrus/Makefile
new file mode 100644 (file)
index 0000000..fa40c89
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-ccflags-y += -I$(src)/../../common
+
+snd-hda-codec-cirrus-y :=      cirrus.o
+snd-hda-codec-cs8409-y :=      cs8409.o cs8409-tables.o
+
+obj-$(CONFIG_SND_HDA_CODEC_CIRRUS) += snd-hda-codec-cirrus.o
+obj-$(CONFIG_SND_HDA_CODEC_CS8409) += snd-hda-codec-cs8409.o
similarity index 99%
rename from sound/pci/hda/patch_cirrus.c
rename to sound/hda/codecs/cirrus/cirrus.c
index 06e046214a41343c552acdd8d24b88d3a5acfb16..81ea66c4e9d317f2a5f15a3aac9eafae5cf98f2d 100644 (file)
@@ -15,7 +15,7 @@
 #include "hda_local.h"
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "../generic.h"
 
 /*
  */
similarity index 99%
rename from sound/pci/hda/patch_cs8409-tables.c
rename to sound/hda/codecs/cirrus/cs8409-tables.c
index 09240138e0871a6e6d91d43f1d193ff8dbeb70ac..5fe49f13c0da58d586303128854e6c47e5f9d0e5 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * patch_cs8409-tables.c  --  HD audio interface patch for Cirrus Logic CS8409 HDA bridge chip
+ * cs8409-tables.c  --  HD audio interface patch for Cirrus Logic CS8409 HDA bridge chip
  *
  * Copyright (C) 2021 Cirrus Logic, Inc. and
  *                    Cirrus Logic International Semiconductor Ltd.
@@ -8,7 +8,7 @@
  * Author: Lucas Tanure <tanureal@opensource.cirrus.com>
  */
 
-#include "patch_cs8409.h"
+#include "cs8409.h"
 
 /******************************************************************************
  *                          CS42L42 Specific Data
similarity index 99%
rename from sound/pci/hda/patch_cs8409.c
rename to sound/hda/codecs/cirrus/cs8409.c
index e50006757a2c85753d818da2f29e88d86d79bad7..5ec1126b2a55a89af7a6ce07905decff506e7e59 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/mutex.h>
 #include <linux/iopoll.h>
 
-#include "patch_cs8409.h"
+#include "cs8409.h"
 
 /******************************************************************************
  *                        CS8409 Specific Functions
similarity index 99%
rename from sound/pci/hda/patch_cs8409.h
rename to sound/hda/codecs/cirrus/cs8409.h
index e4bd2e12110bc4ab5875a8660b5f54ed80bed613..35072cd009dc2db8919f779fd21065ab88130590 100644 (file)
@@ -17,7 +17,7 @@
 #include "hda_local.h"
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "../generic.h"
 
 /* CS8409 Specific Definitions */
 
similarity index 99%
rename from sound/pci/hda/patch_cmedia.c
rename to sound/hda/codecs/cmedia.c
index fe946d40783072b702d6abf05e0a8fc8fe5c2264..c88da2f8233ea610da339a793fdc787f39ef92ae 100644 (file)
@@ -15,7 +15,7 @@
 #include "hda_local.h"
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 /* CM9825 Offset Definitions */
 
similarity index 99%
rename from sound/pci/hda/patch_conexant.c
rename to sound/hda/codecs/conexant.c
index e584a7b2877de507849cc095ce1fcff6c0543f3e..b7710a81fd87bdef3c8cfd991dd3c941ece1d210 100644 (file)
@@ -19,7 +19,7 @@
 #include "hda_auto_parser.h"
 #include "hda_beep.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 struct conexant_spec {
        struct hda_gen_spec gen;
@@ -312,10 +312,10 @@ enum {
 };
 
 /* for hda_fixup_thinkpad_acpi() */
-#include "thinkpad_helper.c"
+#include "helpers/thinkpad.c"
 
 /* for hda_fixup_ideapad_acpi() */
-#include "ideapad_hotkey_led_helper.c"
+#include "helpers/ideapad_hotkey_led.c"
 
 static void cxt_fixup_stereo_dmic(struct hda_codec *codec,
                                  const struct hda_fixup *fix, int action)
similarity index 99%
rename from sound/pci/hda/hda_generic.c
rename to sound/hda/codecs/generic.c
index 2a28c8b6ba552ee77a062812c2235a71646d84e4..873fd4b7f451645f42c9e657802e9ec0e0ef3ea4 100644 (file)
@@ -25,7 +25,7 @@
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
 #include "hda_beep.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 
 /**
diff --git a/sound/hda/codecs/hdmi/Makefile b/sound/hda/codecs/hdmi/Makefile
new file mode 100644 (file)
index 0000000..371818d
--- /dev/null
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-ccflags-y += -I$(src)/../../common
+
+snd-hda-codec-hdmi-y :=                hdmi.o eld.o
+
+obj-$(CONFIG_SND_HDA_CODEC_HDMI) += snd-hda-codec-hdmi.o
similarity index 99%
rename from sound/pci/hda/patch_hdmi.c
rename to sound/hda/codecs/hdmi/hdmi.c
index 9a7793eb16e91eb3aee897f9521700fb56d7ccde..3811eb1dc9989f5446fc22250e0c639947d7006f 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
- *  patch_hdmi.c - routines for HDMI/DisplayPort codecs
+ *  hdmi.c - routines for HDMI/DisplayPort codecs
  *
  *  Copyright(c) 2008-2010 Intel Corporation
  *  Copyright (c) 2006 ATI Technologies Inc.
similarity index 99%
rename from sound/pci/hda/patch_realtek.c
rename to sound/hda/codecs/realtek.c
index 936c3470a13be714a80b70fbf36d74fb80752912..eea42bf5aec2e60562122732e520417e2994e615 100644 (file)
@@ -30,8 +30,8 @@
 #include "hda_auto_parser.h"
 #include "hda_beep.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
-#include "hda_component.h"
+#include "generic.h"
+#include "side-codecs/hda_component.h"
 
 /* keep halting ALC5505 DSP, for power saving */
 #define HALT_REALTEK_ALC5505
@@ -7120,7 +7120,7 @@ static void alc285_fixup_hp_beep(struct hda_codec *codec,
 }
 
 /* for hda_fixup_thinkpad_acpi() */
-#include "thinkpad_helper.c"
+#include "helpers/thinkpad.c"
 
 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
                                    const struct hda_fixup *fix, int action)
@@ -7130,7 +7130,7 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
 }
 
 /* for hda_fixup_ideapad_acpi() */
-#include "ideapad_hotkey_led_helper.c"
+#include "helpers/ideapad_hotkey_led.c"
 
 static void alc_fixup_ideapad_acpi(struct hda_codec *codec,
                                   const struct hda_fixup *fix, int action)
@@ -7362,10 +7362,10 @@ static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
 
 
 /* for alc295_fixup_hp_top_speakers */
-#include "hp_x360_helper.c"
+#include "helpers/hp_x360.c"
 
 /* for alc285_fixup_ideapad_s740_coef() */
-#include "ideapad_s740_helper.c"
+#include "helpers/ideapad_s740.c"
 
 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
        WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
similarity index 98%
rename from sound/pci/hda/patch_senarytech.c
rename to sound/hda/codecs/senarytech.c
index 0691996fa971c895d9d55230285fba39b372cfeb..9a253ad19f4df3f054a408de64c23c188907ea4d 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * HD audio interface patch for Senary HDA audio codec
  *
- * Initially based on sound/pci/hda/patch_conexant.c
+ * Initially based on conexant.c
  */
 
 #include <linux/init.h>
@@ -17,7 +17,7 @@
 #include "hda_auto_parser.h"
 #include "hda_beep.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 struct senary_spec {
        struct hda_gen_spec gen;
diff --git a/sound/hda/codecs/side-codecs/Kconfig b/sound/hda/codecs/side-codecs/Kconfig
new file mode 100644 (file)
index 0000000..cbf1847
--- /dev/null
@@ -0,0 +1,128 @@
+config SND_HDA_CIRRUS_SCODEC
+       tristate
+
+config SND_HDA_CIRRUS_SCODEC_KUNIT_TEST
+       tristate "KUnit test for Cirrus side-codec library" if !KUNIT_ALL_TESTS
+       depends on SND_HDA_CIRRUS_SCODEC && GPIOLIB && KUNIT
+       default KUNIT_ALL_TESTS
+       help
+         This builds KUnit tests for the cirrus side-codec library.
+         For more information on KUnit and unit tests in general,
+         please refer to the KUnit documentation in
+         Documentation/dev-tools/kunit/.
+         If in doubt, say "N".
+
+config SND_HDA_SCODEC_CS35L41
+       tristate
+       select SND_HDA_GENERIC
+       select REGMAP_IRQ
+       select FW_CS_DSP
+
+config SND_HDA_SCODEC_COMPONENT
+       tristate
+
+config SND_HDA_SCODEC_CS35L41_I2C
+       tristate "Build CS35L41 HD-audio side codec support for I2C Bus"
+       depends on I2C
+       depends on ACPI
+       depends on EFI
+       depends on SND_SOC
+       select SND_SOC_CS35L41_LIB
+       select SND_HDA_SCODEC_CS35L41
+       select SND_SOC_CS_AMP_LIB
+       help
+         Say Y or M here to include CS35L41 I2C HD-audio side codec support
+         in snd-hda-intel driver, such as ALC287.
+
+comment "Set to Y if you want auto-loading the side codec driver"
+       depends on SND_HDA=y && SND_HDA_SCODEC_CS35L41_I2C=m
+
+config SND_HDA_SCODEC_CS35L41_SPI
+       tristate "Build CS35L41 HD-audio codec support for SPI Bus"
+       depends on SPI_MASTER
+       depends on ACPI
+       depends on EFI
+       depends on SND_SOC
+       select SND_SOC_CS35L41_LIB
+       select SND_HDA_SCODEC_CS35L41
+       select SND_SOC_CS_AMP_LIB
+       help
+         Say Y or M here to include CS35L41 SPI HD-audio side codec support
+         in snd-hda-intel driver, such as ALC287.
+
+comment "Set to Y if you want auto-loading the side codec driver"
+       depends on SND_HDA=y && SND_HDA_SCODEC_CS35L41_SPI=m
+
+config SND_HDA_SCODEC_CS35L56
+       tristate
+
+config SND_HDA_SCODEC_CS35L56_I2C
+       tristate "Build CS35L56 HD-audio side codec support for I2C Bus"
+       depends on I2C
+       depends on ACPI
+       depends on SND_SOC
+       select FW_CS_DSP
+       imply SERIAL_MULTI_INSTANTIATE
+       select SND_HDA_GENERIC
+       select SND_SOC_CS35L56_SHARED
+       select SND_HDA_SCODEC_CS35L56
+       select SND_HDA_CIRRUS_SCODEC
+       select SND_SOC_CS_AMP_LIB
+       help
+         Say Y or M here to include CS35L56 amplifier support with
+         I2C control.
+
+config SND_HDA_SCODEC_CS35L56_SPI
+       tristate "Build CS35L56 HD-audio side codec support for SPI Bus"
+       depends on SPI_MASTER
+       depends on ACPI
+       depends on SND_SOC
+       select FW_CS_DSP
+       imply SERIAL_MULTI_INSTANTIATE
+       select SND_HDA_GENERIC
+       select SND_SOC_CS35L56_SHARED
+       select SND_HDA_SCODEC_CS35L56
+       select SND_HDA_CIRRUS_SCODEC
+       select SND_SOC_CS_AMP_LIB
+       help
+         Say Y or M here to include CS35L56 amplifier support with
+         SPI control.
+
+config SND_HDA_SCODEC_TAS2781
+       tristate
+       select SND_HDA_GENERIC
+
+config SND_HDA_SCODEC_TAS2781_I2C
+       tristate "Build TAS2781 HD-audio side codec support for I2C Bus"
+       depends on I2C
+       depends on ACPI
+       depends on EFI
+       depends on SND_SOC
+       select SND_HDA_SCODEC_TAS2781
+       select SND_SOC_TAS2781_COMLIB_I2C
+       select SND_SOC_TAS2781_FMWLIB
+       select CRC32
+       help
+         Say Y or M here to include TAS2781 I2C HD-audio side codec support
+         in snd-hda-intel driver, such as ALC287.
+
+comment "Set to Y if you want auto-loading the side codec driver"
+       depends on SND_HDA=y && SND_HDA_SCODEC_TAS2781_I2C=m
+
+config SND_HDA_SCODEC_TAS2781_SPI
+       tristate "Build TAS2781 HD-audio side codec support for SPI Bus"
+       depends on SPI_MASTER
+       depends on ACPI
+       depends on EFI
+       depends on SND_SOC
+       select SND_HDA_SCODEC_TAS2781
+       select SND_SOC_TAS2781_COMLIB
+       select SND_SOC_TAS2781_FMWLIB
+       select CRC8
+       select CRC32
+       help
+         Say Y or M here to include TAS2781 SPI HD-audio side codec support
+         in snd-hda-intel driver, such as ALC287.
+
+comment "Set to Y if you want auto-loading the side codec driver"
+       depends on SND_HDA=y && SND_HDA_SCODEC_TAS2781_SPI=m
diff --git a/sound/hda/codecs/side-codecs/Makefile b/sound/hda/codecs/side-codecs/Makefile
new file mode 100644 (file)
index 0000000..245e84f
--- /dev/null
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-ccflags-y += -I$(src)/../../common
+
+snd-hda-cirrus-scodec-y :=     cirrus_scodec.o
+snd-hda-cirrus-scodec-test-y :=        cirrus_scodec_test.o
+snd-hda-scodec-cs35l41-y :=    cs35l41_hda.o cs35l41_hda_property.o
+snd-hda-scodec-cs35l41-i2c-y :=        cs35l41_hda_i2c.o
+snd-hda-scodec-cs35l41-spi-y :=        cs35l41_hda_spi.o
+snd-hda-scodec-cs35l56-y :=    cs35l56_hda.o
+snd-hda-scodec-cs35l56-i2c-y :=        cs35l56_hda_i2c.o
+snd-hda-scodec-cs35l56-spi-y :=        cs35l56_hda_spi.o
+snd-hda-scodec-component-y :=  hda_component.o
+snd-hda-scodec-tas2781-y :=    tas2781_hda.o
+snd-hda-scodec-tas2781-i2c-y :=        tas2781_hda_i2c.o
+snd-hda-scodec-tas2781-spi-y :=        tas2781_hda_spi.o
+
+obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC) += snd-hda-cirrus-scodec.o
+obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC_KUNIT_TEST) += snd-hda-cirrus-scodec-test.o
+obj-$(CONFIG_SND_HDA_SCODEC_CS35L41) += snd-hda-scodec-cs35l41.o
+obj-$(CONFIG_SND_HDA_SCODEC_CS35L41_I2C) += snd-hda-scodec-cs35l41-i2c.o
+obj-$(CONFIG_SND_HDA_SCODEC_CS35L41_SPI) += snd-hda-scodec-cs35l41-spi.o
+obj-$(CONFIG_SND_HDA_SCODEC_CS35L56) += snd-hda-scodec-cs35l56.o
+obj-$(CONFIG_SND_HDA_SCODEC_CS35L56_I2C) += snd-hda-scodec-cs35l56-i2c.o
+obj-$(CONFIG_SND_HDA_SCODEC_CS35L56_SPI) += snd-hda-scodec-cs35l56-spi.o
+obj-$(CONFIG_SND_HDA_SCODEC_COMPONENT) += snd-hda-scodec-component.o
+obj-$(CONFIG_SND_HDA_SCODEC_TAS2781) += snd-hda-scodec-tas2781.o
+obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_I2C) += snd-hda-scodec-tas2781-i2c.o
+obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_SPI) += snd-hda-scodec-tas2781-spi.o
similarity index 99%
rename from sound/pci/hda/cs35l41_hda.c
rename to sound/hda/codecs/side-codecs/cs35l41_hda.c
index 2d7ee121a7fd4a994257b3fae3511778aa02446c..37f2cdc8ce8243362e61898f87e6a01f3c5cb27e 100644 (file)
@@ -17,7 +17,7 @@
 #include "hda_local.h"
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "../generic.h"
 #include "hda_component.h"
 #include "cs35l41_hda.h"
 #include "cs35l41_hda_property.h"
similarity index 99%
rename from sound/pci/hda/cs35l56_hda.c
rename to sound/hda/codecs/side-codecs/cs35l56_hda.c
index e8b4995118bbff8e5d5f3ffd5866d98a3784126c..8d43119b3dd24e1a9a8cf38e2157d40630644f8e 100644 (file)
@@ -20,7 +20,7 @@
 #include "cirrus_scodec.h"
 #include "cs35l56_hda.h"
 #include "hda_component.h"
-#include "hda_generic.h"
+#include "../generic.h"
 
  /*
   * The cs35l56_hda_dai_config[] reg sequence configures the device as
similarity index 99%
rename from sound/pci/hda/tas2781_hda_i2c.c
rename to sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
index b7ee22840d78935edfdedbb30771ee0b9b0f3be1..bacc3f6ed4bd989ad658e93662602439685f7ef9 100644 (file)
@@ -30,7 +30,7 @@
 #include "hda_auto_parser.h"
 #include "hda_component.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "../generic.h"
 #include "tas2781_hda.h"
 
 #define TAS2563_CAL_VAR_NAME_MAX       16
similarity index 99%
rename from sound/pci/hda/tas2781_hda_spi.c
rename to sound/hda/codecs/side-codecs/tas2781_hda_spi.c
index c4b9a3c1a7f0768fa42bc560530d139bed5b7a0a..09a5d0f131b2fd402d2a5749956fe144c793201a 100644 (file)
@@ -35,7 +35,7 @@
 #include "hda_auto_parser.h"
 #include "hda_component.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "../generic.h"
 #include "tas2781_hda.h"
 
 #define TASDEVICE_RANGE_MAX_SIZE       (256 * 128)
similarity index 99%
rename from sound/pci/hda/patch_sigmatel.c
rename to sound/hda/codecs/sigmatel.c
index bde6b737385831ad23567de54912b55129356fb5..56274ff49b0b7406a7ccc158a728c4eadf005fc1 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (c) 2005 Embedded Alley Solutions, Inc.
  * Matt Porter <mporter@embeddedalley.com>
  *
- * Based on patch_cmedia.c and patch_realtek.c
+ * Based on cmedia.c and realtek.c
  * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
  */
 
@@ -24,7 +24,7 @@
 #include "hda_auto_parser.h"
 #include "hda_beep.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 enum {
        STAC_REF,
similarity index 99%
rename from sound/pci/hda/patch_via.c
rename to sound/hda/codecs/via.c
index d0893059b1b9b7bf0157ebb85d7f9b7333732166..e3ce563f866b378d15ac1b5d399d383e56029d66 100644 (file)
@@ -43,7 +43,7 @@
 #include "hda_local.h"
 #include "hda_auto_parser.h"
 #include "hda_jack.h"
-#include "hda_generic.h"
+#include "generic.h"
 
 /* Pin Widget NID */
 #define VT1708_HP_PIN_NID      0x20
index 787868c9e91b0c1648088439e7c956b8649fd1ea..e0996a9d90b033ed758cdbfd7698a12de40c31ac 100644 (file)
@@ -933,5 +933,3 @@ config SND_YMFPCI
          will be called snd-ymfpci.
 
 endif  # SND_PCI
-
-source "sound/pci/hda/Kconfig"
index 18b673018dfd609f82c5526a017d60e825e4c9eb..9d5e8e12ae73808e00a5270e1ff85990ac3d46e0 100644 (file)
@@ -69,7 +69,6 @@ obj-$(CONFIG_SND) += \
        lx6464es/ \
        echoaudio/ \
        emu10k1/ \
-       hda/ \
        ice1712/ \
        korg1212/ \
        mixart/ \
diff --git a/sound/pci/hda/Makefile b/sound/pci/hda/Makefile
deleted file mode 100644 (file)
index 79de0af..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-subdir-ccflags-y += -I$(src)/../../hda/common
-
-snd-hda-codec-generic-y :=     hda_generic.o
-snd-hda-codec-realtek-y :=     patch_realtek.o
-snd-hda-codec-cmedia-y :=      patch_cmedia.o
-snd-hda-codec-analog-y :=      patch_analog.o
-snd-hda-codec-idt-y :=         patch_sigmatel.o
-snd-hda-codec-si3054-y :=      patch_si3054.o
-snd-hda-codec-cirrus-y :=      patch_cirrus.o
-snd-hda-codec-cs8409-y :=      patch_cs8409.o patch_cs8409-tables.o
-snd-hda-codec-ca0110-y :=      patch_ca0110.o
-snd-hda-codec-ca0132-y :=      patch_ca0132.o
-snd-hda-codec-conexant-y :=    patch_conexant.o
-snd-hda-codec-senarytech-y :=patch_senarytech.o
-snd-hda-codec-via-y :=         patch_via.o
-snd-hda-codec-hdmi-y :=                patch_hdmi.o hda_eld.o
-
-# side codecs
-snd-hda-cirrus-scodec-y :=     cirrus_scodec.o
-snd-hda-cirrus-scodec-test-y :=        cirrus_scodec_test.o
-snd-hda-scodec-cs35l41-y :=    cs35l41_hda.o cs35l41_hda_property.o
-snd-hda-scodec-cs35l41-i2c-y :=        cs35l41_hda_i2c.o
-snd-hda-scodec-cs35l41-spi-y :=        cs35l41_hda_spi.o
-snd-hda-scodec-cs35l56-y :=    cs35l56_hda.o
-snd-hda-scodec-cs35l56-i2c-y :=        cs35l56_hda_i2c.o
-snd-hda-scodec-cs35l56-spi-y :=        cs35l56_hda_spi.o
-snd-hda-scodec-component-y :=  hda_component.o
-snd-hda-scodec-tas2781-y :=    tas2781_hda.o
-snd-hda-scodec-tas2781-i2c-y :=        tas2781_hda_i2c.o
-snd-hda-scodec-tas2781-spi-y :=        tas2781_hda_spi.o
-
-# codec drivers
-obj-$(CONFIG_SND_HDA_GENERIC) += snd-hda-codec-generic.o
-obj-$(CONFIG_SND_HDA_CODEC_REALTEK) += snd-hda-codec-realtek.o
-obj-$(CONFIG_SND_HDA_CODEC_CMEDIA) += snd-hda-codec-cmedia.o
-obj-$(CONFIG_SND_HDA_CODEC_ANALOG) += snd-hda-codec-analog.o
-obj-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += snd-hda-codec-idt.o
-obj-$(CONFIG_SND_HDA_CODEC_SI3054) += snd-hda-codec-si3054.o
-obj-$(CONFIG_SND_HDA_CODEC_CIRRUS) += snd-hda-codec-cirrus.o
-obj-$(CONFIG_SND_HDA_CODEC_CS8409) += snd-hda-codec-cs8409.o
-obj-$(CONFIG_SND_HDA_CODEC_CA0110) += snd-hda-codec-ca0110.o
-obj-$(CONFIG_SND_HDA_CODEC_CA0132) += snd-hda-codec-ca0132.o
-obj-$(CONFIG_SND_HDA_CODEC_CONEXANT) += snd-hda-codec-conexant.o
-obj-$(CONFIG_SND_HDA_CODEC_SENARYTECH) += snd-hda-codec-senarytech.o
-obj-$(CONFIG_SND_HDA_CODEC_VIA) += snd-hda-codec-via.o
-obj-$(CONFIG_SND_HDA_CODEC_HDMI) += snd-hda-codec-hdmi.o
-
-# side codecs
-obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC) += snd-hda-cirrus-scodec.o
-obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC_KUNIT_TEST) += snd-hda-cirrus-scodec-test.o
-obj-$(CONFIG_SND_HDA_SCODEC_CS35L41) += snd-hda-scodec-cs35l41.o
-obj-$(CONFIG_SND_HDA_SCODEC_CS35L41_I2C) += snd-hda-scodec-cs35l41-i2c.o
-obj-$(CONFIG_SND_HDA_SCODEC_CS35L41_SPI) += snd-hda-scodec-cs35l41-spi.o
-obj-$(CONFIG_SND_HDA_SCODEC_CS35L56) += snd-hda-scodec-cs35l56.o
-obj-$(CONFIG_SND_HDA_SCODEC_CS35L56_I2C) += snd-hda-scodec-cs35l56-i2c.o
-obj-$(CONFIG_SND_HDA_SCODEC_CS35L56_SPI) += snd-hda-scodec-cs35l56-spi.o
-obj-$(CONFIG_SND_HDA_SCODEC_COMPONENT) += snd-hda-scodec-component.o
-obj-$(CONFIG_SND_HDA_SCODEC_TAS2781) += snd-hda-scodec-tas2781.o
-obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_I2C) += snd-hda-scodec-tas2781-i2c.o
-obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_SPI) += snd-hda-scodec-tas2781-spi.o