From patchwork Wed Aug 23 19:37:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Parker X-Patchwork-Id: 9918227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 76175602CB for ; Wed, 23 Aug 2017 19:38:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6862C28A23 for ; Wed, 23 Aug 2017 19:38:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6713C28A35; Wed, 23 Aug 2017 19:38:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id E95EE28A23 for ; Wed, 23 Aug 2017 19:38:42 +0000 (UTC) Received: from localhost ([::1]:45416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkbUA-0006di-3E for patchwork-qemu-devel@patchwork.kernel.org; Wed, 23 Aug 2017 15:38:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkbT9-0006c2-My for qemu-devel@nongnu.org; Wed, 23 Aug 2017 15:37:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkbT4-0008Sz-HK for qemu-devel@nongnu.org; Wed, 23 Aug 2017 15:37:39 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34882) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkbT4-0008Qx-AC for qemu-devel@nongnu.org; Wed, 23 Aug 2017 15:37:34 -0400 Received: by mail-wm0-x244.google.com with SMTP id x79so551329wma.2 for ; Wed, 23 Aug 2017 12:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lMMHSEtZlMRarvrzAjiYxpQeE70ZWGG4Zv++gaYV1uE=; b=O8ix5oW3wfMbyqKsk5s1D4mHV+CHcGK1kZGB+UidFv4eDsh43XKWvhKjj1xw8nJuYQ vgi3JGHHdEaulToGsHeqevOelcCKtq0FgHW9wIPMKCZFc6Y1G3PZy9XxpLChj2ZH7n3y 7I2qwi1J/0gWHSC3E2nb8LdALL3gFeOeW7mRLzBYQim0Gd3kMuO+ovVCebUa6OsdPnRx VxZRLbQfhR5ZlaLtdZzXop6+v+KwEeJHSEm9BEqigRPRLRzt20iRgkoIUtcWl8TLm9TI 9k0eGoeInVPjuBZazswD+69aL0FM/k81jH/dXvChulbi7FwaT5Ox5P2ZrT9nO51k6fNt wYQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lMMHSEtZlMRarvrzAjiYxpQeE70ZWGG4Zv++gaYV1uE=; b=hC1vr75nKqdA+EjUyk7UueFsEWj8KuqSXiYFv7U9yBHtS2wZ7DbPAHDfDWlzgOzlIC W1hNOeaREjaaIf9AHLgNgT6qV/xtwQSLgDfc8kci0fAprus4KdgC9wLcOdqAxYTUh76l RhdrJUPPV/lM8reWQn05HfHMTB9iL6qLDczOJSE9U95s68LpidbLdGfvjPvj8c2IR2WF i+XEpCCByunOvS1WDJYlo/4Zr9Q1GRji1cr9Ew8vTximUFDh1FkwUOIcEdTqB02BI/1a ttelC1Dq83i7GwzBfX0Zff+0BBAPVnsUCYT3fF2dxFZ5y2PxSc8W3Rqvzp8kTQS80TUN 4OOA== X-Gm-Message-State: AHYfb5gXAEAp49T07yew7gDiv5qQNHqT5fpmF/hTT2yE9/bAYgiAu0iW Bl3Aly4dNFzDvUwF X-Received: by 10.28.229.196 with SMTP id c187mr2359288wmh.183.1503517051550; Wed, 23 Aug 2017 12:37:31 -0700 (PDT) Received: from solar.home (host81-147-83-176.range81-147.btcentralplus.com. [81.147.83.176]) by smtp.gmail.com with ESMTPSA id j16sm1830329wre.82.2017.08.23.12.37.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 12:37:30 -0700 (PDT) From: Matt Parker To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 20:37:03 +0100 Message-Id: <20170823193703.10808-1-mtparkr@gmail.com> X-Mailer: git-send-email 2.13.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v2] audio: intel-hda: do not use old_mmio accesses X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kraxel@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP intel-hda is currently using the old_mmio accessors for io. This updates the device to use .read and .write accessors instead. Signed-off-by: Matt Parker --- hw/audio/intel-hda.c | 57 +++++++++------------------------------------------- 1 file changed, 10 insertions(+), 47 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 06acc98f7b..95e3e460fb 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -1043,66 +1043,29 @@ static void intel_hda_regs_reset(IntelHDAState *d) /* --------------------------------------------------------------------- */ -static void intel_hda_mmio_writeb(void *opaque, hwaddr addr, uint32_t val) +static void intel_hda_mmio_write(void *opaque, hwaddr addr, uint64_t val, + unsigned size) { IntelHDAState *d = opaque; const IntelHDAReg *reg = intel_hda_reg_find(d, addr); - intel_hda_reg_write(d, reg, val, 0xff); + intel_hda_reg_write(d, reg, val, (1UL << (size * 8)) - 1); } -static void intel_hda_mmio_writew(void *opaque, hwaddr addr, uint32_t val) +static uint64_t intel_hda_mmio_read(void *opaque, hwaddr addr, unsigned size) { IntelHDAState *d = opaque; const IntelHDAReg *reg = intel_hda_reg_find(d, addr); - intel_hda_reg_write(d, reg, val, 0xffff); -} - -static void intel_hda_mmio_writel(void *opaque, hwaddr addr, uint32_t val) -{ - IntelHDAState *d = opaque; - const IntelHDAReg *reg = intel_hda_reg_find(d, addr); - - intel_hda_reg_write(d, reg, val, 0xffffffff); -} - -static uint32_t intel_hda_mmio_readb(void *opaque, hwaddr addr) -{ - IntelHDAState *d = opaque; - const IntelHDAReg *reg = intel_hda_reg_find(d, addr); - - return intel_hda_reg_read(d, reg, 0xff); -} - -static uint32_t intel_hda_mmio_readw(void *opaque, hwaddr addr) -{ - IntelHDAState *d = opaque; - const IntelHDAReg *reg = intel_hda_reg_find(d, addr); - - return intel_hda_reg_read(d, reg, 0xffff); -} - -static uint32_t intel_hda_mmio_readl(void *opaque, hwaddr addr) -{ - IntelHDAState *d = opaque; - const IntelHDAReg *reg = intel_hda_reg_find(d, addr); - - return intel_hda_reg_read(d, reg, 0xffffffff); + return intel_hda_reg_read(d, reg, (1UL << (size * 8)) - 1); } static const MemoryRegionOps intel_hda_mmio_ops = { - .old_mmio = { - .read = { - intel_hda_mmio_readb, - intel_hda_mmio_readw, - intel_hda_mmio_readl, - }, - .write = { - intel_hda_mmio_writeb, - intel_hda_mmio_writew, - intel_hda_mmio_writel, - }, + .read = intel_hda_mmio_read, + .write = intel_hda_mmio_write, + .impl = { + .min_access_size = 1, + .max_access_size = 4, }, .endianness = DEVICE_NATIVE_ENDIAN, };