| .. | .. |
|---|
| 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 | |
|---|
| 10 | 6 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 76 | 72 | |
|---|
| 77 | 73 | cmdbuf[0] = reg; |
|---|
| 78 | 74 | |
|---|
| 79 | | - rc = pmbus_set_page(client, page); |
|---|
| 75 | + rc = pmbus_set_page(client, page, 0xff); |
|---|
| 80 | 76 | if (rc < 0) |
|---|
| 81 | 77 | return rc; |
|---|
| 82 | 78 | |
|---|
| .. | .. |
|---|
| 114 | 110 | if (config < 0) |
|---|
| 115 | 111 | return config; |
|---|
| 116 | 112 | |
|---|
| 117 | | - command = pmbus_read_word_data(client, page, PMBUS_FAN_COMMAND_1); |
|---|
| 113 | + command = pmbus_read_word_data(client, page, 0xff, PMBUS_FAN_COMMAND_1); |
|---|
| 118 | 114 | if (command < 0) |
|---|
| 119 | 115 | return command; |
|---|
| 120 | 116 | |
|---|
| .. | .. |
|---|
| 130 | 126 | } |
|---|
| 131 | 127 | |
|---|
| 132 | 128 | static int max31785_read_word_data(struct i2c_client *client, int page, |
|---|
| 133 | | - int reg) |
|---|
| 129 | + int phase, int reg) |
|---|
| 134 | 130 | { |
|---|
| 135 | 131 | u32 val; |
|---|
| 136 | 132 | int rv; |
|---|
| .. | .. |
|---|
| 248 | 244 | #define MAX31785_VOUT_FUNCS \ |
|---|
| 249 | 245 | (PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT) |
|---|
| 250 | 246 | |
|---|
| 251 | | -#define MAX37185_NUM_FAN_PAGES 6 |
|---|
| 252 | | - |
|---|
| 253 | 247 | static const struct pmbus_driver_info max31785_info = { |
|---|
| 254 | 248 | .pages = MAX31785_NR_PAGES, |
|---|
| 255 | 249 | |
|---|
| .. | .. |
|---|
| 330 | 324 | return 0; |
|---|
| 331 | 325 | } |
|---|
| 332 | 326 | |
|---|
| 333 | | -static int max31785_probe(struct i2c_client *client, |
|---|
| 334 | | - const struct i2c_device_id *id) |
|---|
| 327 | +static int max31785_probe(struct i2c_client *client) |
|---|
| 335 | 328 | { |
|---|
| 336 | 329 | struct device *dev = &client->dev; |
|---|
| 337 | 330 | struct pmbus_driver_info *info; |
|---|
| .. | .. |
|---|
| 360 | 353 | if (ret == MAX31785A) { |
|---|
| 361 | 354 | dual_tach = true; |
|---|
| 362 | 355 | } else if (ret == MAX31785) { |
|---|
| 363 | | - if (!strcmp("max31785a", id->name)) |
|---|
| 356 | + if (!strcmp("max31785a", client->name)) |
|---|
| 364 | 357 | dev_warn(dev, "Expected max3175a, found max31785: cannot provide secondary tachometer readings\n"); |
|---|
| 365 | 358 | } else { |
|---|
| 366 | 359 | return -ENODEV; |
|---|
| .. | .. |
|---|
| 372 | 365 | return ret; |
|---|
| 373 | 366 | } |
|---|
| 374 | 367 | |
|---|
| 375 | | - return pmbus_do_probe(client, id, info); |
|---|
| 368 | + return pmbus_do_probe(client, info); |
|---|
| 376 | 369 | } |
|---|
| 377 | 370 | |
|---|
| 378 | 371 | static const struct i2c_device_id max31785_id[] = { |
|---|
| .. | .. |
|---|
| 396 | 389 | .name = "max31785", |
|---|
| 397 | 390 | .of_match_table = max31785_of_match, |
|---|
| 398 | 391 | }, |
|---|
| 399 | | - .probe = max31785_probe, |
|---|
| 392 | + .probe_new = max31785_probe, |
|---|
| 400 | 393 | .remove = pmbus_do_remove, |
|---|
| 401 | 394 | .id_table = max31785_id, |
|---|
| 402 | 395 | }; |
|---|