Received: from eggs.gnu.org ([2001:4830:134:3::10]:59579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHwuV-0000jF-0U for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:34:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHwuS-00037h-G0 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:34:54 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHwuS-00037d-96 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:34:52 -0400 Received: by mail-wm0-x241.google.com with SMTP id a66so7650426wme.2 for ; Tue, 28 Jun 2016 10:34:52 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 28 Jun 2016 19:33:46 +0200 Message-Id: <1467135242-874-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1467135242-874-1-git-send-email-pbonzini@redhat.com> References: <1467135242-874-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 16/32] MC146818 RTC: add GPIO access to output IRQ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Efimov Vasily From: Efimov Vasily The MC146818 RTC device has output IRQ line. Currently the corresponding field is only accessible through direct access. Such access violates Qemu model. The patch makes the field accessible through GPIO. It also updates the setting of the IRQ during initialization. Signed-off-by: Efimov Vasily Signed-off-by: Paolo Bonzini --- hw/timer/mc146818rtc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index f4e333e..ea625f2 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -906,6 +906,8 @@ static void rtc_realizefn(DeviceState *dev, Error **errp) object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(s), "date", NULL); + + qdev_init_gpio_out(dev, &s->irq, 1); } ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) @@ -920,9 +922,9 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) qdev_prop_set_int32(dev, "base_year", base_year); qdev_init_nofail(dev); if (intercept_irq) { - s->irq = intercept_irq; + qdev_connect_gpio_out(dev, 0, intercept_irq); } else { - isa_init_irq(isadev, &s->irq, RTC_ISA_IRQ); + isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ); } QLIST_INSERT_HEAD(&rtc_devices, s, link); -- 2.7.4