From patchwork Mon Jan 9 09:17:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20100C677F1 for ; Mon, 9 Jan 2023 09:19:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEoI9-0000tp-4f; Mon, 09 Jan 2023 04:18:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEoI7-0000tG-MG for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:03 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEoI6-0002eA-9b for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:03 -0500 Received: by mail-wm1-x329.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso6092223wmq.1 for ; Mon, 09 Jan 2023 01:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c2cB7vWK6nvcfVvDDHq7Sg6wZOh1lh47LPsFPMyP2dk=; b=KLm7kZ8G8vE7lZqRcJg9lazSk5ZG4LsYUGNHKLA8tg8KjCpzedTvZq2/KmgK3nFq+j 9HouMnhOS/r9w5GE6eksHnOnCJbQTQ+HmC75fAVA3SYyCJqxO3Imy3z6pZb/IlI+4mkU QL3iRwQn/LVEfCBmMiTOMiERCYiua6jdSzwQvMj311jyD2KZS/e/x8n5pdJxNgcONvyJ 5BhXwVKQ5Rp4U5ikZXa/jzBiVv1wpiETmTr4a8b52hyy8fbNd8hjP+jNSvJQ7Pzbnrrz Aebj3H/v0M5H9ojPKT2s5TrO8xZ51LqfhOyLiag4o3SvgOyqq0evnEXCMdkLolcwj5CD qATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c2cB7vWK6nvcfVvDDHq7Sg6wZOh1lh47LPsFPMyP2dk=; b=WyfvID6J8/swGwOUhMZaiVXr43vh8HNrKlGetYFQYtYASURp2KlA3SvBmwZq5OopLP DL2Lo/vk8AaWu0BqqIs+UkynhAUXLgMcSHX1RMtaKxIUARpZTACNWHk+uwSEvFOp5QcM lcow4AuCdrzeIIJKOOgcdzr+xonD71ByLodZhz7nO5UPPwK3vq2cnesClqUi7dpblcOP v/uUMzG7T8UJkubCOcI6f1UTeb3ldTcEv6XJ/vBqi35USvEi6H+SvohbyRF3gMWZVNO5 mxmQqzl/X+SljIgtzyxe+IvYFaRg3lLFPOVOb+JGMdHA0k113rIM0BHrV/LY2jI3SX8P 5IHw== X-Gm-Message-State: AFqh2kpVqyIBGdnf+YbFyIhcPSgQCNCZKKQxMbThcy1+wL1Z++mluAhc LVfj4esj1hCWqL1o/6ce5PiHsWSwk/OsqhPG X-Google-Smtp-Source: AMrXdXtXU00iiFH8phX+w7HXNFupFdsGoveCXpmtvA0XJ3rPK8rzRJCR3j+uyoT73/SHRPoENXbo2A== X-Received: by 2002:a05:600c:798:b0:3d3:5737:3b0f with SMTP id z24-20020a05600c079800b003d357373b0fmr55841636wmo.36.1673255880593; Mon, 09 Jan 2023 01:18:00 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bg23-20020a05600c3c9700b003d1de805de5sm11955431wmb.16.2023.01.09.01.17.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 01:18:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] hw/i2c/versatile_i2c: Drop useless casts from void * to pointer Date: Mon, 9 Jan 2023 10:17:50 +0100 Message-Id: <20230109091754.79499-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109091754.79499-1-philmd@linaro.org> References: <20230109091754.79499-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i2c/versatile_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index 3a04ba3969..52a650f45e 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -45,7 +45,7 @@ REG32(CONTROL_CLR, 4) static uint64_t versatile_i2c_read(void *opaque, hwaddr offset, unsigned size) { - VersatileI2CState *s = (VersatileI2CState *)opaque; + VersatileI2CState *s = opaque; switch (offset) { case A_CONTROL_SET: @@ -60,7 +60,7 @@ static uint64_t versatile_i2c_read(void *opaque, hwaddr offset, static void versatile_i2c_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { - VersatileI2CState *s = (VersatileI2CState *)opaque; + VersatileI2CState *s = opaque; switch (offset) { case A_CONTROL_SET: From patchwork Mon Jan 9 09:17:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38A99C5479D for ; Mon, 9 Jan 2023 09:31:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEoIH-0000xM-Hr; Mon, 09 Jan 2023 04:18:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEoID-0000vA-9P for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:10 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEoIA-0002kG-Qg for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:08 -0500 Received: by mail-wr1-x435.google.com with SMTP id r2so7459647wrv.7 for ; Mon, 09 Jan 2023 01:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OIe7Y6R4ZGYTW1AgsVF/JtMshtc/HMe6xazQxLy6+Ac=; b=xSR5saynuC3VTXQ4y7L+weOHfsYJEuC1wJ91CRxG0aTNTheGzmqlgeXoy+gxc0p7RK DfxtB+1pccm1mmYYecT9I3dbI6kCLC5KxoHPC+uBsv8W35+ZxkgQl73dHoRnlwoVGhQ4 FH+Wn8Zsl7mvrK+Jq440iVNlRHYLw3MwpA10AWt2qic3Zs+Hk95FQaASpEQVkgsKc+nf Rd7rsTAbRW0K0jQa4dBdpK0vCIT3LKOvu3Rzf7ZXtjrcq60ogFtnUfIMvTlNiqbM1m51 vsMZs1pTtl9SyDIUYL/Uugteh+iQn9tkzWLrm/8lXrDeCTiCtJ+3wHeTs9dwqF5Y9V51 XSsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OIe7Y6R4ZGYTW1AgsVF/JtMshtc/HMe6xazQxLy6+Ac=; b=GcPsZTXaFkqmM2JeZra8kaJg0J5MZcjLA1dtPP8zpawtsnUyOqxYdvTMLrqCr+3zls yKqSd+Uec6gdSsFFo/S7cLzY1qopBF54egagoXtjx5swgBAvKw3M+6C0vuzBT8TZvmvL fNp3sR9vqWvhNIhwHHEsFQi0oWxbL6RDZz2pBFbIIWIhaIaCuUwkMGZJkwp/XOZZ7gav bKWk0PNxCG7RvcEcRnDzM1G4YeHDggA7Dn1Z3G00GJlyvUVB3ltWW8e3oXuMp7+UEBk5 KLFrZXKmzFzSIbqM6HMaRgyROhc9H7eQhjqV5eBfHlU6ADHf+bHvbdQ0gSxSZLy21GG0 GtXg== X-Gm-Message-State: AFqh2kpkB4tlb7O6pVUTY3GKpKVzkfE9I7khJKyyPOtTbFf0m50RkxVI I6TraeAXJm+AdugZoMmM2dC2eOhE2zvMBVEH X-Google-Smtp-Source: AMrXdXtJRG6W6GiUiWwgnLlqRrWpTeQK7T/BCWxPbhMAmQiIffVtwR1SvDpdj22MWvBamdv02Cb4dg== X-Received: by 2002:adf:cf11:0:b0:242:6777:de38 with SMTP id o17-20020adfcf11000000b002426777de38mr39891631wrj.10.1673255885267; Mon, 09 Jan 2023 01:18:05 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id q11-20020adf9dcb000000b00268aae5fb5bsm8124614wre.3.2023.01.09.01.18.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 01:18:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] hw/i2c/versatile_i2c: Replace VersatileI2CState -> ArmSbconI2CState Date: Mon, 9 Jan 2023 10:17:51 +0100 Message-Id: <20230109091754.79499-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109091754.79499-1-philmd@linaro.org> References: <20230109091754.79499-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In order to rename TYPE_VERSATILE_I2C as TYPE_ARM_SBCON_I2C (the formal ARM naming), start renaming its state. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i2c/versatile_i2c.c | 10 +++++----- include/hw/i2c/arm_sbcon_i2c.h | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index 52a650f45e..ee095762e5 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -30,7 +30,7 @@ #include "qom/object.h" typedef ArmSbconI2CState VersatileI2CState; -DECLARE_INSTANCE_CHECKER(VersatileI2CState, VERSATILE_I2C, +DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, VERSATILE_I2C, TYPE_VERSATILE_I2C) @@ -45,7 +45,7 @@ REG32(CONTROL_CLR, 4) static uint64_t versatile_i2c_read(void *opaque, hwaddr offset, unsigned size) { - VersatileI2CState *s = opaque; + ArmSbconI2CState *s = opaque; switch (offset) { case A_CONTROL_SET: @@ -60,7 +60,7 @@ static uint64_t versatile_i2c_read(void *opaque, hwaddr offset, static void versatile_i2c_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { - VersatileI2CState *s = opaque; + ArmSbconI2CState *s = opaque; switch (offset) { case A_CONTROL_SET: @@ -86,7 +86,7 @@ static const MemoryRegionOps versatile_i2c_ops = { static void versatile_i2c_init(Object *obj) { DeviceState *dev = DEVICE(obj); - VersatileI2CState *s = VERSATILE_I2C(obj); + ArmSbconI2CState *s = VERSATILE_I2C(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); I2CBus *bus; @@ -100,7 +100,7 @@ static void versatile_i2c_init(Object *obj) static const TypeInfo versatile_i2c_info = { .name = TYPE_VERSATILE_I2C, .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(VersatileI2CState), + .instance_size = sizeof(ArmSbconI2CState), .instance_init = versatile_i2c_init, }; diff --git a/include/hw/i2c/arm_sbcon_i2c.h b/include/hw/i2c/arm_sbcon_i2c.h index f54d1e5413..0101422d9d 100644 --- a/include/hw/i2c/arm_sbcon_i2c.h +++ b/include/hw/i2c/arm_sbcon_i2c.h @@ -21,8 +21,7 @@ #define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C typedef struct ArmSbconI2CState ArmSbconI2CState; -DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, ARM_SBCON_I2C, - TYPE_ARM_SBCON_I2C) +DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, ARM_SBCON_I2C, TYPE_ARM_SBCON_I2C) struct ArmSbconI2CState { /*< private >*/ From patchwork Mon Jan 9 09:17:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 768D7C54EBD for ; Mon, 9 Jan 2023 09:32:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEoIJ-0000y5-O1; Mon, 09 Jan 2023 04:18:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEoII-0000xY-1A for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:14 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEoIF-0002mN-Bo for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:12 -0500 Received: by mail-wm1-x333.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so6086269wms.2 for ; Mon, 09 Jan 2023 01:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OifjLWkIiTpp4NzZ3D7HB/BxO662eTPuWGQeISpUJWM=; b=y95U5XbFCWMH4UqxWXs/nMeNNckTxjBw5GqzEhKQPhz4seP5+cFAG0pqzIo9ZJ4zs0 ilHmhIGE5yZ0bHOYFagl7O2tmUx4IzDa3xMSF8Yuptg9fgHyx19P3yu2vKV1yTkZsqPg 4njqe4X1UHpV8ygPQSgRJljrF6p/C/qwfiAMcs3GPlRn4/+KJJl0VERg9Hh7jOZspBzo Qi2/gDJ93kONkTHMVk3USBmq0Ey5Gss7o1VRGLGq5KgFC1cYw6PVaz7R0nDxDqa8q3C2 XXMTaxKPkxL0clu7Nc63uOLH5A29kSFLPmjFG5pGTNATtvJC2o11eSxAoq3lVEYwqUrJ wYug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OifjLWkIiTpp4NzZ3D7HB/BxO662eTPuWGQeISpUJWM=; b=mt0gKyuvDEu3ERWmTgk3XBcClkYYmOzqSlS0eZdFZtkQqHmI1ukcQK/wVDZ1tV1Fip j6rM6H+s1j6RaoaECNUTgP8Rm2smY8ZwisvR8beybNiSTiiQ1NjJXUIA9ZDyBdJcPjJ5 Mk/fuWcnwRnZkr6gRtkFSPF+TC5BAQPcc21NqQSlvfqCn1JEoE/tUmlH0SYAjUUcU9of IIGIsYCVUrl2GTJbUq7IHD2ppaS9YmXnY5VQmAh8ZsFHKwXuVc0JrxuDCFcMcD00v98L qfFBC2ep/mx0PZb/YmleFV0DvAGvNFfPMej1VQ6/a1haSNj+0aOGkgAPL+ZRKbbsofAc Cj6w== X-Gm-Message-State: AFqh2kofYaPMHaIvwqnCvCCJMXl9W/vbWG3eoKP82puqOzRpIH/b78g5 K0OZYRV/O/SUSnc1I0Tv0eWfG+ao5BLjGVWv X-Google-Smtp-Source: AMrXdXtrZ72blCJVqjEUB0SK8nNZ2olujCinE4MhXcIqiCBvKLO0hRKWBcgONjwNqUwxkofNQcYLnw== X-Received: by 2002:a05:600c:5022:b0:3c6:e61e:ae8c with SMTP id n34-20020a05600c502200b003c6e61eae8cmr55792568wmr.28.1673255889877; Mon, 09 Jan 2023 01:18:09 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id 2-20020a05600c228200b003d9e00dfccfsm8342334wmf.8.2023.01.09.01.18.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 01:18:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/5] hw/i2c/versatile_i2c: Replace TYPE_VERSATILE_I2C -> TYPE_ARM_SBCON_I2C Date: Mon, 9 Jan 2023 10:17:52 +0100 Message-Id: <20230109091754.79499-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109091754.79499-1-philmd@linaro.org> References: <20230109091754.79499-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/realview.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 2 +- hw/i2c/versatile_i2c.c | 4 ++-- include/hw/i2c/arm_sbcon_i2c.h | 3 +-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index d2dc8a8952..a5aa2f046a 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -309,7 +309,7 @@ static void realview_init(MachineState *machine, } } - dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL); + dev = sysbus_create_simple(TYPE_ARM_SBCON_I2C, 0x10002000, NULL); i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); i2c_slave_create_simple(i2c, "ds1338", 0x68); diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index ecc1f6cf74..e4fff668e2 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -336,7 +336,7 @@ static void versatile_init(MachineState *machine, int board_id) /* Add PL031 Real Time Clock. */ sysbus_create_simple("pl031", 0x101e8000, pic[10]); - dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL); + dev = sysbus_create_simple(TYPE_ARM_SBCON_I2C, 0x10002000, NULL); i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); i2c_slave_create_simple(i2c, "ds1338", 0x68); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e1d1983ae6..391199d458 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -646,7 +646,7 @@ static void vexpress_common_init(MachineState *machine) sysbus_create_simple("sp804", map[VE_TIMER01], pic[2]); sysbus_create_simple("sp804", map[VE_TIMER23], pic[3]); - dev = sysbus_create_simple(TYPE_VERSATILE_I2C, map[VE_SERIALDVI], NULL); + dev = sysbus_create_simple(TYPE_ARM_SBCON_I2C, map[VE_SERIALDVI], NULL); i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); i2c_slave_create_simple(i2c, "sii9022", 0x39); diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index ee095762e5..b95c70608b 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -31,7 +31,7 @@ typedef ArmSbconI2CState VersatileI2CState; DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, VERSATILE_I2C, - TYPE_VERSATILE_I2C) + TYPE_ARM_SBCON_I2C) @@ -98,7 +98,7 @@ static void versatile_i2c_init(Object *obj) } static const TypeInfo versatile_i2c_info = { - .name = TYPE_VERSATILE_I2C, + .name = TYPE_ARM_SBCON_I2C, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(ArmSbconI2CState), .instance_init = versatile_i2c_init, diff --git a/include/hw/i2c/arm_sbcon_i2c.h b/include/hw/i2c/arm_sbcon_i2c.h index 0101422d9d..da9b5e8f83 100644 --- a/include/hw/i2c/arm_sbcon_i2c.h +++ b/include/hw/i2c/arm_sbcon_i2c.h @@ -17,8 +17,7 @@ #include "hw/i2c/bitbang_i2c.h" #include "qom/object.h" -#define TYPE_VERSATILE_I2C "versatile_i2c" -#define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C +#define TYPE_ARM_SBCON_I2C "versatile_i2c" typedef struct ArmSbconI2CState ArmSbconI2CState; DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, ARM_SBCON_I2C, TYPE_ARM_SBCON_I2C) From patchwork Mon Jan 9 09:17:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58294C54EBD for ; Mon, 9 Jan 2023 09:20:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEoIO-0000zi-Tf; Mon, 09 Jan 2023 04:18:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEoIM-0000z8-SH for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:18 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEoIK-0002ov-2n for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:18 -0500 Received: by mail-wm1-x32f.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so6774331wml.0 for ; Mon, 09 Jan 2023 01:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XBZPNJwwwaWX0RjrF0KkQO4XpoIayE+6GXh3agPp5AU=; b=HThy/Od9Mw18GjYaLpxMrV0IBibiTJIH/JaBK0A/JuGRaNHin+DU8kmFzbfHDO0YN+ 7jIPVAfQk7CczHZ0wrmUezEpcsdXKchz3kU1xZHH5xq9X+hmrsa3HjuFGg2nXDuR1MT3 3KSySxx8WvUWBfJ71sEOlg8Saeao9kyKD+89EgYtXmiIgdKQFnI+uUIX3DSr8jFD9K3V YW7ukY+orZbwUmi3eELYgmfUSGhRGu5nOvQZt38diMysDx2cJy1yJABVQFQWjteSctmY 2LQHNAv1Gy35RPZsKj7fsMVEvUsuliOOYP3nJqbgDL0bFRc6XVubktlmW4HemYvtoW7N UA9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XBZPNJwwwaWX0RjrF0KkQO4XpoIayE+6GXh3agPp5AU=; b=sEQREgk2s90K87TC4atpSaHfSNeZxxjsGBkiEODEmiR9BDPLrFTVSK/oiAQmchsXdP trVVRtgII0/MeXP4hFdmqTwjGx13BNgXLO70GAABKVt7HOyFFUNATB4E1zyH4IOURUc0 9vakHH/PJjlOrr93NZdHxbAvjD6P9zh48pWZZJ+Tk/EBg4RduUUeeF9SIZP3C0LrsZvQ Qd6+qCeTiQro01m9qf480L9GIBvx0ksSiE72qqLf61Wa8/g6UwDUoJVLdqPKpkp17Mj1 XiaNy4bIub4aue/Nvd7uFsfXNMvlg7JjclcM1D/qkdtq4R7oiNGxWZoCBAf1M8lcRpsQ rpTQ== X-Gm-Message-State: AFqh2kpwq568l8aSAFtRS1riBbNnGJR2+wdtEUV33DUPvvJtSUwelBUa vj0tu9pEihUqgjuOYYcnD6//u5ZXDJZtcXw2 X-Google-Smtp-Source: AMrXdXuDrsfwH2tcylv6oI9mcj1wyAAxWANdkDTDmwCxYZ9GhWE9H/g7/T71ECTXVVBLiekHUyJ0Bg== X-Received: by 2002:a05:600c:1d89:b0:3d3:5cd6:781 with SMTP id p9-20020a05600c1d8900b003d35cd60781mr44990326wms.37.1673255894537; Mon, 09 Jan 2023 01:18:14 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bg24-20020a05600c3c9800b003cfa3a12660sm27714784wmb.1.2023.01.09.01.18.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 01:18:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/5] hw/i2c/versatile_i2c: Use ARM_SBCON_I2C() macro Date: Mon, 9 Jan 2023 10:17:53 +0100 Message-Id: <20230109091754.79499-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109091754.79499-1-philmd@linaro.org> References: <20230109091754.79499-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org ARM_SBCON_I2C() macro and ArmSbconI2CState typedef are already declared via the QOM DECLARE_INSTANCE_CHECKER() macro in "hw/i2c/arm_sbcon_i2c.h". Drop the VERSATILE_I2C declarations from versatile_i2c.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i2c/versatile_i2c.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index b95c70608b..d19df62265 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -29,11 +29,6 @@ #include "qemu/module.h" #include "qom/object.h" -typedef ArmSbconI2CState VersatileI2CState; -DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, VERSATILE_I2C, - TYPE_ARM_SBCON_I2C) - - REG32(CONTROL_GET, 0) REG32(CONTROL_SET, 0) @@ -86,7 +81,7 @@ static const MemoryRegionOps versatile_i2c_ops = { static void versatile_i2c_init(Object *obj) { DeviceState *dev = DEVICE(obj); - ArmSbconI2CState *s = VERSATILE_I2C(obj); + ArmSbconI2CState *s = ARM_SBCON_I2C(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); I2CBus *bus; From patchwork Mon Jan 9 09:17:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 886F0C54EBD for ; Mon, 9 Jan 2023 09:29:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEoIS-000115-GX; Mon, 09 Jan 2023 04:18:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEoIQ-00010a-Mk for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:22 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEoIO-0002pt-PV for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:18:22 -0500 Received: by mail-wm1-x329.google.com with SMTP id p3-20020a05600c1d8300b003d9ee5f125bso1993063wms.4 for ; Mon, 09 Jan 2023 01:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=miUjczJli4sjte3qvrNKZ22sCjWcBk4KGoFkszIvwKk=; b=nq5G4QrvABE1DYPK+SRCCjgQb1t1cliZ08cI2zck3TZBWCfR18K4xyNMl6ufCxqowx l7QL8Wsn3GRdyfpA9vZEX0zD0jvhQYkJEoPW19f6wE+0v4XGO4wWaLiw1WTqA7mEKk1L lAc8Nhu3MzWagAJn2KrazxAQMH0rycJ2PGq+w8EgGp9ttdmDAjnVXQnd6cblITq77hq0 nPkY8w9QaAyFYSvFe0phw4+/T/mHCDkQZCutojInCq7wzb+Tt5+LbuVMht/sd5lkv7BW u3JoIPGhOJODhxBgSwJ0dnO4E/PSjHb9y+4ja+BH4fLDzCPYpsA4XOxySwM1ukeshJNj 0rtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=miUjczJli4sjte3qvrNKZ22sCjWcBk4KGoFkszIvwKk=; b=vkjkvgaVfFukkTtB+D7OhDkosH+1tOcsZDY37GTElgByJ1iO5wx9/KGwe4lx3BOckB sbt4mOdqOcLwOILRWrPfzvHcsYdO8+mbmipMIPHbmn7VU1L1YlUnu11goQZUvlSHcDLG GvMXjSA6WFgqjkLkGQcka2lKmc77VYFi4QlGwlrSgz0y6oijRmkOmwM1TNFkq2AI8D6i lEa7RoJamW/CldSjMWlhvJZbqr3qXKO6Iq1v6+e3kyQLge43y74Ytwm2ULrYqRleYR5a 7xVqsjc6rNH1wEK/dlQlbKnhY6IwQI4NMNm+BE2NdZlTxgHntkx/kamBNLV3pu74IUU5 EQSg== X-Gm-Message-State: AFqh2kqEi7bvJv5U5b+Q32L7UJQKbAkZolYDolzcAGo0GxLGTmCBRB7p tFDhb3VU03ArOUg0i6kcN+t/WNNc1EYS4Ojq X-Google-Smtp-Source: AMrXdXubp4CtVJQ0k5E/IzSaqsB1u0IfOVEem90TZyMr0mQmTDawytI22cbKz/SSorq7hRPusArLVA== X-Received: by 2002:a05:600c:1e1d:b0:3cf:b07a:cd2f with SMTP id ay29-20020a05600c1e1d00b003cfb07acd2fmr44838537wmb.37.1673255899250; Mon, 09 Jan 2023 01:18:19 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e18-20020a05600c4e5200b003d9876aa04asm12699130wmq.41.2023.01.09.01.18.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 01:18:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/5] hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c Date: Mon, 9 Jan 2023 10:17:54 +0100 Message-Id: <20230109091754.79499-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109091754.79499-1-philmd@linaro.org> References: <20230109091754.79499-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This device model started with the Versatile board, named TYPE_VERSATILE_I2C, then ended up renamed TYPE_ARM_SBCON_I2C as per the official "ARM SBCon two-wire serial bus interface" description from: https://developer.arm.com/documentation/dui0440/b/programmer-s-reference/two-wire-serial-bus-interface--sbcon Use the latter name as a better description. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/Kconfig | 4 ++-- hw/i2c/Kconfig | 2 +- hw/i2c/{versatile_i2c.c => arm_sbcon_i2c.c} | 24 ++++++++++----------- hw/i2c/meson.build | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) rename hw/i2c/{versatile_i2c.c => arm_sbcon_i2c.c} (81%) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 17fcde8e1c..7db0ad7e8f 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -207,7 +207,7 @@ config REALVIEW select PL110 select PL181 # display select PL310 # cache controller - select VERSATILE_I2C + select ARM_SBCON_I2C select DS1338 # I2C RTC+NVRAM select USB_OHCI @@ -472,7 +472,7 @@ config MPS2 select SPLIT_IRQ select UNIMP select CMSDK_APB_WATCHDOG - select VERSATILE_I2C + select ARM_SBCON_I2C config FSL_IMX7 bool diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig index 9bb8870517..7ac9cadffa 100644 --- a/hw/i2c/Kconfig +++ b/hw/i2c/Kconfig @@ -14,7 +14,7 @@ config SMBUS_EEPROM bool select SMBUS -config VERSATILE_I2C +config ARM_SBCON_I2C bool select BITBANG_I2C diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/arm_sbcon_i2c.c similarity index 81% rename from hw/i2c/versatile_i2c.c rename to hw/i2c/arm_sbcon_i2c.c index d19df62265..979ccbe0ed 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/arm_sbcon_i2c.c @@ -37,7 +37,7 @@ REG32(CONTROL_CLR, 4) #define SCL BIT(0) #define SDA BIT(1) -static uint64_t versatile_i2c_read(void *opaque, hwaddr offset, +static uint64_t arm_sbcon_i2c_read(void *opaque, hwaddr offset, unsigned size) { ArmSbconI2CState *s = opaque; @@ -52,7 +52,7 @@ static uint64_t versatile_i2c_read(void *opaque, hwaddr offset, } } -static void versatile_i2c_write(void *opaque, hwaddr offset, +static void arm_sbcon_i2c_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { ArmSbconI2CState *s = opaque; @@ -72,13 +72,13 @@ static void versatile_i2c_write(void *opaque, hwaddr offset, s->in = bitbang_i2c_set(&s->bitbang, BITBANG_I2C_SDA, (s->out & SDA) != 0); } -static const MemoryRegionOps versatile_i2c_ops = { - .read = versatile_i2c_read, - .write = versatile_i2c_write, +static const MemoryRegionOps arm_sbcon_i2c_ops = { + .read = arm_sbcon_i2c_read, + .write = arm_sbcon_i2c_write, .endianness = DEVICE_NATIVE_ENDIAN, }; -static void versatile_i2c_init(Object *obj) +static void arm_sbcon_i2c_init(Object *obj) { DeviceState *dev = DEVICE(obj); ArmSbconI2CState *s = ARM_SBCON_I2C(obj); @@ -87,21 +87,21 @@ static void versatile_i2c_init(Object *obj) bus = i2c_init_bus(dev, "i2c"); bitbang_i2c_init(&s->bitbang, bus); - memory_region_init_io(&s->iomem, obj, &versatile_i2c_ops, s, + memory_region_init_io(&s->iomem, obj, &arm_sbcon_i2c_ops, s, "arm_sbcon_i2c", 0x1000); sysbus_init_mmio(sbd, &s->iomem); } -static const TypeInfo versatile_i2c_info = { +static const TypeInfo arm_sbcon_i2c_info = { .name = TYPE_ARM_SBCON_I2C, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(ArmSbconI2CState), - .instance_init = versatile_i2c_init, + .instance_init = arm_sbcon_i2c_init, }; -static void versatile_i2c_register_types(void) +static void arm_sbcon_i2c_register_types(void) { - type_register_static(&versatile_i2c_info); + type_register_static(&arm_sbcon_i2c_info); } -type_init(versatile_i2c_register_types) +type_init(arm_sbcon_i2c_register_types) diff --git a/hw/i2c/meson.build b/hw/i2c/meson.build index d3df273251..021bafc9f5 100644 --- a/hw/i2c/meson.build +++ b/hw/i2c/meson.build @@ -11,7 +11,7 @@ i2c_ss.add(when: 'CONFIG_MPC_I2C', if_true: files('mpc_i2c.c')) i2c_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('microbit_i2c.c')) i2c_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_smbus.c')) i2c_ss.add(when: 'CONFIG_SMBUS_EEPROM', if_true: files('smbus_eeprom.c')) -i2c_ss.add(when: 'CONFIG_VERSATILE_I2C', if_true: files('versatile_i2c.c')) +i2c_ss.add(when: 'CONFIG_ARM_SBCON_I2C', if_true: files('arm_sbcon_i2c.c')) i2c_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_i2c.c')) i2c_ss.add(when: 'CONFIG_PPC4XX', if_true: files('ppc4xx_i2c.c')) i2c_ss.add(when: 'CONFIG_PCA954X', if_true: files('i2c_mux_pca954x.c'))