From patchwork Mon Sep 2 16:38:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 13787505 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 D4563CA0ED3 for ; Mon, 2 Sep 2024 16:43:29 +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:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1qpddCRRmb3fQ3DiiRVw8JyuuQKAyQgC4IQuYLW/k1o=; b=LbRh4lCmeD78G7rxjqxLnslACi qR/Ix1J05uG9qyvovs/4Q8kvSustuxqwMWj7Q46CbMIZqR1FNirJxXnUMmVJAFG6NXr2nYCVsEhNL 4gwBnzKsE37fbwmkxBlGvXHz8+rfbHfMrHXQni7kkPC7KBwY9k2DQO64iV0sdL1/meClLXPoFsI2N vRJF0Fs05hUR+YtoQhGzpJoVhcRaGO2ggfziNkMGYVvRp05tXpYoc3QhVtogE1hCOhOAJBaxz1Oec OJJMES0a0wOXyCxxffzCv4yDzRGU7uU96UIUM5S1BWtckuf4QiV7rlvBRqHOGsIwzd70aBsuan0NJ rPc4mKXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slA9G-0000000F41V-38Wo; Mon, 02 Sep 2024 16:43:26 +0000 Received: from mail-db5eur02on2062c.outbound.protection.outlook.com ([2a01:111:f403:2608::62c] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slA4m-0000000F2et-23GI; Mon, 02 Sep 2024 16:38:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aZVTar+D4NUzQTYJ/k2d48jkBhDPzHhJPWO5/szrkw0BAyQQphEeVX+y8zNzks4tqoZvT7I6/Z6J64Ia/aFD0gQ7pNxFKsY9zcj9e5wjhbuUBcS5SEyWK6C4ImfMOWsbdEzqd1xZo24JxXMQMJsloG+Vghe3O2jHss1D0t3oGq49s/nXwesTK+FHJLntnSQIoRBdcQByFA76pIYcI5AMfdSSf9RwgY6MZCwkNXl7OQFppJlMMOOSjTLJRZkoXdr0QJA1c0qePm2oHtegpUosq/J9n1fxKvpxrrcB2VKqiXOY++04mVgjm9FBmheInbCaIvXBY66aio65MMrNPjO5FQ== 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=ZC9pm0/UlHOdgX6xctgp0uwrFczDYUlibdTzGqGUAHt9Hm60n8ubvTbK5iuQ4WB8HsXJ767f4mCMU9AF7mcWH80hfHrkAZVHs444UIigR+qx9JurcN6tcF2pAIAMYHor4NhpMGsqf5iGCKpuUH1bAhD82Ou71A+G0JCC+CiaLjlXZSdnZ83z/WrPE1oc2qvuS4AAo/PSdnpyusjjIUX1Ye0ykROpU4AEe5RZNwxxZhm79m0RsgzmUjiL7jV+nlgwYnOuYTpwGeuU6fiElXDc53FVvM6/k3JXxIAqJpJbfHGI6C0smUOQgNfj6hIaKWOIGAm4yPcIi8mDXR/BoxildQ== 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=jcfNtLZJgkx0TxQUO0ymUU4wmzRZnClt9At0069co5MWEcsfZ8tQ2K2QzVbOTMq7V2SHK1Siwr5HngSK2wlvS8xDt/zdn+1zi8uom6Fw2rBQw3XSJQpIpf3/s1GPdsQx6Vvnxf62TiAJuKZpY16Fk2QSpyEhkOuqNRPHi9wSsGM= 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 DB9PR04MB9645.eurprd04.prod.outlook.com (2603:10a6:10:309::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Mon, 2 Sep 2024 16:38:36 +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; Mon, 2 Sep 2024 16:38:36 +0000 From: Farouk Bouabid Date: Mon, 02 Sep 2024 18:38:17 +0200 Subject: [PATCH v7 4/8] hwmon: (amc6821) add support for tsd,mule Message-Id: <20240902-dev-mule-i2c-mux-v7-4-bf7b8f5385ed@cherry.de> References: <20240902-dev-mule-i2c-mux-v7-0-bf7b8f5385ed@cherry.de> In-Reply-To: <20240902-dev-mule-i2c-mux-v7-0-bf7b8f5385ed@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-99b12 X-ClientProxiedBy: VI1PR0502CA0001.eurprd05.prod.outlook.com (2603:10a6:803:1::14) To DU0PR04MB9562.eurprd04.prod.outlook.com (2603:10a6:10:321::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9562:EE_|DB9PR04MB9645:EE_ X-MS-Office365-Filtering-Correlation-Id: ab050e9c-07b1-4cda-2c73-08dccb6db120 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?yjTRIpAIB8ekLBz4g5fcbthMqPPiRKt?= =?utf-8?q?2e23rVQX550tjHizYjLRkPa/DX/0JtVYDWIAm4w1VDOkZk/71Kk5XMoEsCJsItr45?= =?utf-8?q?Tl7YWNvIpQ+N80An8sOuVYDPZpgoK4Kd1R+4nc9aP+VPLXwzvEQaT5gtatwV2wJDk?= =?utf-8?q?OpOFgbtfg9QxKRDpB7qrIto02dQlaz2PRa7neEk/m3ebaif2qVvDjTN2+eG4HdZ7D?= =?utf-8?q?RjuN1RC+1j2ErUyCEvpnmECN5XusYlKPRBajhr1J/kndBe84BBD1M9bSeAxz1q++T?= =?utf-8?q?OO4TINxW8jOUi0zDP/4tGWjaqMKCLrvC5hFpNab8GDE5IKcp9U+IzQb6/ZQn+m3nG?= =?utf-8?q?HYoTIm3T3abeVWY42acaSyG2LLG2iQQb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L46towrxGdTDOviy9EqVC5Htv3Cz?= =?utf-8?q?rHmHhTxd6yW87NKB2xIfGpw9B79/r6kmPW1IcPeAVaw5A/pEN4Uf3mDNP4Ssefrxb?= =?utf-8?q?hyk/K7m1BwX3iq/Sn3LvmNY3l3aj+dwfJyT6fnJ0dDzYfwH2JHKY9kM=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)(366016)(52116014)(7416014)(376014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gMS+r78CqpHWXnz5t1nTjT7AOJb/?= =?utf-8?q?zN1nSwXK770av1LlrGH0CZMCnBWITadHuDhPNxDyVbcj85czYcvt1rQM6MbIKvLCR?= =?utf-8?q?/weogZr6Ggj62WMgL1KSA2cC+Dj9FIJOgIkiSHdGLFZQzyvz0yWLoVQ3yjlDBq9q/?= =?utf-8?q?+cRq5JjxsO0w6p0Ce5KL/hHXC7F4cEZq+1+6wxdsuQtlihgJ2JA624b7q8YSRDbAD?= =?utf-8?q?qKVsUAJNjykwMF43eVzfQfZ4sSI3wzmQ368VQzJ73ros6T2qDf6bQ12XGWhpF9FpE?= =?utf-8?q?D4ViTximdJxbD6bSQlYZ+U7ZPCLTTSjXjsrWGBQezqv5d/x2v8t86S0tS2UNyyxC9?= =?utf-8?q?/5UaC9cQirSrwgX/zQPTUg384HsraNMqCvFoxR5Iopz2XnotkaZ4o0Ng2LUyyP/KN?= =?utf-8?q?vReDrHnjND8qdoXOrbxudIJ6M1zB+Wa9BJvJNDlVL/pIA3L4UXk8dApsLXjukDGDL?= =?utf-8?q?ls5fJ5DvIvj9H8x5STVNE+ouHQTgl3589trELzIEoxOUb64y9qdOreinU79pkTkJp?= =?utf-8?q?5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eRGAdK1ZFIkIBr+Elho3+1yShEvz28/UW0P5L9KyMLI/+V7N/NK+6?= =?utf-8?q?JkMZz6nV/nPpWPHw2R2m3Yb8cmHqhuZvU/BUlP/tjIlst26L+6k8LsEOy9IXwfa6x?= =?utf-8?q?FQGee3TKxAe6Wo9LEici6r6Cw/KCl8h5cQ=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: ab050e9c-07b1-4cda-2c73-08dccb6db120 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9562.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2024 16:38:36.3944 (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: wcYBZydlnoyIqACE6P7x68QUuMSeajiJU9q4iXq7Q83ZNvzrGUaaMHzEHt6rO41iPcyWy8hLhSZSWyMQowtgHxlR6XT2y+QCJo5eCb97Gd0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9645 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_093848_586131_16C6A7F0 X-CRM114-Status: GOOD ( 14.55 ) 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, 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", + }, { } };