mbox series

[0/6] regulator: pca9450: register restart handlers

Message ID 20230727-pca9450-reboot-v1-0-c8edb27bf404@skidata.com
Headers show
Series regulator: pca9450: register restart handlers | expand

Message

Benjamin Bara July 27, 2023, 3:26 p.m. UTC
Hi!

This series implements two restart handler registrations for the pca9450
(6/6). As the pca9450 supports both, cold and warm resets, and there
exist at least one other PMIC implementation which also implements a
warm and a cold reset (tps65219), 1-5/6 should simplify/clarify the
distinction process between warm/soft and cold/hard resets/restarts.
Instead of deciding in the handler, this should be done during
registration. The series is a follow-up to Dmitry's feedback, regarding
checking the reboot_mode in the handler [1].

This series is based on linux-next and 6/6 depends on [2].

Thanks & best regards,
Benjamin

[1] https://lore.kernel.org/all/7eddaf8c-ab04-7670-fc45-15f0fce5eff2@collabora.com/
[2] https://lore.kernel.org/all/20230327-tegra-pmic-reboot-v7-3-18699d5dcd76@skidata.com/

---
Benjamin Bara (6):
      kernel/reboot: distinguish between cold and warm
      mfd: rk8xx: Specify restart mode
      soc/tegra: pmc: Specify restart mode
      mfd: tps65219: Specify restart mode
      kernel/reboot: remove generic restart mode
      regulator: pca9450: register restart handlers

 drivers/mfd/rk8xx-core.c              |  3 +-
 drivers/mfd/tps65219.c                | 17 ++++++--
 drivers/regulator/pca9450-regulator.c | 59 +++++++++++++++++++++++++
 drivers/soc/tegra/pmc.c               |  2 +-
 include/linux/reboot.h                | 23 +++++++---
 include/linux/regulator/pca9450.h     |  7 +++
 kernel/reboot.c                       | 82 +++++++++++++++++++++++++++++------
 7 files changed, 167 insertions(+), 26 deletions(-)
---
base-commit: 4d2c646ac07cf4a35ef1c4a935a1a4fd6c6b1a36
change-id: 20230724-pca9450-reboot-0b32218fc7a2

Best regards,

Comments

Lee Jones July 28, 2023, 9:59 a.m. UTC | #1
On Thu, 27 Jul 2023, Benjamin Bara wrote:

> From: Benjamin Bara <benjamin.bara@skidata.com>
> 
> Specify the implemented restart handler as a cold one.

 * The current implementation is an issue because ...
 * If this is not fixed, the following will happen ...
 * By fixing this in this way and not another way has ... advantages ...

> Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
> ---
>  drivers/mfd/rk8xx-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
> index e8fc9e2ab1d0..15e8e6a9943a 100644
> --- a/drivers/mfd/rk8xx-core.c
> +++ b/drivers/mfd/rk8xx-core.c
> @@ -697,7 +697,8 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
>  		case RK809_ID:
>  		case RK817_ID:
>  			ret = devm_register_sys_off_handler(dev,
> -							    SYS_OFF_MODE_RESTART, SYS_OFF_PRIO_HIGH,
> +							    SYS_OFF_MODE_RESTART_COLD,
> +							    SYS_OFF_PRIO_HIGH,
>  							    &rk808_restart, rk808);
>  			if (ret)
>  				dev_warn(dev, "failed to register rst handler, %d\n", ret);
> 
> -- 
> 2.34.1
>