.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Hardware monitoring driver for ZL6100 and compatibles |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2011 Ericsson AB. |
---|
5 | 6 | * Copyright (c) 2012 Guenter Roeck |
---|
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 | | - * |
---|
17 | | - * You should have received a copy of the GNU General Public License |
---|
18 | | - * along with this program; if not, write to the Free Software |
---|
19 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
20 | 7 | */ |
---|
21 | 8 | |
---|
22 | 9 | #include <linux/bitops.h> |
---|
.. | .. |
---|
138 | 125 | } |
---|
139 | 126 | } |
---|
140 | 127 | |
---|
141 | | -static int zl6100_read_word_data(struct i2c_client *client, int page, int reg) |
---|
| 128 | +static int zl6100_read_word_data(struct i2c_client *client, int page, |
---|
| 129 | + int phase, int reg) |
---|
142 | 130 | { |
---|
143 | 131 | const struct pmbus_driver_info *info = pmbus_get_driver_info(client); |
---|
144 | 132 | struct zl6100_data *data = to_zl6100_data(info); |
---|
.. | .. |
---|
180 | 168 | } |
---|
181 | 169 | |
---|
182 | 170 | zl6100_wait(data); |
---|
183 | | - ret = pmbus_read_word_data(client, page, vreg); |
---|
| 171 | + ret = pmbus_read_word_data(client, page, phase, vreg); |
---|
184 | 172 | data->access = ktime_get(); |
---|
185 | 173 | if (ret < 0) |
---|
186 | 174 | return ret; |
---|
.. | .. |
---|
313 | 301 | }; |
---|
314 | 302 | MODULE_DEVICE_TABLE(i2c, zl6100_id); |
---|
315 | 303 | |
---|
316 | | -static int zl6100_probe(struct i2c_client *client, |
---|
317 | | - const struct i2c_device_id *id) |
---|
| 304 | +static int zl6100_probe(struct i2c_client *client) |
---|
318 | 305 | { |
---|
319 | 306 | int ret; |
---|
320 | 307 | struct zl6100_data *data; |
---|
.. | .. |
---|
345 | 332 | dev_err(&client->dev, "Unsupported device\n"); |
---|
346 | 333 | return -ENODEV; |
---|
347 | 334 | } |
---|
348 | | - if (id->driver_data != mid->driver_data) |
---|
| 335 | + if (strcmp(client->name, mid->name) != 0) |
---|
349 | 336 | dev_notice(&client->dev, |
---|
350 | 337 | "Device mismatch: Configured %s, detected %s\n", |
---|
351 | | - id->name, mid->name); |
---|
| 338 | + client->name, mid->name); |
---|
352 | 339 | |
---|
353 | 340 | data = devm_kzalloc(&client->dev, sizeof(struct zl6100_data), |
---|
354 | 341 | GFP_KERNEL); |
---|
.. | .. |
---|
401 | 388 | info->write_word_data = zl6100_write_word_data; |
---|
402 | 389 | info->write_byte = zl6100_write_byte; |
---|
403 | 390 | |
---|
404 | | - return pmbus_do_probe(client, mid, info); |
---|
| 391 | + return pmbus_do_probe(client, info); |
---|
405 | 392 | } |
---|
406 | 393 | |
---|
407 | 394 | static struct i2c_driver zl6100_driver = { |
---|
408 | 395 | .driver = { |
---|
409 | 396 | .name = "zl6100", |
---|
410 | 397 | }, |
---|
411 | | - .probe = zl6100_probe, |
---|
| 398 | + .probe_new = zl6100_probe, |
---|
412 | 399 | .remove = pmbus_do_remove, |
---|
413 | 400 | .id_table = zl6100_id, |
---|
414 | 401 | }; |
---|