From patchwork Fri Sep 6 15:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 826096 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011038.outbound.protection.outlook.com [52.101.70.38]) (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 792A21D415A; Fri, 6 Sep 2024 15:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725638161; cv=fail; b=N/42Xwiu/bo27v4dG76WZDNEl0vnBwk66Gtv5pniG5J/SP7Ihtgklzemc3NQfQvwrcx/obWH0jNvtqUhOvi37NOo+7kWECHTN49NAmQd1R0ALnD5mSUe5TXAE0j+jXRzMEGYfRAHwNqkxr6VsYH9CeGVvg5uCjULdjDdZ7ALcf8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725638161; c=relaxed/simple; bh=rwXSRqqFtdcgNACeDSgbnCfmrItiPQM6m/OWfHPeEf8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=hA+tKqPfMIyKq7GAUhYbqOoQ12AiKta/G9hsKgYykhBQ8V1fdXdgx8FDGd2/83hENrNjOG0qc6+X+2mvLaPKMrZdSIqAvqk5MjLFIwIx4DOmJJ3fqkAHkS65hYUdYTCdzMRKNgCN9w80MSeyjGBI0pYLtJbLcdv4jm4C3MR6Loo= 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=TbXXrFUo; arc=fail smtp.client-ip=52.101.70.38 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="TbXXrFUo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LkFHK70zpjCVgceRtpsOVvxEI7mkA+rCe52Ny92Asb6sytQoRevckqnJB+usSzklO+cXfHJY6uYEJNxZ5DBkObwpd3rMwQGBABdpYb2Hm67+phjuxWf2sUqmi7G8lkBBy9zZA5JPS/psMcqiAf798DWL2iwe1n8WNJqgdOTUPoajiiiR8FA2M33AbS8VDK5i3rErDzYOSNaLb4v/un6LBOq59vyqaPEUpyzcqfXo8wKFceH8Z6Ghga25lBkIvWnHsZClqp4MnmU5mTc+L/pdP+c/VRL8WHMhXi6UxZe31QOea9CCt0r1U/ykHTKGOTYa2XgcLnbt9smChvtyGz/FAQ== 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=s8mhuCI8xUg0KfJGj5vUAfFtFVTEWAm7Pr1592ZIMsI=; b=o2oElQn5mjGZPZ34AIZsjM9yay5PirhSlaTp2tet8Qlraq8jYe1P/rRUCMhv172MYjTJmduf8+VR/klWXgqte0VL0sKVl0ebNHeN6/r86qv2guSJGyQABMfXu3pIy3+Fa6Z3gcDQWOY/BkKuG3aIhFXx+y+n0wNtCalf8s9wwkJzqsi8YmDmPYLOkkPCbmCxZgcd4lhEFjv9ozB8a2w4Tc45wG+688bHzKQ9ghrsXZyO1jp5dGX+avI4IYgUByxDL2ay8nad/Ty1fDVAgx99WGwh8WgRQUo6YW6HZMTrqb3Y97IIXV1F5M0slhUnJUhnDXzePbDy49nIt8RzKwScrw== 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=s8mhuCI8xUg0KfJGj5vUAfFtFVTEWAm7Pr1592ZIMsI=; b=TbXXrFUom6QSNwEzFh85UATWuMeO4I75VLSo2xd+loO++mGjQtmP0QF7ypESssP1OKeE64P411izBK/QletsObptzSi7RLhORcB2eTbPECWloTIqZX/lFFyPJZ5T7NkyGYhzBlCu44+bBoyw7E2OmhALPAUs3yObAHkANev916I= 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 PAXPR04MB8319.eurprd04.prod.outlook.com (2603:10a6:102:1c3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 15:55:49 +0000 Received: from DU0PR04MB9562.eurprd04.prod.outlook.com ([fe80::ad4d:8d53:1663:d181]) by DU0PR04MB9562.eurprd04.prod.outlook.com ([fe80::ad4d:8d53:1663:d181%6]) with mapi id 15.20.7918.020; Fri, 6 Sep 2024 15:55:49 +0000 From: Farouk Bouabid Date: Fri, 06 Sep 2024 17:54:15 +0200 Subject: [PATCH v8 4/8] hwmon: (amc6821) add support for tsd,mule Message-Id: <20240906-dev-mule-i2c-mux-v8-4-dbd28a150e41@cherry.de> References: <20240906-dev-mule-i2c-mux-v8-0-dbd28a150e41@cherry.de> In-Reply-To: <20240906-dev-mule-i2c-mux-v8-0-dbd28a150e41@cherry.de> 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.15-dev-77eae X-ClientProxiedBy: VE1PR08CA0022.eurprd08.prod.outlook.com (2603:10a6:803:104::35) To DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) 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: DU0PR04MB9562:EE_|PAXPR04MB8319:EE_ X-MS-Office365-Filtering-Correlation-Id: acced04e-f44a-4342-e80c-08dcce8c60df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|7416014|1800799024|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?EX2OLdKr2XBkmrOWo9wqNPjupFVej7/?= =?utf-8?q?DLXipYYZNYy2Ako4crNAQrFTrdao4nqXmH4rJMjmNMBYmyFRnxSkj58+K+vjPggPG?= =?utf-8?q?AAu1OvjaAHcdltzE/t+2Wc7TYEGD9s7ST6+QQiJFnTxKcYAnZwkdbq75u9UNn4wre?= =?utf-8?q?6hiNAp3OD/qXn6JCK3BAX1R8scnI4ZRFcSxbVXaC+/1GgheDwxiZT55fgVvnLiMX1?= =?utf-8?q?6inMvPls/b5aRvr4KqhrAurTTt1MRL7n3AXssjwATUyh2/vCiNkrMw68Uf+EJG4Pj?= =?utf-8?q?bY1/6z/5EXFevwFSW57bumSNYQZzbsrEQ3V1fT2UFZQe7tbgIzH1PohqFbHKebh/0?= =?utf-8?q?eZXjIkWt4V27bESzOEx42t8YyftDd2aTnRtdyJDqKaWGKv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+0MUT32aZmOPFGv2zTbyJfq0G?= =?utf-8?q?qvsXDHDD5BAWT9MUSGCOvaFzw/pwOBKPxKDhUANq1bkWhGMyOulSteSEBruBEAY/A?= =?utf-8?q?8Cd/c+BPXmgZZecmNZIvWSbfoay8Ggi58DWTwA/YGFTpLF5npQ8JZMk=3D?= 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)(366016)(376014)(7416014)(1800799024)(52116014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nYYuvIUGieR3jDtwWuCMrmBkNJCA?= =?utf-8?q?so0HADorGphzR7f2t7BvCMELpPVI6Aq3JX7oE5ENWL7MDcAb4pW16PWAHRgw1cnzi?= =?utf-8?q?Y5KhwrcxNIVWFq3R2toI2MPriEbOcutVcoGc81rnekQDcyW0N1YsbmA3rO4zxdmjC?= =?utf-8?q?92e2J0Psu6CFCMyFlXJWoCfWgYeyxd/RhSFzhFX0e9fMtckY+mXgqm6nd1nxvcdZ4?= =?utf-8?q?JN8GUHwdbvtZWn84PMvEDhS1NaGTItOn0xP7WySX0FNBBYg9ds3x77JLmBwBGPGhr?= =?utf-8?q?anvpoIHe7b7SoVdTPq+wNAl8N0oe6W5fjMsxI2547COATZeM2pZsrs2oMjEEh2kvz?= =?utf-8?q?5l6i7PkxfG7jR2foD3Ys8Uy77m2f8W9q971dnQnW+7dvmYwn62b9r1iwl1tvacby+?= =?utf-8?q?K/y+XMtVySV+7ilVaq38Pt8ybhcy5eJWqPJgQaxGDOcxVmNgbK0Lg69CmO1oCrB3K?= =?utf-8?q?vM48kpcZv/E9qS2aLxgpqW2wNcV48D3TpdOFWEbZsGjX0C0LPBynOX8oowx6+Vxra?= =?utf-8?q?XS+VeJC7iX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EYSaLZT5LD42Z2PHl6xU0wdukaNKyNZW+HH?= =?utf-8?q?TUinmVHNTL9PzFarpC/apW2EQybZWWh2/DrT9MDBAdxPCiSbnJx/Sk0uqMQIdlFEa?= =?utf-8?q?EEFPj7l4Hk7+bXsVwu16CffxDqUZ8NEktg=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: acced04e-f44a-4342-e80c-08dcce8c60df X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9562.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 15:55:49.6632 (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: sE4J4xH4teQAA5FOvdYOMF76b1JQaeMGNSUIUYpcvWhOVoS5+OJvSWJqeSHUcBQQ6B178//kJb+fQq/zYhfQWjPB5NaETb14tq0zFzFWKEs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8319 Theobroma Systems Mule is an MCU that emulates a set of I2C devices, among which is an amc6821 and other devices that 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 (amc6821: reg 0xff) Implement "tsd,mule" compatible to instantiate the I2C-mux platform device when probing the amc6821. Reviewed-by: Guenter Roeck Signed-off-by: Farouk Bouabid --- drivers/hwmon/amc6821.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index ec94392fcb65..a3fdbcf01ecd 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -897,7 +898,6 @@ static bool amc6821_volatile_reg(struct device *dev, unsigned int reg) static const struct regmap_config amc6821_regmap_config = { .reg_bits = 8, .val_bits = 8, - .max_register = AMC6821_REG_CONF3, .volatile_reg = amc6821_volatile_reg, .cache_type = REGCACHE_MAPLE, }; @@ -924,6 +924,13 @@ static int amc6821_probe(struct i2c_client *client) if (err) return err; + if (of_device_is_compatible(dev->of_node, "tsd,mule")) { + err = devm_of_platform_populate(dev); + if (err) + return dev_err_probe(dev, err, + "Failed to create sub-devices\n"); + } + hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, data, &amc6821_chip_info, amc6821_groups); @@ -941,6 +948,9 @@ static const struct of_device_id __maybe_unused amc6821_of_match[] = { { .compatible = "ti,amc6821", }, + { + .compatible = "tsd,mule", + }, { } };