From patchwork Mon Jul 8 16:12:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 13726840 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2114.outbound.protection.outlook.com [40.107.20.114]) (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 E1CE81459FF; Mon, 8 Jul 2024 16:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.114 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720455201; cv=fail; b=K4uyJ4YskBXPCUCTg2cWzSRO2YrZYke8bSkGueWk/02wu/eZEZFuYXqG11aNgAYDBNI4L/0IFSrJh55vcIt2g/dqLDvyC/CGd05EhARsk/YnsHY8zBn71IDiRgqD9+TAjug3De3poLnT1DlFGJZveX4Cteb1L62SYi/5JSs344Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720455201; c=relaxed/simple; bh=pDOlK6ZlJt/wKJywor9A9G6tYzPtG83l+90VcQ5Sd30=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=DQHvtGwT5d53CQ7eEXNFcsSUSqvEWVabQDh0uNWoJrGDtOjUhHIVmOADGoPqz5LptXFFIC2A4dwzvpuHM3zUvmYhViSbUR4yHtgF9r+bB4bsU+BiMXPf18iMB1nEnMQdQUG84dLGKxYWEH5UL0tuSIoLdRpv9Z+x2jfMeiBzjps= 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=kI0WcmLv; arc=fail smtp.client-ip=40.107.20.114 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="kI0WcmLv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y0rr96R/97a0JFlTbPJRx3cikLY/HZaP8Z8eaxBM+CwrXcHmfMykeCF4RYEvkgVQ0eVduYmTdePYL7jjZg5VBgft5loNOZmD6m2yVuKcXqjKBCaYU60Q8uTTg9e854sgFD4aT7uAtjRA/OauK/sfNqlSHdG00sk2zWy/g8nZNSJ9Y7zetSXO5xh8VlMgBwqZWMHEB5lhWyIicEAEDSRGNszBHtuiEjvmeep3TyzVFLz9XeRFoEL4PsoIlfRVA0uPEzl1Q9lWoAScNepyAVfnetmGSibrkDMGxRezQeJA+CyynSydSaqvNE2xZ8lYgpCGoBPhx64lvEuZVmy/3ALfNQ== 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=d8wJt5ooRgCAnJkw27gNVxp3m2yPaEmfnuBTLMaQXGo=; b=LM9H/SsyVeVea2axWdQugHhz6dZoRWmQvHtwDfWAVm7mAooB0YReLbZMIhIIAVDe4SM7BDmJBe/f3x6avtMqiZF6ngePM0UbNYEmGyDe+5xh6RQWX9TixIM5ndkQM8nGcdkhfn4M5aZkvVQ27aYeOxhsiQtVjvg83p8I8xRqI/K01981849P8pyduXOur48sAzvQDFHPv5uPyEoXsIm4Winr//eJSwA6Xa53F7PyXelluh9Ody2xAtx3p4H97SuHs01tepqj+8QimD6D8SQuXR527/0HyhsIbJmEZu0EEimmcpQ+k2TTIgRnlu+VWlOWBXO70pvyEElLIKewucnxrw== 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=d8wJt5ooRgCAnJkw27gNVxp3m2yPaEmfnuBTLMaQXGo=; b=kI0WcmLvU4wo/XW8uoefzn4qCUFMVODtNu/eEo13H6WUWel2AUXrG2u+RpfR856H7AQE93lrcFxGnPmOOSI0N7FX8gv+zlMI0jz1mooH+M+mLw7BRP2hGN6UrFD0COC7pG9gN2itCNYX9Lt9QriIKvTv83kIr38LNSYxsbTlL7E= 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 GV1PR04MB9055.eurprd04.prod.outlook.com (2603:10a6:150:1e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 16:13:09 +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.7741.033; Mon, 8 Jul 2024 16:13:09 +0000 From: Farouk Bouabid Subject: [PATCH v5 0/8] Add tsd,mule-i2c-mux support Date: Mon, 08 Jul 2024 18:12:11 +0200 Message-Id: <20240708-dev-mule-i2c-mux-v5-0-71446d3f0b8d@cherry.de> X-B4-Tracking: v=1; b=H4sIANsPjGYC/23OwQrCMAwG4FeRnq2k2Vo3T76HeKht6grOSjuLQ /budiooKLnkD+RL7ixR9JTYZnFnkbJPPpxLkMsFM50+H4l7WzJDwBpKcUuZ99dTmaMpzY23Aip jCdaAgpW1SyTnb09yty+582kIcXxeyGKevjFUv1gWHDjUUtcNOuXcYTt0FA4x9JqnMQ3Up5UJP ZvhjB9Mwj8MC6ZbYVpZOyXtems6inFcWXoB1QdQQvwBqvmbxqLS2BCA+AamaXoAvY8uMT4BAAA = 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: VE1PR03CA0057.eurprd03.prod.outlook.com (2603:10a6:803:118::46) To DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9562:EE_|GV1PR04MB9055:EE_ X-MS-Office365-Filtering-Correlation-Id: cdfe7b34-ca79-4587-e3cc-08dc9f68dbe9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|52116014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?MCeYZHYvt5r+4bzzs3qLeqiiwGa60c4?= =?utf-8?q?rLyxz4y9KGOfGP9h2aFUntnwF9ACrg0FRJ8V734w7hfBHHys7ZyGCAEEWiRy5foYP?= =?utf-8?q?bsAMVRffln6EqvtJZI30C1hcYCkpV9tOv769NYJXvRkjpRc1H366CJPk9ZrHoFZCa?= =?utf-8?q?kC2X3EpTE/XiJa5bMANFM4EvMNYKUBFsYxjQioEgDV3g4JqKVEWy6auIP2Lv/AOX5?= =?utf-8?q?vnTp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fgrvwZ6jPmIJZ2tq2dUUHHKJO6gjFWBiUQf3gzkaZ/Z8ibk2OpSIH5hiFt?= =?utf-8?q?2Y6aSsz/t7RupxrxlOpujy+sLZ9vCIBDXIX0S4p95OxCMN+JXqnxrEEIvuoIogZYI?= =?utf-8?q?YK2Ph+27nUr786i950J3Vz3J2hOwlL0KYHE5506/4ZpjatC+7cWo4b5MZWgCqrNnR?= =?utf-8?q?sv3M1hrf7MDOkMF6dMBpbJAGEaz/UDaslX9jiEww1c3x/BWqoxcWb8OL7xkK4MNj/?= =?utf-8?q?9v2JeRcWry4J?= 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)(1800799024)(366016)(7416014)(52116014)(376014)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9K019o0+mWiGgtm1fEmTwAcO8D0H?= =?utf-8?q?aCfseCOCYpirp20kizZgIaF1wYei1N9jlO9AdQPJrvHivEzBRg8KeoGUIO2QhLzZ/?= =?utf-8?q?vZE23l/VbYiwglHd3OlLVrH50cmDpHg0XwZgdyVSVEfZ+oYwasMtRJA2nkwYddAr+?= =?utf-8?q?Eyo2JWjKIV1KL1Hnrf6ndNSQOvPNMOilDgXEeb9tA5s3eh/Bq86Fo1LiMIW+vHaOE?= =?utf-8?q?M5DIK3MSWg5TEMBqjdosjCM9nLb0YbkgHdZoCOmNl3ooQNOESk890gRoV2G28a071?= =?utf-8?q?81arYucDupVTfqMjHmXb9P/OyZfpOJlZ62Ngkc27Btugt8+u82YwL0mARjlLBDerY?= =?utf-8?q?U7NbIvwdUG2rq0yI3Jfr40qYTnHyx8I+v6m9HFK9OuygFHcz1S0HLA6pLfqu6Jj/D?= =?utf-8?q?RUklKgA/rgomwBJvfuA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ZEc8Ff4ob1c6l8oI1n+pS9Xn168MkZ?= =?utf-8?q?r+nt838aVnmbsfDvU7cchB/1t5h6P6MmYIXryNDmp01J7usfuFdX9oJC2L7gBKK4b?= =?utf-8?q?BfcQUawkSrDgg/y/3PlulwI2KgDAkOBUQYqa6UNOxDmd69ODhhZRNBR6nRrFTSgR6?= =?utf-8?q?05Mm1NzCwXsGKoAb3b6ID+vugvrSkxdEPHn0pO1OeN1vvaAW9w7ZSsj5OpeLDDiMU?= =?utf-8?q?vXyLHWQTPOcCzLLhxkpmi6EGwNUuEc7u4Q=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: cdfe7b34-ca79-4587-e3cc-08dc9f68dbe9 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9562.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 16:13:09.5450 (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: ZnjgEnsZrtjbw7rytNXJ/CJHz/xg7ZgdwVNKWDqJ8esdL4MuGO+c0eJMR9cGGZsENRiwIbizPpAZ6/KTOKw4XH1deQle51Y+6m9frH5mN1M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9055 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. this patch-series depends on https://lore.kernel.org/lkml/20240705213547.1155690-1-linux@roeck-us.net/ to add regmap support to amc6821. Signed-off-by: Farouk Bouabid 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: i2c: add support for tsd,mule 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/i2c/tsd,mule-i2c-mux.yaml | 69 +++++++++ .../devicetree/bindings/i2c/tsd,mule.yaml | 63 +++++++++ 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 | 25 +++- drivers/i2c/muxes/Kconfig | 16 +++ drivers/i2c/muxes/Makefile | 1 + drivers/i2c/muxes/i2c-mux-mule.c | 155 +++++++++++++++++++++ 10 files changed, 401 insertions(+), 24 deletions(-) --- base-commit: 97c57cb030b79def7b664c253e0c4f0702b9e758 change-id: 20240404-dev-mule-i2c-mux-9103cde07021 Best regards,