From patchwork Sat Jan 30 01:01:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 8169261 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92D29BEEE5 for ; Sat, 30 Jan 2016 01:08:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0568420381 for ; Sat, 30 Jan 2016 01:08:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20C7020380 for ; Sat, 30 Jan 2016 01:08:37 +0000 (UTC) Received: from localhost ([::1]:37235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPK1k-0005By-Fo for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Jan 2016 20:08:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJxD-0005EB-Oo for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPJx8-00087O-Sn for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:55 -0500 Received: from mail-bl2nam02on0061.outbound.protection.outlook.com ([104.47.38.61]:7915 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJx8-000878-MU for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:50 -0500 Received: from BL2NAM02FT055.eop-nam02.prod.protection.outlook.com (10.152.76.54) by BL2NAM02HT229.eop-nam02.prod.protection.outlook.com (10.152.76.213) with Microsoft SMTP Server (TLS) id 15.1.355.15; Sat, 30 Jan 2016 01:03:49 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none; suse.de; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BL2NAM02FT055.mail.protection.outlook.com (10.152.77.126) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sat, 30 Jan 2016 01:03:48 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:45513 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aPJx5-0002No-Ln; Fri, 29 Jan 2016 17:03:47 -0800 Received: from [127.0.0.1] (port=52732 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aPJx5-0002uk-Gq; Fri, 29 Jan 2016 17:03:47 -0800 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u0U0wAcx022084; Fri, 29 Jan 2016 16:58:10 -0800 Received: from [172.19.74.182] (port=49994 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aPJx4-0002uh-M6; Fri, 29 Jan 2016 17:03:46 -0800 From: Alistair Francis To: , , Date: Fri, 29 Jan 2016 17:01:11 -0800 Message-ID: <98608591f3c29f7705d6cee5abed17876ed1ab0b.1454115217.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22054.006 X-TM-AS-Result: No--1.716-7.0-31-10 X-imss-scan-details: No--1.716-7.0-31-10 X-TMASE-MatchedRID: XSBgVm8tTncuomMkG8nx0hWCVBr+Ay98N25XIDQLt3bfUZT83lbkELlV chvAooLe7uKWKn2LBnuAMuqetGVetnyef22ep6XYxlblqLlYqXJcwD6H2lqmwVY8qe0f7GU836U r48q8IdfjhqN32GBHvTb4vG2ZCLJODLLs2qOCdOe0Iw1A4eAZuxriL3ljsNXgNJFDPuWiWeP+v9 v52ZIoWjoAf389xF3XFSk9HhUZnw7OGIWnws4LoyHWPYzouJUy X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(87936001)(5001960100002)(2950100001)(106466001)(1096002)(1220700001)(11100500001)(189998001)(50986999)(47776003)(85426001)(105606002)(71366001)(64026002)(5008740100001)(586003)(6806005)(5001770100001)(229853001)(48376002)(118296001)(4326007)(33646002)(5003600100002)(19580395003)(2906002)(5003940100001)(50226001)(50466002)(77096005)(3470700001)(36756003)(76176999)(92566002)(86362001)(2201001)(19580405001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT229; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8ea6d9c8-c896-4cdf-8d86-08d329113636 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT229; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(8121501046)(13023025)(13015025)(13024025)(5005006)(13018025)(3002001)(10201501046); SRVR:BL2NAM02HT229; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT229; X-Forefront-PRVS: 083751FCA6 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2016 01:03:48.8380 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT229 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.61 Cc: edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com, crosthwaitepeter@gmail.com, afaerber@suse.de, alistair.francis@xilinx.com Subject: [Qemu-devel] [PATCH v3 12/16] qdev: Add qdev_pass_all_gpios API X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Crosthwaite For passing all GPIOs of all names from a contained device to a container. Signed-off-by: Peter Crosthwaite Signed-off-by: Alistair Francis --- hw/core/qdev.c | 9 +++++++++ include/hw/qdev-core.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 57ce4e7..4cdba10 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -589,6 +589,15 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container, QLIST_INSERT_HEAD(&container->gpios, ngl, node); } +void qdev_pass_all_gpios(DeviceState *dev, DeviceState *container) +{ + NamedGPIOList *ngl; + + QLIST_FOREACH(ngl, &dev->gpios, node) { + qdev_pass_gpios(dev, container, ngl->name); + } +} + BusState *qdev_get_child_bus(DeviceState *dev, const char *name) { BusState *bus; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 0a09b8a..753673c 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -312,6 +312,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, void qdev_pass_gpios(DeviceState *dev, DeviceState *container, const char *name); +void qdev_pass_all_gpios(DeviceState *dev, DeviceState *container); BusState *qdev_get_parent_bus(DeviceState *dev);