hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/hwmon/tmp108.c
....@@ -1,16 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Texas Instruments TMP108 SMBus temperature sensor driver
23 *
34 * Copyright (C) 2016 John Muir <john@jmuir.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
145 */
156
167 #include <linux/delay.h>
....@@ -281,30 +272,13 @@
281272 }
282273 }
283274
284
-static u32 tmp108_chip_config[] = {
285
- HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL,
286
- 0
287
-};
288
-
289
-static const struct hwmon_channel_info tmp108_chip = {
290
- .type = hwmon_chip,
291
- .config = tmp108_chip_config,
292
-};
293
-
294
-static u32 tmp108_temp_config[] = {
295
- HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN | HWMON_T_MIN_HYST
296
- | HWMON_T_MAX_HYST | HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM,
297
- 0
298
-};
299
-
300
-static const struct hwmon_channel_info tmp108_temp = {
301
- .type = hwmon_temp,
302
- .config = tmp108_temp_config,
303
-};
304
-
305275 static const struct hwmon_channel_info *tmp108_info[] = {
306
- &tmp108_chip,
307
- &tmp108_temp,
276
+ HWMON_CHANNEL_INFO(chip,
277
+ HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
278
+ HWMON_CHANNEL_INFO(temp,
279
+ HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
280
+ HWMON_T_MIN_HYST | HWMON_T_MAX_HYST |
281
+ HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM),
308282 NULL
309283 };
310284
....@@ -345,11 +319,11 @@
345319 .volatile_reg = tmp108_is_volatile_reg,
346320 .val_format_endian = REGMAP_ENDIAN_BIG,
347321 .cache_type = REGCACHE_RBTREE,
348
- .use_single_rw = true,
322
+ .use_single_read = true,
323
+ .use_single_write = true,
349324 };
350325
351
-static int tmp108_probe(struct i2c_client *client,
352
- const struct i2c_device_id *id)
326
+static int tmp108_probe(struct i2c_client *client)
353327 {
354328 struct device *dev = &client->dev;
355329 struct device *hwmon_dev;
....@@ -458,7 +432,7 @@
458432 .pm = &tmp108_dev_pm_ops,
459433 .of_match_table = of_match_ptr(tmp108_of_ids),
460434 },
461
- .probe = tmp108_probe,
435
+ .probe_new = tmp108_probe,
462436 .id_table = tmp108_i2c_ids,
463437 };
464438