From nobody Mon Feb 9 03:52:37 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1770108882; cv=none; d=zohomail.com; s=zohoarc; b=Xk8/foy8BFAUkbsTCVeHwAnlXicyqKXFCO4R9QF79cmGn28ual1apN3k3jRpOukuj9fkV3K7P8aIq1McXgSBk/6gSI+PjyCeKkoG1Br2UDOUhE+o9k6BnrIE/AN0OpEiw55x2f5/iI6o0aJRgkOnMH2f/VeLnGCfl0qCeek1oEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770108882; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=bGxsgmt/1N6+Dd2+zxHTeXEEUAt4kEFa60J+UWuXl1s=; b=KDvSQWUlTNeAf/q9VRHmE3BFSRGYoGNbQk2CjysH9Y5P4TxwFFMRd9CwJMwDhrKlZuOo1YoKuUA86WdijWj6mUL2NZBBMDX29Nqiz+axCNTE11TOlS0jBEcW33wItDDnjK7FtHHmjmB867qdSDAfZCV3Eupro25TcBdMSeg92Nk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770108882608707.8058418038719; Tue, 3 Feb 2026 00:54:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnCB2-0005yj-S3; Tue, 03 Feb 2026 03:54:28 -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 1vnCAV-0005LO-Pt; Tue, 03 Feb 2026 03:54:01 -0500 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vnCAU-0003Po-Cq; Tue, 03 Feb 2026 03:53:55 -0500 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Tue, 3 Feb 2026 16:52:37 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Tue, 3 Feb 2026 16:52:37 +0800 To: , , Paolo Bonzini , Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Steven Lee , Troy Lee , Andrew Jeffery , Joel Stanley , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "open list:All patches CC here" , "open list:ARM TCG CPUs" CC: , , Subject: [PATCH v2 16/20] hw/i3c/aspeed: Add I3C bus get function Date: Tue, 3 Feb 2026 16:52:16 +0800 Message-ID: <20260203085229.1543287-17-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260203085229.1543287-1-jamin_lin@aspeedtech.com> References: <20260203085229.1543287-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1770108883172158500 Content-Type: text/plain; charset="utf-8" From: Joe Komlodi To retrieve the I3C bus object normally, the order is Aspeed I3C -> DW I3C[n] -> bus object, so make a nice wrapper for people to use. Signed-off-by: Joe Komlodi Reviewed-by: Jamin Lin --- include/hw/i3c/aspeed_i3c.h | 2 ++ hw/i3c/aspeed_i3c.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/hw/i3c/aspeed_i3c.h b/include/hw/i3c/aspeed_i3c.h index 436fb532b9..e4e8fda93b 100644 --- a/include/hw/i3c/aspeed_i3c.h +++ b/include/hw/i3c/aspeed_i3c.h @@ -34,3 +34,5 @@ typedef struct AspeedI3CState { uint8_t id; } AspeedI3CState; #endif /* ASPEED_I3C_H */ + +I3CBus *aspeed_i3c_get_bus(AspeedI3CState *s, uint8_t bus_num); diff --git a/hw/i3c/aspeed_i3c.c b/hw/i3c/aspeed_i3c.c index bb41493c55..867909ebe2 100644 --- a/hw/i3c/aspeed_i3c.c +++ b/hw/i3c/aspeed_i3c.c @@ -153,6 +153,15 @@ static const MemoryRegionOps aspeed_i3c_ops =3D { } }; =20 +I3CBus *aspeed_i3c_get_bus(AspeedI3CState *s, uint8_t bus_num) +{ + if (bus_num < ARRAY_SIZE(s->devices)) { + return s->devices[bus_num].bus; + } + /* Developer error, fail fast. */ + g_assert_not_reached(); +} + static void aspeed_i3c_reset(DeviceState *dev) { AspeedI3CState *s =3D ASPEED_I3C(dev); --=20 2.43.0