mfd: rk808: fix rk818 ID template
Subsystems (3)
Heiko Stuebner
maintainerPATCH 1/4 mfd: rk808: fix rk818 ID template
From: Daniel Schultz <[email protected]>
The Rockchip PMIC driver can automatically detect connected component versions by reading the ID_MSB and ID_LSB registers. The probe function will always fail with RK818 PMICs because the ID_MSK is 0xFFF0 and the RK818 template ID is 0x8181.
This patch changes this value to 0x8180.
--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mfd/rk808.h +1 -1
@@ -610,7 +610,7 @@ enum {RK808_ID =0x0000 ,RK809_ID =0x8090 ,RK817_ID =0x8170 , - RK818_ID = 0x8181, + RK818_ID = 0x8180, }; struct rk808 {
Signature · 1 line
2.20.1
Heiko Stuebner
maintainerPATCH 2/4 mfd: rk808: fix rk817 powerkey integration
The pwrkey integration seems to stem from the vendor kernel, as the compatible is wrong and also the order of key-irqs is swapped.
So fix these issues to make the pwrkey on rk817 actually work.
--- drivers/mfd/rk808.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/mfd/rk808.c +3 -11
@@ -121,16 +121,8 @@ static struct resource rk817_rtc_resources[] = { };static struct resource rk805_key_resources[] = { - { - .start =RK805_IRQ_PWRON_FALL , - .end =RK805_IRQ_PWRON_FALL , - .flags =IORESOURCE_IRQ , - }, - { - .start =RK805_IRQ_PWRON_RISE , - .end =RK805_IRQ_PWRON_RISE , - .flags =IORESOURCE_IRQ , - } +DEFINE_RES_IRQ (RK805_IRQ_PWRON_RISE ), +DEFINE_RES_IRQ (RK805_IRQ_PWRON_FALL ), };static struct resource rk817_pwrkey_resources[] = {
@@ -167,7 +159,7 @@ static const struct mfd_cell rk817s[] = { { .name = "rk808-clkout",}, { .name = "rk808-regulator",}, { - .name = "rk8xx-pwrkey", + .name = "rk805-pwrkey", .num_resources = ARRAY_SIZE(rk817_pwrkey_resources), .resources = &rk817_pwrkey_resources[0], },
Signature · 1 line
2.20.1
Lee Jones
AppliedRe: [PATCH 2/4] mfd: rk808: fix rk817 powerkey integration
Quoted 9 lines · Heiko Stuebner
The pwrkey integration seems to stem from the vendor kernel, as the compatible is wrong and also the order of key-irqs is swapped.
So fix these issues to make the pwrkey on rk817 actually work.
Signed-off-by Heiko Stuebner <[email protected]>--- drivers/mfd/rk808.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Heiko Stuebner
maintainerPATCH 3/4 mfd: rk808: set rk817 interrupt polarity to low
In reply to Heiko StuebnerAll other rk8xx operate with the polarity on low and even the old submitted devicetree snippet for the px30-evb declared the irq as low. So bring the rk817 preset in line with this, as there is really no reason for it to be the only with with a high polarity.
The rk809/rk817 hasn't been added to any devicetrees so far, so this won't break anything.
--- drivers/mfd/rk808.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/rk808.c +1 -1
@@ -207,7 +207,7 @@ static const struct rk808_reg_data rk808_pre_init_reg[] = {static const struct rk808_reg_data rk817_pre_init_reg[] = { {RK817_RTC_CTRL_REG ,RTC_STOP ,RTC_STOP }, - {RK817_GPIO_INT_CFG ,RK817_INT_POL_MSK ,RK817_INT_POL_H }, + {RK817_GPIO_INT_CFG ,RK817_INT_POL_MSK ,RK817_INT_POL_L }, {RK817_SYS_CFG (1 ),RK817_HOTDIE_TEMP_MSK |RK817_TSD_TEMP_MSK ,RK817_HOTDIE_105 |RK817_TSD_140 }, };
Signature · 1 line
2.20.1
Heiko Stuebner
maintainerPATCH 4/4 mfd: rk808: use DEFINE_RES_IRQ for rk808 rtc alarm irq
In reply to Heiko StuebnerDo not open code the definition, instead use the nice DEFINE_RES_IRQ macro for it.
--- drivers/mfd/rk808.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/mfd/rk808.c +1 -5
@@ -109,11 +109,7 @@ static const struct regmap_config rk817_regmap_config = { };static struct resource rtc_resources[] = { - { - .start =RK808_IRQ_RTC_ALARM , - .end =RK808_IRQ_RTC_ALARM , - .flags =IORESOURCE_IRQ , - } +DEFINE_RES_IRQ (RK808_IRQ_RTC_ALARM ), };static struct resource rk817_rtc_resources[] = {
Signature · 1 line
2.20.1
Lee Jones
AppliedRe: [PATCH 4/4] mfd: rk808: use DEFINE_RES_IRQ for rk808 rtc alarm irq
Quoted 7 lines · Heiko Stuebner
Do not open code the definition, instead use the nice
DEFINE_RES_IRQmacro for it.Signed-off-by Heiko Stuebner <[email protected]>--- drivers/mfd/rk808.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedQuoted 17 lines · Heiko Stuebner
From: Daniel Schultz <[email protected]>
The Rockchip PMIC driver can automatically detect connected component versions by reading the
ID_MSBandID_LSBregisters. The probe function will always fail with RK818 PMICs because theID_MSKis0xFFF0and the RK818 template ID is0x8181.This patch changes this value to
0x8180.Fixes 9d6105e19f61 ("mfd: rk808: Fix up the chip id get failed")Cc Elaine Zhang <[email protected]>Cc Joseph Chen <[email protected]>Signed-off-by Daniel Schultz <[email protected]>Acked-by Lee Jones <[email protected]>[resend as it seems to have dropped on the floor]Signed-off-by Heiko Stuebner <[email protected]>
Quoted 3 lines
--- include/linux/mfd/rk808.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog