History

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()

Linus Torvalds committed 2 years ago

Commit 43e7ef62 parents 79837a7 91564412 files · +17 −1Browse files

Unified · Split

2 files
  1. drivers/hwmon/gigabyte_waterforce.c +1 −1
  2. drivers/hwmon/pmbus/mp2975.c +16 −0
drivers/hwmon/gigabyte_waterforce.c+1−1
@@ -146,7 +146,7 @@ static int waterforce_get_status(struct waterforce_data *priv) · 145 unmodified lines
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+16−0
@@ -126,6 +126,21 @@ static const struct regulator_desc __maybe_unused mp2975_reg_desc[] = { · 125 unmodified lines
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 = { · 737 unmodified lines
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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t