Skip to content

Commit 43e7ef6

Browse files
committed
Merge tag 'hwmon-for-v6.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - pmbus/mp2975: Fix driver initialization - gigabyte_waterforce: Add missing unlock in error handling path * tag 'hwmon-for-v6.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (pmbus/mp2975) Correct comment inside 'mp2975_read_byte_data' hwmon: (pmbus/mp2975) Fix driver initialization for MP2975 device hwmon: gigabyte_waterforce: Fix locking bug in waterforce_get_status()
2 parents 79837a7 + 9156441 commit 43e7ef6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

drivers/hwmon/gigabyte_waterforce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int waterforce_get_status(struct waterforce_data *priv)
146146
/* Send command for getting status */
147147
ret = waterforce_write_expanded(priv, get_status_cmd, GET_STATUS_CMD_LENGTH);
148148
if (ret < 0)
149-
return ret;
149+
goto unlock_and_return;
150150

151151
ret = wait_for_completion_interruptible_timeout(&priv->status_report_received,
152152
msecs_to_jiffies(STATUS_VALIDITY));

drivers/hwmon/pmbus/mp2975.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ static const struct regulator_desc __maybe_unused mp2975_reg_desc[] = {
126126

127127
#define to_mp2975_data(x) container_of(x, struct mp2975_data, info)
128128

129+
static int mp2975_read_byte_data(struct i2c_client *client, int page, int reg)
130+
{
131+
switch (reg) {
132+
case PMBUS_VOUT_MODE:
133+
/*
134+
* Report direct format as configured by MFR_DC_LOOP_CTRL.
135+
* Unlike on MP2971/MP2973 the reported VOUT_MODE isn't automatically
136+
* internally updated, but always reads as PB_VOUT_MODE_VID.
137+
*/
138+
return PB_VOUT_MODE_DIRECT;
139+
default:
140+
return -ENODATA;
141+
}
142+
}
143+
129144
static int
130145
mp2975_read_word_helper(struct i2c_client *client, int page, int phase, u8 reg,
131146
u16 mask)
@@ -869,6 +884,7 @@ static struct pmbus_driver_info mp2975_info = {
869884
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
870885
PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_POUT |
871886
PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | PMBUS_PHASE_VIRTUAL,
887+
.read_byte_data = mp2975_read_byte_data,
872888
.read_word_data = mp2975_read_word_data,
873889
#if IS_ENABLED(CONFIG_SENSORS_MP2975_REGULATOR)
874890
.num_regulators = 1,

0 commit comments

Comments
 (0)