rk808: fix RK818_IRQ_DISCHG_ILIM initializer
PATCH 1/1 rk808: fix RK818_IRQ_DISCHG_ILIM initializer
When building with -Woverride-init, we get a warning about an incorrect initializer:
drivers/mfd/rk808.c:244:8: error: initialized field overwritten [-Werror=override-init]
[RK818_IRQ_DISCHG_ILIM] = {
This is clearly a mistake, as both RK818_IRQ_DISCHG_ILIM and RK818_IRQ_USB_OV are defined as '7', but they refer to different register bits. Changing RK818_IRQ_DISCHG_ILIM to 15 is consistent with how all other 14 interrupts are handled here, so I'm assuming this is what it should have been.
--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mfd/rk808.h +1 -1
@@ -244,7 +244,7 @@ enum rk818_reg {#define RK818_IRQ_CHG_TS1 12#define RK818_IRQ_TS2 13#define RK818_IRQ_CHG_CVTLIM 14 -#define RK818_IRQ_DISCHG_ILIM 7 +#define RK818_IRQ_DISCHG_ILIM 15#define RK818_IRQ_VOUT_LO_MSK BIT(0)#define RK818_IRQ_VB_LO_MSK BIT(1)
Signature · 1 line
2.9.0
Quoted 11 lines · Arnd Bergmann
When building with -Woverride-init, we get a warning about an incorrect initializer:
drivers/mfd/rk808.c:244:8: error: initialized field overwritten [-Werror=override-init]
[RK818_IRQ_DISCHG_ILIM] = {This is clearly a mistake, as both
RK818_IRQ_DISCHG_ILIMandRK818_IRQ_USB_OVare defined as '7', but they refer to different register bits. ChangingRK818_IRQ_DISCHG_ILIMto 15 is consistent with how all other 14 interrupts are handled here, so I'm assuming this is what it should have been.
Quoted 5 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes 2eedcbfc0612 ("mfd: rk808: Add RK818 support")--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I would like someone who is in possession of a datasheet to confirm this.
Quoted 13 lines
include/linux/mfd/rk808.h +1
-1@@ -244,7 +244,7 @@ enum rk818_reg {#define RK818_IRQ_CHG_TS1 12#define RK818_IRQ_TS2 13#define RK818_IRQ_CHG_CVTLIM 14 -#define RK818_IRQ_DISCHG_ILIM 7 +#define RK818_IRQ_DISCHG_ILIM 15#define RK818_IRQ_VOUT_LO_MSK BIT(0)#define RK818_IRQ_VB_LO_MSK BIT(1)
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Hi:
Quoted 13 lines · Lee Jones
Quoted 11 lines · Arnd Bergmann
When building with -Woverride-init, we get a warning about an incorrect initializer:
drivers/mfd/rk808.c:244:8: error: initialized field overwritten [-Werror=override-init]
[RK818_IRQ_DISCHG_ILIM] = {This is clearly a mistake, as both
RK818_IRQ_DISCHG_ILIMandRK818_IRQ_USB_OVare defined as '7', but they refer to different register bits. ChangingRK818_IRQ_DISCHG_ILIMto 15 is consistent with how all other 14 interrupts are handled here, so I'm assuming this is what it should have been.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes 2eedcbfc0612 ("mfd: rk808: Add RK818 support")--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)I would like someone who is in possession of a datasheet to confirm this.
According to the datasheet, the RK818_IRQ_USB_OV is in bit 7 ofINT_STS_REG1(0x4c) and RK818_IRQ_DISCHG_ILIM is in bit 7 of INT_STS_REG2(0x4e), so Arnd's change is right.
Thanks.
Quoted 13 lines
Quoted 13 lines
include/linux/mfd/rk808.h +1
-1@@ -244,7 +244,7 @@ enum rk818_reg {#define RK818_IRQ_CHG_TS1 12#define RK818_IRQ_TS2 13#define RK818_IRQ_CHG_CVTLIM 14 -#define RK818_IRQ_DISCHG_ILIM 7 +#define RK818_IRQ_DISCHG_ILIM 15#define RK818_IRQ_VOUT_LO_MSK BIT(0)#define RK818_IRQ_VB_LO_MSK BIT(1)
Quoted 19 lines · Andy Yan
Quoted 18 lines · Lee Jones
Quoted 16 lines · Arnd Bergmann
When building with -Woverride-init, we get a warning about an incorrect initializer:
drivers/mfd/rk808.c:244:8: error: initialized field overwritten [-Werror=override-init]
[RK818_IRQ_DISCHG_ILIM] = {This is clearly a mistake, as both
RK818_IRQ_DISCHG_ILIMandRK818_IRQ_USB_OVare defined as '7', but they refer to different register bits. ChangingRK818_IRQ_DISCHG_ILIMto 15 is consistent with how all other 14 interrupts are handled here, so I'm assuming this is what it should have been.Signed-off-by Arnd Bergmann <[email protected]>Fixes 2eedcbfc0612 ("mfd: rk808: Add RK818 support")--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
Quoted 2 lines
I would like someone who is in possession of a datasheet to confirm this.
According to the datasheet, the
RK818_IRQ_USB_OVis in bit 7 ofINT_STS_REG1(0x4c)andRK818_IRQ_DISCHG_ILIMis in bit 7 ofINT_STS_REG2(0x4e), so Arnd's change is right.
I'll take that as an Ack.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedQuoted 11 lines · Arnd Bergmann
When building with -Woverride-init, we get a warning about an incorrect initializer:
drivers/mfd/rk808.c:244:8: error: initialized field overwritten [-Werror=override-init]
[RK818_IRQ_DISCHG_ILIM] = {This is clearly a mistake, as both
RK818_IRQ_DISCHG_ILIMandRK818_IRQ_USB_OVare defined as '7', but they refer to different register bits. ChangingRK818_IRQ_DISCHG_ILIMto 15 is consistent with how all other 14 interrupts are handled here, so I'm assuming this is what it should have been.
Quoted 5 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes 2eedcbfc0612 ("mfd: rk808: Add RK818 support")--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Quoted 13 lines
include/linux/mfd/rk808.h +1
-1@@ -244,7 +244,7 @@ enum rk818_reg {#define RK818_IRQ_CHG_TS1 12#define RK818_IRQ_TS2 13#define RK818_IRQ_CHG_CVTLIM 14 -#define RK818_IRQ_DISCHG_ILIM 7 +#define RK818_IRQ_DISCHG_ILIM 15#define RK818_IRQ_VOUT_LO_MSK BIT(0)#define RK818_IRQ_VB_LO_MSK BIT(1)
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog