From patchwork Mon Aug 31 10:27:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 32620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id AAA37B7087 for ; Mon, 31 Aug 2009 20:35:01 +1000 (EST) Received: from localhost ([127.0.0.1]:44742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mi4Du-0007Zq-BP for incoming@patchwork.ozlabs.org; Mon, 31 Aug 2009 06:34:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mi47A-0005ID-FN for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mi474-0005ED-OZ for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:55 -0400 Received: from [199.232.76.173] (port=56575 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mi474-0005EA-Jq for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10844) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mi474-0003VU-45 for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:50 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7VARn2I008033 for ; Mon, 31 Aug 2009 06:27:49 -0400 Received: from zweiblum.home.kraxel.org (vpn2-8-244.ams2.redhat.com [10.36.8.244]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n7VARl0l012241; Mon, 31 Aug 2009 06:27:47 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 385CB700E3; Mon, 31 Aug 2009 12:27:39 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 31 Aug 2009 12:27:36 +0200 Message-Id: <1251714459-2467-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1251714459-2467-1-git-send-email-kraxel@redhat.com> References: <1251714459-2467-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/5] qdev: add audio capability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org ... and tag sound drivers (well, only the pci ones as the others are not yet converted to qdev). Signed-off-by: Gerd Hoffmann --- hw/ac97.c | 1 + hw/es1370.c | 1 + hw/qdev.c | 1 + hw/qdev.h | 4 +++- 4 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index 610ca60..cceb66b 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -1350,6 +1350,7 @@ static PCIDeviceInfo ac97_info = { .qdev.name = "AC97", .qdev.desc = "Intel 82801AA AC97 Audio", .qdev.size = sizeof (AC97LinkState), + .qdev.caps = DEV_CAP_AUDIO, .init = ac97_initfn, }; diff --git a/hw/es1370.c b/hw/es1370.c index 9071a48..2dfec15 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -1046,6 +1046,7 @@ static PCIDeviceInfo es1370_info = { .qdev.name = "ES1370", .qdev.desc = "ENSONIQ AudioPCI ES1370", .qdev.size = sizeof (ES1370State), + .qdev.caps = DEV_CAP_AUDIO, .init = es1370_initfn, }; diff --git a/hw/qdev.c b/hw/qdev.c index 0d21152..760efd4 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name) static int qdev_print_devinfo(DeviceInfo *info, char *dest, int len) { static const char *capname[] = { + [ DEV_CAP_BIT_AUDIO ] = "audio", }; const char *sep; int pos = 0; diff --git a/hw/qdev.h b/hw/qdev.h index 3d07a24..ef05903 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -103,9 +103,11 @@ typedef void (*SCSIAttachFn)(DeviceState *host, BlockDriverState *bdrv, int unit); enum DeviceCapBits { - dummy + DEV_CAP_BIT_AUDIO = 0, }; +#define DEV_CAP_AUDIO (1 << DEV_CAP_BIT_AUDIO) + struct DeviceInfo { const char *name; const char *alias;