From nobody Sat Nov 23 23:48:50 2024 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2057.outbound.protection.outlook.com [40.107.241.57]) (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 BD9F21F9414; Fri, 8 Nov 2024 22:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731104842; cv=fail; b=qj3I6eeKo4GgXc3paljvHz1fYiGYPFzW/MaeMAzR+oq3oND0uwS7u3D5ig7AYKOJ6Z6XdTdIjKjCDgR84BDX40jA6hrfLKnqQ2+Sb6dPayaLgx/aKV1S+ZCJbDlpucB+XCGfbL4+NIrJcMYLu4XRyadhn2JE7E9Mhfs4b/WY2W0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731104842; c=relaxed/simple; bh=7vqUo8jS1tJGYAA/RPchhwptChqKVdHqHfWjBgds2OY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=AV8Wc7g9utpmyH9kAC7cPfJxEALSC9zune5HkTL3AxGaGAVBN5R3PNxCLKyiJCW9h2DwLATO3VsBkyQ8Efv6d86OgV6BUdVJfhSf0pFTv4HuBrlIuZwy5qu3Xop5J7We5XtHnNDB5+NmYNWcpiNx5ReHal7gDXZTihsFXFSXOAg= 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=l4ROD/yr; arc=fail smtp.client-ip=40.107.241.57 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="l4ROD/yr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kQCOKadvvjCrpApWobOIAK+rk9H30+4C7yqdAna+h2pr7W3apSEsed5o1w7OlBTyokQkh+2PuT8rpUTE67o+cLX8d5MVyhepvytdmtoZCdhIWuqKSanxlpCRhdbdo8dxTNZZutEF6R752JLdkdKzfH2lPO3KTG1WoJNNMaJAMeH7cd3ieGcFEZdIxcBegUeT7CfZlJJJaj5dj2v3ESzLoabNLPTBgGkYh8jrZcMtIbGeatYrWmUfX2wnXdAJXuZkwTiZnJUWsMUw46IGDvFCEEwc0G25hjpBY+9mD2+ayVcarpq5TEf9DF8ENXdGQ33c5noqXuHUvCKnYUrApWpKdA== 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=cQxxB2o2JSHVWvb0oARWH5ibKPXi3Q/FGDb0iu0rvFQ=; b=exnn/gzOGArB8rIJh10KylMSQgVJfX28kxBog7WJHUTwJkJybC6mUfX2Jxb9D7xHzojIVoAu0bKGttYNAGcJVRR6eSllIu7h5vLgToKEMy/KoMBgjiB/FhmUSg4IbDcS94uaAgkVVKWtvKgQ4BZr8t6ghKJFta2MYY/+RqJPe0W3qmwxGmL2EFyc9jLiIHCq2ZVm4B0liUw8irikiQq1B9KA0pUxqZXlLLdqomeYSE+t5JrsqvY3YAAi6XCFc3CDyCMguqv5pysoCoN8dYdB+iRTBdu5TJXC9yjOle820K8Kromc1m0CeCfjBYx8t3qD9zy+Jd9d9bbar8yZXjl94w== 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=cQxxB2o2JSHVWvb0oARWH5ibKPXi3Q/FGDb0iu0rvFQ=; b=l4ROD/yru64ZeLjg6D+4n8mMZk2gGqXnn05ACMa1VN+HIaLdiLBOgkml3HPb8//veK1q6lztE3EmmxioOfXcD2wIrClTmhDNUU1QPee4gesQ9ITDAMosG2sAyJFTcPvS8pio+qIt5r0Tjccb40vHJ35Fu3A3q5Y6coiyfIy9qbYVmjVat5s4XfJT5I7Z73My6veJcRZEoPk/0eeEJsBAITtZv5+XqKN33UIUZydIFG/hRmKh8WZQq01zzMKzMX5+Owu+qeJG2hQeiTRcRxqd9KSI/psW2zJWeK9teEyxS5yH0AZBVRVGx5b0L6kWAvPU55t1WAG6Wy1wh1VBapwL7g== 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:18 +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:18 +0000 From: Frank Li Date: Fri, 08 Nov 2024 17:26:56 -0500 Subject: [PATCH v2 2/4] hwmon: tmp108: Add help function tmp108_common_probe() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241108-p3t1085-v2-2-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=2932; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=7vqUo8jS1tJGYAA/RPchhwptChqKVdHqHfWjBgds2OY=; b=IzeN1oI+bStNzAHrZzCbhvDeXZKvG3ArBDR+V7az5kHvP7mUDXeOCV05iQzqu7DkFkc5pzTsV mpom4z2QDnrD/9eq1qguYClJtv6IS4enJd/4qt66CFLmiNDeQ9EdAgR 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-kernel@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: 99662ea3-c3ce-4687-1053-08dd00448112 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?B?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dhSDcxaVpIK1laS2dQ?= =?utf-8?B?OW13S2hKQ0kvUnB3VXo3Z2txd0pwWWhFdGNYVGNOZDlxdVZhcWNWOEJzMmdw?= =?utf-8?Q?UoYHfijYqvNNh?= 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?B?bVd4NG9OMm5yNG00L2JRUjAvUVhIN0NkcElabXZIN0I4dlFQTFlKQ3QxZk54?= =?utf-8?B?Y3ZLN2RjV1FMcld1NGZkU2ZVNWwwZlplbEhBSUhvYnZ5YkNmaU9yWjBxQjQr?= =?utf-8?B?K0FMcGJZUmpLTGZWRm8yNE04MWd4WUwzdFdwN1pvR3NMQkdFakxoN1NZMDcz?= =?utf-8?B?N0VtSEFGRVVjTWxOR2o1RE01bWZ0Y0VNR2VEbUhBeGNDcXhlM2VnMHhXeGFN?= =?utf-8?B?UnNjbGdqblYycjZWbGcwOFB0eVhhdW81aWFkS09uZklhNWY4bGNUQWhvd1NK?= =?utf-8?B?dThOblNLK3RzK21lSDFBRml4Z1Z1bkh0SjJscEhVdUhtRTlWUW9vSGRyVWxD?= =?utf-8?B?Wi9QRTJCckF4dUViVFBQUXBmV3VPKzNnbTNNN2JjM0Q5VkxDYXRJWnNaN05L?= =?utf-8?B?SDdIcGpXaitVVHVGWDZiWG9jSCtEb3RFWEVBektOK3FrOVJUZG8veG0vNUlD?= =?utf-8?B?ei9QSUR3aFlCa0U1WWFYRmZ4TDFIMlB5UVZBRy9rTTlMbXpHUnVJSktvTE1q?= =?utf-8?B?cTEwc2Y1bUZJeHNWN0Uxa0tsRGlwNVEzcUFheTUrREMrTzYxZTE4NT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3RBUlJMQjBlWUlaZjlG?= =?utf-8?B?azcxTFVJS0F0Q0RUUnJldDducGUzTDBwQVZKb0JGUy9QbCtGSjVxOExObFFz?= =?utf-8?B?TFdaWnNMS0c1UmJyT0E5Z1krRjhZWmFjZ2djVGpxUEIvSFcwMXMxK21iNmYv?= =?utf-8?B?dlBkSHFIWkJJaGFaVE9ZZDhOcTVESG9WRklKR0g2NWw3VHRseWFZa1BZb1lo?= =?utf-8?B?a3FnTkFhWEd5dUJqOUJOUmtFcWorQi9EMGt3OWNiRzZsa2kzd2huWVdROExu?= =?utf-8?B?VjMzMWtWeGFzaVJORTlTTmpOZUlmQVBZTzh1aFhLdWtDZjZsTGkwd2tRTU0z?= =?utf-8?B?aU9tTVZsY3daWU1wbkhMbDBQTmNtZHRVeklrck5FVHBnLzk4SlhzTlp1S2l1?= =?utf-8?B?U3c5ME0zZHhHajlqaGE2bnQvaTRCc2RrRVVKdzdEUFFXcjh1SjYzbWFTcFJn?= =?utf-8?B?OEVUNFpEL1ZucnprdlRZUEN5Vi9oUjZoMmpNMURPRkREMENyd1FKckdZK3gr?= =?utf-8?B?NkhwbnpCQzRXeVhpZHRuT1FYeEZNZ1dHQTgrVEpKRVczOHh3K0U0Q2NOTU9Y?= =?utf-8?B?b054c2tiV1Z2Q3FUVW05VTg1WjBhdXJ2T01wNXovbytHMk9VaGR1cjhTWFpj?= =?utf-8?Q?46DA0oFG5dHCpt5aM8HYy/edB?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99662ea3-c3ce-4687-1053-08dd00448112 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:18.0483 (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: DMjZM2xMQqpf3FUR9Zd6A1ZgiZcAaJMyu5PZb1tghRFA1OtALOEXFlRjRsnROKwt9pYChJF/N4KQzhDsGlHeaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8318 Add help function tmp108_common_probe() to pave road to support i3c for P3T1085(NXP) chip. Using dev_err_probe() simple code. Add compatible string "nxp,p3t1085". Signed-off-by: Frank Li --- dev_err_probe() have not involve addition diff change. The difference always list these code block change regardless use dev_err_probe(). --- drivers/hwmon/tmp108.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c index a82bbc959eb15..bfbea6349a95f 100644 --- a/drivers/hwmon/tmp108.c +++ b/drivers/hwmon/tmp108.c @@ -323,33 +323,19 @@ static const struct regmap_config tmp108_regmap_confi= g =3D { .use_single_write =3D true, }; =20 -static int tmp108_probe(struct i2c_client *client) +static int tmp108_common_probe(struct device *dev, struct regmap *regmap, = char *name) { - struct device *dev =3D &client->dev; struct device *hwmon_dev; struct tmp108 *tmp108; - int err; u32 config; - - if (!i2c_check_functionality(client->adapter, - I2C_FUNC_SMBUS_WORD_DATA)) { - dev_err(dev, - "adapter doesn't support SMBus word transactions\n"); - return -ENODEV; - } + int err; =20 tmp108 =3D devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL); if (!tmp108) return -ENOMEM; =20 dev_set_drvdata(dev, tmp108); - - tmp108->regmap =3D devm_regmap_init_i2c(client, &tmp108_regmap_config); - if (IS_ERR(tmp108->regmap)) { - err =3D PTR_ERR(tmp108->regmap); - dev_err(dev, "regmap init failed: %d", err); - return err; - } + tmp108->regmap =3D regmap; =20 err =3D regmap_read(tmp108->regmap, TMP108_REG_CONF, &config); if (err < 0) { @@ -383,13 +369,30 @@ static int tmp108_probe(struct i2c_client *client) return err; } =20 - hwmon_dev =3D devm_hwmon_device_register_with_info(dev, client->name, + hwmon_dev =3D devm_hwmon_device_register_with_info(dev, name, tmp108, &tmp108_chip_info, NULL); return PTR_ERR_OR_ZERO(hwmon_dev); } =20 +static int tmp108_probe(struct i2c_client *client) +{ + struct device *dev =3D &client->dev; + struct regmap *regmap; + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_WORD_DATA)) + return dev_err_probe(dev, -ENODEV, + "adapter doesn't support SMBus word transactions\n"); + + regmap =3D devm_regmap_init_i2c(client, &tmp108_regmap_config); + if (IS_ERR(regmap)) + return dev_err_probe(dev, PTR_ERR(regmap), "regmap init failed"); + + return tmp108_common_probe(dev, regmap, client->name); +} + static int tmp108_suspend(struct device *dev) { struct tmp108 *tmp108 =3D dev_get_drvdata(dev); @@ -420,6 +423,7 @@ MODULE_DEVICE_TABLE(i2c, tmp108_i2c_ids); =20 #ifdef CONFIG_OF static const struct of_device_id tmp108_of_ids[] =3D { + { .compatible =3D "nxp,p3t1085", }, { .compatible =3D "ti,tmp108", }, {} }; --=20 2.34.1