From patchwork Thu Jul 25 13:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 13741909 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 455C7C3DA49 for ; Thu, 25 Jul 2024 13:29:41 +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=sxhpc0wSd+p9IkszqAwHj+a4SnqdHAs58oJrGoduKt8=; b=k6k2/OaTZ/Oebb ksh3rwE2jpFdiyBi6MJs5ToYx3HvEBTOx032A3AzMi11ZAeHPljhhV2yCPY3gAZmIyFSbcMtNpUW2 M93MsJlNh+J1NaFTXwy7tsCbkg9O/WQPBvq2rR0DDULtciyuHqR1wt4DR2yyw4GYvnY+etyGXJnMn BREew32gqBhp4FHDD3pK0oVkYHAqnrKDNOfM+66073NRr/y4CUDCxl8X0CvkHKplzTxHk9VEtqonI ce4fZS2T1kG5s9qAcofmvPa4qQhAFPoYwr36XBbbEeE1DgVXPJxlkS35m9ttT3645hcVYqGbL10Pi cAN22pxkYP+2OLBwis6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWyXK-0000000155O-3ISP; Thu, 25 Jul 2024 13:29:38 +0000 Received: from mail-db5eur02on20701.outbound.protection.outlook.com ([2a01:111:f403:2608::701] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWyW9-000000014Ul-2m0z; Thu, 25 Jul 2024 13:28:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fhFsSJaH536XP6tEWl9jt1YbRhUmnlR4oqO+JvPJLOdwJcNsR4DM9EDhqa7BUp7LoKX5vv3Zk1ctBc8Sg2tycqM8ExkgUWEpq27rvoYZ/c96nMynNmeh1sBdUv3KOYmLPVwDKLLTkDzpLE3oTKUssYR24OOFc9dvRJ8dkIQlCh+ua0aXj0v0osDV01piHAjS8sI93Y1gLBJ4YFLJUz5ry82LmnUOgrssAYzYCsRcCmo00J2AH9l+FEldYWkPD6V10upB6JYBIhujXISmIAK+YBPP5r2ULVWFNC8w8k9sQTbf6X8pwYEQZDPTUlWis1yPd1VBwUrIowmQFycz++GJ9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DcI2y59ZncmqVCISnBYMWBY75e61+QC84/pGME5QrAs=; b=egGjqnekbVLDAcWvt2ogZk4xjnAxhpmbDAjExI8HI7YZtqWLjGT9nc1YC35PMv9OB9IlhL2CVDzFCGKwVRcTBb6dbVmqJA6820InUvQqY/wD259Mk2xZ2hR7RAPymYqkueX137ZqQuaGx86ejMQuPpV9uqboGD1CmwHlpikgT78IFcxDGjnlIXRqxoeSbo1z4OS84Q/hFTCU5aaUyiU/VhypxV1CJgVVWUiQgGLvO19hmSkC7z/orUvheOEO9lsBOqw51dwj+a3pKjJJRKp8EUyA5fTf5OCuIlM+QAXU6Vil58jU82dtSr8SMnr+Dn8JAhjZv4zVveIpFiP4jspFNA== 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=DcI2y59ZncmqVCISnBYMWBY75e61+QC84/pGME5QrAs=; b=DYnb1rOS1unD7S1Tfh/yi0/w/7s4oQt8+KauSFK5evaCdW0X58FaYQGyCWoqpf5wLrxvoZgthxbOW+6h31/K9kH0BpTqtWgUYR0ZRhXBsg2tbNqDT3F83LOhhjOL6s4luL/IEEge/Kk62wAnXFlOMKd4RPx22Yiic7/RRrTrAcc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) by PAXPR04MB8287.eurprd04.prod.outlook.com (2603:10a6:102:1c4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Thu, 25 Jul 2024 13:28:15 +0000 Received: from DU0PR04MB9562.eurprd04.prod.outlook.com ([fe80::ad4d:8d53:1663:d181]) by DU0PR04MB9562.eurprd04.prod.outlook.com ([fe80::ad4d:8d53:1663:d181%4]) with mapi id 15.20.7784.016; Thu, 25 Jul 2024 13:28:15 +0000 From: Farouk Bouabid Subject: [PATCH v6 0/8] Add tsd,mule-i2c-mux support Date: Thu, 25 Jul 2024 15:27:46 +0200 Message-Id: <20240725-dev-mule-i2c-mux-v6-0-f9f6d7b60fb2@cherry.de> X-B4-Tracking: v=1; b=H4sIANJSomYC/23OwW7DIAwG4FepOI/KOECSnfoe0w4EzIK0lAky1 KjKu490kzJtkS/+Lfmz7yxTCpTZ8+nOEpWQQ7zWoJ9OzI7m+kY8uJoZAkqoxR0VPn2+1zna2tx 4L6CxjqAFFKyufSTy4fYgX15rHkOeY1oeF4rYpj8Y6v9YERw4SGVkh157P1zmkeKQ4mR4XvJMU z7bOLENLrhjCo4wrJjphe2V9Fq59mJHSmk5O/oGmh3QQhwAzfZN51Ab7AhA/AXUDrTQHQCqAq2 QUrvGw9C538C6rl/PQRBLfwEAAA== To: Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Farouk Bouabid , Quentin Schulz , Peter Rosin , Jean Delvare , Guenter Roeck , Heiko Stuebner Cc: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.14.0 X-ClientProxiedBy: VI1P189CA0008.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::21) To DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9562:EE_|PAXPR04MB8287:EE_ X-MS-Office365-Filtering-Correlation-Id: d845a61a-142a-49fd-8f6c-08dcacada346 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?mM4ZMYJ/4gI+rYLnDxuFFIDTd8oT1aT?= =?utf-8?q?QKmnbzQMSjh5GWH3AOf2u7KaE8ykPEb6LV2O/yCTzpjKxwz9ULG5wV6/8ofYPEFjD?= =?utf-8?q?BELy0uTLx1XTQFl1DAOp7H9rYnSrvERYMbQr3BUOmhN59U+bPs/zC5dIHNYgXmKzv?= =?utf-8?q?ZZXCJXwUHv0YEc6DG3kkOGD4EGYDZGU1RA7BrLcRIxSiGNaNcv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bo5NtKp?= =?utf-8?q?ur8JNSCuKFrJ6SFnQOE7WdBK1jbVf52Z4udWy+xcgyZmGzN3dOHS2nwAFaPLBDr5Z?= =?utf-8?q?GxuZBYBbPUe6bnXc3NcXbcRRUVGdxYFxaRqxj2sjo4/qjm9+Fg2fMgybcMYdj06dc?= =?utf-8?q?6oQIrY5DloM6Zqimo3cYYtsy7UCq/NDWGGqXg7WNjZmJrLZ5WTFrLA98LcTJmyPub?= =?utf-8?q?GNB1WKG89ryUtJ3FeEnVyTsPhik15HGmdqMQBG3XVRbOpQ5NAwjd4ECAoFXSqnVs4?= =?utf-8?q?AD1nOFYzVCE9?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9562.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qsce67K81vQNSRGJFfs7CJDxmnS1?= =?utf-8?q?eerXe9hJ4McGcOUhdqFKYA/wJkxF+kktyrbBgeCWr+HL8YnI+LOKWAxBVdty0aQ40?= =?utf-8?q?Z3OkZlKSng9E0nRT63WamCVu5hCFl9qXy26pihcGHcqd+ZO6U6ZU9Zj+bTaingW3x?= =?utf-8?q?MA9TA907pT321x/jpRKB8BbFAxOXIZsvvwe8g2h1sx+2Ja7ypb9cwdhAu957YOeBW?= =?utf-8?q?UO+yY72Oe5c+rrPb3F1vGm0f9aL0zxOgW/vCQVIGLCVilo3yE9KEX+95DdhiOgD1o?= =?utf-8?q?q9vx9qAJFiIIxJGqnncJE25Y1CKlHwf4IeE6E0/ubh0krA8dZikQPvkp+MJNZ0fZ4?= =?utf-8?q?kcFGR9KQ2Ttw5lr5PRTxRxZtKxslxGoEUmEaawI//4gGio22Eivkhdc9NUEWR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d2zZl?= =?utf-8?q?hTXqyOnARoj73IdvxTdjTvOMlfDa2X2afHyCsv72O56xxj5sONsgAXAQnDcaE+j0z?= =?utf-8?q?Ih1V6azjml9AtEZEOIefYCm0hz0x+sTyT+r9BVXSSlH9kBemexDghzpr+w4szG0kT?= =?utf-8?q?aszPWuguium8KJWedClJw0HaAYb4mUE9e95405UCpRtH8W88e3nT1rly35E3n2iK2?= =?utf-8?q?n3gAz8kjSmRafE4ydL8KjBslD0QdNXNl4dC89LaSoI5hh101WswaglLW7yLwX3rMm?= =?utf-8?q?r/iR6+uaqdXOC/KCiSUZq4gMRgMPsh1PDg=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: d845a61a-142a-49fd-8f6c-08dcacada346 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9562.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 13:28:14.9799 (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: qhMWkU4/cJH+KpZwfsHa/iafr0O7DAX2sxrQMd6E9OqBazXFxihkXfZQ9LaboXgyrNJ9YD6W7H9bRKqP8n/NARExN7S2/iKNqENe8tbxsg8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8287 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240725_062825_962411_76CD2D89 X-CRM114-Status: GOOD ( 17.62 ) 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 Theobroma Systems Mule is an MCU that emulates a set of I2C devices which are reachable through an I2C-mux. The devices on the mux can be selected by writing the appropriate device number to an I2C config register (0xff) that is not used by amc6821 logic. This required us to add a new compatible to the amc6821 driver, from which, the new platform device "tsd,mule-i2c-mux" is probed. The selected device on the mux can be accessed for reading and writing at I2C address 0x6f. +--------+----------------+------------------------------+ | Mule | 0x18 | +------------------+ | --------+----->| amc6821 | | | | +------------------+ | | +----->| tsd,mule-i2c-mux |---+ | | +------------------+ | | | V__ +---------+ | | | \-------->| isl1208 | | | | | +---------+ | 0x6f | | M |-------->| dev #1 | | ------------------------------------>| U | +---------+ | | | X |-------->| dev #2 | | | | | +---------+ | | | /-------->| dev #3 | | | |__/ +---------+ | +--------------------------------------------------------+ This patch-series adds support for the tsd,mule-i2c multiplexer as part of rk3399-puma, px30-ringneck, rk3588-tiger and rk3588-jaguar boards. Signed-off-by: Farouk Bouabid Changes in v6: - Move ti,amc6821 from trivial-devices into its own dt-bindings - Use same regmap config structure for both tsd,mule and ti,amc6821 - Remove max_register from regmap config structure for amc6821 - Link to v5: https://lore.kernel.org/r/20240708-dev-mule-i2c-mux-v5-0-71446d3f0b8d@cherry.de Changes in v5: - Drop the mfd implementation of v4 - Add more dev_probe_err callbacks to tsd,mule-i2c-mux - Instantiate tsd,mule-i2c-mux as a platform device from amc6821 driver - add "Theobroma Systems" when describing mule. - Link to v4: https://lore.kernel.org/lkml/20240618-dev-mule-i2c-mux-v4-0-5462d28354c8@cherry.de/ Changes in v4: - Drop the previously added i2c adapter quirks - Add platform driver probe to amc6821. - Change mule-i2c-mux driver to a platform driver - Add dev_probe_err in mule-i2c-mux driver - Add support for tsd,mule in simple-mfd-i2c - Add tsd,mule mfd to supported dts - Link to v3: https://lore.kernel.org/r/20240611-dev-mule-i2c-mux-v3-0-08d26a28e001@cherry.de Changes in v3: - Change "i2c" in comments/commit-logs to "I2C" - Fix long line-length - Warn when "share_addr_with_children" is set and the Mux is not an I2C device - Fix/stop propagating "I2C_AQ_SKIP_ADDR_CHECK" flag if "share_addr_with_children" is not set. - Fix "old_fw" variable is used to indicate the reversed meaning. - Link to v2: https://lore.kernel.org/r/20240506-dev-mule-i2c-mux-v2-0-a91c954f65d7@cherry.de Changes in v2: - Add i2c-adapter quirks to skip checking for conflict between the mux core and a child device address. - Rename dt-binding to "tsd,mule-i2c-mux.yaml" - Add Mule description to kconfig - Fix indentation - Move device table after probe - Link to v1: https://lore.kernel.org/r/20240426-dev-mule-i2c-mux-v1-0-045a482f6ffb@theobroma-systems.com --- Farouk Bouabid (8): dt-bindings: i2c: add support for tsd,mule-i2c-mux i2c: muxes: add support for tsd,mule-i2c multiplexer dt-bindings: hwmon: add support for ti,amc6821 hwmon: (amc6821) add support for tsd,mule arm64: dts: rockchip: add tsd,mule-i2c-mux on rk3588-jaguar arm64: dts: rockchip: add tsd,mule-i2c-mux on rk3399-puma arm64: dts: rockchip: add tsd,mule-i2c-mux on rk3588-tiger arm64: dts: rockchip: add tsd,mule-i2c-mux on px30-ringneck .../devicetree/bindings/hwmon/ti,amc6821.yaml | 86 ++++++++++++ .../devicetree/bindings/i2c/tsd,mule-i2c-mux.yaml | 69 +++++++++ .../devicetree/bindings/trivial-devices.yaml | 2 - arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi | 24 +++- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 24 +++- arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts | 25 +++- arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 23 ++- drivers/hwmon/amc6821.c | 12 +- drivers/i2c/muxes/Kconfig | 16 +++ drivers/i2c/muxes/Makefile | 1 + drivers/i2c/muxes/i2c-mux-mule.c | 155 +++++++++++++++++++++ 11 files changed, 411 insertions(+), 26 deletions(-) --- base-commit: 5d09c33f705191f1be376ecd1bc41fd32798370c change-id: 20240404-dev-mule-i2c-mux-9103cde07021 Best regards,