From patchwork Mon Jan 9 08:41:17 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: 640585 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2028710pvb; Mon, 9 Jan 2023 00:53:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvDDl9veFWkCr1HFkR+a+Ra/j6/JkHgVOqi4p/kt6d3LEH/dwWcVYmI9fmI6g4uyf3y0kF6 X-Received: by 2002:aed:27c2:0:b0:3ac:5748:54a0 with SMTP id m2-20020aed27c2000000b003ac574854a0mr7809071qtg.67.1673254438563; Mon, 09 Jan 2023 00:53:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673254438; cv=none; d=google.com; s=arc-20160816; b=sBwdGXsuUVC80atbWcfZvfmuzchHMmvLIZKDEnQ4UoRqQWP1VcsPI3SSzKeAfKn+bO P4Hvui+weBB0oNbrZ8lLuhx9ziWIKn51WjZSJii+d32K3qrREKC93XFOTjidPhYRRTt2 Hs3n36WxlG9LESMS8frH1MPwMdISFGFwBLDOKblQzRCcVZ7T5e3+0k2wlrtlkTz67PPQ trB5senyCKiIz9BYjSuRFvCtQsUYhuoLbndSLrUh50ryojozxwRFCFyItnhMSzgI5HDB C/eEEo7FmybZTKI6if/y2ONKhI0Gdoy8ASnfJsMXgkHlOyfttb5f53thQr76o7Q8KeMR dxXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HTqoT3kxPcjorZ3mugLt6fynVNQ3ed1VmFMT7P6iTBY=; b=fbOahD+RL0Yg+ht+q6VHT1tSstvu5f9A3eb0uOeF34SzpdNvxu/XRhJGhBAzIzLc22 OYcSOrgQLwgpBfHXmdq9KWHaclLe5e7ysIzUdMyFdKbqb4kgWTpGKCsEp+i6v2KavZZL 04jmUmrKl9nYuBngktfWBrt0wxxXqmjrJlwwPHmuzUnkpjNp0MU83D8sxbXcalKy20xl Y97Z1X2LbUuyrvKbfzefWZsQoJhI0zarNjVn+UiKqe7u8PebKroRJd0gadCoFDRzm1SM KrJ+c4tNHpJh8GdyIlgu0t5qJ9S7y7iAyT88IGrfCc30iNJy4LQonrzL7XuXhYJqu6S0 T1Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YgSNwICS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y18-20020a05620a25d200b006fca83b669dsi4348751qko.61.2023.01.09.00.53.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 00:53:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YgSNwICS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEnin-0005fj-E1; Mon, 09 Jan 2023 03:41:33 -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 1pEnim-0005fJ-5M for qemu-devel@nongnu.org; Mon, 09 Jan 2023 03:41:32 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEnik-0001iJ-8x for qemu-devel@nongnu.org; Mon, 09 Jan 2023 03:41:31 -0500 Received: by mail-wm1-x32e.google.com with SMTP id m8-20020a05600c3b0800b003d96f801c48so8416285wms.0 for ; Mon, 09 Jan 2023 00:41:29 -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=HTqoT3kxPcjorZ3mugLt6fynVNQ3ed1VmFMT7P6iTBY=; b=YgSNwICSTdBN20I0dQ+7Tcgu3fsIsNfGWs9BHqt5lyQ1ieWs23OzjVVDtIbh7od5Uq vU3/iqdr6GLDXuo7UwGD5oTZobSr+a3VwqcXpLNjIj4y1iypO9dUHn86gmbyPtyTmmMh ue3XZGBqbY/ct6j9iLdhzyERR5kVQ8Y2fCOUTDJ+B7WFNV2761P7BBx5M23t3nlciafi qUmrAEtP/CXRlLwjaCrTtDM5wyfHZzWRsz5xrmALIzPe59pGgzN6t2n5l+j0DQqiyGAo Yi1lk+UPa0+16MWa77rOK3IvVFFFYpXTSfR8pxEWrma1Rlo1+9JwRLrYV6Og67v6/G65 lkqw== 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=HTqoT3kxPcjorZ3mugLt6fynVNQ3ed1VmFMT7P6iTBY=; b=cAuZsB5F4NzeLz3kiGifLBHcF+iqjz0toFDsk/DpKK1tUuOf264f55VVnneq20zZuA G0eEYNlhJea85h/IcxYb7v3bT/JgUXEUvQMnooFSgekI0Q1DzgMXieGFM9i4nd8CpHu6 Tm5+ut/EozrI6B6tWuyu0FhMN/Zkg2XkSIMwPuaMTvxTx40IdmvIxBUbD+5r3+3v5xeX xzOMgx0Cz+oFHwxGpqQ6XfCbEw3nTEAFfd2VePPdS7a413yDjg7Qt/nNioK9SV54Kk73 7MRB1aXAVyoNX0ZX+uHX2h+0MOq0+4rHKKc9DvNDlIQkdzKZyr592mzSIlMN3N6rv1P/ rUpA== X-Gm-Message-State: AFqh2koggBeYS4iwYOxPmr7pwvpQ2ybieys5NODBeMlw9cKJ8XThgyl+ BuGo8GdoETbrDvozuN3wKbYg0TanY9HvGdxw X-Received: by 2002:a05:600c:21d9:b0:3d1:d396:1adc with SMTP id x25-20020a05600c21d900b003d1d3961adcmr55848029wmj.14.1673253688366; Mon, 09 Jan 2023 00:41:28 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bg42-20020a05600c3caa00b003b4cba4ef71sm17107033wmb.41.2023.01.09.00.41.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 00:41:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, qemu-trivial@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] hw/i2c/bitbang_i2c: Define TYPE_GPIO_I2C in public header Date: Mon, 9 Jan 2023 09:41:17 +0100 Message-Id: <20230109084121.72138-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109084121.72138-1-philmd@linaro.org> References: <20230109084121.72138-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Define TYPE_GPIO_I2C in the public "hw/i2c/bitbang_i2c.h" header and use it in hw/arm/musicpal.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/musicpal.c | 3 ++- hw/i2c/bitbang_i2c.c | 1 - include/hw/i2c/bitbang_i2c.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index b65c020115..813232682f 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -25,6 +25,7 @@ #include "hw/block/flash.h" #include "ui/console.h" #include "hw/i2c/i2c.h" +#include "hw/i2c/bitbang_i2c.h" #include "hw/irq.h" #include "hw/or-irq.h" #include "hw/audio/wm8750.h" @@ -1300,7 +1301,7 @@ static void musicpal_init(MachineState *machine) dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE, qdev_get_gpio_in(pic, MP_GPIO_IRQ)); - i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL); + i2c_dev = sysbus_create_simple(TYPE_GPIO_I2C, -1, NULL); i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c"); lcd_dev = sysbus_create_simple(TYPE_MUSICPAL_LCD, MP_LCD_BASE, NULL); diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index e9a0612a04..ac84bf0262 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -162,7 +162,6 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBus *bus) /* GPIO interface. */ -#define TYPE_GPIO_I2C "gpio_i2c" OBJECT_DECLARE_SIMPLE_TYPE(GPIOI2CState, GPIO_I2C) struct GPIOI2CState { diff --git a/include/hw/i2c/bitbang_i2c.h b/include/hw/i2c/bitbang_i2c.h index 92334e9016..a079e6d70f 100644 --- a/include/hw/i2c/bitbang_i2c.h +++ b/include/hw/i2c/bitbang_i2c.h @@ -3,6 +3,8 @@ #include "hw/i2c/i2c.h" +#define TYPE_GPIO_I2C "gpio_i2c" + typedef struct bitbang_i2c_interface bitbang_i2c_interface; #define BITBANG_I2C_SDA 0