hwmon fixes for v6.7-rc5

- acpi_power_meter: Fix 4.29 MW output sen if acpi reports bad data
 
 - corsair-psu: Fix ability to probe if the driver is built into the kernel
 
 - ltc2991: Fix spelling mistake "contiuous" -> "continuous"
 
 - max31827: Add missing regulator header file include
 
 - nzxt-kraken2: Fix error handling path in probe function
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmVzZNcACgkQyx8mb86f
 mYFCgg/+KwO3QvSY7Mfwl93Xhijix7VC1XjJL4eHZfODiUQWnCgsjFLcA9SzbUsu
 mN2kKVrDWtN+Gp5rPOmCN8JFLxe4uifdg1ThfZ1rVv0xrowiffLgibFM5OVo4ynO
 1RJ8mg8y6JYb/Dy67kYwq2Z2NQPSB+6JourOJ+egXgZutZ7qmEcz81JjN+Dy1FAg
 Wa7bEuIlPChPmWwZRHBSilkoyb9tvMpU/5jG06UWrQOjMNYE2Incw9HRmg5tKVlD
 UVh4QrtP2kuk+M6ChwS4ffjD0Me3KIqQ9aAXb+QqNE0QziLkrLbRwHk1bHxrfjse
 EdKs+X7Ic40U6N7BFbEEiq+MeG3Q+47S8IVDlWIvIR3om13Jswn6wGkHB2WnVGBk
 zGXJ8iXLmxKuNiWvoeGUBvuSr/iaFY1jb8xFf+T92pso52GPVIgIDtS2H6qjSUE9
 iE9hwxLGE5GHNQJNN3dmCvUV22RUOTQVVMqmMOGerufusyb55Am6KHar9HtxAmpe
 SI0KB7i6zaPe0o8pXVMuWmonAsR0YXs57jyKB0lENJSCtjl3XiHEw7KkPZTYyKEo
 3m3xpOGvSnmAK7DHlm2CAP6UvBpikG/JXJnLyT+0LcsC6ifhcAjdossoi4Jyk0fv
 +v0tdhtd0DJTAO2DmVGtfc1WLIFEUq5xBEUhpLKMR2JpyVUTWAY=
 =Bj8e
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - acpi_power_meter: Fix 4.29 MW output seen if acpi reports bad data

 - corsair-psu: Fix ability to probe if the driver is built into the kernel

 - ltc2991: Fix spelling mistake "contiuous" -> "continuous"

 - max31827: Add missing regulator header file include

 - nzxt-kraken2: Fix error handling path in probe function

* tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (corsair-psu) Fix probe when built-in
  hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe()
  hwmon: (acpi_power_meter) Fix 4.29 MW bug
  hwmon: max31827: include regulator header
  hwmon: ltc2991: Fix spelling mistake "contiuous" -> "continuous"
This commit is contained in:
Linus Torvalds 2023-12-08 11:46:41 -08:00
commit 0dfe14fca9
5 changed files with 25 additions and 4 deletions

View File

@ -31,6 +31,7 @@
#define POWER_METER_CAN_NOTIFY (1 << 3)
#define POWER_METER_IS_BATTERY (1 << 8)
#define UNKNOWN_HYSTERESIS 0xFFFFFFFF
#define UNKNOWN_POWER 0xFFFFFFFF
#define METER_NOTIFY_CONFIG 0x80
#define METER_NOTIFY_TRIP 0x81
@ -348,6 +349,9 @@ static ssize_t show_power(struct device *dev,
update_meter(resource);
mutex_unlock(&resource->lock);
if (resource->power == UNKNOWN_POWER)
return -ENODATA;
return sprintf(buf, "%llu\n", resource->power * 1000);
}

View File

@ -899,7 +899,23 @@ static struct hid_driver corsairpsu_driver = {
.reset_resume = corsairpsu_resume,
#endif
};
module_hid_driver(corsairpsu_driver);
static int __init corsair_init(void)
{
return hid_register_driver(&corsairpsu_driver);
}
static void __exit corsair_exit(void)
{
hid_unregister_driver(&corsairpsu_driver);
}
/*
* With module_init() the driver would load before the HID bus when
* built-in, so use late_initcall() instead.
*/
late_initcall(corsair_init);
module_exit(corsair_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Wilken Gottwalt <wilken.gottwalt@posteo.net>");

View File

@ -373,7 +373,7 @@ static int ltc2991_init(struct ltc2991_state *st)
LTC2991_REPEAT_ACQ_EN);
if (ret)
return dev_err_probe(st->dev, ret,
"Error: Failed to set contiuous mode.\n");
"Error: Failed to set continuous mode.\n");
/* Enable all channels and trigger conversions */
return regmap_write(st->regmap, LTC2991_CH_EN_TRIGGER,

View File

@ -12,6 +12,7 @@
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#define MAX31827_T_REG 0x0
#define MAX31827_CONFIGURATION_REG 0x2

View File

@ -161,13 +161,13 @@ static int kraken2_probe(struct hid_device *hdev,
ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
if (ret) {
hid_err(hdev, "hid hw start failed with %d\n", ret);
goto fail_and_stop;
return ret;
}
ret = hid_hw_open(hdev);
if (ret) {
hid_err(hdev, "hid hw open failed with %d\n", ret);
goto fail_and_close;
goto fail_and_stop;
}
priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2",