2020-01-12 01:56:22

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v2 0/5] mfd: RK8xx tidyup

Hi all,

Here's a second crack at my RK805-inspired cleanup. There was a bit
of debate around v1[1], but it seems like we're now all happy that this
is a reasonable way to go. For clarity I decided to include Soeren's
patch as #1/5, but since I've rewritten most of my patches I've not
included the tested-by tags.

Robin.

[1] https://lore.kernel.org/lkml/[email protected]/

Robin Murphy (4):
mfd: rk808: Ensure suspend/resume hooks always work
mfd: rk808: Stop using syscore ops
mfd: rk808: Reduce shutdown duplication
mfd: rk808: Convert RK805 to shutdown/suspend hooks

Soeren Moch (1):
mfd: rk808: Always use poweroff when requested

drivers/mfd/rk808.c | 139 +++++++++++++-------------------------
include/linux/mfd/rk808.h | 2 -
2 files changed, 48 insertions(+), 93 deletions(-)

--
2.17.1


2020-01-12 01:56:28

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v2 3/5] mfd: rk808: Stop using syscore ops

Setting the SLEEP pin to its shutdown function for appropriate PMICs
doesn't need to happen in single-CPU context, so there's really no point
involving the syscore machinery. Hook it up to the standard driver model
shutdown method instead. This also obviates the issue that the syscore
ops weren't being unregistered on probe failure or module removal.

Signed-off-by: Robin Murphy <[email protected]>
---
drivers/mfd/rk808.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index ac798053c26a..8116ed6cf2e7 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -19,7 +19,6 @@
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
-#include <linux/syscore_ops.h>

struct rk808_reg_data {
int addr;
@@ -509,28 +508,27 @@ static void rk818_device_shutdown(void)
dev_err(&rk808_i2c_client->dev, "Failed to shutdown device!\n");
}

-static void rk8xx_syscore_shutdown(void)
+static void rk8xx_shutdown(struct i2c_client *client)
{
- struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
+ struct rk808 *rk808 = i2c_get_clientdata(client);
int ret;

- if (system_state == SYSTEM_POWER_OFF &&
- (rk808->variant == RK809_ID || rk808->variant == RK817_ID)) {
+ switch (rk808->variant) {
+ case RK809_ID:
+ case RK817_ID:
ret = regmap_update_bits(rk808->regmap,
RK817_SYS_CFG(3),
RK817_SLPPIN_FUNC_MSK,
SLPPIN_DN_FUN);
- if (ret) {
- dev_warn(&rk808_i2c_client->dev,
- "Cannot switch to power down function\n");
- }
+ break;
+ default:
+ return;
}
+ if (ret)
+ dev_warn(&client->dev,
+ "Cannot switch to power down function\n");
}

-static struct syscore_ops rk808_syscore_ops = {
- .shutdown = rk8xx_syscore_shutdown,
-};
-
static const struct of_device_id rk808_of_match[] = {
{ .compatible = "rockchip,rk805" },
{ .compatible = "rockchip,rk808" },
@@ -623,7 +621,6 @@ static int rk808_probe(struct i2c_client *client,
nr_pre_init_regs = ARRAY_SIZE(rk817_pre_init_reg);
cells = rk817s;
nr_cells = ARRAY_SIZE(rk817s);
- register_syscore_ops(&rk808_syscore_ops);
break;
default:
dev_err(&client->dev, "Unsupported RK8XX ID %lu\n",
@@ -759,6 +756,7 @@ static struct i2c_driver rk808_i2c_driver = {
},
.probe = rk808_probe,
.remove = rk808_remove,
+ .shutdown = rk8xx_shutdown,
};

module_i2c_driver(rk808_i2c_driver);
--
2.17.1

2020-01-12 01:56:31

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v2 4/5] mfd: rk808: Reduce shutdown duplication

Rather than having 3 almost-identical functions plus the machinery to
keep track of them, it's far simpler to just dynamically select the
appropriate register field per variant.

Signed-off-by: Robin Murphy <[email protected]>
---
drivers/mfd/rk808.c | 61 +++++++++++++--------------------------
include/linux/mfd/rk808.h | 1 -
2 files changed, 20 insertions(+), 42 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index 8116ed6cf2e7..b2265c6e94ae 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -448,21 +448,6 @@ static const struct regmap_irq_chip rk818_irq_chip = {

static struct i2c_client *rk808_i2c_client;

-static void rk805_device_shutdown(void)
-{
- int ret;
- struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
-
- if (!rk808)
- return;
-
- ret = regmap_update_bits(rk808->regmap,
- RK805_DEV_CTRL_REG,
- DEV_OFF, DEV_OFF);
- if (ret)
- dev_err(&rk808_i2c_client->dev, "Failed to shutdown device!\n");
-}
-
static void rk805_device_shutdown_prepare(void)
{
int ret;
@@ -478,32 +463,29 @@ static void rk805_device_shutdown_prepare(void)
dev_err(&rk808_i2c_client->dev, "Failed to shutdown device!\n");
}

-static void rk808_device_shutdown(void)
+static void rk808_pm_power_off(void)
{
int ret;
+ unsigned int reg, bit;
struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);

- if (!rk808)
+ switch (rk808->variant) {
+ case RK805_ID:
+ reg = RK805_DEV_CTRL_REG;
+ bit = DEV_OFF;
+ break;
+ case RK808_ID:
+ reg = RK808_DEVCTRL_REG,
+ bit = DEV_OFF_RST;
+ break;
+ case RK818_ID:
+ reg = RK818_DEVCTRL_REG;
+ bit = DEV_OFF;
+ break;
+ default:
return;
-
- ret = regmap_update_bits(rk808->regmap,
- RK808_DEVCTRL_REG,
- DEV_OFF_RST, DEV_OFF_RST);
- if (ret)
- dev_err(&rk808_i2c_client->dev, "Failed to shutdown device!\n");
-}
-
-static void rk818_device_shutdown(void)
-{
- int ret;
- struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
-
- if (!rk808)
- return;
-
- ret = regmap_update_bits(rk808->regmap,
- RK818_DEVCTRL_REG,
- DEV_OFF, DEV_OFF);
+ }
+ ret = regmap_update_bits(rk808->regmap, reg, bit, bit);
if (ret)
dev_err(&rk808_i2c_client->dev, "Failed to shutdown device!\n");
}
@@ -592,7 +574,6 @@ static int rk808_probe(struct i2c_client *client,
nr_pre_init_regs = ARRAY_SIZE(rk805_pre_init_reg);
cells = rk805s;
nr_cells = ARRAY_SIZE(rk805s);
- rk808->pm_pwroff_fn = rk805_device_shutdown;
rk808->pm_pwroff_prep_fn = rk805_device_shutdown_prepare;
break;
case RK808_ID:
@@ -602,7 +583,6 @@ static int rk808_probe(struct i2c_client *client,
nr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg);
cells = rk808s;
nr_cells = ARRAY_SIZE(rk808s);
- rk808->pm_pwroff_fn = rk808_device_shutdown;
break;
case RK818_ID:
rk808->regmap_cfg = &rk818_regmap_config;
@@ -611,7 +591,6 @@ static int rk808_probe(struct i2c_client *client,
nr_pre_init_regs = ARRAY_SIZE(rk818_pre_init_reg);
cells = rk818s;
nr_cells = ARRAY_SIZE(rk818s);
- rk808->pm_pwroff_fn = rk818_device_shutdown;
break;
case RK809_ID:
case RK817_ID:
@@ -673,7 +652,7 @@ static int rk808_probe(struct i2c_client *client,

if (of_property_read_bool(np, "rockchip,system-power-controller")) {
rk808_i2c_client = client;
- pm_power_off = rk808->pm_pwroff_fn;
+ pm_power_off = rk808_pm_power_off;
pm_power_off_prepare = rk808->pm_pwroff_prep_fn;
}

@@ -694,7 +673,7 @@ static int rk808_remove(struct i2c_client *client)
* pm_power_off may points to a function from another module.
* Check if the pointer is set by us and only then overwrite it.
*/
- if (rk808->pm_pwroff_fn && pm_power_off == rk808->pm_pwroff_fn)
+ if (pm_power_off == rk808_pm_power_off)
pm_power_off = NULL;

/**
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
index a59bf323f713..b038653fa87e 100644
--- a/include/linux/mfd/rk808.h
+++ b/include/linux/mfd/rk808.h
@@ -620,7 +620,6 @@ struct rk808 {
long variant;
const struct regmap_config *regmap_cfg;
const struct regmap_irq_chip *regmap_irq_chip;
- void (*pm_pwroff_fn)(void);
void (*pm_pwroff_prep_fn)(void);
};
#endif /* __LINUX_REGULATOR_RK808_H */
--
2.17.1

2020-01-12 01:56:57

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v2 2/5] mfd: rk808: Ensure suspend/resume hooks always work

The RK809/RK817 suspend/resume hooks should not have to depend on
whether this driver owns the pm_power_off hook, and thus the global
rk808_i2c_client is set - indeed, the GPIO-based control is really
only relevant when PSCI firmware is in charge of power rather than
the kernel. As driver model callbacks, they have an appropriate
device argument to hand, so can just always use that.

Signed-off-by: Robin Murphy <[email protected]>
---
drivers/mfd/rk808.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index 616e44e7ef98..ac798053c26a 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -712,7 +712,7 @@ static int rk808_remove(struct i2c_client *client)

static int __maybe_unused rk8xx_suspend(struct device *dev)
{
- struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
+ struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev));
int ret = 0;

switch (rk808->variant) {
@@ -732,7 +732,7 @@ static int __maybe_unused rk8xx_suspend(struct device *dev)

static int __maybe_unused rk8xx_resume(struct device *dev)
{
- struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
+ struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev));
int ret = 0;

switch (rk808->variant) {
--
2.17.1

2020-01-12 01:57:16

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v2 1/5] mfd: rk808: Always use poweroff when requested

From: Soeren Moch <[email protected]>

With the device tree property "rockchip,system-power-controller" we
explicitly request to use this PMIC to power off the system. So always
register our poweroff function, even if some other handler (probably
PSCI poweroff) was registered before.

This does tend to reveal a warning on shutdown due to the Rockchip I2C
driver not implementing an atomic transfer method, however since the
write to DEV_OFF takes effect immediately the I2C completion interrupt
is moot anyway, and as the very last thing written to the console it is
only visible to users going out of their way to capture serial output.

Signed-off-by: Soeren Moch <[email protected]>
Reviewed-by: Heiko Stuebner <[email protected]>
[ rm: note potential warning in commit message ]
Signed-off-by: Robin Murphy <[email protected]>
---
drivers/mfd/rk808.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index a69a6742ecdc..616e44e7ef98 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -550,7 +550,7 @@ static int rk808_probe(struct i2c_client *client,
const struct mfd_cell *cells;
int nr_pre_init_regs;
int nr_cells;
- int pm_off = 0, msb, lsb;
+ int msb, lsb;
unsigned char pmic_id_msb, pmic_id_lsb;
int ret;
int i;
@@ -674,16 +674,9 @@ static int rk808_probe(struct i2c_client *client,
goto err_irq;
}

- pm_off = of_property_read_bool(np,
- "rockchip,system-power-controller");
- if (pm_off && !pm_power_off) {
+ if (of_property_read_bool(np, "rockchip,system-power-controller")) {
rk808_i2c_client = client;
pm_power_off = rk808->pm_pwroff_fn;
- }
-
- if (pm_off && !pm_power_off_prepare) {
- if (!rk808_i2c_client)
- rk808_i2c_client = client;
pm_power_off_prepare = rk808->pm_pwroff_prep_fn;
}

--
2.17.1

2020-01-12 01:57:36

by Robin Murphy

[permalink] [raw]
Subject: [PATCH v2 5/5] mfd: rk808: Convert RK805 to shutdown/suspend hooks

RK805 has the same kind of dual-role sleep/shutdown pin as RK809/RK817,
so it makes little sense for the driver to have to have two completely
different mechanisms to handle essentially the same thing. Move RK805
over to the shutdown/suspend flow to clean things up.

Signed-off-by: Robin Murphy <[email protected]>
---
drivers/mfd/rk808.c | 37 ++++++++++++-------------------------
include/linux/mfd/rk808.h | 1 -
2 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index b2265c6e94ae..d109b9f14407 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -185,7 +185,6 @@ static const struct rk808_reg_data rk805_pre_init_reg[] = {
{RK805_BUCK4_CONFIG_REG, RK805_BUCK3_4_ILMAX_MASK,
RK805_BUCK4_ILMAX_3500MA},
{RK805_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_400MA},
- {RK805_GPIO_IO_POL_REG, SLP_SD_MSK, SLEEP_FUN},
{RK805_THERMAL_REG, TEMP_HOTDIE_MSK, TEMP115C},
};

@@ -448,21 +447,6 @@ static const struct regmap_irq_chip rk818_irq_chip = {

static struct i2c_client *rk808_i2c_client;

-static void rk805_device_shutdown_prepare(void)
-{
- int ret;
- struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
-
- if (!rk808)
- return;
-
- ret = regmap_update_bits(rk808->regmap,
- RK805_GPIO_IO_POL_REG,
- SLP_SD_MSK, SHUTDOWN_FUN);
- if (ret)
- dev_err(&rk808_i2c_client->dev, "Failed to shutdown device!\n");
-}
-
static void rk808_pm_power_off(void)
{
int ret;
@@ -496,6 +480,12 @@ static void rk8xx_shutdown(struct i2c_client *client)
int ret;

switch (rk808->variant) {
+ case RK805_ID:
+ ret = regmap_update_bits(rk808->regmap,
+ RK805_GPIO_IO_POL_REG,
+ SLP_SD_MSK,
+ SHUTDOWN_FUN);
+ break;
case RK809_ID:
case RK817_ID:
ret = regmap_update_bits(rk808->regmap,
@@ -574,7 +564,6 @@ static int rk808_probe(struct i2c_client *client,
nr_pre_init_regs = ARRAY_SIZE(rk805_pre_init_reg);
cells = rk805s;
nr_cells = ARRAY_SIZE(rk805s);
- rk808->pm_pwroff_prep_fn = rk805_device_shutdown_prepare;
break;
case RK808_ID:
rk808->regmap_cfg = &rk808_regmap_config;
@@ -653,7 +642,6 @@ static int rk808_probe(struct i2c_client *client,
if (of_property_read_bool(np, "rockchip,system-power-controller")) {
rk808_i2c_client = client;
pm_power_off = rk808_pm_power_off;
- pm_power_off_prepare = rk808->pm_pwroff_prep_fn;
}

return 0;
@@ -676,13 +664,6 @@ static int rk808_remove(struct i2c_client *client)
if (pm_power_off == rk808_pm_power_off)
pm_power_off = NULL;

- /**
- * As above, check if the pointer is set by us before overwrite.
- */
- if (rk808->pm_pwroff_prep_fn &&
- pm_power_off_prepare == rk808->pm_pwroff_prep_fn)
- pm_power_off_prepare = NULL;
-
return 0;
}

@@ -692,6 +673,12 @@ static int __maybe_unused rk8xx_suspend(struct device *dev)
int ret = 0;

switch (rk808->variant) {
+ case RK805_ID:
+ ret = regmap_update_bits(rk808->regmap,
+ RK805_GPIO_IO_POL_REG,
+ SLP_SD_MSK,
+ SLEEP_FUN);
+ break;
case RK809_ID:
case RK817_ID:
ret = regmap_update_bits(rk808->regmap,
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
index b038653fa87e..e07f6e61cd38 100644
--- a/include/linux/mfd/rk808.h
+++ b/include/linux/mfd/rk808.h
@@ -620,6 +620,5 @@ struct rk808 {
long variant;
const struct regmap_config *regmap_cfg;
const struct regmap_irq_chip *regmap_irq_chip;
- void (*pm_pwroff_prep_fn)(void);
};
#endif /* __LINUX_REGULATOR_RK808_H */
--
2.17.1

2020-01-12 10:22:49

by Soeren Moch

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] mfd: RK8xx tidyup

On 12.01.20 02:54, Robin Murphy wrote:
> Hi all,
>
> Here's a second crack at my RK805-inspired cleanup. There was a bit
> of debate around v1[1], but it seems like we're now all happy that this
> is a reasonable way to go. For clarity I decided to include Soeren's
> patch as #1/5, but since I've rewritten most of my patches I've not
> included the tested-by tags.
I re-tested this series on a RockPro64 board with RK808 PMIC.

Tested-by: Soeren Moch <[email protected]>

Regards,
Soeren
>
> Robin.
>
> [1] https://lore.kernel.org/lkml/[email protected]/
>
> Robin Murphy (4):
> mfd: rk808: Ensure suspend/resume hooks always work
> mfd: rk808: Stop using syscore ops
> mfd: rk808: Reduce shutdown duplication
> mfd: rk808: Convert RK805 to shutdown/suspend hooks
>
> Soeren Moch (1):
> mfd: rk808: Always use poweroff when requested
>
> drivers/mfd/rk808.c | 139 +++++++++++++-------------------------
> include/linux/mfd/rk808.h | 2 -
> 2 files changed, 48 insertions(+), 93 deletions(-)
>

2020-01-13 14:54:23

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] mfd: RK8xx tidyup

Hi Robin,

On Sun, 12 Jan 2020 at 07:25, Robin Murphy <[email protected]> wrote:
>
> Hi all,
>
> Here's a second crack at my RK805-inspired cleanup. There was a bit
> of debate around v1[1], but it seems like we're now all happy that this
> is a reasonable way to go. For clarity I decided to include Soeren's
> patch as #1/5, but since I've rewritten most of my patches I've not
> included the tested-by tags.
>
> Robin.
>
> [1] https://lore.kernel.org/lkml/[email protected]/
>

Despite the i2c warning message it performs clean shutdown. So Please add my

Tested-by: Anand Moon <[email protected]>

-Anand

> Robin Murphy (4):
> mfd: rk808: Ensure suspend/resume hooks always work
> mfd: rk808: Stop using syscore ops
> mfd: rk808: Reduce shutdown duplication
> mfd: rk808: Convert RK805 to shutdown/suspend hooks
>
> Soeren Moch (1):
> mfd: rk808: Always use poweroff when requested
>
> drivers/mfd/rk808.c | 139 +++++++++++++-------------------------
> include/linux/mfd/rk808.h | 2 -
> 2 files changed, 48 insertions(+), 93 deletions(-)
>
> --
> 2.17.1
>
>
> _______________________________________________
> Linux-rockchip mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

2020-02-18 21:45:26

by Robin Murphy

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] mfd: RK8xx tidyup

On 2020-01-12 1:54 am, Robin Murphy wrote:
> Hi all,
>
> Here's a second crack at my RK805-inspired cleanup. There was a bit
> of debate around v1[1], but it seems like we're now all happy that this
> is a reasonable way to go. For clarity I decided to include Soeren's
> patch as #1/5, but since I've rewritten most of my patches I've not
> included the tested-by tags.

Any more comments, or are these patches good to merge now? My local
branch seemed to rebase to 5.6-rc1 cleanly, but I can resend if necessary.

Thanks,
Robin.

>
> [1] https://lore.kernel.org/lkml/[email protected]/
>
> Robin Murphy (4):
> mfd: rk808: Ensure suspend/resume hooks always work
> mfd: rk808: Stop using syscore ops
> mfd: rk808: Reduce shutdown duplication
> mfd: rk808: Convert RK805 to shutdown/suspend hooks
>
> Soeren Moch (1):
> mfd: rk808: Always use poweroff when requested
>
> drivers/mfd/rk808.c | 139 +++++++++++++-------------------------
> include/linux/mfd/rk808.h | 2 -
> 2 files changed, 48 insertions(+), 93 deletions(-)
>

2020-02-26 09:46:50

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] mfd: rk808: Stop using syscore ops

On Sun, 12 Jan 2020, Robin Murphy wrote:

> Setting the SLEEP pin to its shutdown function for appropriate PMICs
> doesn't need to happen in single-CPU context, so there's really no point
> involving the syscore machinery. Hook it up to the standard driver model
> shutdown method instead. This also obviates the issue that the syscore
> ops weren't being unregistered on probe failure or module removal.
>
> Signed-off-by: Robin Murphy <[email protected]>
> ---
> drivers/mfd/rk808.c | 26 ++++++++++++--------------
> 1 file changed, 12 insertions(+), 14 deletions(-)

Going to ignore the unrelated change in this one!

(reviewing the remainder before responding)

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-02-26 10:32:21

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] mfd: rk808: Always use poweroff when requested

On Sun, 12 Jan 2020, Robin Murphy wrote:

> From: Soeren Moch <[email protected]>
>
> With the device tree property "rockchip,system-power-controller" we
> explicitly request to use this PMIC to power off the system. So always
> register our poweroff function, even if some other handler (probably
> PSCI poweroff) was registered before.
>
> This does tend to reveal a warning on shutdown due to the Rockchip I2C
> driver not implementing an atomic transfer method, however since the
> write to DEV_OFF takes effect immediately the I2C completion interrupt
> is moot anyway, and as the very last thing written to the console it is
> only visible to users going out of their way to capture serial output.
>
> Signed-off-by: Soeren Moch <[email protected]>
> Reviewed-by: Heiko Stuebner <[email protected]>
> [ rm: note potential warning in commit message ]
> Signed-off-by: Robin Murphy <[email protected]>
> ---
> drivers/mfd/rk808.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-02-26 10:32:36

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] mfd: rk808: Ensure suspend/resume hooks always work

On Sun, 12 Jan 2020, Robin Murphy wrote:

> The RK809/RK817 suspend/resume hooks should not have to depend on
> whether this driver owns the pm_power_off hook, and thus the global
> rk808_i2c_client is set - indeed, the GPIO-based control is really
> only relevant when PSCI firmware is in charge of power rather than
> the kernel. As driver model callbacks, they have an appropriate
> device argument to hand, so can just always use that.
>
> Signed-off-by: Robin Murphy <[email protected]>
> ---
> drivers/mfd/rk808.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-02-26 10:32:53

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] mfd: rk808: Stop using syscore ops

On Sun, 12 Jan 2020, Robin Murphy wrote:

> Setting the SLEEP pin to its shutdown function for appropriate PMICs
> doesn't need to happen in single-CPU context, so there's really no point
> involving the syscore machinery. Hook it up to the standard driver model
> shutdown method instead. This also obviates the issue that the syscore
> ops weren't being unregistered on probe failure or module removal.
>
> Signed-off-by: Robin Murphy <[email protected]>
> ---
> drivers/mfd/rk808.c | 26 ++++++++++++--------------
> 1 file changed, 12 insertions(+), 14 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-02-26 10:33:12

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 4/5] mfd: rk808: Reduce shutdown duplication

On Sun, 12 Jan 2020, Robin Murphy wrote:

> Rather than having 3 almost-identical functions plus the machinery to
> keep track of them, it's far simpler to just dynamically select the
> appropriate register field per variant.
>
> Signed-off-by: Robin Murphy <[email protected]>
> ---
> drivers/mfd/rk808.c | 61 +++++++++++++--------------------------
> include/linux/mfd/rk808.h | 1 -
> 2 files changed, 20 insertions(+), 42 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-02-26 10:33:23

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 5/5] mfd: rk808: Convert RK805 to shutdown/suspend hooks

On Sun, 12 Jan 2020, Robin Murphy wrote:

> RK805 has the same kind of dual-role sleep/shutdown pin as RK809/RK817,
> so it makes little sense for the driver to have to have two completely
> different mechanisms to handle essentially the same thing. Move RK805
> over to the shutdown/suspend flow to clean things up.
>
> Signed-off-by: Robin Murphy <[email protected]>
> ---
> drivers/mfd/rk808.c | 37 ++++++++++++-------------------------
> include/linux/mfd/rk808.h | 1 -
> 2 files changed, 12 insertions(+), 26 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-04-27 18:45:41

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] mfd: RK8xx tidyup

Hi Robin,

On Sun, 12 Jan 2020 at 07:25, Robin Murphy <[email protected]> wrote:
>
> Hi all,
>
> Here's a second crack at my RK805-inspired cleanup. There was a bit
> of debate around v1[1], but it seems like we're now all happy that this
> is a reasonable way to go. For clarity I decided to include Soeren's
> patch as #1/5, but since I've rewritten most of my patches I've not
> included the tested-by tags.
>
> Robin.
>

Can you re-spin this series, it seem these patches are lost.

-Anand

2020-04-27 18:48:24

by Soeren Moch

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] mfd: RK8xx tidyup



On 27.04.20 20:41, Anand Moon wrote:
> Hi Robin,
>
> On Sun, 12 Jan 2020 at 07:25, Robin Murphy <[email protected]> wrote:
>> Hi all,
>>
>> Here's a second crack at my RK805-inspired cleanup. There was a bit
>> of debate around v1[1], but it seems like we're now all happy that this
>> is a reasonable way to go. For clarity I decided to include Soeren's
>> patch as #1/5, but since I've rewritten most of my patches I've not
>> included the tested-by tags.
>>
>> Robin.
>>
> Can you re-spin this series, it seem these patches are lost.
>
These patches are already merged as
d8f083a302f7..42679765faf2

Soeren

2020-04-27 19:00:34

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] mfd: RK8xx tidyup

Hi Soeren

On Tue, 28 Apr 2020 at 00:16, Soeren Moch <[email protected]> wrote:
>
>
>
> On 27.04.20 20:41, Anand Moon wrote:
> > Hi Robin,
> >
> > On Sun, 12 Jan 2020 at 07:25, Robin Murphy <[email protected]> wrote:
> >> Hi all,
> >>
> >> Here's a second crack at my RK805-inspired cleanup. There was a bit
> >> of debate around v1[1], but it seems like we're now all happy that this
> >> is a reasonable way to go. For clarity I decided to include Soeren's
> >> patch as #1/5, but since I've rewritten most of my patches I've not
> >> included the tested-by tags.
> >>
> >> Robin.
> >>
> > Can you re-spin this series, it seem these patches are lost.
> >
> These patches are already merged as
> d8f083a302f7..42679765faf2
>
> Soeren

Thanks for the input.

-Anand