Skip to content

Commit

Permalink
hwmon: (pmbus/ibm-cffps) Fix the LED behavior when turned off
Browse files Browse the repository at this point in the history
The driver should remain in control of the LED on the PSU, even while
off, not the PSU firmware as previously indicated.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/1576788607-13567-4-git-send-email-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Eddie James authored and Guenter Roeck committed Jan 23, 2020
1 parent 1952d79 commit 74a71a8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/hwmon/pmbus/ibm-cffps.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@
#define CFFPS_MFR_VAUX_FAULT BIT(6)
#define CFFPS_MFR_CURRENT_SHARE_WARNING BIT(7)

/*
* LED off state actually relinquishes LED control to PSU firmware, so it can
* turn on the LED for faults.
*/
#define CFFPS_LED_OFF 0
#define CFFPS_LED_BLINK BIT(0)
#define CFFPS_LED_ON BIT(1)
#define CFFPS_LED_OFF BIT(2)
#define CFFPS_BLINK_RATE_MS 250

enum {
Expand Down Expand Up @@ -436,6 +432,9 @@ static void ibm_cffps_create_led_class(struct ibm_cffps *psu)
rc = devm_led_classdev_register(dev, &psu->led);
if (rc)
dev_warn(dev, "failed to register led class: %d\n", rc);
else
i2c_smbus_write_byte_data(client, CFFPS_SYS_CONFIG_CMD,
CFFPS_LED_OFF);
}

static struct pmbus_driver_info ibm_cffps_info[] = {
Expand Down

0 comments on commit 74a71a8

Please sign in to comment.