hwmon:pmbus:ucd9000: Fix error in ucd9000_gpio_set
PATCH 1/1 hwmon:pmbus:ucd9000: Fix error in ucd9000_gpio_set
The GPIO output functionality does not work as intended.
The ucd9000_gpio_set function should set UCD9000_GPIO_CONFIG_OUT_VALUE (bit 2) in order to change the output value of the selected GPIO. Instead UCD9000_GPIO_CONFIG_STATUS (bit 3) is set, but this is a read-only value. This patch fixes the mistake and provides the intended functionality of the GPIOs.
See UCD90xxx Sequencer and System Health Controller PMBus Command SLVU352C section 10.43 for reference.
---
Reworded commit message as per suggestion by Guenter Roeck.
drivers/hwmon/pmbus/ucd9000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/pmbus/ucd9000.c +4 -4
@@ -226,15 +226,15 @@ static int ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, }if (value) { -if (ret &UCD9000_GPIO_CONFIG_STATUS ) +if (ret &UCD9000_GPIO_CONFIG_OUT_VALUE )return 0 ; - ret |=UCD9000_GPIO_CONFIG_STATUS ; + ret |=UCD9000_GPIO_CONFIG_OUT_VALUE ; }else { -if (!(ret &UCD9000_GPIO_CONFIG_STATUS )) +if (!(ret &UCD9000_GPIO_CONFIG_OUT_VALUE ))return 0 ; - ret &= ~UCD9000_GPIO_CONFIG_STATUS ; + ret &= ~UCD9000_GPIO_CONFIG_OUT_VALUE ; } ret |=UCD9000_GPIO_CONFIG_ENABLE ;
base-commit: e2291551827fe5d2d3758c435c191d32b6d1350e
Signature · 1 line
2.43.0
Quoted 8 lines · Torben Nielsen
The GPIO output functionality does not work as intended.
The
ucd9000_gpio_setfunction should setUCD9000_GPIO_CONFIG_OUT_VALUE(bit 2) in order to change the output value of the selected GPIO. InsteadUCD9000_GPIO_CONFIG_STATUS(bit 3) is set, but this is a read-only value. This patch fixes the mistake and provides the intended functionality of the GPIOs.
Quoted 4 lines
See UCD90xxx Sequencer and System Health Controller PMBus Command SLVU352C section 10.43 for reference.
Signed-off-by Torben Nielsen <[email protected]>
Applied.
Thanks,
Guenter
Quoted 33 lines
---
Reworded commit message as per suggestion by Guenter Roeck.drivers/hwmon/pmbus/ucd9000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)base-commit:
e2291551827fe5d2d3758c435c191d32b6d1350edrivers/hwmon/pmbus/ucd9000.c +4
-4@@ -226,15 +226,15 @@ static int ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, }if (value) { -if (ret &UCD9000_GPIO_CONFIG_STATUS ) +if (ret &UCD9000_GPIO_CONFIG_OUT_VALUE )return 0 ; - ret |=UCD9000_GPIO_CONFIG_STATUS ; + ret |=UCD9000_GPIO_CONFIG_OUT_VALUE ; }else { -if (!(ret &UCD9000_GPIO_CONFIG_STATUS )) +if (!(ret &UCD9000_GPIO_CONFIG_OUT_VALUE ))return 0 ; - ret &= ~UCD9000_GPIO_CONFIG_STATUS ; + ret &= ~UCD9000_GPIO_CONFIG_OUT_VALUE ; } ret |=UCD9000_GPIO_CONFIG_ENABLE ;