[Qemu-devel] [PATCH 43/52] i2c: express dependencies with Kconfig

Paolo Bonzini posted 52 patches 7 years ago
Maintainers: Eduardo Habkost <ehabkost@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Palmer Dabbelt <palmer@sifive.com>, Max Filippov <jcmvbkbc@gmail.com>, Alistair Francis <alistair@alistair23.me>, Guan Xuetao <gxt@mprc.pku.edu.cn>, Max Reitz <mreitz@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Igor Mammedov <imammedo@redhat.com>, Aleksandar Markovic <amarkovic@wavecomp.com>, Fam Zheng <fam@euphon.net>, Cornelia Huck <cohuck@redhat.com>, Peter Crosthwaite <crosthwaite.peter@gmail.com>, Gerd Hoffmann <kraxel@redhat.com>, Aleksandar Rikalo <arikalo@wavecomp.com>, Corey Minyard <minyard@acm.org>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Alex Williamson <alex.williamson@redhat.com>, Alberto Garcia <berto@igalia.com>, Anthony Green <green@moxielogic.com>, Jason Wang <jasowang@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Richard Henderson <rth@twiddle.net>, Greg Kurz <groug@kaod.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Alistair Francis <Alistair.Francis@wdc.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Michael Clark <mjc@sifive.com>, Kevin Wolf <kwolf@redhat.com>, Chris Wulff <crwulff@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stafford Horne <shorne@gmail.com>, Michael Walle <michael@walle.cc>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, David Hildenbrand <david@redhat.com>, Marek Vasut <marex@denx.de>, Paolo Bonzini <pbonzini@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Peter Maydell <peter.maydell@linaro.org>, Halil Pasic <pasic@linux.ibm.com>, Stefan Berger <stefanb@linux.ibm.com>, John Snow <jsnow@redhat.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Christian Borntraeger <borntraeger@de.ibm.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Cleber Rosa <crosa@redhat.com>
There is a newer version of this series
[Qemu-devel] [PATCH 43/52] i2c: express dependencies with Kconfig
Posted by Paolo Bonzini 7 years ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-38-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 default-configs/i386-softmmu.mak | 2 --
 hw/Makefile.objs                 | 2 +-
 hw/audio/Kconfig                 | 1 +
 hw/display/Kconfig               | 3 +++
 hw/gpio/Kconfig                  | 1 +
 hw/i2c/Kconfig                   | 6 ++++++
 hw/i386/Kconfig                  | 1 +
 hw/input/Kconfig                 | 1 +
 hw/isa/Kconfig                   | 1 +
 hw/misc/Kconfig                  | 4 ++++
 hw/timer/Kconfig                 | 3 +++
 11 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 9eb9a5e..4aa04e4 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -22,8 +22,6 @@ CONFIG_NVDIMM=y
 CONFIG_ACPI_NVDIMM=y
 CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
-CONFIG_SMBUS_EEPROM=y
-CONFIG_I2C=y
 CONFIG_PCI_DEVICES=y
 
 # Boards:
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index e2fcd6a..225f6cc 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -10,7 +10,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += display/
 devices-dirs-$(CONFIG_SOFTMMU) += dma/
 devices-dirs-$(CONFIG_SOFTMMU) += gpio/
 devices-dirs-$(CONFIG_HYPERV) += hyperv/
-devices-dirs-$(CONFIG_SOFTMMU) += i2c/
+devices-dirs-$(CONFIG_I2C) += i2c/
 devices-dirs-$(CONFIG_SOFTMMU) += ide/
 devices-dirs-$(CONFIG_SOFTMMU) += input/
 devices-dirs-$(CONFIG_SOFTMMU) += intc/
diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
index 01aea55..e9c6fed 100644
--- a/hw/audio/Kconfig
+++ b/hw/audio/Kconfig
@@ -40,6 +40,7 @@ config PCSPK
 
 config WM8750
     bool
+    depends on I2C
 
 config PL041
     bool
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index 64a5764..66044ca 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -24,9 +24,11 @@ config PL110
 
 config SII9022
     bool
+    depends on I2C
 
 config SSD0303
     bool
+    depends on I2C
 
 config SSD0323
     bool
@@ -71,6 +73,7 @@ config MILKYMIST_TMU2
 
 config SM501
     bool
+    depends on I2C
 
 config TCX
     bool
diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig
index d0a4abf..9227cb5 100644
--- a/hw/gpio/Kconfig
+++ b/hw/gpio/Kconfig
@@ -1,5 +1,6 @@
 config MAX7310
     bool
+    depends on I2C
 
 config PL061
     bool
diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
index d6d4402..74c9328 100644
--- a/hw/i2c/Kconfig
+++ b/hw/i2c/Kconfig
@@ -3,18 +3,24 @@ config I2C
 
 config SMBUS_EEPROM
     bool
+    depends on I2C
 
 config DDC
     bool
+    depends on I2C
 
 config VERSATILE_I2C
     bool
+    select I2C
 
 config ACPI_SMBUS
     bool
+    select I2C
 
 config BITBANG_I2C
     bool
+    select I2C
 
 config IMX_I2C
     bool
+    select I2C
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 8814b7c..966c97c 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -27,6 +27,7 @@ config PC_ACPI
     select ACPI_X86
     select ACPI_CPU_HOTPLUG
     select ACPI_MEMORY_HOTPLUG
+    select SMBUS_EEPROM
     depends on ACPI_SMBUS
 
 config I440FX
diff --git a/hw/input/Kconfig b/hw/input/Kconfig
index bdb4237..ec014a9 100644
--- a/hw/input/Kconfig
+++ b/hw/input/Kconfig
@@ -3,6 +3,7 @@ config ADB
 
 config LM832X
     bool
+    depends on I2C
 
 config PCKBD
     bool
diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
index 6f0812d..fcd87b4 100644
--- a/hw/isa/Kconfig
+++ b/hw/isa/Kconfig
@@ -19,6 +19,7 @@ config PIIX4
 config VT82C686
     bool
     select ISA_BUS
+    select ACPI_SMBUS
 
 config SMC37C669
     bool
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index ca051fb..0680d1e 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -7,9 +7,11 @@ config MAX111X
 
 config TMP105
     bool
+    depends on I2C
 
 config TMP421
     bool
+    depends on I2C
 
 config ISA_DEBUG
     bool
@@ -34,6 +36,7 @@ config EDU
 
 config PCA9552
     bool
+    depends on I2C
 
 config PL310
     bool
@@ -100,3 +103,4 @@ config PVPANIC
 
 config AUX
     bool
+    select I2C
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index 7dbc121..e1a6e74 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -9,6 +9,7 @@ config A9_GTIMER
 
 config DS1338
     bool
+    depends on I2C
 
 config HPET
     bool
@@ -18,6 +19,7 @@ config I8254
 
 config M41T80
     bool
+    depends on I2C
 
 config M48T59
     bool
@@ -27,6 +29,7 @@ config PL031
 
 config TWL92230
     bool
+    depends on I2C
 
 config XLNX_ZYNQMP
     bool
-- 
1.8.3.1



Re: [Qemu-devel] [PATCH 43/52] i2c: express dependencies with Kconfig
Posted by Philippe Mathieu-Daudé 7 years ago
Hi Paolo,

On 1/25/19 11:07 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> Acked-by: Thomas Huth <thuth@redhat.com>
> Message-Id: <20190123065618.3520-38-yang.zhong@intel.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  default-configs/i386-softmmu.mak | 2 --
>  hw/Makefile.objs                 | 2 +-
>  hw/audio/Kconfig                 | 1 +
>  hw/display/Kconfig               | 3 +++
>  hw/gpio/Kconfig                  | 1 +
>  hw/i2c/Kconfig                   | 6 ++++++
>  hw/i386/Kconfig                  | 1 +
>  hw/input/Kconfig                 | 1 +
>  hw/isa/Kconfig                   | 1 +
>  hw/misc/Kconfig                  | 4 ++++
>  hw/timer/Kconfig                 | 3 +++
>  11 files changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index 9eb9a5e..4aa04e4 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -22,8 +22,6 @@ CONFIG_NVDIMM=y
>  CONFIG_ACPI_NVDIMM=y
>  CONFIG_PXB=y
>  CONFIG_ACPI_VMGENID=y
> -CONFIG_SMBUS_EEPROM=y
> -CONFIG_I2C=y
>  CONFIG_PCI_DEVICES=y
>  
>  # Boards:
> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> index e2fcd6a..225f6cc 100644
> --- a/hw/Makefile.objs
> +++ b/hw/Makefile.objs
> @@ -10,7 +10,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += display/
>  devices-dirs-$(CONFIG_SOFTMMU) += dma/
>  devices-dirs-$(CONFIG_SOFTMMU) += gpio/
>  devices-dirs-$(CONFIG_HYPERV) += hyperv/
> -devices-dirs-$(CONFIG_SOFTMMU) += i2c/
> +devices-dirs-$(CONFIG_I2C) += i2c/
>  devices-dirs-$(CONFIG_SOFTMMU) += ide/
>  devices-dirs-$(CONFIG_SOFTMMU) += input/
>  devices-dirs-$(CONFIG_SOFTMMU) += intc/
> diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig
> index 01aea55..e9c6fed 100644
> --- a/hw/audio/Kconfig
> +++ b/hw/audio/Kconfig
> @@ -40,6 +40,7 @@ config PCSPK
>  
>  config WM8750
>      bool
> +    depends on I2C
>  
>  config PL041
>      bool
> diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> index 64a5764..66044ca 100644
> --- a/hw/display/Kconfig
> +++ b/hw/display/Kconfig
> @@ -24,9 +24,11 @@ config PL110
>  
>  config SII9022
>      bool
> +    depends on I2C
>  
>  config SSD0303
>      bool
> +    depends on I2C
>  
>  config SSD0323
>      bool
> @@ -71,6 +73,7 @@ config MILKYMIST_TMU2
>  
>  config SM501
>      bool
> +    depends on I2C
>  
>  config TCX
>      bool
> diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig
> index d0a4abf..9227cb5 100644
> --- a/hw/gpio/Kconfig
> +++ b/hw/gpio/Kconfig
> @@ -1,5 +1,6 @@
>  config MAX7310
>      bool
> +    depends on I2C
>  
>  config PL061
>      bool
> diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
> index d6d4402..74c9328 100644
> --- a/hw/i2c/Kconfig
> +++ b/hw/i2c/Kconfig
> @@ -3,18 +3,24 @@ config I2C
>  
>  config SMBUS_EEPROM
>      bool
> +    depends on I2C


Can we have:

  config SMBUS
      bool
      select I2C

  config SMBUS_EEPROM
      bool
      select SMBUS

(or 'depends on')

>  
>  config DDC
>      bool
> +    depends on I2C
>  
>  config VERSATILE_I2C
>      bool
> +    select I2C
>  
>  config ACPI_SMBUS
>      bool
> +    select I2C

       select SMBUS

>  
>  config BITBANG_I2C
>      bool
> +    select I2C
>  
>  config IMX_I2C
>      bool
> +    select I2C
> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index 8814b7c..966c97c 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -27,6 +27,7 @@ config PC_ACPI
>      select ACPI_X86
>      select ACPI_CPU_HOTPLUG
>      select ACPI_MEMORY_HOTPLUG
> +    select SMBUS_EEPROM
>      depends on ACPI_SMBUS
>  
>  config I440FX
> diff --git a/hw/input/Kconfig b/hw/input/Kconfig
> index bdb4237..ec014a9 100644
> --- a/hw/input/Kconfig
> +++ b/hw/input/Kconfig
> @@ -3,6 +3,7 @@ config ADB
>  
>  config LM832X
>      bool
> +    depends on I2C
>  
>  config PCKBD
>      bool
> diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig
> index 6f0812d..fcd87b4 100644
> --- a/hw/isa/Kconfig
> +++ b/hw/isa/Kconfig
> @@ -19,6 +19,7 @@ config PIIX4
>  config VT82C686
>      bool
>      select ISA_BUS
> +    select ACPI_SMBUS
>  
>  config SMC37C669
>      bool
> diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
> index ca051fb..0680d1e 100644
> --- a/hw/misc/Kconfig
> +++ b/hw/misc/Kconfig
> @@ -7,9 +7,11 @@ config MAX111X
>  
>  config TMP105
>      bool
> +    depends on I2C
>  
>  config TMP421
>      bool
> +    depends on I2C
>  
>  config ISA_DEBUG
>      bool
> @@ -34,6 +36,7 @@ config EDU
>  
>  config PCA9552
>      bool
> +    depends on I2C
>  
>  config PL310
>      bool
> @@ -100,3 +103,4 @@ config PVPANIC
>  
>  config AUX
>      bool
> +    select I2C
> diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
> index 7dbc121..e1a6e74 100644
> --- a/hw/timer/Kconfig
> +++ b/hw/timer/Kconfig
> @@ -9,6 +9,7 @@ config A9_GTIMER
>  
>  config DS1338
>      bool
> +    depends on I2C
>  
>  config HPET
>      bool
> @@ -18,6 +19,7 @@ config I8254
>  
>  config M41T80
>      bool
> +    depends on I2C
>  
>  config M48T59
>      bool
> @@ -27,6 +29,7 @@ config PL031
>  
>  config TWL92230
>      bool
> +    depends on I2C
>  
>  config XLNX_ZYNQMP
>      bool
> 

Re: [Qemu-devel] [PATCH 43/52] i2c: express dependencies with Kconfig
Posted by Paolo Bonzini 7 years ago
On 31/01/19 23:10, Philippe Mathieu-Daudé wrote:
>   config SMBUS
>       bool
>       select I2C
> 
>   config SMBUS_EEPROM
>       bool
>       select SMBUS
> 
> (or 'depends on')

Sure.

Paolo