From patchwork Fri Apr 26 16:49:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 13645087 Return-Path: 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 61815C19F4F for ; Fri, 26 Apr 2024 16:50:59 +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:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=41yTzbWGwN8qJXY+2wq5ML2KMHMYSow1ZKuOGCLcufM=; b=g4DybQMJIBidVT b1V+HwWhBKIsdssxRhRPtfCJyXCoYX6s5ohrB3zBYolOQdFPSY+/hX4j2Gw8y2cgZBcwSQxQQVg+t ZKII7uOGLFarP43cQa32ioO7LnpU8jlw4gzxwpZMnXPk/V1vGHvyOGaTpDQ+4IgBp+76KpkbcDKm9 ly2PIiutEW9DH+WYwO9oPQz6x8/HMLbfwxmHnYcGYUmnhJH1hydKSthD8zuHDbvTy6Mw0eQVOr3F9 ywWmsH+OTrAOINfowY9U2U2Ait5ZbYbPtyO5Ily5qOEqYedTsuCFa2nUIHoq0kK91XXPABnqKTcY/ 6apzc8uuJkgcnxdQ3t4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0Oml-0000000DJpw-1w2w; Fri, 26 Apr 2024 16:50:55 +0000 Received: from mail-db3eur04on070d.outbound.protection.outlook.com ([2a01:111:f400:fe0c::70d] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0OmX-0000000DJe8-0RtC; Fri, 26 Apr 2024 16:50:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXzgGfSv2+Jz8VdUhPP2WoqVIsz0KLxCjsn4BqE3rK6Rq72nFu55BpUEx3b3be8gB3FUEWWb3a+E86AFvr72BtHUt6/tJDTOdCzDTA/Er2IFAkYbQPPQ9u0sIsGO2rB+Y45IxP0DiGZuE01y8c/xGgi7dgjk+CsLPkouVNzEfrb2Z4Zp0UjgKtAP71p42XHfZdWTqios2+Mqkniotmu8r6QthU6E3hxHE176j+QVBO2UHI3ULpsFcFnivrCcqsdC98ADugNHaHMxi5WIjmPhFcV5LX6HK5IcaqjdtojMOsWhMWntsMls4aUuotd8U0UsBqHd3dKxER6i2EnV2DJQMg== 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=vYBRW4r+i9vMVde6VQIjVU7PiC+AYrrmMIzyCRy8XdE=; b=OrnyCoCt9gIP6OJQrBQsV2SMeucAdZqI5/naEmLGDrq1f38+6E7Ua38NTx5Mub85+8iHHXtXi6YF2BtDJrGJOi+bbzAZw4zd6mVdwqTW1dBO/6jVIOd1rROIWY53QIN6TOzKDqeoBe6gMRbOCPDqxl1Tvf9nMrG2xvAHXaWdN3uMuwX5rVbZLI6VFOp00pg4d6qohHr4RCX7HBJPGn/GjH7rfg5Gfdn0No/1Pj8ouhGGaeO1IQER+3SuoQA/iv/lPCA7Cxky/i4Au1uBBnSOjt3/E1nJRZAUkuBSDyN1RKraPnXLOn890Q6inrPXygpTQwNhrj7EaPCrupzAQi+CFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=theobroma-systems.com; dmarc=pass action=none header.from=theobroma-systems.com; dkim=pass header.d=theobroma-systems.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=theobroma-systems.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vYBRW4r+i9vMVde6VQIjVU7PiC+AYrrmMIzyCRy8XdE=; b=jU5zA7w16R6UF2LT+fAOOUS6nHb94xQmbS/tmGqWEJda6Id30puJuhxyAQCWyM2c5bUDZ4yB8Me2k5qsuoYZAEfSncddRvbHw4ezzqzPUnJmDudxKimW2yHODRlDcqiNSXP2V/C8n6hWi/9O2ehI88r5XJRFyRma44tAVpeD+acY7ya1pBIEFhkryRwWpWl+HgzI0CJMKUH5fyTA9dXtxxmSBg0G/nM78nGu61CtwzuxK4FsAeCK74A0itCq7fQl3Si/rCXjwTIqof6wX8tmfPjmpP2EE6EC8ieHB/qGVpp/VbKEE06aVjoZYUEmD51XiOtlzSJnckmk9zzcQhtKfw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=theobroma-systems.com; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by VI0PR04MB10230.eurprd04.prod.outlook.com (2603:10a6:800:240::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Fri, 26 Apr 2024 16:50:23 +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.7472.044; Fri, 26 Apr 2024 16:50:23 +0000 From: Farouk Bouabid Subject: [PATCH 0/7] Add Mule I2C multiplexer support Date: Fri, 26 Apr 2024 18:49:31 +0200 Message-Id: <20240426-dev-mule-i2c-mux-v1-0-045a482f6ffb@theobroma-systems.com> X-B4-Tracking: v=1; b=H4sIABvbK2YC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDINRNSS3TzS3NAYobJQMZFbqWhgbGySmpBuYGRoZKQG0FRalpmRVgI6N ja2sBX1N6rmIAAAA= To: Wolfram Sang , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Quentin Schulz , Heiko Stuebner 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, Farouk Bouabid X-Mailer: b4 0.13.0 X-ClientProxiedBy: VI1PR08CA0261.eurprd08.prod.outlook.com (2603:10a6:803:dc::34) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|VI0PR04MB10230:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b96f515-648e-4859-7057-08dc6610f6de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Sp09519elSaI7qJ3DhFesQfXeSqIt/1?= =?utf-8?q?zDYMlZLkM5XYPpmjM6hEq9OSgs2SaCzQDo4tutJT9rqtpl1imPUvdYQMcwjwKbLGR?= =?utf-8?q?f7O/iBWC0UclU9zmNT6/raqiGqwpFPBtAtzW73NvezzY1MlXl1EirbAwGSnjMxmLk?= =?utf-8?q?cu5bVkhrmp88ocOpm9E2c3iMO20oSLaj7Q/cuWaw6d2o8njAgV+YrCgKGvQHvYodO?= =?utf-8?q?G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3KKht6a1VaLPNXJsCJIMLEqAyCdenFdBU2i8LmBwW0aI5yk/MT14dBC+hIGs?= =?utf-8?q?XCSJGpRiT36aJnS9GHZHdXc4pLUnHxpZV3EXA45IIFq+92LSVShGFQqF7/gtHSVdM?= =?utf-8?q?ywqFwj7ULywgU9Keuk15pLjKstaufoMXd9iy9ahJ9igdZvzhKNeDRuzveoep5fVte?= =?utf-8?q?spk6VQetwvlYX0rwM2UzOYCJ9Jh14b9q+kA=3D=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)(376005)(52116005)(7416005)(1800799015)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7PxGxj0sFWd6mxPAJr9Pam26QER8?= =?utf-8?q?xuaGYIwA724RHfgEhLqGgbz/i6B1LrBjs6vCID15d7Sv4ohWFWm9+AyjZ0RX+jTXA?= =?utf-8?q?Qv25TWyrkLecEzrFRCXsv69A+quoEYf1o0OdqObi15jDbVeq6mB/Yd0zSPHRzbfki?= =?utf-8?q?SGT/moT2e7bpUjQ7nr+opGxgd6OY1aLAqv/yTxuku5ovub+AAhcinMJq4//22sBb0?= =?utf-8?q?VkruIWPNmF31l4QhfHtXrdzaLKpfWsv6/Shcv7heWazaQsPB6oQVWxDWjQ0JHro3u?= =?utf-8?q?RukcgrM3YKNyakDFssJIIqkGAFWuqKiLpi01iZDGNY/bw/yPSSE9AH23nL+rCUdkE?= =?utf-8?q?LdBZyx8M7D4XQGLdRgrzf4ILzFF86C2AiRnbeRlHjoNeSC8Y/G+PSuM/Wjsz8rCM5?= =?utf-8?q?J6A9UkMm46nb8KnQ/4MdZgJnTA08+waCKpHV4xD1ayZQcpCgmQAn87hAEtFlPsbBK?= =?utf-8?q?E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vKY2/XN+0imY7yrld3+0nxPLDFB1yuiGcVAOga642xN9opi0?= =?utf-8?q?HhJRm2sUiJgnyeiAN8i+s9VhFojuZ0ZIYmxgdyb0g1XuPoTJd4BsEH/uG3qJ7IR+M?= =?utf-8?q?xZp+06eqVN0OJwokJ0TExGNKPjAjOhLqc9cgBBl8p10Tf38qPhawbO2SkVayQNKAI?= =?utf-8?q?wBsYojEsTOE5lzEN0X3aBz9qM37sfOsuVc2U/sUvb6GJLGXSKlgeGBk=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b96f515-648e-4859-7057-08dc6610f6de X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2024 16:50:23.2746 (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: VvvqemZ8njvqR1TvyLgM1KjNznkMp1IBBFXtdQux6Rm20IGUH59nXNtpXEsjXEtF0K3TyW4AaCKAVHzA3RgY7Lc5WImy/FaCdoOLLKqYOBXNhYjH34sGGdieonfZ5Ntx X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10230 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240426_095041_282038_F0F816B3 X-CRM114-Status: GOOD ( 10.80 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Mule is an mcu that emulates a set of i2c devices which are reacheable through an i2c-mux. The emulated devices share a single i2c address with the mux itself where the requested register is what determines which logic is executed (mux or device): 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. +-------------------------------------------------------+ | Mule | | +---------------+ | ----+-(1)->|Config register|-----+ | | | +---------------+ | | | | V_ | | | | \ +--------+ | | | | \-------->| dev #0 | | | | | | +--------+ | | | | M |-------->| dev #1 | | | +-----------(2)------------->| U | +--------+ | | | X |-------->| dev #2 | | | | | +--------+ | | | /-------->| dev #3 | | | |__/ +--------+ | +-------------------------------------------------------+ The current i2c-mux implementation does not allow the mux to share the i2c address of a child device. As a workaround, when creating each i2c child adapter we do not assign the parent adapter to avoid the address-match with the mux. This patch-series adds support for this multiplexer. Mule is integrated as part of rk3399-puma, px30-ringneck, rk3588-tiger and rk3588-jaguar boards. Signed-off-by: Farouk Bouabid --- Farouk Bouabid (7): i2c: mux: add the ability to share mux-address with child nodes dt-bindings: i2c: mux: mule: add dt-bindings for mule i2c multiplexer i2c: muxes: add support for mule i2c multiplexer arm64: dts: rockchip: add mule i2c mux (0x18) on rk3399-puma arm64: dts: rockchip: add mule i2c mux (0x18) on rk3588-tiger arm64: dts: rockchip: add mule i2c mux (0x18) on px30-ringneck arm64: dts: rockchip: add mule i2c mux (0x18) on rk3588-jaguar .../devicetree/bindings/i2c/i2c-mux-mule.yaml | 80 +++++++++++ arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi | 20 ++- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 20 ++- arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts | 19 ++- arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 19 ++- drivers/i2c/i2c-mux.c | 10 +- drivers/i2c/muxes/Kconfig | 11 ++ drivers/i2c/muxes/Makefile | 1 + drivers/i2c/muxes/i2c-mux-mule.c | 157 +++++++++++++++++++++ include/linux/i2c-mux.h | 1 + 10 files changed, 327 insertions(+), 11 deletions(-) --- base-commit: c85af715cac0a951eea97393378e84bb49384734 change-id: 20240404-dev-mule-i2c-mux-9103cde07021 Best regards,