From patchwork Mon Nov 26 15:27:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 1003298 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=plaes.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=plaes.org header.i=@plaes.org header.b="DAeLnSct"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 433W6t3mgHz9s29 for ; Tue, 27 Nov 2018 02:29:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbeK0CWl (ORCPT ); Mon, 26 Nov 2018 21:22:41 -0500 Received: from plaes.org ([188.166.43.21]:49992 "EHLO plaes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726260AbeK0CWk (ORCPT ); Mon, 26 Nov 2018 21:22:40 -0500 Received: from localhost (85.253.196.132.cable.starman.ee [85.253.196.132]) by plaes.org (Postfix) with ESMTPSA id 5660841437; Mon, 26 Nov 2018 15:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1543246092; bh=6EKNczPzAeRmYVbTYMAGxPpSb8ylewUfArbtCQEqQ8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DAeLnSctjEHrv0VtbEodU5v6ZrERG4na7i1pWutAANPvY8uotH+LpBiYIfhhBvSZl 3D0le5p2qa9Eb0EU3tcKuSNWtlC9KsK+GZlZeEKm4m2IrnFI3E2GHcXND3eurvrIWb V0rYeR2B4LF//dWntXY1yIW1GulN0NjbS9nATXJru8AQQqcJQOx1iu+8TBl3HIUqmy 8TRGQAn9JUDoMFufdJbT0tlxixqCATFJZGCk0lyX9zmN8N6Cj+UXec6+zqI0/znr/6 tSPTMofvVoDfg4dDB/GuJBayXiCdcs4wJXWYrKXLNJOe630B6QTFW69fMskb/FULCl zgJADnjpHevrg== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Sebastian Reichel , Hans de Goede , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: Priit Laes , Olliver Schinagl Subject: [PATCH 05/14] dt-bindings: mfd: axp20x: add support for regulator-ramp-delay for AXP209 Date: Mon, 26 Nov 2018 17:27:46 +0200 Message-Id: <4333f81dfa1d9be082b09ab9ddf2694cb56285e2.1543245984.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Olliver Schinagl The AXP209 supports ramping up voltages on several regulators such as DCDC2 and LDO3, therefore we can use the standard 'regulator-ramp-delay' property for those 2 regulators. Note that the voltage ramp only works when the regulator is already enabled. E.g. when going from say 0.7 V to 3.6 V. When turning on the regulator, no voltage ramp is performed in hardware. What this means, is that if the bootloader brings up the voltage at 0.7 V, the ramp delay property is properly applied. If however, the bootloader leaves the power off, no ramp delay is applied when the power is enabled by the regulator framework. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes --- Documentation/devicetree/bindings/mfd/axp20x.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt index 188f037..5542212 100644 --- a/Documentation/devicetree/bindings/mfd/axp20x.txt +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt @@ -32,6 +32,11 @@ Required properties: - interrupt-controller: The PMIC has its own internal IRQs - #interrupt-cells: Should be set to 1 +Supported common regulator properties, see regulator.txt for more information: +- regulator-ramp-delay: sets the ramp up delay in uV/us + AXP20x/DCDC2: 1600, 800 + AXP20x/LDO3: 1600, 800 + Optional properties: - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz AXP152/20X: range: 750-1875, Default: 1.5 MHz From patchwork Mon Nov 26 15:27:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 1003295 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=plaes.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=plaes.org header.i=@plaes.org header.b="QlfbeeSY"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 433W6R4ZQFz9s3q for ; Tue, 27 Nov 2018 02:29:03 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727259AbeK0CX3 (ORCPT ); Mon, 26 Nov 2018 21:23:29 -0500 Received: from plaes.org ([188.166.43.21]:50026 "EHLO plaes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726745AbeK0CWm (ORCPT ); Mon, 26 Nov 2018 21:22:42 -0500 Received: from localhost (85.253.196.132.cable.starman.ee [85.253.196.132]) by plaes.org (Postfix) with ESMTPSA id BA6D7419F3; Mon, 26 Nov 2018 15:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1543246093; bh=2y/7SIgzDiOCzHzW9rhbAuXxYi5ONCzQRe3PFNumDZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QlfbeeSYfkpSMoKsFb72/itqF/XK4u2jnYQ2y1h6uuWjH3M1NpkqjDB9+yg02duNb 9ms1kuxAeZuxpEx2kPaA+R2d2SiyEvDmtLd3B7HTBVIQiaehTrBwAsZ8EFu3MKTTq7 tkVlTb5B1nxkLmG1K3h8u7NqPgLWKUXwhK7VeMnvgVkjv3o3cCjpHQlWbqOjQy4tfT ocqsDjJHsfsTRVfteBtZol/MtPtSAuKanetdQYO6HAni0W3cWIRvqngM0UYuduI2Cy cPzEIKWU8V14nHdmze9pGKFXmNmvBqyNdmxE1chQn4byYl7mUXIb8ZV9Eq9KdiSFM5 Vciyp2yhH0Idw== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Sebastian Reichel , Hans de Goede , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: Priit Laes , Olliver Schinagl Subject: [PATCH 07/14] dt-bindings: mfd: axp20x: Add software based soft_start for AXP209 LDO3 Date: Mon, 26 Nov 2018 17:27:48 +0200 Message-Id: <2cd75ee27982f3be0d86104d80eaa13efeb2c65d.1543245984.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Olliver Schinagl In the past, there have been words on various lists that if LDO3 is disabled in u-boot, but enabled in the DTS, the axp209 driver would fail to continue/hang. Several enable/disable patches have been issues to devicetree's in both the kernel and u-boot to address this issue. What really happened however, was that the AXP209 shuts down without a notice and without setting an interrupt. This is caused when LDO3 gets overloaded, for example with large capacitors on the LDO3 output. Normally, we would expect that AXP209 would source 200 mA as per datasheet and set and trigger an interrupt when being overloaded. For some reason however, this does not happen. As a work-around, implement software-based 'regulator-soft-start' property for AXP209 LDO3 regulator, which is used to first bring up the LDO3 to the lowest possible voltage and then enable the LDO. After that, we can set the requested voltage as usual. Combining this setting with the regulator-ramp-delay allows LDO3 to come up slowly and staggered, potentially reducing overall inrush current. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes --- Documentation/devicetree/bindings/mfd/axp20x.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt index 5542212..7e97bb7 100644 --- a/Documentation/devicetree/bindings/mfd/axp20x.txt +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt @@ -36,6 +36,9 @@ Supported common regulator properties, see regulator.txt for more information: - regulator-ramp-delay: sets the ramp up delay in uV/us AXP20x/DCDC2: 1600, 800 AXP20x/LDO3: 1600, 800 +- regulator-soft-start: enable the output at the lowest possible voltage and + only then set the desired voltage + AXP20x/LDO3 Optional properties: - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz