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()
Unified · Split
| @@ -146,7 +146,7 @@ static int waterforce_get_status(struct waterforce_data *priv) · 145 unmodified lines | ||
| 146 | 146 | /* Send command for getting status */ |
| 147 | 147 | ret = waterforce_write_expanded(priv, get_status_cmd, GET_STATUS_CMD_LENGTH); |
| 148 | 148 | if (ret < 0) |
| 149 | − return ret; | |
| 149 | + goto unlock_and_return; | |
| 150 | 150 | |
| 151 | 151 | ret = wait_for_completion_interruptible_timeout(&priv->status_report_received, |
| 152 | 152 | msecs_to_jiffies(STATUS_VALIDITY)); |
| @@ -126,6 +126,21 @@ static const struct regulator_desc __maybe_unused mp2975_reg_desc[] = { · 125 unmodified lines | ||
| 126 | 126 | |
| 127 | 127 | #define to_mp2975_data(x) container_of(x, struct mp2975_data, info) |
| 128 | 128 | |
| 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 | + | |
| 129 | 144 | static int |
| 130 | 145 | mp2975_read_word_helper(struct i2c_client *client, int page, int phase, u8 reg, |
| 131 | 146 | u16 mask) |
| @@ -869,6 +884,7 @@ static struct pmbus_driver_info mp2975_info = { · 737 unmodified lines | ||
| 869 | 884 | PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | |
| 870 | 885 | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_POUT | |
| 871 | 886 | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | PMBUS_PHASE_VIRTUAL, |
| 887 | + .read_byte_data = mp2975_read_byte_data, | |
| 872 | 888 | .read_word_data = mp2975_read_word_data, |
| 873 | 889 | #if IS_ENABLED(CONFIG_SENSORS_MP2975_REGULATOR) |
| 874 | 890 | .num_regulators = 1, |