| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Hardware monitoring driver for Maxim MAX6621 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2017 Mellanox Technologies. All rights reserved. |
|---|
| 5 | 6 | * Copyright (c) 2017 Vadim Pasternak <vadimp@mellanox.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 9 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | | - * (at your option) any later version. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | 7 | */ |
|---|
| 17 | 8 | |
|---|
| 18 | 9 | #include <linux/bitops.h> |
|---|
| .. | .. |
|---|
| 458 | 449 | .num_reg_defaults = ARRAY_SIZE(max6621_regmap_default), |
|---|
| 459 | 450 | }; |
|---|
| 460 | 451 | |
|---|
| 461 | | -static u32 max6621_chip_config[] = { |
|---|
| 462 | | - HWMON_C_REGISTER_TZ, |
|---|
| 463 | | - 0 |
|---|
| 464 | | -}; |
|---|
| 465 | | - |
|---|
| 466 | | -static const struct hwmon_channel_info max6621_chip = { |
|---|
| 467 | | - .type = hwmon_chip, |
|---|
| 468 | | - .config = max6621_chip_config, |
|---|
| 469 | | -}; |
|---|
| 470 | | - |
|---|
| 471 | | -static const u32 max6621_temp_config[] = { |
|---|
| 472 | | - HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET, |
|---|
| 473 | | - HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 474 | | - HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 475 | | - HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 476 | | - HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 477 | | - HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 478 | | - HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 479 | | - HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 480 | | - HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 481 | | - 0 |
|---|
| 482 | | -}; |
|---|
| 483 | | - |
|---|
| 484 | | -static const struct hwmon_channel_info max6621_temp = { |
|---|
| 485 | | - .type = hwmon_temp, |
|---|
| 486 | | - .config = max6621_temp_config, |
|---|
| 487 | | -}; |
|---|
| 488 | | - |
|---|
| 489 | 452 | static const struct hwmon_channel_info *max6621_info[] = { |
|---|
| 490 | | - &max6621_chip, |
|---|
| 491 | | - &max6621_temp, |
|---|
| 453 | + HWMON_CHANNEL_INFO(chip, |
|---|
| 454 | + HWMON_C_REGISTER_TZ), |
|---|
| 455 | + HWMON_CHANNEL_INFO(temp, |
|---|
| 456 | + HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET, |
|---|
| 457 | + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 458 | + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 459 | + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 460 | + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_LABEL, |
|---|
| 461 | + HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 462 | + HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 463 | + HWMON_T_INPUT | HWMON_T_LABEL, |
|---|
| 464 | + HWMON_T_INPUT | HWMON_T_LABEL), |
|---|
| 492 | 465 | NULL |
|---|
| 493 | 466 | }; |
|---|
| 494 | 467 | |
|---|
| .. | .. |
|---|
| 504 | 477 | .info = max6621_info, |
|---|
| 505 | 478 | }; |
|---|
| 506 | 479 | |
|---|
| 507 | | -static int max6621_probe(struct i2c_client *client, |
|---|
| 508 | | - const struct i2c_device_id *id) |
|---|
| 480 | +static int max6621_probe(struct i2c_client *client) |
|---|
| 509 | 481 | { |
|---|
| 510 | 482 | struct device *dev = &client->dev; |
|---|
| 511 | 483 | struct max6621_data *data; |
|---|
| .. | .. |
|---|
| 570 | 542 | }; |
|---|
| 571 | 543 | MODULE_DEVICE_TABLE(i2c, max6621_id); |
|---|
| 572 | 544 | |
|---|
| 573 | | -static const struct of_device_id max6621_of_match[] = { |
|---|
| 545 | +static const struct of_device_id __maybe_unused max6621_of_match[] = { |
|---|
| 574 | 546 | { .compatible = "maxim,max6621" }, |
|---|
| 575 | 547 | { } |
|---|
| 576 | 548 | }; |
|---|
| .. | .. |
|---|
| 582 | 554 | .name = MAX6621_DRV_NAME, |
|---|
| 583 | 555 | .of_match_table = of_match_ptr(max6621_of_match), |
|---|
| 584 | 556 | }, |
|---|
| 585 | | - .probe = max6621_probe, |
|---|
| 557 | + .probe_new = max6621_probe, |
|---|
| 586 | 558 | .id_table = max6621_id, |
|---|
| 587 | 559 | }; |
|---|
| 588 | 560 | |
|---|