From patchwork Thu Jul 25 13:27:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 13741917 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11021098.outbound.protection.outlook.com [52.101.65.98]) (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 D402E19B595; Thu, 25 Jul 2024 13:28:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.98 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721914107; cv=fail; b=sEwRapZ9m9R/v+u2hlIRNQaqzf9X+aoh05LVwCE7O8JN8fi1567hNCBR6lSFIysdWoClDAkcACDxcuYr6qf/1P4G1gTaK4ZaGTodkrYgpsk35B1FBbaBt2d4lc52WGIFYREcAqmWDZuOdhANm0nF5XH68uDSob60vavUK0kCu4I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721914107; c=relaxed/simple; bh=xxDr4tH0jYVtI1uNZVM0QYJAjQECE9PrtTFs4OrIjlI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=YAznEZu7ArjHxofNUDI9o5idkyPORnPTpvxRdQk6fPTWa+8QkYLRNCo/OoqvQ/bmeex93teTkUyEOCKYcUUHVPIy8mINllgAzsIf67qZPMYzPyzYK2Ay/Y0HBsxRK5GFltVRXlUFDzb15TE6/EtxGX93zvF1gL9OSeQBKQ0+cs4= 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=BPjhWkU+; arc=fail smtp.client-ip=52.101.65.98 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="BPjhWkU+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RvWSqEbAflcZdoLz3IdsIjvrxPSyTVUS7HZkdXREvykRCs7/yfkL4yJ+GSYpgDLVwfTqVlyUEEJUjhozYE4AaHBoTN8PlnRMA55Dw0/2q4bGdqNpFQdUP9mfSKAbZ55S7ghgW6hozwaamb3wzL4QrjWm7vFMA68WgxjGAySO17VnzrjuenA+2rqSQMq1ns+OdKecYs1fykJCRIu47Gis/TReAyL6faG5NMcWihsImS7mibLdbCkd1nGSM6bQeOg9xzBpD0gNLiyU1qZV4CgUWIDiy9pmBfjfKFgWw4rt01/+SEkJiLbCoDQJaRmRk1j95iBzlGH80KKdVT504g3E5Q== 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=3fm8yQ+KBG2t8PH/TgkrdICnoRfgysn+qCLCtueqNFE=; b=mw6nHmUcN3KkkNSE7qSJuhCaoD2u3CKwOh3t8KkOHpTDa6Xz2sIWqKERD0iohqvGcU48u1FYAu94K5BQenuSicStuTqiW1he2QWfUpYFsOhMRAZGuT8/Rd446SA4NG7zvyIApvd4XV9owqSD/PWp2ilR2KdQ8pe/a71lvYgm8TaQyEiNqZyMFzocJ7iFPxDmDo79WrC5elIP4h9FH2B2qH4m9d3CoX/TQ4e2bL/SxgyIUawEy1lIdGRrgnn9sC+kK+l/4Yzs1lS4R6xxAJgU4impoxXBL3DWqRNDDZdLiY21mt3SWHw3vG9o3gEm7QXIVWC0FBcxi+eA78MR0KbTzA== 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=3fm8yQ+KBG2t8PH/TgkrdICnoRfgysn+qCLCtueqNFE=; b=BPjhWkU+13DFax8JieB3eV5fj0TKwGa81P7ptw1l/lLsRSx6qPSPAbu+c/2M7XU6AG0ouncTqQIsFYIZmlb9KCZjDwrnba5kJdpUlRtIaP2rMroAWgHNpF6qk9cLPgSMdSu2knRXu01wEkjknHviccEOwnvwEvCeCdXdd6SUQDs= 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 DU4PR04MB10670.eurprd04.prod.outlook.com (2603:10a6:10:58d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.28; Thu, 25 Jul 2024 13:28:19 +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:19 +0000 From: Farouk Bouabid Date: Thu, 25 Jul 2024 15:27:50 +0200 Subject: [PATCH v6 4/8] hwmon: (amc6821) add support for tsd,mule Message-Id: <20240725-dev-mule-i2c-mux-v6-4-f9f6d7b60fb2@cherry.de> References: <20240725-dev-mule-i2c-mux-v6-0-f9f6d7b60fb2@cherry.de> In-Reply-To: <20240725-dev-mule-i2c-mux-v6-0-f9f6d7b60fb2@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.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) 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_|DU4PR04MB10670:EE_ X-MS-Office365-Filtering-Correlation-Id: 05f8472b-b959-42a0-f3df-08dcacada56d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8nJ13TlqhYaa7nBj27dueOk+sb1e05T?= =?utf-8?q?w7Zvu4IlAdgZF2wxg5Q0UBx8fg48C2GR2Fnl9Z2VstzH5HwJSSa0+lTfaQ9fktQxL?= =?utf-8?q?C6/iHei2GWHGWAlPZzmz+aB+m0vFbvlklUuPdebMH3+s4HDlb6b4RY+dczZz4vS/+?= =?utf-8?q?AzmO1pyEplCJ6wSr8swWFNxkkfWIk9NNFLKhVVoqK7+VSRmnCYl/qOcjjPzwT2JZM?= =?utf-8?q?KZKXvv8l8Jk8oM6U3BaXfR8wfyN9/mPDmszCJSapNdJNIUJfo6PruF46aXL6H1Pv1?= =?utf-8?q?NgbENBxavSUiNMjH55QcMM9a9//Ntf3M83hclzIZI4GLndXjUdXbH1ibhLpUwTIBJ?= =?utf-8?q?d5rnfonCyhrnj7cAF5iO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tub8fzUIS5jLECTJTo48T0IkMSK?= =?utf-8?q?QsXlU7O1MJ25XuNTMTS2C5y3gbpgTN9Bf1yPXVxxn32XkYsilBlw2zDMHi6YTB9I6?= =?utf-8?q?trqP+XKzc8TGKhPOW1BvkNzN/L4Nx+YcqsIrne3UQ1HzJOAomVppADI=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6+3V7esgrpIVJo/98j26ShvotBeN?= =?utf-8?q?Hcr/v/OuCYjVT8kNxNf8LsijBGoAL/J8stmHA1EUJxBUlk0eRZC7e/Ca1G5CpbzYF?= =?utf-8?q?0B4VF+tummI8YEtZX/sDCz7O6vrlvaLfKVP6y1f2idrdVrt2cVRADqu9mMQRc+exP?= =?utf-8?q?j6Rxbnkbw44Dqzw2l6juXKv0bCOcpdYuXFanVJvln9RG81VxXpveu6AQpnUBK6y5v?= =?utf-8?q?qa6r6k/Bd6GXl1fXCQXWWMQ/ikoIxHGZl0ZT5EAxf7P5tGDxriEyzPzsN4nxnocZm?= =?utf-8?q?qLgBinLhJK0V12TgP/n27rIwosIqNoOxXBR2c6d0b1JquEAmF0nFWQMFOaLiuBvxK?= =?utf-8?q?Rx4X6HRyFg44KRSpENif/Fe7wAHvxAWwVZNsT2x09ggnw/8fg8vQJ7pWpuzYf/plL?= =?utf-8?q?I+8UwM8VRqpqraQmDySdUSVe+DGN1QN5dG/MxzXp9G2dsQb3Xi+BPZ49IFDrCAPCj?= =?utf-8?q?ojLm+96K9gQ9zCgJcg6zGTb4tRHmHQ5vX1ayEIV9offVQ+28CnD2oOPI0TwDx4lza?= =?utf-8?q?C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aVJEAqtkEIS4qBGk8bdMZ7GZIBc3w2K9o5hNxbjj0E1oYHXushquPu?= =?utf-8?q?iwPNqNQOqkqb7ysEUoDrhE5Fnqz9VGp7ydeSXAxdMtS5P02Wq3J51kt3+FYwiq+tG?= =?utf-8?q?zEMExJlUtUqsC8aN8Hwb7dmH5kFMli+jdw=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 05f8472b-b959-42a0-f3df-08dcacada56d 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:18.5776 (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: 0xgVVpPnS7yA6YU40lrE0LqbPMKg3S4WEbUSsOX4KGDeCBHKx1/PR5r31O/mZ9HEO7GUgzQ483voMkRKKuX2suSioKYKM/TJXRfAxI2sTWs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10670 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. Signed-off-by: Farouk Bouabid Reviewed-by: Guenter Roeck --- 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", + }, { } };