Skip to content

Commit 0dddf35

Browse files
ljd42cfriedt
authored andcommitted
drivers: mfd: axp192 fix EXTEN switch control value
Currently, EXTEN switch control (mapped to GPIO5) is always 0, due to a bug in the shift value. This has been reported in Coverity CID 353647. Following the AXP192-X Datasheet, the EXTEN switch control status is given by bit 2 of the register 10h. If "GPIO5" corresponds to EXTEN Switch control (AXP192_GPIO5_OUTPUT_MASK is 0x04U), then the shift AXP192_GPIO5_OUTPUT_SHIFT should be 2, not 3. Signed-off-by: Loic Domaigne <[email protected]>
1 parent 3165d3c commit 0dddf35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mfd/mfd_axp192.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ struct mfd_axp192_config {
100100

101101
#define AXP192_GPIO5_OUTPUT_MASK 0x04U
102102
#define AXP192_GPIO5_OUTPUT_VAL 0x04U
103-
#define AXP192_GPIO5_OUTPUT_SHIFT 3U
103+
#define AXP192_GPIO5_OUTPUT_SHIFT 2U
104104

105105
struct mfd_axp192_data {
106106
const struct device *gpio_mask_used[AXP192_GPIO_MAX_NUM];

0 commit comments

Comments
 (0)