.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2017 IBM Corp. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License as published by |
---|
6 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
7 | | - * (at your option) any later version. |
---|
8 | 4 | * |
---|
9 | 5 | * Driver for the Nuvoton W83773G SMBus temperature sensor IC. |
---|
10 | 6 | * Supported models: W83773G |
---|
.. | .. |
---|
44 | 40 | |
---|
45 | 41 | MODULE_DEVICE_TABLE(i2c, w83773_id); |
---|
46 | 42 | |
---|
47 | | -static const struct of_device_id w83773_of_match[] = { |
---|
| 43 | +static const struct of_device_id __maybe_unused w83773_of_match[] = { |
---|
48 | 44 | { |
---|
49 | 45 | .compatible = "nuvoton,w83773g" |
---|
50 | 46 | }, |
---|
.. | .. |
---|
237 | 233 | return 0; |
---|
238 | 234 | } |
---|
239 | 235 | |
---|
240 | | -static const u32 w83773_chip_config[] = { |
---|
241 | | - HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL, |
---|
242 | | - 0 |
---|
243 | | -}; |
---|
244 | | - |
---|
245 | | -static const struct hwmon_channel_info w83773_chip = { |
---|
246 | | - .type = hwmon_chip, |
---|
247 | | - .config = w83773_chip_config, |
---|
248 | | -}; |
---|
249 | | - |
---|
250 | | -static const u32 w83773_temp_config[] = { |
---|
251 | | - HWMON_T_INPUT, |
---|
252 | | - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET, |
---|
253 | | - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET, |
---|
254 | | - 0 |
---|
255 | | -}; |
---|
256 | | - |
---|
257 | | -static const struct hwmon_channel_info w83773_temp = { |
---|
258 | | - .type = hwmon_temp, |
---|
259 | | - .config = w83773_temp_config, |
---|
260 | | -}; |
---|
261 | | - |
---|
262 | 236 | static const struct hwmon_channel_info *w83773_info[] = { |
---|
263 | | - &w83773_chip, |
---|
264 | | - &w83773_temp, |
---|
| 237 | + HWMON_CHANNEL_INFO(chip, |
---|
| 238 | + HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL), |
---|
| 239 | + HWMON_CHANNEL_INFO(temp, |
---|
| 240 | + HWMON_T_INPUT, |
---|
| 241 | + HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET, |
---|
| 242 | + HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_OFFSET), |
---|
265 | 243 | NULL |
---|
266 | 244 | }; |
---|
267 | 245 | |
---|
.. | .. |
---|
281 | 259 | .val_bits = 8, |
---|
282 | 260 | }; |
---|
283 | 261 | |
---|
284 | | -static int w83773_probe(struct i2c_client *client, |
---|
285 | | - const struct i2c_device_id *id) |
---|
| 262 | +static int w83773_probe(struct i2c_client *client) |
---|
286 | 263 | { |
---|
287 | 264 | struct device *dev = &client->dev; |
---|
288 | 265 | struct device *hwmon_dev; |
---|
.. | .. |
---|
318 | 295 | .name = "w83773g", |
---|
319 | 296 | .of_match_table = of_match_ptr(w83773_of_match), |
---|
320 | 297 | }, |
---|
321 | | - .probe = w83773_probe, |
---|
| 298 | + .probe_new = w83773_probe, |
---|
322 | 299 | .id_table = w83773_id, |
---|
323 | 300 | }; |
---|
324 | 301 | |
---|