| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Texas Instruments TMP108 SMBus temperature sensor driver |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * 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. |
|---|
| 14 | 5 | */ |
|---|
| 15 | 6 | |
|---|
| 16 | 7 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 281 | 272 | } |
|---|
| 282 | 273 | } |
|---|
| 283 | 274 | |
|---|
| 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 | | - |
|---|
| 305 | 275 | 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), |
|---|
| 308 | 282 | NULL |
|---|
| 309 | 283 | }; |
|---|
| 310 | 284 | |
|---|
| .. | .. |
|---|
| 345 | 319 | .volatile_reg = tmp108_is_volatile_reg, |
|---|
| 346 | 320 | .val_format_endian = REGMAP_ENDIAN_BIG, |
|---|
| 347 | 321 | .cache_type = REGCACHE_RBTREE, |
|---|
| 348 | | - .use_single_rw = true, |
|---|
| 322 | + .use_single_read = true, |
|---|
| 323 | + .use_single_write = true, |
|---|
| 349 | 324 | }; |
|---|
| 350 | 325 | |
|---|
| 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) |
|---|
| 353 | 327 | { |
|---|
| 354 | 328 | struct device *dev = &client->dev; |
|---|
| 355 | 329 | struct device *hwmon_dev; |
|---|
| .. | .. |
|---|
| 458 | 432 | .pm = &tmp108_dev_pm_ops, |
|---|
| 459 | 433 | .of_match_table = of_match_ptr(tmp108_of_ids), |
|---|
| 460 | 434 | }, |
|---|
| 461 | | - .probe = tmp108_probe, |
|---|
| 435 | + .probe_new = tmp108_probe, |
|---|
| 462 | 436 | .id_table = tmp108_i2c_ids, |
|---|
| 463 | 437 | }; |
|---|
| 464 | 438 | |
|---|