From patchwork Mon May 6 11:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=Kldl70xV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3428-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0w911GKz1xnT for ; Mon, 6 May 2024 22:24:41 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 70960B2524B for ; Mon, 6 May 2024 12:24:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE754143C6D; Mon, 6 May 2024 12:24:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="Kldl70xV" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2134.outbound.protection.outlook.com [40.107.22.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FF73143888; Mon, 6 May 2024 12:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998267; cv=fail; b=bKiKx+NfxnYFLdMdE8hANRS3UXRet5BXgnahFe9YY1uE2DQuonhyppow2QPg9OC+wPaRdnDmH6mdssUQpE9kzDNpm0vYsZsdeWRfikIgdSJoxyHfvTJJBM1KSnESqk5giXF1q8CM5r+xcc4ohSdhVMHsjf+zcfLYnsLYXCXOAAA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998267; c=relaxed/simple; bh=Ca2uKOFaUFQYmrzz9oCzcU5bwL0LB/x1odz4MSAr75o=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=IZtD6M32S+jZ5YOPzZTLarrTmL8mypekGHbTL1MCpdEB17gadaIO/dWFHnFw+gK4Htm5Ov5cMAl9VORJx7i2pABVczSq3QzODOiDNeVS5TIY0nA60cIWx55yZxepbXA6J+KYEvy83ZSJC+pnQG+E8QLX0E5k1C5kGZdJhPynS3g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=Kldl70xV; arc=fail smtp.client-ip=40.107.22.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fn15/+A6ms0Ev8d4e32AOTwfu2N20rsmmqvVYc5GbbiECpUoYH2hWBDs2pK2MGm30qVgDjZhEO3d37/01+gY1hBRSKMMmWADyE8Srxd+hF9DfswVvCgjWn5ryR29el5RK/CmImc2P6ih91/IgWSdlZg0JEE+R2rKDuNwLO4yV9ZKu3AqoKDvPeWdaf31AQJM9Ddo9wSF37CWULfL7MfzvHAmQuwz+mHOJzIAdTdsbqQHRxVHSId5zsjMmOLbJ3HAWfv11WT0TBAyYszQSi2zIF5LdL6hhIMPziRO1KGtUvGfbDjA+RgH0r8pfmi18HLDHu9naZkD0YPV05e2ZFDFsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=RyeBzbPQltYK0YMrn80XxvYh6a7BPrKE96OfIhxZSaE=; b=g4IoRcW02DNAT+ftwe2ER0YNzrf07HyefAN0vNu5meReG9KCppvPBamUkI69RGehBVzKUdJJazO58IXqQ4P2iaNhAVfNxy4s6sDJXpWdTQ8Pr7ZEXXbD+35I5zsWle1H0zF+XLsCWoy2ICikqBiD6ZDb0MvmZKI9E7aSbSiN/irDVi7eavqOiOrWCcIZUK9yXu43+oZ8GLZCp6zn6kK0ddDAAhGnEZHgEsdjYTOyPMgF6aS76Fa3WbW0jj+eBtsk359RpdUS1R3RlWxqEYhu+rxp4ovacfR7xW2LMv3BWBOltKKB2sk/cS+AgRceWBIvhPCMvfaUskelrDv9farfGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RyeBzbPQltYK0YMrn80XxvYh6a7BPrKE96OfIhxZSaE=; b=Kldl70xVGooihM9hneLNi19A8Cg5V0KNY1P5YrBSF2bfwmSGwcRBbcXQiHwWAbkOCVh4mnFHBjDENgitFk9k1i4Qq52sODg9+2zuidPfWzfduLngB/6xRR2e9LMO+ujAkj3WFrC/8YTapRnvyshHASlsHLg6lE14Qth7X3SG7aA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:19 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:19 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:52 +0200 Subject: [PATCH v2 1/7] i2c: mux: add the ability to share mux core address with child nodes Message-Id: <20240506-dev-mule-i2c-mux-v2-1-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 6effe2ac-152d-4e1c-0cf6-08dc6dc771b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?g6Miu+avHf5nQ7x5T0lDWM58n3w6F5O?= =?utf-8?q?O0uBEMD9skA7+ZVjcEawGVRoMBr5/rJ5QKOuvY5vcEUVmunAjLAiOriTdICLAlwMK?= =?utf-8?q?/Gh5cDVBKW1WDDmiMKE7HlHvDjvnA0CuzjmW3zXcaJn4e4J4eL+JA5ETGwjFxx6UG?= =?utf-8?q?Ssn9XwQrPsftqhSjBdcFeYoY8MRGtBSRd/Pa+0lsAVO/z0iOUWvFFcLWJeLTuExxR?= =?utf-8?q?LLVCJlHEZio6Gutgw9U0+/Xhh6YGkf/198clGVhGuURbeyr6/pDKjlUTCA3TO1lza?= =?utf-8?q?6xCe7LxNciYoxoSJSD6JoeHQz6AEpiWyyCtS7ahxA4CyDkPeSH6yM79s4PuG8FYvU?= =?utf-8?q?iv9f1xPR9uTxGH6UX70H7zPdYt5TAkz2WJCHktCS5W3YWSANh83s5HWOW0ZvXqkXB?= =?utf-8?q?epecaEJuDUyxer1v1Ii6iBBknrcSWOvmdbM7UzAq0TuC1GAesxxNPoLMKFkOjNcFr?= =?utf-8?q?JOl5TCigPCnT60TzqGBeYJ0+Fj1XSF/uGJPZvsmZ5LjHWpHeB3J359l3Du46eQi8J?= =?utf-8?q?LmpA5oxPIsJk+uLsn91ssEUtA0c7IlAg+6ysiY3cgP82iujaF09IzD0g4UTXEhqys?= =?utf-8?q?E5l3fTkzdai83fXgKz7SAFXZzv5Ms//H6g4w/dHWcdKVZezlnefFTypUeEiPf5hAz?= =?utf-8?q?RAfhqtKvBWQzfQCfWsjTrTkfrDi8XcDF4QdMC6I/fZ8JM6YlfOWS/Xkv+lxtxWknp?= =?utf-8?q?d9cvxhrx5IcjDA/IkemEMUlkKpZD3h2BoRR2AMHq9nLKrtEULBjQM6qwZ9Nraa72V?= =?utf-8?q?l4mszH7D07QqqloUilywYZC73Hr3vSo05MBT9cPPGqglsEohX19JUMK25Bn4GPtXN?= =?utf-8?q?Ul03wX2m8wzJnULCcGo6VQcxWt339Z5daOnbapC6zh6rSS/FLT9PaJW0u0em+2YPe?= =?utf-8?q?1AjtOOtNnh1XPFTb3xNTYQt1OfBIfR5qg2Qo8GWMAdSb8kPt0lF/CrqicnSXqIgRn?= =?utf-8?q?eQ9e4rrg5MyaDw0RfU3qBYR61gUWm6A56H6yrYxCN+SdAQa+09cQ8fq6YRzT2MNN6?= =?utf-8?q?7GzG4EBir6PUoqY2MdrtiZEwqoj1KVB2YCIlCu0zMRl6395444Ss4VXkSHpiroxtL?= =?utf-8?q?HeAN0M5He/ijK43PMS/q6st2mZlUugPbzhKumhmarHT/R2FWF1xYVOKAY0ZR6QCOY?= =?utf-8?q?2iBeLYnnAMewdFyiW/Np8XmpcI+MRG1I5Ol8TwrypzXKk+iWuHPe8U9t6o/UWmKI4?= =?utf-8?q?7Cil9a1AIsWoDUbPFtTvE7GiTXVZ/1DAB9BbNyddg+8qGRyJIYNkPqCJl24o9QfBz?= =?utf-8?q?rGq3s011KYZV7S26tjxPppur+7GfVc1StWi89F2MS0FZTuN/pmEc/WFU=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102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zG8lw+v6VnQ47jFT6M6UUa?= =?utf-8?q?djIFFqFxY7bviiVSeJG4E34vCCL4R9HFbTmbIylyxqXHdyi7iJydHTGC0pjLTkwbs?= =?utf-8?q?aPRfIDquwJFPCLmV8P6Kj0VvubrdIYtAHwCl7rg+lSdaz8/w8+p5fo5V65ykLo6md?= =?utf-8?q?YRebztRlckkCIVdMM4N6ZbvE1lndTkleCvz6n2gA40reydcN0AjD2RFQvkaqkeUZW?= =?utf-8?q?5JFrwDc5YIYS7dS2WHwl0eTdMXvFzQa5lDofQNuGc8Dv0cry9TSozyX4i5vqFE78N?= =?utf-8?q?sPnZuCfOmjz4xkPcB0Oo4Fy3xNOKgkdbHLNpak6t7h3s3BY1VyrffWEA6ei5Ki/aS?= =?utf-8?q?eZicKv5b4USf22lxqRvA0mHiYeSok5r/kcpfUYR3amgYVGFb7+lr9omAjANJrPEul?= =?utf-8?q?CKelimRS9I+PUooW8a2ICJFa4RpWW8WfhAeFs9yV+xkJng/mpfiWL09NOmaIb+aU7?= =?utf-8?q?oM+nNZggJARI347792jObdOTMvMEKN4gOp+AEM2RgtC31b9ZVtdQB9+pfo4ZlCilN?= =?utf-8?q?mgYmkKlRbRj5sQLlYe0lX68UkPET4dVGMlBf3jDbip40v0dhmPp78u1yuQnThOokb?= =?utf-8?q?P1osFwcPFfw34ap5eTlfL7Co38+ikaweFoJ3O+q0/9W8Z7n7KVc3k9bonZ7Q0aMu0?= =?utf-8?q?wSTJkjjy60/aGI9XpdwOoqqK0TdGip+EfRrK7B/KkgDomVMG6V+lRO6nCQmJoHLbW?= =?utf-8?q?FPKMaXGIMYdXY2eFivbHBLsRHf+uAFs54Q=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 6effe2ac-152d-4e1c-0cf6-08dc6dc771b8 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:15.4771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FrzVeorVuNa9d7Gp/GyT+qoUB/NErmzYZ4C/giRA3T3HQVn4NgJo99HGhdYyw451v3aFiS1qr84xV1osZAnqmgbE2fEz5FdXfJ8JDev6RCY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Allow the mux core (if it's an i2c device) to have the same address as a child device. This is useful when the mux core can only use an i2c address that is used by a child device because no other addresses are free to use. eg. the mux core can only use address 0x18 which is used by amc6821 connected to the mux. Signed-off-by: Farouk Bouabid --- drivers/i2c/i2c-core-base.c | 6 +++++- drivers/i2c/i2c-mux.c | 25 ++++++++++++++++++++++++- include/linux/i2c-mux.h | 1 + include/linux/i2c.h | 7 +++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index ff5c486a1dbb..ce2425b0486d 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -821,9 +821,13 @@ static int i2c_check_mux_children(struct device *dev, void *addrp) static int i2c_check_addr_busy(struct i2c_adapter *adapter, int addr) { struct i2c_adapter *parent = i2c_parent_is_i2c_adapter(adapter); + bool skip_check = false; int result = 0; - if (parent) + if (adapter->quirks && adapter->quirks->flags & I2C_AQ_SKIP_ADDR_CHECK) + skip_check = adapter->quirks->skip_addr_in_parent == addr; + + if (parent && !skip_check) result = i2c_check_mux_parents(parent, addr); if (!result) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 57ff09f18c37..bdb75a130cab 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -334,7 +334,30 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, priv->adap.dev.parent = &parent->dev; priv->adap.retries = parent->retries; priv->adap.timeout = parent->timeout; - priv->adap.quirks = parent->quirks; + /* + * When creating the adapter, the node devices are checked for i2c address + * match with other devices on the parent adapter, among which is the mux core itself. + * If a match is found the node device is not probed successfully. + * Allow the mux to have the same address as a child device by skipping this check. + */ + if (muxc->share_addr_with_children && muxc->dev->type == &i2c_client_type) { + struct i2c_adapter_quirks *quirks = devm_kzalloc(muxc->dev, + sizeof(*quirks), GFP_KERNEL); + struct i2c_client *client = to_i2c_client(muxc->dev); + + if (!quirks) + return -ENOMEM; + + if (parent->quirks) + memcpy(quirks, parent->quirks, sizeof(*quirks)); + + quirks->flags |= I2C_AQ_SKIP_ADDR_CHECK; + quirks->skip_addr_in_parent = client->addr; + priv->adap.quirks = quirks; + } else { + priv->adap.quirks = parent->quirks; + } + if (muxc->mux_locked) priv->adap.lock_ops = &i2c_mux_lock_ops; else diff --git a/include/linux/i2c-mux.h b/include/linux/i2c-mux.h index 98ef73b7c8fd..17ac68bf1703 100644 --- a/include/linux/i2c-mux.h +++ b/include/linux/i2c-mux.h @@ -21,6 +21,7 @@ struct i2c_mux_core { unsigned int mux_locked:1; unsigned int arbitrator:1; unsigned int gate:1; + unsigned int share_addr_with_children:1; void *priv; diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 5e6cd43a6dbd..c3acbaaadae9 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -670,6 +670,7 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap); * @max_read_len: maximum length of a read message * @max_comb_1st_msg_len: maximum length of the first msg in a combined message * @max_comb_2nd_msg_len: maximum length of the second msg in a combined message + * @skip_addr_in_parent: No conflict check on parent adapter for a given address * * Note about combined messages: Some I2C controllers can only send one message * per transfer, plus something called combined message or write-then-read. @@ -690,6 +691,7 @@ struct i2c_adapter_quirks { u16 max_read_len; u16 max_comb_1st_msg_len; u16 max_comb_2nd_msg_len; + unsigned short skip_addr_in_parent; }; /* enforce max_num_msgs = 2 and use max_comb_*_len for length checks */ @@ -711,6 +713,11 @@ struct i2c_adapter_quirks { #define I2C_AQ_NO_ZERO_LEN (I2C_AQ_NO_ZERO_LEN_READ | I2C_AQ_NO_ZERO_LEN_WRITE) /* adapter cannot do repeated START */ #define I2C_AQ_NO_REP_START BIT(7) +/** + * do not check for conflict on a given address + * used accordingly with "struct i2c_adapter_quirks.skip_addr_in_parent" + */ +#define I2C_AQ_SKIP_ADDR_CHECK BIT(8) /* * i2c_adapter is the structure used to identify a physical i2c bus along From patchwork Mon May 6 11:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=HS/+fdMX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3429-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0wK02hzz1xnT for ; Mon, 6 May 2024 22:24:49 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A0455285D80 for ; Mon, 6 May 2024 12:24:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7C181442FC; Mon, 6 May 2024 12:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="HS/+fdMX" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2102.outbound.protection.outlook.com [40.107.13.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 518EE143C52; Mon, 6 May 2024 12:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.102 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998268; cv=fail; b=q12FLxks1rTOzVEaY7bQh3s+ePJEPRGoLtmdlxDb1tWJyTQDoWo8YIsdmS3MgqbByzbDPRYb3g9vZsRQ1n8MwFtXTbCzI8vBk4o/+gS6CGrU5UqhRc6tpIVb6jYy/TgjzcB1H3uMUhDE21tUL4CCSA9ticJqeMQEEm6v5h/BdJc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998268; c=relaxed/simple; bh=ChWq4k6TLZAaRDFyH49Ss6I8/AVibvlLgLYdCYXpveo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=s/Tjc8CD7Ac/ZnhH7uBpQKSZGfHnuMkcJkXIC9v3kMig0a72lcnjSw2+Fn+4UbBKlWGyACafypg6PaKviP8J0PGxe4Rnt5kzniaNGjhQIeQgyLTsUTWG1WCc3b+xcPifV30t9sVvJVcNqEEsqIhxJpcAxj8hwViUkmmUzrGrGh8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=HS/+fdMX; arc=fail smtp.client-ip=40.107.13.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZX3l38xP0MwcbjQaR4jB4Gbl6VHKwgtD6tGyhjJgASmzkW1zvd3kIfH1mJhTzwzzuBh+dc9KcOrxNXyk2M9o3xfErTXkvgP6/Fu3WGRI342ZDzjmCwtS+iqCmnbErFNi6rBoKY446wDcZDBZI6iDes1WxHlNV4NdHg/vYvztYu7N2+AENYhmPz9n4h34Y3Mm5D6z0/TmC3wjFeArLwagvuNBAe/eVPPZpSLF0dg6sCO3MI9/W2JLN9q3KxFqPM9LTegx0eY5+29aa3DyNOZ9DzoiHQDI8qk1RNNJsWALeMu+8j6El5cMqbQC7eBSRg/J+XVo6QlkeuhDFMxH5nah6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=flFaBaooq3Gfn4fLB5Qqk2nhJsqmOaFf3eZyVRSG/To=; b=E7WuCJzWI8hUB852SlsmEmdM5KygSqecd/sMEoapn6afQE7KRLie9LiXXpUhGP7JhJQNUHFBLwsTufWJQkbV+41c6eSpHgDlaWG6KiRggnrOA9wrB1enGKkTEP381f5LjVvjGHL3sFKKAB89i+CWbEaUnLT2rKRAEb+USO4CBINGVfGwst3ToI1p1YsTdcKL+ktuDBUL4qdnWff9xwDEdBdp9iNFOZJrKTgRC7c2e04wSRyq/bbgxydl26higgo4LVsaFUVsTLSazqltaA/T5ytnNU8PL0uuamq50keif9XjYIVu6VdBQf4N+RYq10Csn/dRnDMUmgQai8KaZTBfKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=flFaBaooq3Gfn4fLB5Qqk2nhJsqmOaFf3eZyVRSG/To=; b=HS/+fdMX7zZ/WnpszGvPWfOtRlFgH24Hi1oMga/l6vj8VR1mnwu1VTGrz5W9BuMKbvOa2iEpneY0p6VErksUnwz6TGXj3buWK6ythSjoKwIM4t62vrAjBjDcSRfD5py0UnsD+tMNJDPlHzAkOszFUwYL+20emfouPg45dfzSdL8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:19 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:19 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:53 +0200 Subject: [PATCH v2 2/7] dt-bindings: i2c: mux: mule: add dt-bindings for mule i2c multiplexer Message-Id: <20240506-dev-mule-i2c-mux-v2-2-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d23d7aa-f01f-4efe-64eb-08dc6dc771dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?jVU5Mi7hJ+8dcY4Ivr1UE1iQRN0NTgF?= =?utf-8?q?f2jCWyTbF46mCDMlk1tKR1qaD2GOKk5A2XJfFcRN+TCj7TzDVrQVLk2Jpgu+T/5py?= =?utf-8?q?WIJGXXEHiNEgbTJq69qjAmH7gnXi2a+YxYNFLBD4ghNKY7LuSjZ5aOYAZr8ZsbiiU?= =?utf-8?q?u6JRY+Pfhoqe7UEGiV5dvf8Iag2pNiprfk8/mw4sMZ+DsJPiRxxpCrzFBoD9JflRP?= =?utf-8?q?yUFKIqjD4hm2UhTkzwXTGkq4AVKvXm/dGvRn2o4aK0cWqeT0jcwaMHfreDna2g5uF?= =?utf-8?q?Gad7ifwd37T/ViK5gp1bCkzczaI4GW1hWsfRIk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bTe51zlgiHnjoJHz+M?= =?utf-8?q?ihAONrq64CMHyqW9IzyhIx1wJIZ8uTkgrjisunlvEMIQie8UFIgZ5EKG4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?YEV8jdS+mTwPn77fJCCYTCvUY2Za?= =?utf-8?q?X+Pr0XGPRe66i7hSRAvrU0o9lw5xblKoW4H/IwskjRyYV0ypJRiOKASPaJMVW8erV?= =?utf-8?q?8J6xgAke09DcEFckKZEQRPJCdSuh9RUr0nU5BIFBw6yGCPEkSfaMQk6CHGZJ2J7yx?= =?utf-8?q?sSgyakhAHXztyjTXUIjV3ACyCFKLB0Waza48c7rI4nhdmfRJ+a+MlDPpkHW/6v/F1?= =?utf-8?q?4ba038FS8/KqFmm5ciHqLh9GiZohku42MzBgxjTElOktfCB9v6L//OmVQakO0Zpig?= =?utf-8?q?tC+cJdd6UJ2ZmmDD9wbunKE3KW+ZNWC3hx6E2MsslJUTOnaewyLOF8qYEHXtYz5Ty?= =?utf-8?q?A5O65rdIc7RACcZ9iKHs448Cw39ayjgrP7G5dOJ26S3HAQk+xaRYwMqb1UzbjNLOk?= =?utf-8?q?aQU9QY0aQWE1AMZ6UpMSt2pbaLFbqBH3Uyijn86KS1zi0qwV40zsJ1TsCj81IftA0?= =?utf-8?q?KJSz3id7UNBp7t8faLjYTnw1HMlrl0R6pGGm6iJ8vYGbBy9g+2Kd1jJ3u4TFcgkVf?= =?utf-8?q?akaJiuZTVgGJ34hXORswCLpVSQDXDeFzrbmjavJ6K8d/5FGUSOxItLVvchUYtcfWJ?= =?utf-8?q?zHr9Uqp8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+iYYzox38c2EeEX5rP255SwkDXhd8DQe/2WyvHgkFwIUN2AKlf1bMz?= =?utf-8?q?uAawkqZBqzf+f7be328lAGkVH65N2tHOQQ=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 0d23d7aa-f01f-4efe-64eb-08dc6dc771dd X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:15.7098 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BReddaunuBFEohIcHeUWPojG1psSVlkcEF/6Tc8i45jYGrB33HqA/wYdgLUi1m6IsLlh9ccVZz8MmF5oO2dtkncc3NYz0DhH9s9yiLeKfmM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Mule is an MCU that emulates a set of i2c devices which are reachable through an i2c-mux. The emulated devices share a single i2c address with the mux core itself where the requested register is what determines which logic is executed (mux logic or device logic). Add support for the Mule I2C multiplexer bindings. Signed-off-by: Farouk Bouabid --- .../devicetree/bindings/i2c/tsd,mule-i2c-mux.yaml | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/tsd,mule-i2c-mux.yaml b/Documentation/devicetree/bindings/i2c/tsd,mule-i2c-mux.yaml new file mode 100644 index 000000000000..50915183bd43 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/tsd,mule-i2c-mux.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/tsd,mule-i2c-mux.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mule I2C multiplexer + +maintainers: + - Farouk Bouabid + - Quentin Schulz + +description: | + Mule is an MCU that emulates a set of i2c devices which are reachable + through an i2c-mux. + + The emulated devices share a single i2c address with the mux core itself + where the requested register is what determines which logic is executed + (mux logic or device logic) + + +--------------------------------------------------+ + | Mule | + | +---------------+ | + ------+->|Config register|----+ | + | | +---------------+ | | + | | V_ | + | | | \ +--------+ | + | | | \-------->| dev #0 | | + | | | | +--------+ | + | | | M |-------->| dev #1 | | + | +--------------------->| U | +--------+ | + | | X |-------->| dev #2 | | + | | | +--------+ | + | | /-------->| dev #3 | | + | |__/ +--------+ | + +--------------------------------------------------+ + + +allOf: + - $ref: /schemas/i2c/i2c-mux.yaml# + +properties: + compatible: + const: tsd,mule-i2c-mux + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux@18 { + compatible = "tsd,mule-i2c-mux"; + reg = <0x18>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + #cooling-cells = <2>; + }; + }; + }; + }; +... From patchwork Mon May 6 11:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=csHEwPi/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3430-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0wb32CRz1xnT for ; Mon, 6 May 2024 22:25:03 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 80DC11C237DB for ; Mon, 6 May 2024 12:25:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 611981448D7; Mon, 6 May 2024 12:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="csHEwPi/" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2134.outbound.protection.outlook.com [40.107.22.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FD74143C65; Mon, 6 May 2024 12:24:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998270; cv=fail; b=KtJQSaydWwv2+WyDLUaO5kphcSrZnG39RuRDzjKm3lhaqTDoqatEbNshVwV9HC7B2eic+V17ppmm5Ud1ArwcYNBzwnEMOupTFk1QqjI8sB6QiEtU10XNwmHxG3Icik4Z1LItqmDCdtm9dm1lsp6170gGhx8uldlnApfo+t29IYk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998270; c=relaxed/simple; bh=/3tU5oEp1PyVb/8VTRLzwNflZMx3jKZpa4G30Kf+HZI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=sGqg1TmCR1iTLHckZKF4gNS5SBrmIK6YAtCUBAuHy85QOXwpM9SpnBEQgN6nS2DJvSCcTb6alQHUhBXpWBf26nQ9eI8nTgyW5p1pkySSeil4RNPJcERrQo0ejY4DLhKwHufC9TPsPxWBFMoY0jwX3JvETmWhrHBS7piuJt572u0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=csHEwPi/; arc=fail smtp.client-ip=40.107.22.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQGnprD+sykCMq7SQhxo+p0c4XXA4MNeAkZtotJGml3TxRUvVRkPNrzDzHRada4EieaeN+UNxLp4p9cRoaxTnOIpiLTbsrudJcbSc5UDqlmw2PANFGYlcVVvY1/Kbm1+0KDGIvlzhg4jesraql+3WdbymfP7t0RmgUcj7J05KnBpql0x9pW82hSJkkwqLF7XeOZFOEIOSsWrBVwi9kLlDXn9NoB/os069HMC15CzSg7ArCzSbF7CyeIxZ2VKTjym3VZR57yRKP2g5kAuLivJhNvBfyo2Uu3dTdydX4B+sClntXOQXIKfA701l9pIttF9q0K+zFlaO7Ef2/8Hh41/bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=rPMpt+YkB7cnmhpDNTVx484n70RADJC0Zbe8qS+2Dgg=; b=VTDSZKj3ZYwM17CoYQXCLfidCfpPI7ZKSfAcbQ+7ISlE6Xm/NXvfA7FwJbjm7HNYVTGftVD18HRzzANQ0SOtDFIp+gdk8pr6OYpovmaOK6YMvu3qFznzw+g94SfKRpGg856Ig7t0q+XejmKe2vldKLHsbVCn4ZHa71Nc9jODFcdFpJPkSrViKgvNg2oP2GScAM7E6vUdgeC3cVsSMqZKiS0sjbpBKtKbsgcYOwe6ORUQFHaa6QqrTEOtaG9nAq85p039Jm+jnVcdHGQa6h7azCOHFzmzih+xFgZfsnODlWMlxe1tslo1ApJtal3fXDc4wMfnoJu3SGd8NVaWHDahAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rPMpt+YkB7cnmhpDNTVx484n70RADJC0Zbe8qS+2Dgg=; b=csHEwPi/UEvEjAilo67VGPj5RGvUPpm+QitMR1AhCM1WSjieVv3lWCfdy1l8lmyB6tGJfbvn5tCNkFckcJq68qFNpXkI973kkTvdl3DTAHlbFEIo6Sok+fA4Wnw++645gI1oHuyLSU1qZb9kfKO1awlPJr0mfYQeO5/fE8n3i7I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:19 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:19 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:54 +0200 Subject: [PATCH v2 3/7] i2c: muxes: add support for mule i2c multiplexer Message-Id: <20240506-dev-mule-i2c-mux-v2-3-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: b5359552-88a7-432d-281d-08dc6dc77200 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?/mjfFhiRTLmHIOj4YzIoWueSEivHInS?= =?utf-8?q?aZfxyQvtDXeINoO5WswYJzEBIb2+qNKyeN+YlQ3/+PX4sK+PORt9s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5O++/AHWxGRMvxZA?= =?utf-8?q?/iv7pppkO4EEHB2BLce/dxNKW4D1eWJazdA0B7io1eeodw+vnZlvcM/f8Le4fYNcx?= =?utf-8?q?57ijpkHq2oVhY9FqjwYXv24TBCOM9ra60uX4RUp7bP7kNeBCybp7WdJIGW0ARohXl?= =?utf-8?q?BaiMx/39TInwpcVjpbj6I3yKg7Nvcf/DpiibHoacSWW+toaTeNQRagGdMPP1yL+aX?= =?utf-8?q?4rdZHvv1mhxE5QDnvTdGeCL2aPMNLlyZE8Ml5wgPJQ7Z3u7OxFgv9i5Af7zNNafTG?= =?utf-8?q?mDSpH2pLTSogJ3gd/UsYDGOTOxQZgN6tWp90Md6Pk6Q2FixGsxprZPwHSbHbKgubJ?= =?utf-8?q?lyjXT4PoQFIE306T5Iycp4uU9yl5QX2NppBEktjEpc1wf96UxKdLtlZk=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Yeo3HylL1KtjYsR4Dtauyz4rGEUp?= =?utf-8?q?zrMinNU/mkrAhw6f46J8YR9VmJgto49jqi8ApZrIKrVzycqMCx5yZo+dbld4Bqiwm?= =?utf-8?q?GfXfbFHhcaki4hLn9l2PUWUEmgwdzHCw+ZQEoxMYOUO/KUxCPOiJ+pxzW49lFG6OO?= =?utf-8?q?dRlCx4ActtdvOC2zGXO3jlFTyaWjGGKZuizDjMjZCrlp5W2Km1KcItMhG71WWmDWZ?= =?utf-8?q?GEf6ZAYRJtHJCTQUG3WDKnFrUwJMQirZJ1l8SHqfVlzwELLBJX6KlzUuvUvtuve5x?= =?utf-8?q?8kQJAtzHjw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aCUQ8ZljXP9x2/2K1+zvPkT1eQSIszK5C7HR85QU?= =?utf-8?q?gvG8Dypv9liRBGwJSa2K3KI4E9bAoQqrIziSBql/3lsmXIIpEX3h9ID3iCqRFL6fk?= =?utf-8?q?yiX1PmOZe4TQJdpzlwO4pyL1RbIjI3wkpkra3KhcU2jWSKEv4FneuPw1w2m5ciW9W?= =?utf-8?q?s8Qwfx6h4sP5AlAl+meBq3SCW3TFXaFudQVLBeq81UeY6PclPVpdyoKuJ2sVSNfJB?= =?utf-8?q?SLp/ZjGC6icLwk2t69jljj2fuyh5EWVxzopi/bs8S3kUkpI5r6qspFtkIO96syWBq?= =?utf-8?q?yiIGgODocZ/Iju8ePg+bP29M9NSZ/95TxBtvAcKyBmMY40xV4MxrdrKDx63msZ2DS?= =?utf-8?q?2ICh8NvT2r8VF7QF0E6IWHyWeZxG2MYKkg=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: b5359552-88a7-432d-281d-08dc6dc77200 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:15.9736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fqd67OihrbR7pViEvmpaLbDKREcAH9BLHzvDuUO91LBTGDOCcsEh/utbwzuHF+WQEGqsOpsW8dDfHi7OiggV3UDTAq3kolT54tSvLykrBws= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Mule is an MCU that emulates a set of i2c devices which are reachable through an i2c-mux. The emulated devices share a single i2c address with the mux core itself where the requested register is what determines which logic is executed (mux logic or device logic): 1- The devices on the mux can be selected (mux function) by writing the appropriate device number to an i2c config register (0xff) that is not used by any device logic. 2- Any access to a register other than the config register will be handled by the previously selected device. Signed-off-by: Farouk Bouabid --- drivers/i2c/muxes/Kconfig | 18 +++++ drivers/i2c/muxes/Makefile | 1 + drivers/i2c/muxes/i2c-mux-mule.c | 157 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 176 insertions(+) diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig index db1b9057612a..45d3c5997a4f 100644 --- a/drivers/i2c/muxes/Kconfig +++ b/drivers/i2c/muxes/Kconfig @@ -119,4 +119,22 @@ config I2C_MUX_MLXCPLD This driver can also be built as a module. If so, the module will be called i2c-mux-mlxcpld. +config I2C_MUX_MULE + tristate "Mule I2C device multiplexer" + depends on OF + help + Mule is an MCU that emulates a set of i2c devices which are reachable + through an i2c-mux. + + The emulated devices share a single i2c address with the mux core itself + where the requested register is what determines which logic is executed + (mux logic or device logic). + + If you say yes to this option, support will be included for a + Mule I2C device multiplexer. This driver provides access to + I2C devices connected on the Mule I2C mux. + + This driver can also be built as a module. If so, the module + will be called i2c-mux-mule. + endmenu diff --git a/drivers/i2c/muxes/Makefile b/drivers/i2c/muxes/Makefile index 6d9d865e8518..4b24f49515a7 100644 --- a/drivers/i2c/muxes/Makefile +++ b/drivers/i2c/muxes/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_I2C_MUX_GPIO) += i2c-mux-gpio.o obj-$(CONFIG_I2C_MUX_GPMUX) += i2c-mux-gpmux.o obj-$(CONFIG_I2C_MUX_LTC4306) += i2c-mux-ltc4306.o obj-$(CONFIG_I2C_MUX_MLXCPLD) += i2c-mux-mlxcpld.o +obj-$(CONFIG_I2C_MUX_MULE) += i2c-mux-mule.o obj-$(CONFIG_I2C_MUX_PCA9541) += i2c-mux-pca9541.o obj-$(CONFIG_I2C_MUX_PCA954x) += i2c-mux-pca954x.o obj-$(CONFIG_I2C_MUX_PINCTRL) += i2c-mux-pinctrl.o diff --git a/drivers/i2c/muxes/i2c-mux-mule.c b/drivers/i2c/muxes/i2c-mux-mule.c new file mode 100644 index 000000000000..781c978276cd --- /dev/null +++ b/drivers/i2c/muxes/i2c-mux-mule.c @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Mule I2C device multiplexer + * + * Copyright (C) 2024 Theobroma Systems Design und Consulting GmbH + */ + +#include +#include +#include +#include +#include +#include + +#define MUX_CONFIG_REG 0xff +#define MUX_DEFAULT_DEV 0x0 + +struct mule_i2c_reg_mux { + struct regmap *regmap; +}; + +static const struct regmap_config mule_regmap_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static inline int __mux_select(struct regmap *regmap, u32 dev) +{ + return regmap_write(regmap, MUX_CONFIG_REG, dev); +} + +static int mux_select(struct i2c_mux_core *muxc, u32 dev) +{ + struct mule_i2c_reg_mux *mux = muxc->priv; + + return __mux_select(mux->regmap, dev); +} + +static int mux_deselect(struct i2c_mux_core *muxc, u32 dev) +{ + return mux_select(muxc, MUX_DEFAULT_DEV); +} + +static void mux_remove(void *data) +{ + struct i2c_mux_core *muxc = data; + + i2c_mux_del_adapters(muxc); + + mux_deselect(muxc, MUX_DEFAULT_DEV); +} + +static int mule_i2c_mux_probe(struct i2c_client *client) +{ + struct i2c_adapter *adap = client->adapter; + struct mule_i2c_reg_mux *priv; + struct i2c_mux_core *muxc; + struct device_node *dev; + unsigned int readback; + bool old_fw; + int ndev, ret; + + /* Count devices on the mux */ + ndev = of_get_child_count(client->dev.of_node); + dev_dbg(&client->dev, "%u devices on the mux\n", ndev); + + muxc = i2c_mux_alloc(adap, &client->dev, + ndev, sizeof(*priv), + I2C_MUX_LOCKED, + mux_select, mux_deselect); + if (!muxc) + return -ENOMEM; + + muxc->share_addr_with_children = 1; + priv = i2c_mux_priv(muxc); + + priv->regmap = devm_regmap_init_i2c(client, &mule_regmap_config); + if (IS_ERR(priv->regmap)) + return dev_err_probe(&client->dev, PTR_ERR(priv->regmap), + "Failed to allocate i2c register map\n"); + + i2c_set_clientdata(client, muxc); + + /* + * Mux 0 is guaranteed to exist on all old and new mule fw. + * mule fw without mux support will accept write ops to the + * config register, but readback returns 0xff (register not updated). + */ + ret = mux_select(muxc, 0); + if (ret) + return ret; + + ret = regmap_read(priv->regmap, MUX_CONFIG_REG, &readback); + if (ret) + return ret; + + old_fw = (readback == 0); + + ret = devm_add_action_or_reset(&client->dev, mux_remove, muxc); + if (ret) + return ret; + + /* Create device adapters */ + for_each_child_of_node(client->dev.of_node, dev) { + u32 reg; + + ret = of_property_read_u32(dev, "reg", ®); + if (ret) { + dev_err(&client->dev, "No reg property found for %s: %d\n", + of_node_full_name(dev), ret); + return ret; + } + + if (!old_fw && reg != 0) { + dev_warn(&client->dev, + "Mux %d not supported, please update Mule FW\n", reg); + continue; + } + + ret = mux_select(muxc, reg); + if (ret) { + dev_warn(&client->dev, + "Mux %d not supported, please update Mule FW\n", reg); + continue; + } + + ret = i2c_mux_add_adapter(muxc, 0, reg, 0); + if (ret) { + dev_err(&client->dev, "Failed to add i2c mux adapter %d: %d\n", reg, ret); + return ret; + } + } + + mux_deselect(muxc, MUX_DEFAULT_DEV); + + return 0; +} + +static const struct of_device_id mule_i2c_mux_of_match[] = { + {.compatible = "tsd,mule-i2c-mux",}, + {}, +}; +MODULE_DEVICE_TABLE(of, mule_i2c_mux_of_match); + +static struct i2c_driver mule_i2c_mux_driver = { + .driver = { + .name = "mule-i2c-mux", + .of_match_table = mule_i2c_mux_of_match, + }, + .probe = mule_i2c_mux_probe, +}; + +module_i2c_driver(mule_i2c_mux_driver); + +MODULE_AUTHOR("Farouk Bouabid "); +MODULE_DESCRIPTION("I2C mux driver for Mule"); +MODULE_LICENSE("GPL"); From patchwork Mon May 6 11:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=b3fT7rfe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3431-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0wl3DFzz1yZk for ; Mon, 6 May 2024 22:25:11 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E134E1F251AD for ; Mon, 6 May 2024 12:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D25421448F3; Mon, 6 May 2024 12:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="b3fT7rfe" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2102.outbound.protection.outlook.com [40.107.13.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2D501442F7; Mon, 6 May 2024 12:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.102 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998270; cv=fail; b=jTU9eHPnG3eJoEgl/8JKZp5UnPk+dKm8deUNR6JZMyw6O8iHFIPbx93i9VIbcIYDDslByzEw65XbCjOhnTA/G82yTESrzHtLDmQUm36AcK7+svbEGIM1OeZpA7zgT5ryl0uuX7laZ3DC9uJKTdR/wtmlLXp67K3LofEOjWXgKcc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998270; c=relaxed/simple; bh=eeUECib7l+Rt7YbDwNX5ncgZEkGH1P2nFJ7Sl5IKW30=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=n69uwU+gYZgI6NZdoNycpfazBE7wxqgJ6kB/8DQw69Xz2Cb5HVLZgQaQokKLFInNZ0vAx4iuNsPeo5Okz9Tywgfp+eWdociGMHv1uMjIyQYP+mDrkpun8lYHsG9e0mH3gXrbDTdWxCUb/UG0GHqU/16BrOCrw2vj+/x0tesSMCI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=b3fT7rfe; arc=fail smtp.client-ip=40.107.13.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdGf6/5j9KimTmigYqoKBhqG+2pQKbd3lw3Z+DPeYkuA2NIiKlCG8xGsHccxkRMU2zQVuBsHs44rWKTsFM874l7MlliI7ReDZeXGRhMqkXaw6WqSzgiJDV7ek1ihDIV+J0IrIBn7eYIHVvoO4CB8Nw6yOq42w0DQQW52S0nNnh2nu5cOIzV4U2h0kk0LzS3mDApXvdpdpAaMUm3nPnilb6cj+X7TM+zpoiOJD8Ppjejr/2z5v9DuN8wnchE1YThXSzmXdBgYx0r73GeGKteyuW6Ct4tgHmKID7bweGmpvZ8JRzsC+YKOzDkB9p5jzyOQDbKHLtTp1lqS6/BG+PYz7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=f1nb6MgHmQ5pthwDInvb3XPmB6gg/eaOPb6jhHJS89A=; b=eqsJhUuluoGULP/o6gBsCeeKZ2jdF/QG4j1njPo/TbpRfpfxkyTe6Sv6RnQMSTIHFgCqEpdtpq9mw26KCuVZgSJEzCJAguoeAYh8/+55Dr8CCxIfRJ3a1wAIoe2AxO9/5cYlL8eHKwPjYEDS1XiV6todLLIt0z1M4am/y98mATTaoSsop+4QiIkmd+DmFm357tvhhUF+ygnL6fZvMyiDrFUGXTsPBDF4XWCXoHOgUKjigCvYXlWSc8rpIUD++ELSEvXk4FRolIQsXoO4nFfNTstzda8eNIzuBM7yTY5WEV/OrcTc6MQlZFBqTQlck0u1HDZU9mjHarOIy9wXiBECCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f1nb6MgHmQ5pthwDInvb3XPmB6gg/eaOPb6jhHJS89A=; b=b3fT7rfe4VOSCj4taMSxhd8fLRJJrYbWC2vjFA6nVCVPKbNz+ou3EUB5RrEUoal9LYsGzHVe49lfLuYsmqT+uF4BAEyxB6AvYAbz+HcLJWq84nGaMMn3Qj7KSQKoE6LJ0FUtbxxFwWxH+WKchzPUGeVAMU+6YHqNbuAPW5EzgLg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:20 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:20 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:55 +0200 Subject: [PATCH v2 4/7] arm64: dts: rockchip: add mule i2c mux (0x18) on rk3399-puma Message-Id: <20240506-dev-mule-i2c-mux-v2-4-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: cd8daa05-fdfb-4bc5-f1c5-08dc6dc77228 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?VzaksAzXDEirM9rj8Ki/tgT/arlc5GC?= =?utf-8?q?9S2KhbUtcYGi87M6UoX2etOfg8XpJ4oktcM7TANBT5p97U+EFeFMT6BP6Vi5Wz0a0?= =?utf-8?q?OUAfeJPZnmHoUW27q71B4jbISifBU6kJJs0bZBZDMn263UVEAFujzuTI6aGmrlLBG?= =?utf-8?q?Yi2J5ujMrpHtAiJ8bZzhIbZggWjsj1DEX8hNUi8RjpVmqb5OK+6gugRaFDDgC1qgV?= =?utf-8?q?QZAPfNooB4QKxUAg7/tZD86pnOtgaHBClRPmvryBG6nmHjxu6alsgWW/xwQE7RG9X?= =?utf-8?q?y2zsrhQlSAn3oNA2n+hHxyK/snSU0Pv8EF/ZdkHXtvCu75WFwQBIrA6ReXUoF8/I8?= =?utf-8?q?JrPq1ZSsjymbkoRFObSrJQtE+58d0dieu/wvocwLUHaQcj8nUfzFjdhn2l6mp4u/M?= =?utf-8?q?cy6CPb52jF3cFQruBNE7FJ0fS+iOkVenOrUzfpJOrH9p2l2EkuejlMNs8OhVH92bD?= =?utf-8?q?2Sk9JBLYi2aGV4DL2P1ay/xW3iKSCwa8dpOvLh7smF5KLlO9bE+1RCABu9ZDKMYx/?= =?utf-8?q?CrS8DSj4dLGi5jmJlNFAQfQRqt/V7GgpzSzgIeg1wniZfYi9Tutp9fq4TkuT7gLdH?= =?utf-8?q?78V8d2RTI372JbMi9cI7nbHAI0nRkEbOyd+2dTmzxvQyBs+zWvi1RfrmoSwDdBtrW?= =?utf-8?q?34TW+YPqQ5gHlNAQY4x0w2kxgsWVYuY1NeXTj9rkHApxgqpYWw1pOsnyFAN+AbcXv?= =?utf-8?q?1ylCWBuNhQCOQI+Zia1/iJttJIScJmHPhFA/nwfEvXu5nah3c98t5wUU8myi5R+xj?= =?utf-8?q?oROtpK9OZHuXLAm3RJ8CXPdC5F8ExDg/KF2n/ZTpxcotfcc2L+OZBHetLuPPn/dag?= =?utf-8?q?1PlGQxnLXIUGxD70FCO0CaHHzzpZt01kCvjqVLWgGvUy7rnSHADhpIo6J08r3lXX/?= =?utf-8?q?5l4IRht9vabY0VVM0U8K+ISYWMF+oGVgTvs0M4avomHaw3hyiBSHp+F6l7486KNAC?= =?utf-8?q?n+f7g0xClL1O//VV6RhZADSXGAytRRdJbqTc7M7RA46nxj4gPU7h+IfTTWqoM5IUf?= =?utf-8?q?2NcCusibU8VGFq41/Jj0R8pEmnVIsUOPd5cF+7LUVi6yoYryrwY0APHDA5+ZCKMAL?= =?utf-8?q?OFZkM+7+Honxwctmn9Rmxq9tAhjS6R5u7afK33ALQ04XFX0Yt2Es4/noWTgBZ37ik?= =?utf-8?q?M2/Ro69uyGanTKXxuK8XjA7OK+t9H8qwWNksRrBbXehzPOQyCl7iTK9AgATZWPsxA?= =?utf-8?q?PTMiYV960wVMyjo5kck7v/VUZrcT1tBH1VWm6wnzPmCai1SiJmfjatXe37vxYq9Do?= =?utf-8?q?a8bsX1FccwdJ4jNhSff8T+B6J+B1gi0URsI/KuitoIOvygHn+xSwJYFI=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?GOulo0ZUjGANBP00mjqY8v8d6L8a?= =?utf-8?q?jGDhvaqamev32CXL16cpbIjbN7cea/uyYLOWomuZzVhX59FehA9r5XyZi+PaFM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utf-8?q?NDQwhvTmHs7Ngz07s0eqSJCDi7irIP6exSYO2F4s5selHZbubPevcEcgfUurhb34p?= =?utf-8?q?aAiSEkcqF8JBXMQNmenIPPXmxylO6fWz+iG5s9w1wzES9W34tZ5kQXx1W7giv8QXW?= =?utf-8?q?kHdT0l43BLqgwqeXT0MBquUM/HHgL7hFihB39O+QqjRm+X96VqEkXVsY71/JSoavb?= =?utf-8?q?xdBrGSe04lwk2GK6+fMX55PtW6qELLPy6ddlrZhDXh0jtWq6po9bvsMlU0UPjUP+A?= =?utf-8?q?Ss2CQXcBM+uPUDMJYADGUiiL1UMuOEB0uvUUFt7jYJZ1DpcZarIJkiQ+uIc1pKwfL?= =?utf-8?q?drVan6FCUBWbDKt+LzirydU0sSFeFICemn69cqZozBg/htJbyMqdGPtbR/i5fOyAH?= =?utf-8?q?ZNVppLEWVC8O0+QyfzjJ1eH6vHVK0vvSM4WFi6JVy/s+rJJE3SZ9viW7NZM5D0cyK?= =?utf-8?q?A+s9oE3fKoy0oq3Lw/rxEFkAengZHigMUP+hlzVxs1R7trwiamdVlWC9gV9igHGhP?= =?utf-8?q?VAD17lZixCmdyGx59tb8JYPNRyTbw5dyb7J73g7tviOWvF+siKi/3gtJXUY0V4gPk?= =?utf-8?q?TkS/IbivLo7/1zp35Cu8JsPJKlryGzWyLA=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: cd8daa05-fdfb-4bc5-f1c5-08dc6dc77228 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:16.1806 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eFytnREWoE70HMv/+lSBz/J88HyrP/v0AEFwjWnLCgeuj/eOP4kqB7J6gvxZ5cnaPT9pdAiaFs5qTGLAuVfvVDR6U6GBURIdnWuc4zWga2c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Mule emulates an i2c mux (address 0x18). The amc6821 is exposed behind this bus. Add the mux node and amc6821 as a default device. Signed-off-by: Farouk Bouabid --- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index c08e69391c01..e7313be24c1a 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -10,6 +10,7 @@ / { aliases { ethernet0 = &gmac; + i2c10 = &i2c10; mmc0 = &sdhci; }; @@ -357,10 +358,23 @@ &i2c7 { status = "okay"; clock-frequency = <400000>; - fan: fan@18 { - compatible = "ti,amc6821"; + i2c-mux@18 { + compatible = "tsd,mule-i2c-mux"; reg = <0x18>; - #cooling-cells = <2>; + #address-cells = <1>; + #size-cells = <0>; + + i2c10: i2c@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + #cooling-cells = <2>; + }; + }; }; rtc_twi: rtc@6f { From patchwork Mon May 6 11:37:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=UGsT0bPA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.48.161; helo=sy.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3432-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0x40bSBz1yZk for ; Mon, 6 May 2024 22:25:28 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A4A9EB23A89 for ; Mon, 6 May 2024 12:25:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B2F2144D39; Mon, 6 May 2024 12:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="UGsT0bPA" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2134.outbound.protection.outlook.com [40.107.22.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5138F1448CB; Mon, 6 May 2024 12:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998272; cv=fail; b=sFuvX3VBvP/HfW+nQc5/uEyt+6TiKiNX6EDIy47zSaX52rJro527hkSTHodh71QSonmobsb+WfqkBe3vXfSNtC/+Vo2uBws3A5dYYmVpF/yMF66ogQmbJZBM6+UXOQeRo8lUyyOqTgB0MQA1aHKFl8ibsmycCG+ecPmFa9vZ07o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998272; c=relaxed/simple; bh=NfTfHJ18239p1sYsdBArc7Weo8iLOFNVO4S7pDS4fAA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=J12b0RKtPgKSX399JmnOxeZRWlhSyN4ebLUbRaA21Ss3hF3jIrwhYMR0tMwjacVCNbmjjjuWgpDvUb9HKoIzZIpf2lFrU6mmu4uaYBImSnWbxYmWozGZPIUP7CLfIjmbDN3W69/QrHfg3gbHgFQ8PkvkrPeKeHZX/rmQuXKeAyg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=UGsT0bPA; arc=fail smtp.client-ip=40.107.22.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QbBr9b9g4JOueMtQ9uEqL8DFAR1aIAve7Tuj9hkRfbQqRrqa2wydKKIDWzsJBfBepWMJETPIbNTXrsyPks6EMyEYQFviD2aKPAupXZjYhCzppFMH2Vd43Mv3EchzVO6cQKtkCQzLAI6+e4BFbhZwM+UElY5pT+ZvAfn2d2kPd6+cYifWclU0oUtK96tKCAgJwVHYFlFEOj9XWadK+hyzFpMc1EUt0E431uTQiNI1iqB3ZQdRHZIMC+CiEgDQS6g8XFA7sLCTe/F41iwOeQNlHZgwHyc9G3yrRDnmwCeOKddC6pmq1wWRHellPib9XbZ4a84kgmPAufVewdEfYtKttg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=U1/V+lbRp3WelWm1b5wkE6w2cGaJdeer/dAdKepK58E=; b=EEVipjEqJeyb+Y3eQSr1gDZOrL7fv559cYsHVIQDUo0VdoFgfY+vE8767Ups+QaNzblxPwksSlWZpgg2pH49ZLsC+ppPWS/XPp43lxervuBIS5qiwWHxl5nM7ypGYottDOzDUr7DggVAekki1WYdAaEwuS2W9H0pwG0EXRo8ES+QUuFS1pof2fC002LKNoSbYYg8mvovoTd6xtVRD2rNF3a5O/FU3djoFd+Iew7s982kyo8JUfD6BaXoVrq0EIFJT8kZF+qwImYA6SGuIEQsSNRTTALcARuwtyWUdV5IN/5elY0ZGDlSwQd7zCVsTYApwj6rmFSilKgbqDwCx2eOLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U1/V+lbRp3WelWm1b5wkE6w2cGaJdeer/dAdKepK58E=; b=UGsT0bPAB9oOsL0BbekZtSMqUshU7vA7+fzS8p0al4WWHukFm+PMd4RpYAiquHjK91zrK27u2HZ3ffk/clqQFnM0HGLEFLV8ihRMQJNHEWFp8S/pOmhUumBUxFeLMXbrjuEOIXPbXtSkI8eVazYDk526XJMYLvKt53L9h3ddzbY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:20 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:20 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:56 +0200 Subject: [PATCH v2 5/7] arm64: dts: rockchip: add mule i2c mux (0x18) on rk3588-tiger Message-Id: <20240506-dev-mule-i2c-mux-v2-5-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 18ecc76e-d411-4665-45f3-08dc6dc7724a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?vyPE0RZdFTioDcYVeynh3OErd6ncNdn?= =?utf-8?q?lWXP6DXeFjlMvqqlY04u69wfQGmn6bjAdmMF5TFY/T9gIL4IzgW/140dbiSyp2Gfr?= =?utf-8?q?55FD/+DeURN9JfuxVWeGAOjZy+/C/yQnkcT+0d8QO7Y7rS3GWBr8/T6QvheOT9Dpc?= =?utf-8?q?GIeMLlVisySpVaL0ugmQVtUmhTwRTjZtoctl0MjwOYiO1BOv/aS8QO+lL2geZMUPx?= =?utf-8?q?YrVkt51zAZqzlz0tgqgnTg9ZZqHr86beIohxCmnkMo0lB4U8MEHdA92SxNpntBqQQ?= =?utf-8?q?Cgla7MLBRQOSo0zTIOiT/lBB80iocMOGpoBVG3HIyPsiAi4piE+dQtOkiGFAGZ4K7?= =?utf-8?q?4oyPGBqzS7MrSA+euH0Vgy6M+nZyQJ7ba23loicv0h82BcTnkRu7oU2uQQVXV/huk?= =?utf-8?q?HAZFGshPJgHpgOIugUy3Ki3BZzqQbd2ALVIkX1muWqPrCROG9PqXagaz5l2AESfcX?= =?utf-8?q?PuMgGOmG93HTbCZ57kLQlP1qP/e7Ora6n4IVi3ISgKAK5FUutdSB3Th+nJKpuNLJP?= =?utf-8?q?Fh4h6EK12kLh1e4ymdZDWsFnVen1L/BZM6ZqZhLNqhvtooueCJIcNEBNIDYnwukeK?= =?utf-8?q?AkWj4s2vJX7e4fVQh+MP+i0HNk2XqQaMsJ8x1MFERyKcbXKnD1QAwEdjOD6UW2mOf?= =?utf-8?q?WQDHazjuERsML2k/ELiwmvlZCu0qUr5qVZAyUH8nq6vgf3HIQO8IMx/ItM6ewPEOs?= =?utf-8?q?H/TZx6U2TzhxJpUqow8Co5x3tdRL3cZF41LlH7iI1g2e6oX98MpA2nRAvqNxAXCHS?= =?utf-8?q?o3xhULiNIYARJU6wjaOXhfmQI4Vwux9FU/c4fYygAbOEgb+stMZzxiHQ/iw+hE/53?= =?utf-8?q?8SGow98rHsFKk7u7sHeXDJmOI+HSsfp6xuY+vygt0BpLU3Mf6sj7bzWPswp5kOtu1?= =?utf-8?q?y0hG4ene6wN+mGGmKxo0rfrji79ze0J39QLsT+u7yIX5ztC9PDByGHjYMNdqQV1iy?= =?utf-8?q?lrFraTBT0G5NZmkOazFEbB4sRL7CX0rVBFPTsPKQEXnTNhhgoOLyNUtTssZH3IsRm?= =?utf-8?q?ZXVP00CCnFMzQP6BsV/kyRgYi7ydg7YK11uJaALvthuUWjauihFQujJl3bvOPGGJW?= =?utf-8?q?/F8H61G0TheW30Fe1vRNWYSdx2jAu4FMQ8g7BkYyeC+TyPYLMOKyfNww2vSctb2iP?= =?utf-8?q?lDmTp8MpU6aPsbhcdBHZNshzgLQWMYq75sc5fbJsOmIzmdmRH0QaEyiBXG2czhSvu?= =?utf-8?q?hpDkiy2sHAMEwhMNkgyuaotUsgqQ3mB5nNejLKyptdXKa6NAgnTEPnDgjMNVFepe4?= =?utf-8?q?oMZsu3OfnpoHm+Js7kNBaQbV9ZU2/VhxWCML+XQf5ySDNJ87v2U6yJlQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7A99qxBLNrYYeKji1eRGD0IOy3Jj?= =?utf-8?q?HzgYhPhYyClbSsEd/idSprFvr7W904d8KxcWPvAuYUAhKtIpnW63RK4yNQwbU29k+?= =?utf-8?q?wPDXPNy4Lgerj+O5NeoO0xEditH6MY6Ka6XBeCGTE5rVINp4Rs/x9XiX0RyoJOiRa?= =?utf-8?q?WFLgepLGFXv8oVipHsMPaW4MWkMCy/xVs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igXl4BdOGieC7y+Xh5WCqU85EfVcToUe+dY?= =?utf-8?q?8VdYBpKWWnEskou1HuuKfzzD3jCLOqaxv5yASUIG95DzVKO6R1wCWTWanBKq3HfAc?= =?utf-8?q?0DO+mMN2O8Vzdgk9WAzrfjIoZFpu5wcIx1kYaet2UrdWGyURv6ZOMvQ/++vKQsr3i?= =?utf-8?q?3CfoA6HRIH7rJEkvRL07oOkHumIBvdvGqSno8VW+r3B0Ebwx3t+fspBMos5v9wJoX?= =?utf-8?q?VBz37nYZT4NyhSuRK9aprlDRNZaSq2Uznj5ouoqr0iOpe35f0n/e1LcW7uKToZzAx?= =?utf-8?q?5d3E7lkEYzGL3XoA3bAY/lC66Y9shE/t2WphU72Zj3x2pMEts+LyfckmRxAx54E8j?= =?utf-8?q?caHN4LXmGF2g6vCJyvJfvnTVlJ68itSV4Gkib1S6eC+lNkvAXTyukDRoYNSEyh2WD?= =?utf-8?q?n4jzl9cfJ5VE8IWZCFSlUoZz9Z5G268H8oafeF/hkLGl31qYx8N74/0l6FTZcU7za?= =?utf-8?q?eGgzmwU3xdzo1dJaZ6BcpF1DJKKupjFM3A=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 18ecc76e-d411-4665-45f3-08dc6dc7724a X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:16.4117 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cBffa2g/1iTKG5ZfW14la8JXn8eT8490uSO87N27vogXvOkRUrfxY7IGEWt6UgeLsZ/+IIPnznwGURGPVbSkzc12gIxCsykRH1YHIw4T1rQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Mule emulates an i2c mux (address 0x18). The amc6821 is exposed behind this bus. Add the mux node and amc6821 as a default device. Signed-off-by: Farouk Bouabid --- arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi index 1eb2543a5fde..5ed7d51717bb 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi @@ -12,6 +12,7 @@ / { compatible = "tsd,rk3588-tiger", "rockchip,rk3588"; aliases { + i2c10 = &i2c10; mmc0 = &sdhci; rtc0 = &rtc_twi; }; @@ -210,9 +211,23 @@ &i2c6 { clock-frequency = <400000>; status = "okay"; - fan@18 { - compatible = "ti,amc6821"; + i2c-mux@18 { + compatible = "tsd,mule-i2c-mux"; reg = <0x18>; + #address-cells = <1>; + #size-cells = <0>; + + i2c10: i2c@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + #cooling-cells = <2>; + }; + }; }; rtc_twi: rtc@6f { From patchwork Mon May 6 11:37:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=Mf016ZPk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3433-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0xF2h1hz1yZk for ; Mon, 6 May 2024 22:25:37 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id ED273B23AA1 for ; Mon, 6 May 2024 12:25:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05CEC143C4D; Mon, 6 May 2024 12:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="Mf016ZPk" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2102.outbound.protection.outlook.com [40.107.13.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9F821448EF; Mon, 6 May 2024 12:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.102 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998272; cv=fail; b=oB4p3YVImLQ8zw/BCEx/rdkNh1FGdoRebaHeEJ7gF2Slf3kVl6KngWMTkaZHFrOpXQd8c4wVdKtBKT5XYejXlSfRXM6LZ2wVmfmxPrFtNuw+5rujFFd6qyURcZOOkbNMDtPbij+x4u7W1vgPHiZXflCPuQ7K3x64q/WWtwNuMnc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998272; c=relaxed/simple; bh=xqpzc7NXXqiL2JHQhHtVFr4vFonc04Qv4B57IIk6dIc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=S+up/grcZqBz/e40SZvhqo4Q+kwl7slWovlsIaQaIU+VAk0rgSQ38OeOAlP3He5X6TIRE5V12Ffz4lTz7olMLtiAmLIn8EZEO6sCzeHsIuErCjEOpHEIU+9wbCVbt5157DQ9h6kwXHs6/fWDBg4s3+qlGSAIl9rzgZFBGWY9jwI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=Mf016ZPk; arc=fail smtp.client-ip=40.107.13.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cPoBX3mjF7hUNfTc0Dlqj1KTsoF+sYKhYBGI7uohJC1r6KkC8rBTdNMm5rvntkb3+ZdJZ/K5m2Td9ciEoh8UluLJIjBUfmUMVWbwx9D6fWBvxYXaNefeV7djPj5ql4bHQhj9EjhJX4fJGZxGXhvGZKF/zwFnhnkceQxwQnfck1wEDtsB51C2bXIEKP8EhGgxv3Wppb9KZP9c8cpf+d2aIpXziSMSa9Vq2dw791rTYr6h9I37cqRECiDSK7BBMaZ+Gk+MzvJxNg5GfKZVRH2EwxGG2RqeAInY5rWT6kYSMmgNh6lZIrnsttPnqT0jCRjjiSVENQ4dM0S6VciqKal8tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=NR1k8eLeUhXOQnJCjLHpucEuwIQW6rlkR2Z0uoNpV9w=; b=Eg9Ww7e6RoiwalHEqDPzIe/LTUfQfTI6Da2GBHlEi1zIOr4FO6199pLrcJ9Si4CcZSMLI7WjGVDTu2XZdBUiGQ4xBIPdwF7LLMPY0eOD7iyP1BnGi102f5drMmQJ3aqKtz0/zkxIbwhKTdD9S90yofydOYDcQokEAsSqS21dskAWz5Ie5Z/hKGTtx89/nx+bUAaCVsVjsTb9yHYiBcdT9jB9XzJ4Vg00rAjd6OEJeleEsF83+ofG7GzqmZtKKJeCkPbmTgy76llpEWogcJRjxKEaVNIMf1U63HOtsC0J68K7kr5Yl4nnFKZHrFsHOdLCQmUav/y5W5bV2OudbkvKIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NR1k8eLeUhXOQnJCjLHpucEuwIQW6rlkR2Z0uoNpV9w=; b=Mf016ZPkk+YAa0f+IxUX1FH5NSPrbzrcJ25MVgXisUCQFq1mX5hcmkRL2jITPi18CAPj5eZGEh/kBJQACCjvgyzOi/TYnQFEBAag1E/foHb1g14fbkgFWOWXJS42m1lX/2TTwt/XuJrxxN0Lqy8Kmp3Qp0Km0317bpv6Y2Omlgc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:21 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:21 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:57 +0200 Subject: [PATCH v2 6/7] arm64: dts: rockchip: add mule i2c mux (0x18) on px30-ringneck Message-Id: <20240506-dev-mule-i2c-mux-v2-6-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 1933d2b4-380b-4ab2-b53a-08dc6dc77269 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005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?g/LNCZQjksltUnQMwRJQii7l8SwBsCkUSbZ8GB7Llp2n35TRPp3mtXgM3GRq7PdGA?= =?utf-8?q?Ie8bOke9QMFFx0NyTjZ/D4VuQAErCSd93YLGD3XhL8V9+b/d5dV9qPnqZM9f3Me7p?= =?utf-8?q?/EdEfeRvxFM7uyS/zScNQaApOqXdCeMrLv+pCPpyRzrqZeo3KxB4cHC8SFUKN1TIz?= =?utf-8?q?c31ukMUlHUBetqS5SJe3yceIYrD1Po1eEmK0VaQcSyLLloBkuSG4oWIsT2OT73s9X?= =?utf-8?q?P+FQngYN7DKsVSQ3e7oAqKcK3a5/Qq/j6uVIE9marjUVshLYnphmabVpWpGcbqjv6?= =?utf-8?q?MWeU3oGebEeeQYeq16HEWYum57ueWXH6jDpCjoLiwZQqilr1WEVJl9hPzTGzWvxZd?= =?utf-8?q?nKelLd7VEN60uPxDg/xRZqnEvg08ZwS/re10tC1XgV0luJoPD/4FHY1wJPC5REw9k?= =?utf-8?q?W9by+BR1emaIRpkZFk1FXUmgIRAhwkS431Ec6i7QAkKlgtw1e8lx6jyw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?UGNls45+7iCagLoeLERdcORFYdYC?= =?utf-8?q?c6a6SrX+fNo3nOUzYo2r7K6YtIxrRjBn+31aAMl0b10VPQcyH8dUAwV0t9Heg0gy9?= =?utf-8?q?0KikAIFqflPcgaY27fDhXfTUnbsCIUVWxg0mwkLNIPBMwnjHM9PmxeaLAfqDtNxTS?= =?utf-8?q?iEEl2B0UBnIKlSXNOCLa01EIpM65NpHs+oCW6Jos9ndOurbdty2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GTWk9w+nKQg/Mrl?= =?utf-8?q?vagTWD+khvJ/SmmnSFN55xHjcOHqTLy2fOYUDNJqaREGY1eoWVDZoMixSMIkmCuaX?= =?utf-8?q?BWoQzvZinXKk0vCZhiJcPVFWLIlOVt8RYCeRYvukk2A0zfgYX+0/S4bESnrweV1Qs?= =?utf-8?q?xfPfmGGWkI7VvD8Dj6wlUSVoM+qIrd+Udos/KbH1HM0prZ8LolKm5gD0XvI/C0U/o?= =?utf-8?q?zXGWbLy384X7gEZxXchwTAuybXxmRqX7WfkAq2fE+PY0M2zltwZ35+CFRsfp1iEZg?= =?utf-8?q?LbdjbJY7rsS0cZLh57Asp9hbCO87EuiPc5yKKZRKvvjhQwzA74qH8gjMkIieXoP/D?= =?utf-8?q?FOp0wwD9JgrycQt8ITXSZ2xlzyUYVNsxg3h0x4ZWyvDN6egx9hmSDi4aN6/tFZTcs?= =?utf-8?q?LEgIVoW0rgU5ejMX8ZaTZlbPG0W2ezao/63UvYg8UoKiLq3vlwFVFdjTsMch3WB2B?= =?utf-8?q?KMKTt5IlDqhF0L0UYy/N7gvdq4jZz2Ot/g=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 1933d2b4-380b-4ab2-b53a-08dc6dc77269 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:16.6117 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: anNosjluEfS1r/eggCwcFVG50B9Oi0PTDK8Fop25OkPdi83/k4WlIAgUKiwE9WLN40Bn7MTNT05aMoaYN/KXIUNfKJQozU9P1bHoi/bAEoY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Mule emulates an i2c mux (address 0x18). The amc6821 is exposed behind this bus. Add the mux node and amc6821 as a default device. Signed-off-by: Farouk Bouabid --- arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi b/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi index bb1aea82e666..eea906379983 100644 --- a/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi +++ b/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi @@ -9,6 +9,7 @@ / { aliases { + i2c10 = &i2c10; mmc0 = &emmc; mmc1 = &sdio; rtc0 = &rtc_twi; @@ -291,10 +292,23 @@ &i2c1 { /* SE05x is limited to Fast Mode */ clock-frequency = <400000>; - fan: fan@18 { - compatible = "ti,amc6821"; + i2c-mux@18 { + compatible = "tsd,mule-i2c-mux"; reg = <0x18>; - #cooling-cells = <2>; + #address-cells = <1>; + #size-cells = <0>; + + i2c10: i2c@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + #cooling-cells = <2>; + }; + }; }; rtc_twi: rtc@6f { From patchwork Mon May 6 11:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 1931955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cherry.de header.i=@cherry.de header.a=rsa-sha256 header.s=selector1 header.b=kBn+oMNs; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=139.178.88.99; helo=sv.mirrors.kernel.org; envelope-from=linux-i2c+bounces-3434-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VY0xc4k98z1ydY for ; Mon, 6 May 2024 22:25:56 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4C4E5287E7E for ; Mon, 6 May 2024 12:25:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DC2814535E; Mon, 6 May 2024 12:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="kBn+oMNs" X-Original-To: linux-i2c@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2134.outbound.protection.outlook.com [40.107.22.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69689144D2E; Mon, 6 May 2024 12:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998274; cv=fail; b=RyA3ZD0nDsBuXWqt2qLEBS/WD/taRqPVYQhCXvAszsHUWupsRoodum6HU8l7l4Ea1DInHeKLZ9X4Z8RXSTxgK8mu/xiR3PK1VxB1Cz6tRTEQwMehbL5IwAugSrAQ7KQeweImIQdwKV2eX9geEuMS2PnO8btfCkm/bf++P3J5WTg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714998274; c=relaxed/simple; bh=bu3/kFk/5u3incaJRPSakwvL8ETOXOCGjkcyxwm4Kzc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=PLKWuS/EetjrCwvyN6m6leCtpVc47TqQsX8Moq1zGPxJmH95vRXl4qNjFSst6GZliz3CPgYv1+bqYKZpk1lIWEd8cy2b6pktEcy/lUVVyNfp66bi8MRXbyqHaDUfpECGE4WfiqGUfGtqsQOPR2oDhzmmQWaDhaYcFBtBieq2WNs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=kBn+oMNs; arc=fail smtp.client-ip=40.107.22.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I/5uePzD5XCbuUCrjpYCO/ewaiEAnU6z8m4Y/gE8hVOsomKStvPWhJZGcyRxk6dgjiDcl2MZT1ee3zG5tJz1VVAHxo6htw2BELyVrQWrylctp8MHPbfCRoJP5JhDB+eaUPv14WJF5oiTO7VJw5Qlk7AuYaOrBZN76NXs1+Xlaw2xoICRtqKCJkI6CVGLQKSIVL1HyOmHq07/DRZsep97oRmvO4sJLqfdD/jMAmeK/3bPQYqZCP9/zPxKwYTAcsnlmVh6LlWykAZ0R/pteCCKvHJgahdEmxqPO+H8SO8IZoUqP5aLFrNaUTmQThOiccNEUOVKu4gKmhjOMvjdIUmQmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=8PY3q5GBvcYpL+wae89VuyYkBsPvdoQ/tP1PV/CHqZ4=; b=dgameYgwcULaHwvptyA7knGEdtFwnWPbYkrXKT/3aCch/aTpdCArPOgRgmgfCh6jryAa426VwR7IRw1p32l+qlwn3FXV2Rnh6lTlk7LLtmEcdUojO2UTS0oqg10+/5MzEia/P0lUKSpp3VWBtBldjV7c8i59lY3iNXJzmfMXWEuB4+dRoodpRfkNnafd9Jna8XaZdQ09Kb5xh9n/zRYjMdjh8VTnwA7GG7UH7yKbzarZkq7HYuhmxyL5HZuB5BQf7alzv6/c7/nkXK0rqytiM7sjTFzAUw9vCUIzh+u7/WGuAstydUD8qqK+hh0+Oqfm+qY4OjRb1AYdD3kGD6VVvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8PY3q5GBvcYpL+wae89VuyYkBsPvdoQ/tP1PV/CHqZ4=; b=kBn+oMNs65S9oSwAoRWft/hoqdjXf/mCcHHgHNjYnozSm0+iWB2gn2q0srWh1+j5lsi9MLmKoHvfj5ZbRLxPcqS5GC0Kgsp/BOIECCrm6h+yij1gvD0HVnASSDIaG5iJb4LwUwtCiruJ6TUfNSvJPiKXgKNWqxn7o+6Tunx+D+4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 12:24:22 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::59d9:878d:65f0:3936%4]) with mapi id 15.20.7544.029; Mon, 6 May 2024 12:24:22 +0000 From: Farouk Bouabid Date: Mon, 06 May 2024 13:37:58 +0200 Subject: [PATCH v2 7/7] arm64: dts: rockchip: add mule i2c mux (0x18) on rk3588-jaguar Message-Id: <20240506-dev-mule-i2c-mux-v2-7-a91c954f65d7@cherry.de> References: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> In-Reply-To: <20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de> To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Heiko Stuebner , Quentin Schulz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR0102CA0103.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::44) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f023787-ea0f-4ee5-8160-08dc6dc77292 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|52116005|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Y7eZ0VekmoIQJgwuI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UPq8y6fMt5?= =?utf-8?q?8g1OOLy33lukjTtSJo08StDnNB133aI2I3lGZSSkbTIQF/cB08e7BoedPAMjCpdMh?= =?utf-8?q?JG/r/fNkOkeXSoQi7sk8dQUc3BHKfydQEEVLBP/PIZfUF/fRD55xDQfKtU18/nMlI?= =?utf-8?q?T0RGp8J2xjCD5TJplmnCrDukIpTeZNJbTjjwCy86z8spvFOaq1MJMxJ1PklwitN2/?= =?utf-8?q?Y1ZcExKOf76t2XMLkprSPRUDH51HS/lV4UZC1eqFPGLVsmuGbPqJByqbVIuNabt7d?= =?utf-8?q?AGB24PjbhX/JzC8Teay6HFYo3YPPTVetDCbC3oc50xByqzXrcHIALisW7z1Xsb3Cc?= =?utf-8?q?v/Qb2R6ZnzrMbch4xm5QfH7M7uH5YM6Gn/UimAebBx6od78UmiW4aENG8ULobmAV6?= =?utf-8?q?25d5X2WF6edDTyEIALOkslkiUXzFmB/pY9t63zZ/kNOooekSqh1lcsKk=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0w0hPP7KVgDPXzaeGngrDxMKBVQa?= =?utf-8?q?gbIohbqh+g8kkFNX8JLpE4EL8a8ZU0nRYa8rPnz/u+C8e7OU7Je5vfDbHoZl5mMn4?= =?utf-8?q?cbV0j2gqOO4NsjGsQFut0s3dITN4zd6Wve0BgFxW1KACLspLaUGt8tULU6zol9N5N?= =?utf-8?q?qXGWN7kDGikTlPDE6luxKuPse3cYGbeWyq26qyDj2CAfsatH/dSogT/cEyjtVTaRy?= =?utf-8?q?a5wsXRo+jld3dIuHz1RWHIAeyjxOJmvd3Nnb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YAfV30u/T8iYdTf6geD4B1wc3z4M4IqjGCJ2LvW3v?= =?utf-8?q?H8RjNyQCNLjPyCSJ+f31Dt/oyKB8NEz84m91ILMQF5CHDX0pAdt5N8f2fbQZNOa0A?= =?utf-8?q?v7W0jPbgQ+3kXMNWABnFxW0s7bi+XBfDUesTlt9voRhjaEw6Y0aYrJ3ZZWpLCHLUJ?= =?utf-8?q?xCu9UrNwGkiGOtukfh3gpTJIbzEZwLVoD5pSvW9c7HF0999U1Eej2B9XgJux+NnTx?= =?utf-8?q?F4k/AJNY+YHnnJuL067+eYgYPkbMVLgixBPyr162nUTnMNyT+e+wBaOoK8EtWuZn9?= =?utf-8?q?lD61UBSyXbhiKpX2mqJx1KyQJ9CjPE596LsKXVCvMetjyxC5W0V4tuh+CshiCN3yO?= =?utf-8?q?9+DuB7lfSrtqK3/0p1RLFexgxEWxysyUnirurHbTkeIslae/NElFCMOMEN1ot1n7w?= =?utf-8?q?sxtRSWYwrO/uLGazmXDmLGvObTIXPvkqkQ=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 6f023787-ea0f-4ee5-8160-08dc6dc77292 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 12:24:16.8812 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UkAiFB5Cv2qFvSxvLJrf0UZRBWWXbkyfIcRjtP3Bwzny/59ZeTRymCWn5oVafHtaiOABCwFWtbrzCGTEo5VYrla6ankU17yx3zjsVXClZaE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512 Mule emulates an i2c mux (address 0x18). The amc6821 is exposed behind this bus. Add the mux node and amc6821 as a default device. Signed-off-by: Farouk Bouabid --- arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts index 39d65002add1..14f1322c162f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts @@ -32,6 +32,7 @@ button-bios-disable { aliases { ethernet0 = &gmac0; + i2c10 = &i2c10; mmc0 = &sdhci; mmc1 = &sdmmc; rtc0 = &rtc_twi; @@ -249,9 +250,23 @@ &i2c0 { pinctrl-0 = <&i2c0m2_xfer>; status = "okay"; - fan@18 { - compatible = "ti,amc6821"; + i2c-mux@18 { + compatible = "tsd,mule-i2c-mux"; reg = <0x18>; + #address-cells = <1>; + #size-cells = <0>; + + i2c10: i2c@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + #cooling-cells = <2>; + }; + }; }; vdd_npu_s0: regulator@42 {