All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: [PATCH] hw/usb: Introduce Kconfig switches for the CCID card devices
Date: Tue, 10 Dec 2019 08:20:48 +0100	[thread overview]
Message-ID: <20191210072048.15603-1-thuth@redhat.com> (raw)

In our downstream distribution of QEMU, we need more fine-grained
control on the set of CCID card devices that we want to include.
So let's introduce some proper Kconfig switches that it is easier
to disable them without modifying the corresponding Makefile.objs.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/usb/Kconfig       | 10 ++++++++++
 hw/usb/Makefile.objs |  7 +++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index 555e09377b..1358847eba 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -96,3 +96,13 @@ config USB_STORAGE_MTP
     bool
     default y
     depends on USB
+
+config CCID_PASSTHRU
+    bool
+    default y
+    depends on USB_SMARTCARD
+
+config CCID_EMULATED
+    bool
+    default y
+    depends on USB_SMARTCARD
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 303ac084a0..ebe103fb3d 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -29,11 +29,14 @@ common-obj-$(CONFIG_USB_BLUETOOTH)    += dev-bluetooth.o
 
 ifeq ($(CONFIG_USB_SMARTCARD),y)
 common-obj-y                          += dev-smartcard-reader.o
-common-obj-$(CONFIG_SMARTCARD)        += smartcard.mo
-smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o
+ifeq ($(CONFIG_SMARTCARD),y)
+common-obj-$(call lor,$(CONFIG_CCID_PASSTHRU),$(CONFIG_CCID_EMULATED)) += smartcard.mo
+smartcard.mo-objs := $(call lif,$(CONFIG_CCID_PASSTHRU),ccid-card-passthru.o) \
+                     $(call lif,$(CONFIG_CCID_EMULATED),ccid-card-emulated.o)
 smartcard.mo-cflags := $(SMARTCARD_CFLAGS)
 smartcard.mo-libs := $(SMARTCARD_LIBS)
 endif
+endif
 
 ifeq ($(CONFIG_POSIX),y)
 common-obj-$(CONFIG_USB_STORAGE_MTP)  += dev-mtp.o
-- 
2.18.1



             reply	other threads:[~2019-12-10  7:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10  7:20 Thomas Huth [this message]
2019-12-10  7:43 ` [PATCH] hw/usb: Introduce Kconfig switches for the CCID card devices Philippe Mathieu-Daudé
2019-12-10  8:11   ` Thomas Huth
2019-12-10 13:27     ` Philippe Mathieu-Daudé
2019-12-10 13:32       ` Paolo Bonzini

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=20191210072048.15603-1-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.