Message ID | 20240618-dev-mule-i2c-mux-v4-1-5462d28354c8@cherry.de (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org> 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 BBAE8C2BA18 for <linux-rockchip@archiver.kernel.org>; Tue, 18 Jun 2024 16:10:16 +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=4aF8YXv3DZCYYM2SiKfaZYxJks2/F9RGoNDGVgfSrJg=; b=2lCVOGMao4I1tzHzvdGMF3gtRz Yz8DMo6wmy3fmKJ1Hd7HYvN9EkTt/mKGJdHzDCCpwq7+1kMaNfu2Yc7TRq/789xWQHbuURnj0cgE3 V7MfmHONDTIAC63yOi/qIec57UTVvOUx5rgFIGHPGOYf5qojGq/kJ9TG1zQkIiUF9vhK0rr7DPgfb sIyVQicVFRFrJHWuFcuePgLqIpIKWmIa4yb2toBj/yl46OqHiohWIkTmq3584InY8gfBGBeIcSrt7 pnvKpMsLIft2MF49bFMTMCiYIv0X8eOaMFP+CdD0+XRg+z1SBi9fJ++e2VB6SH8Vwi4fcF4ElZdmz JSDyLPbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJbPL-0000000FlU5-1fp8; Tue, 18 Jun 2024 16:10:07 +0000 Received: from mail-am6eur05on2072c.outbound.protection.outlook.com ([2a01:111:f403:2612::72c] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJbPD-0000000FlMt-317C; Tue, 18 Jun 2024 16:10:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J0uSTurEV0fukxyzHG0yA7EsFCM1pk+gQ9Jl2y2YLTwTv0r9sEZSlSxK1EKeBBEkYY31mKlTopLNUZ+NQQTDzuqOcyWXSbBXZJUp1kYSHdXQtoHmXiEBNnAHoXK3fKY/vgIo0AMJdZAhyY+oGL9hYHxL8AB6vyeihQTTaXtGXSfgoVZiNJaS9qJp5PVwhG5bMxnSMTEU7TjtnsnAAkuz50Pwna1WkHKnHHQ998LGMhiqL1fQoz/kJo2YXh+rne9IHdZRRdckn6yUmMryI1vNWflQ7jQpk2YitWrrWIL2Qrr2EDeqnosEq9DKToKF7f4gqjhwrb1SZbmWYA9Ez2t8Ig== 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=V2z5e7rgCz+d7AjJV8SAIlOSx0KmT8TyU4loHyhJ0NA=; b=elF84OGBo0J2xyxpMDAobO3qFFkC9lm8bi+utWXKYmQ+PB8ckVVjKj0kIoFpAJq7NAV+vjppqZGCJq61vHdNHV65Tk1V6CzV5j7yOkQhCoRHzxVftMjV4PWU1+zfDuBuidPYI1HCycyJj4aBsdTMbTTa8XkbZsR6lZrc6rH7yZ8gvIJIVtd8w2j0IsEdLlOmkGchTD697JfaHSubgjCBQmRf/R1mAFo5Puj87FlbUfRZffA9dpPG5vKHr1+QCKTK+qS4qMK010g+N0Nx5vFmlOaxHSkho1R/du9A9bv2HjZTr3CrmMU5oPlA37IsPBXSkhAfw2mn4X2Xv7CdMzaQfQ== 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=V2z5e7rgCz+d7AjJV8SAIlOSx0KmT8TyU4loHyhJ0NA=; b=JJ9a+hWRcGiKpKEjsLCnImy6AlwQg4QCwNHCyEQHXzfcNaoXEl1aH3KERwQsH++k1Co2gO3jfF9Ao3Wh1bivZs0ECFhckvDzwkfPMOfrknu8pL+6Pgio239T78ZhS7TGLbGw03koLrK4saqw6RFm0wAC7wAl5eqNyYEwOObk6bQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by VI2PR04MB10642.eurprd04.prod.outlook.com (2603:10a6:800:27f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 16:09:48 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::2a24:328:711:5cd6]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::2a24:328:711:5cd6%5]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 16:09:48 +0000 From: Farouk Bouabid <farouk.bouabid@cherry.de> Date: Tue, 18 Jun 2024 18:06:43 +0200 Subject: [PATCH v4 1/9] hwmon: (amc6821) add platform driver probe Message-Id: <20240618-dev-mule-i2c-mux-v4-1-5462d28354c8@cherry.de> References: <20240618-dev-mule-i2c-mux-v4-0-5462d28354c8@cherry.de> In-Reply-To: <20240618-dev-mule-i2c-mux-v4-0-5462d28354c8@cherry.de> To: Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>, Farouk Bouabid <farouk.bouabid@cherry.de>, Quentin Schulz <quentin.schulz@cherry.de>, Peter Rosin <peda@axentia.se>, Heiko Stuebner <heiko@sntech.de> Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.14.0 X-ClientProxiedBy: VI1PR07CA0286.eurprd07.prod.outlook.com (2603:10a6:800:130::14) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|VI2PR04MB10642:EE_ X-MS-Office365-Filtering-Correlation-Id: 452b9efa-b473-4909-7955-08dc8fb11397 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|52116011|7416011|376011|366013|1800799021|38350700011|921017; X-Microsoft-Antispam-Message-Info: =?utf-8?q?eqa0aZbmQ6KIA6OhJUauOpwbDOAobZf?= =?utf-8?q?12prinCcLD6mkbugbm3lLurosBNWs8XfbjXOhMg+5VN+wcxf8EZYZq+gHqh7ZvvV+?= =?utf-8?q?i4MptSyOp8Twq+kKkyrrhvOoikpO3D3IKoqTpNK49zZ7oahHN/6YQWfzD8GonrJ88?= =?utf-8?q?LdjE8+Sbo5BEOr923hSspicgPtPKMU9EwGfw9xBh9AtnMr8jrt/EV770NrxViXLOt?= =?utf-8?q?h1NsLnSW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ToGzYISrazp31EnFe5awv1Uyec71i9gZD2ZeZ2aA2fKQlDUK/T02qJYFLZiWLRNfJ?= =?utf-8?q?Tue+cDfhckqBAghKRijxKnEUl7tiEy2TNsZsE8+SlrT5clxMAnlzYydJdOpPl95Hh?= =?utf-8?q?FLOsXeknM3EI+igh/x6EzvWidtVkBzWPPhDAq7l8bs2yXrXgrMbMQK3hOJ3eOLGrO?= =?utf-8?q?aogemmcXuSfNRDhLplpev9pM31vvqiYeKt0IUuL89kjCFQEVLK7EE2n3voUWvByVu?= =?utf-8?q?JaQ0VKTVDYuR?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(52116011)(7416011)(376011)(366013)(1800799021)(38350700011)(921017);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?g9akEK29axWb7rfTOWWliwpihFJv?= =?utf-8?q?S2jFIftPmcXd+PK4VAuGb8N6PGabMBmoVeM/t5AGz6rdgo5Dzxm+JjQwXnIzrdXED?= =?utf-8?q?ZKWCqO84zUgU84sjz2q04bnT1IBPLMQWEZ4CQJDERuJeDMrSnIr3Z/UbMffclIaMx?= =?utf-8?q?xNFwiC5WYZOjnZX+EZNPY2WT+W9iWm0eHk2UAOIKyVLqcosLHpHdo3JoTwInOrpN0?= =?utf-8?q?4zRmdlx0nzS+M6HC1O5He8PagG3FVUj1ipPnLygRROGxcaul5MrdALsBIpng8L7qJ?= =?utf-8?q?G/NfVboJOTes8NFocE/6y9w/6KOTwNh6FPjoFShY2091FM3SYzAfySP/Lbg9OCYxm?= =?utf-8?q?J1ng02f7CeiB4K7X9uhWEQwQdGgtglIOkaMfuicMQARmTfXuRWdm0R0Y4PLONgQvd?= =?utf-8?q?9pDy999mRCznEt9SqBlnudYalIKc29lle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vZyYVSuK74mM3+MwEs7Dl83j4xzz0IsQuRKng?= =?utf-8?q?oe9h98k4v2FOpV8E2qrFC1c0+4KYpgbBA+5oPSSz4Oabs509w+Z7LXwr4mAdSRwfL?= =?utf-8?q?JXJCO11PDbSD03s/uPeO/1mcBE1Du46ibSrAKJfrsvLGnwJIo3zvYm37TiXmIGIIu?= =?utf-8?q?vBJ0vuhHKjwPPEm39w5h2EKi28SeoZRJzScMxrpLNILybH6z5XAQrPg8nb59OkEZV?= =?utf-8?q?HbrS0zHh+l1THIGZD4FkZJ3fRwapPFZPUA=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: 452b9efa-b473-4909-7955-08dc8fb11397 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 16:09:48.2574 (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: RDe1OPC2Zr8WDET/+jmgnUIunZPnxj6OFLXnnzRsfvnIKjDujgcoUcYXRUPytvBfFgG89j3bneTS5Eb0rs271IEzNxOHy/9TLcrfLujThKY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10642 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_090959_848608_D7E87D34 X-CRM114-Status: GOOD ( 15.00 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms <linux-rockchip.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-rockchip>, <mailto:linux-rockchip-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-rockchip/> List-Post: <mailto:linux-rockchip@lists.infradead.org> List-Help: <mailto:linux-rockchip-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-rockchip>, <mailto:linux-rockchip-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" <linux-rockchip-bounces@lists.infradead.org> Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org |
Series |
Add Mule MFD support
|
expand
|
diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index 9b02b304c2f5..464991fd7fc9 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c @@ -18,6 +18,7 @@ #include <linux/hwmon-sysfs.h> #include <linux/err.h> #include <linux/mutex.h> +#include <linux/platform_device.h> /* * Addresses to scan. @@ -900,9 +901,8 @@ static int amc6821_init_client(struct i2c_client *client) return 0; } -static int amc6821_probe(struct i2c_client *client) +static int probe(struct device *dev, struct i2c_client *client) { - struct device *dev = &client->dev; struct amc6821_data *data; struct device *hwmon_dev; int err; @@ -927,6 +927,18 @@ static int amc6821_probe(struct i2c_client *client) return PTR_ERR_OR_ZERO(hwmon_dev); } +static int amc6821_probe(struct i2c_client *client) +{ + return probe(&client->dev, client); +} + +static int amc6821_platform_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + + return probe(dev, to_i2c_client(dev->parent)); +} + static const struct i2c_device_id amc6821_id[] = { { "amc6821", amc6821 }, { } @@ -958,6 +970,16 @@ static struct i2c_driver amc6821_driver = { module_i2c_driver(amc6821_driver); +static struct platform_driver amc6821_platform_driver = { + .driver = { + .name = "amc6821", + .of_match_table = of_match_ptr(amc6821_of_match), + }, + .probe = amc6821_platform_probe, +}; + +module_platform_driver(amc6821_platform_driver); + MODULE_LICENSE("GPL"); MODULE_AUTHOR("T. Mertelj <tomaz.mertelj@guest.arnes.si>"); MODULE_DESCRIPTION("Texas Instruments amc6821 hwmon driver");
Prepare for probing amc6821 in an I2C MFD device, by adding support to probing amc6821 as a platform device. Signed-off-by: Farouk Bouabid <farouk.bouabid@cherry.de> --- drivers/hwmon/amc6821.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)