From nobody Sun Feb 8 18:12:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519053821969769.7434247254688; Mon, 19 Feb 2018 07:23:41 -0800 (PST) Received: from localhost ([::1]:50804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ennI0-00051i-3h for importer@patchew.org; Mon, 19 Feb 2018 10:23:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ennEu-0003CD-F7 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 10:20:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ennEo-0008Uk-E6 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 10:20:24 -0500 Received: from mail-ot0-x242.google.com ([2607:f8b0:4003:c0f::242]:38332) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ennEj-0008Rb-Id; Mon, 19 Feb 2018 10:20:13 -0500 Received: by mail-ot0-x242.google.com with SMTP id 95so7227387ote.5; Mon, 19 Feb 2018 07:20:13 -0800 (PST) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id s11sm13217447ots.77.2018.02.19.07.20.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 07:20:11 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id F307A6EA; Mon, 19 Feb 2018 09:20:09 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 13CD8300966; Mon, 19 Feb 2018 09:20:08 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=cusqc1X4gG/UtlHSinYxpQcggXpVDY6SFgpui8GkcC8=; b=rsPvG29wyiI5Jb1I6nKuLkxnECndRtTkywVXRxlfdxeSq5oyDHyDl50vLmVYlDGTfL DTQwA51zRkRFOAS7N3X1EX5YGbWOY6+QX6PFWQaQaMMJF16XBRAhvalNd0vZ0zQjAAuy KWuUb2t8pri6SV51qsoc1llwI0iczOqneG76PJ2vD/Vsti8962TFdCS2PRSwdZOSf9y8 fg41MIBiJK2aZ5ZOFO9HVq0JukFZljIIjToh84vHdKwnUrEDeJ01pSNruI7UWX237Fz4 m8Vcdq0W/idl5fG8MraI2kqBdWWJ4y4R/37R28FV+iut9bHpoMomvZcmir9gv6KgXzYN I0OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=cusqc1X4gG/UtlHSinYxpQcggXpVDY6SFgpui8GkcC8=; b=s5CfKgDJq/GM1pe0hHkbGAVushGzF/aTC/aI0tdIPnxzVCamL+4o6BhlXohe5KGWFE Ovd3ROYqeTsk6FSmF4DXwDaekWFWpVnPgHtKuyE3W9AUX/0OaFjs4sqixfSz9PR/8+Yd HGUdvVaWcAcCAZXJBRsHnCqrlYkaIwP1DW+mYjxVP1GRJcdzfNTHYcM8Yy15tMHEcCXO 1rh7mq5BH+qKOgYYuXXSA3L2VNJRAPU1GMuw9p1LnE+gMvQcWsRqs3iVAQ8pJa3Z7TQA 5rQj5BkQgBXHPclJ+/CF7oZYMTPhlOhGnn2RpSxp7nSx6dFfBGYDmyNjboasfup+Pghb Theg== X-Gm-Message-State: APf1xPCmm7FHpOQlR1Fqn6M/2qTebsMhv8C66zmSEOcKTRO28C/IWIMF KaeKqF4fDZ7cjeEUnTCq3w== X-Google-Smtp-Source: AH8x227kMbehMU1OjnOyDJlFxve92Rv4xdI4wiPYZMt6XkzHaXdSXHSbB2d8HswBHAkx5hr26NyVYg== X-Received: by 10.157.13.165 with SMTP id 34mr11963171ots.313.1519053612751; Mon, 19 Feb 2018 07:20:12 -0800 (PST) From: minyard@acm.org To: Linus Walleij , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 19 Feb 2018 09:20:06 -0600 Message-Id: <1519053606-9817-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519053606-9817-1-git-send-email-minyard@acm.org> References: <1519053606-9817-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::242 Subject: [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h 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: Corey Minyard , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Corey Minyard Some devices need access to it. Signed-off-by: Corey Minyard Reviewed-by: Linus Walleij Reviewed-by: Peter Maydell --- hw/i2c/core.c | 17 ----------------- include/hw/i2c/i2c.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/i2c/core.c b/hw/i2c/core.c index 9a54b61..cfccefc 100644 --- a/hw/i2c/core.c +++ b/hw/i2c/core.c @@ -10,30 +10,13 @@ #include "qemu/osdep.h" #include "hw/i2c/i2c.h" =20 -typedef struct I2CNode I2CNode; - -struct I2CNode { - I2CSlave *elt; - QLIST_ENTRY(I2CNode) next; -}; - #define I2C_BROADCAST 0x00 =20 -struct I2CBus { - BusState qbus; - QLIST_HEAD(, I2CNode) current_devs; - uint8_t saved_address; - bool broadcast; -}; - static Property i2c_props[] =3D { DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0), DEFINE_PROP_END_OF_LIST(), }; =20 -#define TYPE_I2C_BUS "i2c-bus" -#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) - static const TypeInfo i2c_bus_info =3D { .name =3D TYPE_I2C_BUS, .parent =3D TYPE_BUS, diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 8fd449f..d727379 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -56,6 +56,23 @@ struct I2CSlave { uint8_t address; }; =20 +#define TYPE_I2C_BUS "i2c-bus" +#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) + +typedef struct I2CNode I2CNode; + +struct I2CNode { + I2CSlave *elt; + QLIST_ENTRY(I2CNode) next; +}; + +struct I2CBus { + BusState qbus; + QLIST_HEAD(, I2CNode) current_devs; + uint8_t saved_address; + bool broadcast; +}; + I2CBus *i2c_init_bus(DeviceState *parent, const char *name); void i2c_set_slave_address(I2CSlave *dev, uint8_t address); int i2c_bus_busy(I2CBus *bus); --=20 2.7.4