From nobody Sun Feb 8 13:36:36 2026 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B52AA1EA7CC for ; Fri, 6 Jun 2025 19:05:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749236714; cv=none; b=sfOQrnKhLVx9+cuaX0ui/7jwp8jdrYYNNFv7ryM0lv8mHZLEdu99E3bN/alOg4kpxiQPPdeL0yf28epdh0dFeguEgAMSmo97/12BFiHSlU/qWjOFfrGf5/rgoFvqrxJYiJgL+ddL8bQPUdf+OfymiAKxJ5xYsvF1ysNNP7qg1fA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749236714; c=relaxed/simple; bh=6H0DwloF7vOEqUU5gLmsPjegYl0CykJEIcaaq36pH1Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jtI8AOlEHGjDQnwcHDc8Hw0t3i5XPN9gkQQpLyC3D2Bs3zV36r5uapwCb+yP7rEgIX4zQw4+iyvNzcvv6wGtp87Gu1YhG1eaSfV92p3KoyrM/H46oOrx0q5AL2yJqR8NAW9e7RHTn204u2LQMlM12ceopVzEilbvGsVNwDmGjD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=CZrpXVTE; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="CZrpXVTE" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=dTTSMmd1HyZzX30vPWlv02znwCagkmKHfnpI1QcQGwo=; b=CZrpXVTE0FnsVVm7uXUEYzF6vT qSJpxpOwJO+OTIEXd7HXrWaA+0EQdFcpLY59ywCDaZe1x74hlN4GRFzVkQpebOKnO4zCQLAF6liQO vM2Qn6F/dEVlMBkP0q5PSvx55xrNTezm/CaaG2BvNr4A9Ab/X/KzonvZ1Srt7eVAC8u6ixpOSli4x GdGzcvhFdXz/QZT+5MgtTR3wqNsWllSLSmBkeiZpUvlWyMJJ8622iWIZgLXBj0kWYX4xLeNnre12G m+UlkL+zcQjm6MU1PAqSc8dyczD7P0j0Tk1rYoVE1bFRMtr08pQeXVxpLu9/GVkkuG4idRdeouyBF HF2Y37GQ==; Received: from i53875ad6.versanet.de ([83.135.90.214] helo=localhost.localdomain) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uNcNE-0003rs-0W; Fri, 06 Jun 2025 21:05:04 +0200 From: Heiko Stuebner To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, wens@kernel.org, quentin.schulz@cherry.de, Heiko Stuebner Subject: [PATCH] regulator: fan53555: add enable_time support and soft-start times Date: Fri, 6 Jun 2025 21:04:18 +0200 Message-ID: <20250606190418.478633-1-heiko@sntech.de> X-Mailer: git-send-email 2.47.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The datasheets for all the fan53555 variants (and clones using the same interface) define so called soft start times, from enabling the regulator until at least some percentage of the output (i.e. 92% for the rk860x types) are available. The regulator framework supports this with the enable_time property but currently the fan53555 driver does not define enable_times for any variant. I ran into a problem with this while testing the new driver for the Rockchip NPUs (rocket), which does runtime-pm including disabling and enabling a rk8602 as needed. When reenabling the regulator while running a load, fatal hangs could be observed while enabling the associated power-domain, which the regulator supplies. Experimentally setting the regulator to always-on, made the issue disappear, leading to the missing delay to let power stabilize. And as expected, setting the enable-time to a non-zero value according to the datasheet also resolved the regulator-issue. The datasheets in nearly all cases only specify "typical" values, except for the fan53555 type 08. There both a typical and maximum value are listed - 40uS apart. For all typical values I've added 100uS to be on the safe side. Individual details for the relevant regulators below: - fan53526: The datasheet for all variants lists a typical value of 150uS, so make that 250uS with safety margin. - fan53555: types 08 and 18 (unsupported) are given a typical enable time of 135uS but also a maximum of 175uS so use that value. All the other types only have a typical time in the datasheet of 300uS, so give a bit margin by setting it to 400uS. - rk8600 + rk8602: Datasheet reports a typical value of 260us, so use 360uS to be safe. - syr82x + syr83x: All datasheets report typical soft-start values of 300uS for these regulators, so use 400uS. - tcs452x: Datasheet sadly does not report a soft-start time, so I've not set an enable-time Signed-off-by: Heiko Stuebner --- I've started with just setting regulator-enable-ramp-delay in devicetree, but Chen-Yu suggested [0] that these are characteristics of the regulator so possibly should be defined in the driver instead. And after thinking about it more, I agree. [0] https://lore.kernel.org/linux-rockchip/CAGb2v65C0jHsD2HD_AEt+AGqMfWUUww= WV0bXw4i9Hw2tCNHZpA@mail.gmail.com/ drivers/regulator/fan53555.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index bd9447dac596..c282236959b1 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c @@ -147,6 +147,7 @@ struct fan53555_device_info { unsigned int slew_mask; const unsigned int *ramp_delay_table; unsigned int n_ramp_values; + unsigned int enable_time; unsigned int slew_rate; }; =20 @@ -282,6 +283,7 @@ static int fan53526_voltages_setup_fairchild(struct fan= 53555_device_info *di) di->slew_mask =3D CTL_SLEW_MASK; di->ramp_delay_table =3D slew_rates; di->n_ramp_values =3D ARRAY_SIZE(slew_rates); + di->enable_time =3D 250; di->vsel_count =3D FAN53526_NVOLTAGES; =20 return 0; @@ -296,10 +298,12 @@ static int fan53555_voltages_setup_fairchild(struct f= an53555_device_info *di) case FAN53555_CHIP_REV_00: di->vsel_min =3D 600000; di->vsel_step =3D 10000; + di->enable_time =3D 400; break; case FAN53555_CHIP_REV_13: di->vsel_min =3D 800000; di->vsel_step =3D 10000; + di->enable_time =3D 400; break; default: dev_err(di->dev, @@ -311,13 +315,19 @@ static int fan53555_voltages_setup_fairchild(struct f= an53555_device_info *di) case FAN53555_CHIP_ID_01: case FAN53555_CHIP_ID_03: case FAN53555_CHIP_ID_05: + di->vsel_min =3D 600000; + di->vsel_step =3D 10000; + di->enable_time =3D 400; + break; case FAN53555_CHIP_ID_08: di->vsel_min =3D 600000; di->vsel_step =3D 10000; + di->enable_time =3D 175; break; case FAN53555_CHIP_ID_04: di->vsel_min =3D 603000; di->vsel_step =3D 12826; + di->enable_time =3D 400; break; default: dev_err(di->dev, @@ -350,6 +360,7 @@ static int fan53555_voltages_setup_rockchip(struct fan5= 3555_device_info *di) di->slew_mask =3D CTL_SLEW_MASK; di->ramp_delay_table =3D slew_rates; di->n_ramp_values =3D ARRAY_SIZE(slew_rates); + di->enable_time =3D 360; di->vsel_count =3D FAN53555_NVOLTAGES; =20 return 0; @@ -372,6 +383,7 @@ static int rk8602_voltages_setup_rockchip(struct fan535= 55_device_info *di) di->slew_mask =3D CTL_SLEW_MASK; di->ramp_delay_table =3D slew_rates; di->n_ramp_values =3D ARRAY_SIZE(slew_rates); + di->enable_time =3D 360; di->vsel_count =3D RK8602_NVOLTAGES; =20 return 0; @@ -395,6 +407,7 @@ static int fan53555_voltages_setup_silergy(struct fan53= 555_device_info *di) di->slew_mask =3D CTL_SLEW_MASK; di->ramp_delay_table =3D slew_rates; di->n_ramp_values =3D ARRAY_SIZE(slew_rates); + di->enable_time =3D 400; di->vsel_count =3D FAN53555_NVOLTAGES; =20 return 0; @@ -594,6 +607,7 @@ static int fan53555_regulator_register(struct fan53555_= device_info *di, rdesc->ramp_mask =3D di->slew_mask; rdesc->ramp_delay_table =3D di->ramp_delay_table; rdesc->n_ramp_values =3D di->n_ramp_values; + rdesc->enable_time =3D di->enable_time; rdesc->owner =3D THIS_MODULE; =20 rdev =3D devm_regulator_register(di->dev, &di->desc, config); --=20 2.47.2