From 905a8088c7d5acc87a1a7aa07b68fe6cf058f810 Mon Sep 17 00:00:00 2001 From: Shengfei Xu Date: Thu, 31 Jul 2025 09:37:23 +0800 Subject: [PATCH] regulator: rk806: Modify the implementation of RK806 shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure the shutdown function and level by directly setting PWRCTRL1 register‌, bypassing the pinctrl subsystem. Implement PMIC reset by toggling the RESET pin‌ of PMIC through CPU GPIO control. Change-Id: I370fd20638ef0fa08bcb67a3304509dc058b99d6 Signed-off-by: Shengfei Xu --- drivers/regulator/rk806-regulator.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/rk806-regulator.c b/drivers/regulator/rk806-regulator.c index e42c234b802b..2672bf91dd77 100644 --- a/drivers/regulator/rk806-regulator.c +++ b/drivers/regulator/rk806-regulator.c @@ -1250,12 +1250,10 @@ static void rk806_regulator_shutdown(struct platform_device *pdev) if (system_state == SYSTEM_POWER_OFF) { rk806_shutdown_requence_config(rk806); - if ((rk806->pins->p) && (rk806->pins->power_off)) - pinctrl_select_state(rk806->pins->p, rk806->pins->power_off); + rk806_field_write(rk806, PWRCTRL1_FUN, PWRCTRL_NULL_FUN); + rk806_field_write(rk806, PWRCTRL1_POL, POL_HIGH); + rk806_field_write(rk806, PWRCTRL1_FUN, PWRCTRL_POWOFF_FUN); } - if (system_state == SYSTEM_RESTART) - if ((rk806->pins->p) && (rk806->pins->reset)) - pinctrl_select_state(rk806->pins->p, rk806->pins->reset); } static const struct platform_device_id rk806_regulator_id_table[] = {