[PATCH v2 05/10] Kconfig: add AUDIO dependency to audio-related devices

Sergei Heifetz posted 10 patches 1 month, 2 weeks ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Richard Henderson <richard.henderson@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH v2 05/10] Kconfig: add AUDIO dependency to audio-related devices
Posted by Sergei Heifetz 1 month, 2 weeks ago
The idea of the `--disable-audio` option is to stop building audio-related
source files. Although this is not yet implemented, we can already make
the existing AUDIO Kconfig option a dependency for a number of devices so
that the build does not break when we remove `audio/` and other sources.

Note that some machines have embedded audio devices and therefore cannot
be used with `--disable-audio` at all. `-audio none` should be used for
such machines if audio needs to be muted.

The only device that is purposefully not included in this patch is PCSPK
(PC speaker), because its code has already been modified to work with
`--disable-audio`.

Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 hw/audio/Kconfig | 21 ++++++++++++---------
 hw/usb/Kconfig   |  2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
index daf060e1be..0479818e3f 100644
--- a/hw/audio/Kconfig
+++ b/hw/audio/Kconfig
@@ -1,37 +1,37 @@
 config SB16
     bool
     default y
-    depends on ISA_BUS
+    depends on ISA_BUS && AUDIO
 
 config ES1370
     bool
     default y if PCI_DEVICES
-    depends on PCI
+    depends on PCI && AUDIO
 
 config AC97
     bool
     default y if PCI_DEVICES
-    depends on PCI
+    depends on PCI && AUDIO
 
 config ADLIB
     bool
     default y
-    depends on ISA_BUS
+    depends on ISA_BUS && AUDIO
 
 config GUS
     bool
     default y
-    depends on ISA_BUS
+    depends on ISA_BUS && AUDIO
 
 config CS4231A
     bool
     default y
-    depends on ISA_BUS
+    depends on ISA_BUS && AUDIO
 
 config HDA
     bool
     default y if PCI_DEVICES
-    depends on PCI
+    depends on PCI && AUDIO
 
 config PCSPK
     bool
@@ -40,18 +40,21 @@ config PCSPK
 
 config WM8750
     bool
-    depends on I2C
+    depends on I2C && AUDIO
 
 config PL041
     bool
+    depends on AUDIO
 
 config CS4231
     bool
+    depends on AUDIO
 
 config ASC
     bool
+    depends on AUDIO
 
 config VIRTIO_SND
     bool
     default y
-    depends on VIRTIO
+    depends on VIRTIO && AUDIO
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index de95686720..e370585892 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -98,7 +98,7 @@ config USB_STORAGE_UAS
 config USB_AUDIO
     bool
     default y
-    depends on USB
+    depends on USB && AUDIO
 
 config USB_SERIAL
     bool
-- 
2.34.1
Re: [PATCH v2 05/10] Kconfig: add AUDIO dependency to audio-related devices
Posted by Marc-André Lureau 1 month, 2 weeks ago
On Mon, Feb 23, 2026 at 9:26 PM Sergei Heifetz <heifetz@yandex-team.com> wrote:
>
> The idea of the `--disable-audio` option is to stop building audio-related
> source files. Although this is not yet implemented, we can already make
> the existing AUDIO Kconfig option a dependency for a number of devices so
> that the build does not break when we remove `audio/` and other sources.
>
> Note that some machines have embedded audio devices and therefore cannot
> be used with `--disable-audio` at all. `-audio none` should be used for
> such machines if audio needs to be muted.
>
> The only device that is purposefully not included in this patch is PCSPK
> (PC speaker), because its code has already been modified to work with
> `--disable-audio`.
>
> Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  hw/audio/Kconfig | 21 ++++++++++++---------
>  hw/usb/Kconfig   |  2 +-
>  2 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
> index daf060e1be..0479818e3f 100644
> --- a/hw/audio/Kconfig
> +++ b/hw/audio/Kconfig
> @@ -1,37 +1,37 @@
>  config SB16
>      bool
>      default y
> -    depends on ISA_BUS
> +    depends on ISA_BUS && AUDIO
>
>  config ES1370
>      bool
>      default y if PCI_DEVICES
> -    depends on PCI
> +    depends on PCI && AUDIO
>
>  config AC97
>      bool
>      default y if PCI_DEVICES
> -    depends on PCI
> +    depends on PCI && AUDIO
>
>  config ADLIB
>      bool
>      default y
> -    depends on ISA_BUS
> +    depends on ISA_BUS && AUDIO
>
>  config GUS
>      bool
>      default y
> -    depends on ISA_BUS
> +    depends on ISA_BUS && AUDIO
>
>  config CS4231A
>      bool
>      default y
> -    depends on ISA_BUS
> +    depends on ISA_BUS && AUDIO
>
>  config HDA
>      bool
>      default y if PCI_DEVICES
> -    depends on PCI
> +    depends on PCI && AUDIO
>
>  config PCSPK
>      bool
> @@ -40,18 +40,21 @@ config PCSPK
>
>  config WM8750
>      bool
> -    depends on I2C
> +    depends on I2C && AUDIO
>
>  config PL041
>      bool
> +    depends on AUDIO
>
>  config CS4231
>      bool
> +    depends on AUDIO
>
>  config ASC
>      bool
> +    depends on AUDIO
>
>  config VIRTIO_SND
>      bool
>      default y
> -    depends on VIRTIO
> +    depends on VIRTIO && AUDIO
> diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
> index de95686720..e370585892 100644
> --- a/hw/usb/Kconfig
> +++ b/hw/usb/Kconfig
> @@ -98,7 +98,7 @@ config USB_STORAGE_UAS
>  config USB_AUDIO
>      bool
>      default y
> -    depends on USB
> +    depends on USB && AUDIO
>
>  config USB_SERIAL
>      bool
> --
> 2.34.1
>
>


--
Marc-André Lureau