From patchwork Fri Nov 8 22:26:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13869002 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2044.outbound.protection.outlook.com [40.107.22.44]) (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 2689520B7F8; Fri, 8 Nov 2024 22:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731104847; cv=fail; b=CteUMQCO9rIKL+nq/czQaKfG40j5g4OreK5JsyORaPbtgc7hvjqGwjly9N+2QbezX6qCI13XCyz95ivdYinGHDV4LDlTrusLVUE86Ea3a9iQEwVc+AbQaDHAd7fzm2xnxRTFHNHHN+ff/NimTFWhYrbLndznL/VcpTezrU2KU8w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731104847; c=relaxed/simple; bh=dNC+ZQ30MlH5Eg8phImGTLf2Ic51qNcIJJM20651DNs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=kLAu1EXEkMm/S8btq3ihXJ7O0UvjRZxuaN0skPssyhJfnuPfDPVa4O56Qgj4mTL/J+bz/LOiMeP2LI9AtPurIrlhuCYOaM70chne0UCa9e/I5MtVoxE1zlRhuhwIvc28AK3AK1HXGkPfdst+Jcv52U9aGvvEMbuUrS8So6y3IMk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=GelNZdWO; arc=fail smtp.client-ip=40.107.22.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="GelNZdWO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TPyEYd3wJ2q6rsz97k+O+OIYfAsmJ2PwFTs3+XWP+vPpmUvzZxmwA/G5jRF5VWlC8/CoNRrZAyhY88HjUyIqOajfeo4aicBXr1EDVgtG12b06gPOl5RENUBn/seohagknDD+aFZpJkg0Q1CjX6vPtC0R2t5hHpHLgFvTCOB9bOQgdXrrpUIy3iJt+oN3Mmf7UWyLzMoN1r4c+sulxp7ACzpEZARDobdSJNW2HJ6JOIi6/GXPvgG9dIiQZL23huvQrQ58hP0cbyEoIa6vGrs4o6xM9NS+onZnmj7ekClBw3k08yI/QW+VScVpk0+Fq0EOKNDGZBKaQY9paE9Vk3X9SQ== 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=RFmlONCWGpLj73XDAx4W3D0f9kD7Obz3kl1YoM4qpaY=; b=Tv08ebieWAo6iAL5dB3FLFCnPT4bA89erypGNIpwJiHzDIAsPWZ7YzVuwSmvTc090ve5qH0j8GkBKz6G8GpxiKeILUQKiwF4I+xBRqarobTygiDCaUtbR8vAMKfeyFsLjjE5hYUs83bfoK94esz3K9jankIs5yQpDBveeVsljG29XrFznGsIxupEaimZurRk3aumuwSFFRoyRUWNgItHxi/n/HSZDqmfFR6teErJqOZ4Ri7IKz8fVMoR6//10kCI6H21BivoDIf+cqWqjDE5a0zybMezFK61WTDJsoMeijnaAPIiNMZ0/dEmTvsYi7qOGm5XL4bQmoybm+K/aGmQ5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RFmlONCWGpLj73XDAx4W3D0f9kD7Obz3kl1YoM4qpaY=; b=GelNZdWObwm/Cu+fwAfpcWoND6L6rczgN2t4ExMgT9vAhqlOD7dhLcdKKPhJR6dCT/6DTEf8YpGUe3wK00QVrkdav1BmcDBDNJXqZXPlVETBMZPWvLBSX6RIiFsKEbrn/F+FqEoqfvGk6sQ+as22d0S2StxqgkVfTiOdr1OzsS1lpu5hqvrBYp0Gu5WU3EHqYVzFXmOPKbRwbkbmsurNZTBOadenpzflBgBbWL1QaqbNDvgGPXvqF+ZyxaTcx46NMJhvyfxWHhrYJEUQEBfB6Y7uKz5+N/Sm//fxRyk4WMf1ugWoOTB8px+/jOWKW/sanhj3Sl6+Id5MeySLlT+G7g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8318.eurprd04.prod.outlook.com (2603:10a6:102:1c0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21; Fri, 8 Nov 2024 22:27:22 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8137.021; Fri, 8 Nov 2024 22:27:22 +0000 From: Frank Li Date: Fri, 08 Nov 2024 17:26:57 -0500 Subject: [PATCH v2 3/4] hwmon: tmp108: Add support for I3C device Message-Id: <20241108-p3t1085-v2-3-6a8990a59efd@nxp.com> References: <20241108-p3t1085-v2-0-6a8990a59efd@nxp.com> In-Reply-To: <20241108-p3t1085-v2-0-6a8990a59efd@nxp.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , Lars-Peter Clausen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Jean Delvare , Guenter Roeck Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , linux-hwmon@vger.kernel.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1731104824; l=1736; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=dNC+ZQ30MlH5Eg8phImGTLf2Ic51qNcIJJM20651DNs=; b=1QVgOqrY5wGn2COQ5CWxshxQj0TE+iEGMOb0SjFc8GyeMJ/+XyHoThOXeVHT5y+qgvcMOOQR9 0tQ14ldloaCDEzwbhcVpJjfXQk9MZQNYH53EOdFlclP120vZvUDfBjm X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY5PR03CA0028.namprd03.prod.outlook.com (2603:10b6:a03:1e0::38) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8318:EE_ X-MS-Office365-Filtering-Correlation-Id: 7afabcf6-2289-46b8-e0b5-08dd004483d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|38350700014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YzXVg3fdDsebWSg3+Ax2pPSr0v8Ix01Zlvnretd3gGFDWPlUKqaxMJG+sDCjwhLqh?= =?utf-8?q?Ydzjhj14wQqQyUj0CKOYzb+ejcwHd7Sw/hLQBpChIHvALmpszWHkiZYDRGnAvzYvP?= =?utf-8?q?FPHYaqj8uVWHa5Q1TgVYFp3vdR5l4OFjnXkn1NQVPCaJ30EI/duZTelj7at6mOY7n?= =?utf-8?q?09V659G22U/tfQ3447Itwr7sfZAqou5bMWQr6eCKmS6alAR+frs5OWEBXwCBwuA0R?= =?utf-8?q?zGklFHP4neYeUO5o7ooNAAWlqdU9BM2NADtT2yQOy8kG5WHX2ogPabYvjEBI5ROav?= =?utf-8?q?jx/CKEJIl6hlYKJ/A+ZE1Wfn+QISpEwzcSgfrslisIRfKk0A58XdiZmKTOcKUKjU1?= =?utf-8?q?+J5JyoplQDUJQ4Cdxbftp/KyZAuEi/t4UE1Ha/YmMESgdnRoDjZrLdW4ATdX/E71h?= =?utf-8?q?sWmdhLa1nVNYix3K8g0w8TLT3rhH7EIFITYn50Eh1QqXwkXon0notbRGakgvieXOO?= =?utf-8?q?0NrT2Shdr1Dv?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(366016)(7416014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?dHQRkUvgz+YGtfoWYtblKOFl6b2/?= =?utf-8?q?Hz37H4RJNi8tx3CiyMdny4Xddvon2xfGO31hc8ZKwI3se2LdPlgbV3kuf0r0rygbB?= =?utf-8?q?0ipi1+22qfri8MGdOjcNtJZUa1ZovKLoGIXe8bi6BUte83lz9MVmDOGbH1e3WY6NJ?= =?utf-8?q?kvjpCaEsA5P9Cq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6KdvXdsEiR+ypIwVwFslpaX8If75/QOZu5?= =?utf-8?q?QPtRy0aawhQH5ANzCt62/CzFxaUF3/fOV1XZI4H7QEZEtaMcnZubhlkuSfBlPzCmo?= =?utf-8?q?DdVVvtAyTw9QwnWsL39pNzXk0SACfo+M0fzLMisRnof/rINRbqBTyMdBu8JxeWIXM?= =?utf-8?q?TkukJuSQ9fV8jEo5RKHyD933TAFiVPHvGa0501clcSFW6+iS/S8Fi+wbOWeyN3qhB?= =?utf-8?q?uxpoE6QdhxioSloqMKzUNQF7npVzEsejqKoG9t7yaPW1XwNA3bccRV4ZPw+PoKt8Z?= =?utf-8?q?OamUICu2piukA6zWa039Uk47oNjGCmdrqj7e/95TzhC+VkCdZ7CiVmlVxV3dpKRs+?= =?utf-8?q?brP9zyQNcySNHmSRjnHH4D5fjlCwpeAEJOV2EzOkCHaLj6zVsDGNq7rMLMeyYQSqX?= =?utf-8?q?MD8qLY16zXooVST88WE877ynOxB05jgRyQam5z8P9kfz7tzRhtHurExTh6SCyuf/a?= =?utf-8?q?zDaaKQhsoyCS?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7afabcf6-2289-46b8-e0b5-08dd004483d0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 22:27:22.6548 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wTtTVPUow5RusrHfJqFssMdUAubBs1tvaM4v4b/4BsTaanme0xC4xJ7Z/U4OoBs453artmi5uPjOY1uQkaDrcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8318 Add support for I3C device in the tmp108 driver to handle the P3T1085 sensor. Register the I3C device driver to enable I3C functionality for the sensor. Signed-off-by: Frank Li --- drivers/hwmon/tmp108.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c index bfbea6349a95f..83d6847cb542c 100644 --- a/drivers/hwmon/tmp108.c +++ b/drivers/hwmon/tmp108.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include #include @@ -442,6 +444,35 @@ static struct i2c_driver tmp108_driver = { module_i2c_driver(tmp108_driver); +#ifdef CONFIG_REGMAP_I3C +static const struct i3c_device_id p3t1085_i3c_ids[] = { + I3C_DEVICE(0x011b, 0x1529, NULL), + {}, +}; +MODULE_DEVICE_TABLE(i3c, p3t1085_i3c_ids); + +static int p3t1085_i3c_probe(struct i3c_device *i3cdev) +{ + struct regmap *regmap; + + regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config); + if (IS_ERR(regmap)) + return dev_err_probe(&i3cdev->dev, PTR_ERR(regmap), + "Failed to register i3c regmap\n"); + + return tmp108_common_probe(&i3cdev->dev, regmap, "p3t1085_i3c"); +} + +static struct i3c_driver p3t1085_driver = { + .driver = { + .name = "p3t1085_i3c", + }, + .probe = p3t1085_i3c_probe, + .id_table = p3t1085_i3c_ids, +}; +module_i3c_driver(p3t1085_driver); +#endif + MODULE_AUTHOR("John Muir "); MODULE_DESCRIPTION("Texas Instruments TMP108 temperature sensor driver"); MODULE_LICENSE("GPL");