hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/hwmon/pmbus/max8688.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Hardware monitoring driver for Maxim MAX8688
34 *
45 * Copyright (c) 2011 Ericsson AB.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
196 */
207
218 #include <linux/bitops.h>
....@@ -41,7 +28,8 @@
4128 #define MAX8688_STATUS_OT_FAULT BIT(13)
4229 #define MAX8688_STATUS_OT_WARNING BIT(14)
4330
44
-static int max8688_read_word_data(struct i2c_client *client, int page, int reg)
31
+static int max8688_read_word_data(struct i2c_client *client, int page,
32
+ int phase, int reg)
4533 {
4634 int ret;
4735
....@@ -50,13 +38,15 @@
5038
5139 switch (reg) {
5240 case PMBUS_VIRT_READ_VOUT_MAX:
53
- ret = pmbus_read_word_data(client, 0, MAX8688_MFR_VOUT_PEAK);
41
+ ret = pmbus_read_word_data(client, 0, 0xff,
42
+ MAX8688_MFR_VOUT_PEAK);
5443 break;
5544 case PMBUS_VIRT_READ_IOUT_MAX:
56
- ret = pmbus_read_word_data(client, 0, MAX8688_MFR_IOUT_PEAK);
45
+ ret = pmbus_read_word_data(client, 0, 0xff,
46
+ MAX8688_MFR_IOUT_PEAK);
5747 break;
5848 case PMBUS_VIRT_READ_TEMP_MAX:
59
- ret = pmbus_read_word_data(client, 0,
49
+ ret = pmbus_read_word_data(client, 0, 0xff,
6050 MAX8688_MFR_TEMPERATURE_PEAK);
6151 break;
6252 case PMBUS_VIRT_RESET_VOUT_HISTORY:
....@@ -107,7 +97,7 @@
10797
10898 switch (reg) {
10999 case PMBUS_STATUS_VOUT:
110
- mfg_status = pmbus_read_word_data(client, 0,
100
+ mfg_status = pmbus_read_word_data(client, 0, 0xff,
111101 MAX8688_MFG_STATUS);
112102 if (mfg_status < 0)
113103 return mfg_status;
....@@ -121,7 +111,7 @@
121111 ret |= PB_VOLTAGE_OV_FAULT;
122112 break;
123113 case PMBUS_STATUS_IOUT:
124
- mfg_status = pmbus_read_word_data(client, 0,
114
+ mfg_status = pmbus_read_word_data(client, 0, 0xff,
125115 MAX8688_MFG_STATUS);
126116 if (mfg_status < 0)
127117 return mfg_status;
....@@ -133,7 +123,7 @@
133123 ret |= PB_IOUT_OC_FAULT;
134124 break;
135125 case PMBUS_STATUS_TEMPERATURE:
136
- mfg_status = pmbus_read_word_data(client, 0,
126
+ mfg_status = pmbus_read_word_data(client, 0, 0xff,
137127 MAX8688_MFG_STATUS);
138128 if (mfg_status < 0)
139129 return mfg_status;
....@@ -175,10 +165,9 @@
175165 .write_word_data = max8688_write_word_data,
176166 };
177167
178
-static int max8688_probe(struct i2c_client *client,
179
- const struct i2c_device_id *id)
168
+static int max8688_probe(struct i2c_client *client)
180169 {
181
- return pmbus_do_probe(client, id, &max8688_info);
170
+ return pmbus_do_probe(client, &max8688_info);
182171 }
183172
184173 static const struct i2c_device_id max8688_id[] = {
....@@ -193,7 +182,7 @@
193182 .driver = {
194183 .name = "max8688",
195184 },
196
- .probe = max8688_probe,
185
+ .probe_new = max8688_probe,
197186 .remove = pmbus_do_remove,
198187 .id_table = max8688_id,
199188 };