Message ID | 20241008-i3c_dts_assign-v7-1-96ec93d1f34c@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9CAA2CEFC26 for <linux-i3c@archiver.kernel.org>; Tue, 8 Oct 2024 15:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VmnxBpXlFHXhKFBYS5KznXkNQ72/KcT03vd/jPVdgFI=; b=SUzmemXVPSXobyQCBcmuf3QjPX fBpQpI+9t+maaB8K5v/Za3fL4vJBPIXsDVWWsV2wRmzY/JsR862N7zasYMm6/nCwml4eKArtcfH6X ACZNTVAB8cvagjuGVMwldiW+HhhTtFYogwAucPN1XrlFvcF/L+YwmlVWtvrgWNBknYKlahW4JSGly 4EVknZqVUAXC1L0jfhpA4ZGitoYjE5fba8sRwhqONUg19EI2bi2UO1xVNKjtQWPbsFc10zc4I3ux6 s8XfZAaKc8MXW+xTPm0V62geJTR4DLzXm2om2dbxTSZkHfmMn8dRDsxgDmNlRQE1FK0jCZ87teHhF piRuWERw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syC06-00000006LSP-0f1o; Tue, 08 Oct 2024 15:19:50 +0000 Received: from mail-northeuropeazlp170130004.outbound.protection.outlook.com ([2a01:111:f403:c200::4] helo=DUZPR83CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syBzI-00000006LAZ-0Nn4 for linux-i3c@lists.infradead.org; Tue, 08 Oct 2024 15:19:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L2V2LYdcjEA0jgBTzCYfg8KcJF2zvjpDwo2mVgvhaSmCZKlUMQ0etZ2QyeZnexMjkKgmPUboBIiRKg/w1jsMAjXRMSM2ksreHo83yhMI3wpedEPsOeqRzaux6E3YkacWhEeQPKljlPz86VnSOPaRS1T7lf7gosqnoKxNkuSGhd3nswLwR3wXUokHk4p1dWSnJwt39H6xrB3WPLmU5Jk7x5wIsDMoQ9wqMB2VWmmFNDQFk/TxchVQqJYERSgvubPthgDQPLanL/T6xKG7w8awbp+qQdo8Yp/Vj5vEONm+EOtvKTceLRsQZ2NcBJa+Gqz6qPFGXuE8ueYIF9vvA/qVnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CtrMS8OXbe0qcYxmNRu2SlrZq9vhMYyZCg5B65vBMeY=; b=soocErKvx1hSo5ye/7oSqx8Y+s6/UooqD4cj5i35hKZSTz/a3KB9YZo62cQTGShfOjSyFcx+57tuh2TAjLUfHZyr8yuVeVCNoMPwirporRDydLcyxxl4qzJzwtDmDQ//WPnhRg7bRo+++TZAt9FZVXNydQU0udEySLUpbilqKU04GaagRN8yHqdmFMPOtkrmeOpMvcKNi6EQwhTAigFJvvZD1Y+PGVJvkfLBp9SOQAL/F5AvnSAQ/ZaANad6BoF4wZleZYrSM8k7hdMLXRwE2Eo0TjlJ4eRz+StH6M7qMxnvNWSVPFiJtdIoRvlyaOUTgyqBmGcfZCjXjTUClKI0MA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CtrMS8OXbe0qcYxmNRu2SlrZq9vhMYyZCg5B65vBMeY=; b=aDHwHjT6R3oBw8A2rX3nt/STBxD1aODnZtXarkBNXrJnYeR7w1serANqLxLcPPqcngJgJXUI4lqXfgFEkiFM9GL/rt1tUOYWSsM7BiM0E2Y4VRGLpAn0OhpgF2WBXlUsFtXGI9ZiRD1+IQcMjhkcI3bp/ZOVgQ02DyYJYOuKXTsWjjeuh5jcucUePo9kf+L+CyjPI8auPAmqUucyjQjGwC3NgZBkfWtP87l4+Z150taaSsnPeY3EuOZHX0R9euH4TsCBqz5HTgVYqcMZQFx6oGh91u5JS9+tj1TGBvYzYoLdG6FZT/o9Qq58dUFNvkEHMgxbySHwgv1ZmZ8+5GIt7w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) by DB8PR04MB7194.eurprd04.prod.outlook.com (2603:10a6:10:127::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 15:18:47 +0000 Received: from DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d]) by DB9PR04MB9626.eurprd04.prod.outlook.com ([fe80::e81:b393:ebc5:bc3d%3]) with mapi id 15.20.8026.019; Tue, 8 Oct 2024 15:18:47 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Tue, 08 Oct 2024 11:18:24 -0400 Subject: [PATCH v7 1/3] i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS Message-Id: <20241008-i3c_dts_assign-v7-1-96ec93d1f34c@nxp.com> References: <20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com> In-Reply-To: <20241008-i3c_dts_assign-v7-0-96ec93d1f34c@nxp.com> To: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, arnd@arndb.de, bbrezillon@kernel.org, boris.brezillon@collabora.com, conor.culhane@silvaco.com, gregkh@linuxfoundation.org, imx@lists.linux.dev, miquel.raynal@bootlin.com, pthombar@cadence.com, ravindra.yashvant.shinde@nxp.com, Frank Li <Frank.Li@nxp.com> X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728400720; l=2178; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=mJQ2NVwjODXELkcDKNUIEYw/DZI0LGJGAQy+lGen7bE=; b=UnbOBSsYXxfymZwvnMKhf6Sj/J6XWt0gN36MJyZunF41KlP0gmWvL/QhEQ82FL183JmvlROKG 00ALDPU/NVyAP0Zf4eLkR/JyXjkaQxwKyAF7afIoDtL2fERVCQmqUcR X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR11CA0101.namprd11.prod.outlook.com (2603:10b6:a03:f4::42) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9626:EE_|DB8PR04MB7194:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e3c7333-6db8-4aa6-61d0-08dce7ac8156 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|7416014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?bh1bNck+8qaZwKygIZMLDDpj/ffTlQ1?= =?utf-8?q?tnnVvz927Exs9Sds9uVBDPxCXp2d589Y0FrHJmF07fGbbdlnpl7HofHxqTTxyI4yh?= =?utf-8?q?8hskS8ZKQIVqLvIDqZ3lY3EqD2u0Jm2rZVx7rOEyu4Oj1Bnn+qIfy7JzWB7hNaP2B?= =?utf-8?q?IRRL6FA5WTpghSEbssVfdK84ono474zpPlJOWtUWj+yyOkY9Bk7exNlNyH1q8VUfW?= =?utf-8?q?Hh48gm1l4knU/9g4XHg3UHTQdJCFgHiTpy2UAKBjhMx+YIHBrCGr6ybNRMAtus6ho?= =?utf-8?q?MX9xctlfZuf5f0/Bx2bvOd1i2HVHL94J3o3u4LRYg7pl+cDfGzWV5IPvs57b96DUn?= =?utf-8?q?zy9MocLYuRJM5hJiQbZireIKu/DGKgvwwLlqh1inv6DaeXGz5rSkpHOnZo+O+/Wc1?= =?utf-8?q?w4DIvumkodSLrZIzLtVYVWlBHvtkh9rC+V2at2ZiPrSbQdjY+PRxS0GJBaGAac6Ks?= =?utf-8?q?C6nFiG42HK6Sk4btO6XGuuGluaSAknwxW4pYi2u3mxU8paWAaeP7GoFEO0AAvWnfN?= =?utf-8?q?G72qkSlnSGgSM46sJWIvyrbWVpq6XOuw7MtPlKDwGYJqTbeMNpfPfKioKlnK0yKBZ?= =?utf-8?q?ADe3FVUNNXkSLnB1pUdKgFk2xAKFffpNDpqdOw4I2dFdM0W/1a1ecleYQkt4AP82X?= =?utf-8?q?Tbi5h6pERkvMNdJ3ZinY3K85IGs/VOI7+dWCoEiqw+PoIfLdis/uRsoq8/V/iP9QK?= =?utf-8?q?5sDDSr0HCHW+CKFfSdtjL8HFRjckiidbZEgWiN+YiU5vewVgkz4rLNedmDVViPGDU?= =?utf-8?q?6lJD2WjCT/V3PTaOnJhiSF5IxAXWsBv0sLxz2H/x5N0WP7pif5Ahy/G6/SC1WJ8JI?= =?utf-8?q?v/nTbQgvUXYIW/UnxHpp64IC3oEIsIFsb5QYdy+uyyxAyL+xslSwCiCuTP40mt7/Q?= =?utf-8?q?uBI7yiyJ/MwtVFXLAje6cg4eapObQRv4UEy/2TfSu1YvWXkvaBIekL2QvIDB2j+rA?= =?utf-8?q?CN+NynBAjWpzJdv2croNLyry+y73T9PyePzFP8uD8c7zsPeFZAhhwc/xlT2s1JH76?= =?utf-8?q?D6zPfswA+llknmAKygKMeusn1+MLX/X86B6r6MkZl0f2JX8I4nqo1Lqlc96pVJZnR?= =?utf-8?q?MoGcwUGv+VEyQWAT+hyXFoC/7il9OatN+Xu3mYWoqQcdC+yMUbCTaEBi719rC7631?= =?utf-8?q?R6bH37zXnZ4dXmP/ApviWPxazs692RUQMNspnApvmfCR4ifK0Ph25YBxR+5l2DqCL?= =?utf-8?q?ONZ/g+tIEGa+UTBvVks4C4vv/jZyjpxg2QC013dvXP2cZEBRevYXpoPZL0wx8O13S?= =?utf-8?q?NFvZIfmub498npaWvZkt5FGuiB7mamIwV7Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9626.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(7416014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NV63vVP+fBiiqS4CpsX1ock6zEbS?= =?utf-8?q?lPNME85KdqDhJWiJ3q21hmXQA5h/eofufdX/w1cd0rNVbRf7U8o8I910Bh37Q3Uen?= =?utf-8?q?baX1iNaEg4AH7c9s4RRf+Pf9OYEM9kY849ID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+k+MOqed3?= =?utf-8?q?nsRXkLPtQ0YoHnceWmy45egAlYtZPH1Q8az+nsVUAme/QzyEqmwkGzoTgsDmPXJa4?= =?utf-8?q?WR5Y8IJ7RIwr3/DcD7YGtPgz56Qj8SLJPV7B1Z6iJmVsjObcr3YQpkgK9Yq8CfgFZ?= =?utf-8?q?t/CEt0jEyN+oBEN4ayJyycWhfvggAnRCfILo/HsMwvMbzMOni70DJxgoMFpV2gV8z?= =?utf-8?q?wNt+EoXVwa2G+uagC/ybDgBFIJg6v5hatYJqmW1q5KOxqjGHrrcBn26ZhxcJ1Upah?= =?utf-8?q?LY1ONuPK8eCVi6bxQ0rpQBz4gGLoedCVLWn6bbF864VSKO72oRVf5MLVIqOWa+siE?= =?utf-8?q?Yxp+ncxtfPo3NzUWUQnNMu9ki7dfQNe8WOzPvXPESFeBxZ0kXNKe2KJGB95hO6LAl?= =?utf-8?q?66q2i2Z7EqmDp3TezjYvPvimtc6z1xWKhIY7rQ61+8FiuLrvgYKW+sfnz9B9yO51D?= =?utf-8?q?OY7bqkMfSkDt7iBF+MtUzBBZCLLFeywjlefNtRFnXKHjStGLNqydob74=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e3c7333-6db8-4aa6-61d0-08dce7ac8156 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 15:18:47.1137 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1Yj42lLtg32gIdIQBoCSe6mwHyiSIugfzpGMYfpN7YT3u338H8Io7SMOIX4AiIQigdtMLWmi9PfWTfcuWLz9KA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7194 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241008_081900_323833_B6026EA7 X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-i3c.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-i3c>, <mailto:linux-i3c-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-i3c/> List-Post: <mailto:linux-i3c@lists.infradead.org> List-Help: <mailto:linux-i3c-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-i3c>, <mailto:linux-i3c-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-i3c" <linux-i3c-bounces@lists.infradead.org> Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org |
Series |
I3C: master: fix the address assign issue if assign-address is exist in dts
|
expand
|
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 6f3eb710a75d6..dcf8d23c5941a 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -348,7 +348,7 @@ static enum i3c_addr_slot_status i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) { unsigned long status; - int bitpos = addr * 2; + int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS; if (addr > I2C_MAX_ADDR) return I3C_ADDR_SLOT_RSVD; @@ -362,7 +362,7 @@ i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) static void i3c_bus_set_addr_slot_status(struct i3c_bus *bus, u16 addr, enum i3c_addr_slot_status status) { - int bitpos = addr * 2; + int bitpos = addr * I3C_ADDR_SLOT_STATUS_BITS; unsigned long *ptr; if (addr > I2C_MAX_ADDR) diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 2a1ed05d5782a..2100547b2d8d2 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -313,6 +313,8 @@ enum i3c_addr_slot_status { I3C_ADDR_SLOT_STATUS_MASK = 3, }; +#define I3C_ADDR_SLOT_STATUS_BITS 2 + /** * struct i3c_bus - I3C bus object * @cur_master: I3C master currently driving the bus. Since I3C is multi-master @@ -354,7 +356,7 @@ enum i3c_addr_slot_status { struct i3c_bus { struct i3c_dev_desc *cur_master; int id; - unsigned long addrslots[((I2C_MAX_ADDR + 1) * 2) / BITS_PER_LONG]; + unsigned long addrslots[((I2C_MAX_ADDR + 1) * I3C_ADDR_SLOT_STATUS_BITS) / BITS_PER_LONG]; enum i3c_bus_mode mode; struct { unsigned long i3c;