Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F13CAC001DF for ; Sun, 6 Aug 2023 17:52:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 559B48683F; Sun, 6 Aug 2023 19:52:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J1XyNWbV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6926086826; Sun, 6 Aug 2023 19:52:51 +0200 (CEST) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7084F863E5 for ; Sun, 6 Aug 2023 19:52:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-99bfcf4c814so563313866b.0 for ; Sun, 06 Aug 2023 10:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691344369; x=1691949169; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mP2zQqH4z+Zzz5ODn7jt6/6FYiyrE0MvWKhXkpO9HQ0=; b=J1XyNWbVGK3npkutBvS3HjVp7z/j07eJWP8LLV5n0B3wAWwwg/pbFzePSyVayKcfhP km0uurXlnRy0ljkseSugxOM8j86WVCNu6/AYgrzVJj3OXYSq4fgR6gq1wX8DKcueLcxh JBrnQ/WeXgx4orAr5hT6L/E04OwTnjh1SVQp5NFeWe8PRwFaei6VNoMuV0Eyc/6feV57 AEbP3kC4mq5Lq628+81hbfpXiYCJbTlxE3PX88ZcGt+X8Xu5sBSoE+haTjnuSN0SwXvU 7YnJIFpeKigkkapIElzCVra61/2USFGZQP2bftLk7POuVVt0Q4NanCwokCX8Nd8/QO1L YDrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691344369; x=1691949169; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mP2zQqH4z+Zzz5ODn7jt6/6FYiyrE0MvWKhXkpO9HQ0=; b=QWb0KKolvJwp2AvdPTmpOpfpnbHwaoYtC3DAPnk1qHw5YmeulMYP3+7zd/X7Il9/FE XW/Bf/G0JDtzSAKIPoKznUdaQaMSVlv4sQEdvG9eFOUekkhcduwIMxH9dFt7GuemLbyR k1k64P/DKa4lq4+vUaD7YuPEA1aADqYPeaLLVSJjjppcTwkojMEj6wrcdS3OfIUDlU+e 3OO4AKdPX/qtJUc1MRZSu1ZZCeUcVXAcOv7JVpTRG1+SwQ5/tv5wAYvDImhk0P1YST5o HZHVY9lQmyDefHgtNOxndIQe3jKdt6yTRgNBlYESwpKM2JFBrPvNH2HXzDXKr43n09Pa +5+A== X-Gm-Message-State: AOJu0Yz8XBoAjU/9cWNF6caKuLL3wuApNBxZH1oTMZvA5VLwZTTS7uno H7iECVUGtoHid2TdQQ82JxjctPx2vFG3lA== X-Google-Smtp-Source: AGHT+IENzH1AMmAqcp5WjVT+a7oCcdkKgttb52mua/oCiEg/c2y//A6wbbf5FT2X3FPhjKMeNduB7g== X-Received: by 2002:a17:907:778e:b0:993:dd1d:8251 with SMTP id ky14-20020a170907778e00b00993dd1d8251mr7142748ejc.28.1691344368756; Sun, 06 Aug 2023 10:52:48 -0700 (PDT) Received: from xeon.. ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id la4-20020a170906ad8400b0099bd682f317sm4066454ejb.206.2023.08.06.10.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 10:52:48 -0700 (PDT) From: Svyatoslav Ryhel To: Jaehoon Chung , Simon Glass , Jonas Karlman , Svyatoslav Ryhel , Eugen Hristev , Patrice Chotard , John Keeping Cc: u-boot@lists.denx.de Subject: [PATCH v3 0/4] General regulator and pmic uclass improvements Date: Sun, 6 Aug 2023 20:52:20 +0300 Message-Id: <20230806175224.103002-1-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This patchset derives from discussion of TPS65913 bringup and aims to cycle all regulator management inside uclass removing need of any board calls for regulators. My hw setup is Tegra 3 LG Optimus Vu P895 (PMIC is MAX77663) with native spl u-boot build. power: regulator: expand basic reference counter onto all uclass Commit is basically expansion of 4fcba5d ("regulator: implement basic reference counter") onto all regulators. My testing on hw has shown no issues so far with both pmic regulators and fixed regulators. Counting works as expected, dm test is set in test of regulator_set_enable_if_allowed. power: regulator-uclass: perform regulator setup inside uclass All regulators with always-on or boot-on are set to probe after bind which ensures that essential regulators are set. In the post probe regulator autoset is called so that correct regulator state according to device tree is reached. DM test is set by checking regulators data without pre-configuring them manually. --- Changes from v2: - dropped changes related to pmic (pmic regulator probing on pmic post bind) - regulator uclass changes are dropped to minimum to remain compatibility: - always-on and boot-on check is moved to post bind - regulator_autoset is called on post_probe - adjusted dm tests to pass with this changes Changes from v1: - adapted description of regulator_set_enable - remove uc_pdata->enable_count from post_probe - added tests from counter and regulators post_probe --- Svyatoslav Ryhel (4): power: regulator: expand basic reference counter onto all uclass test: dm: regulator: test counter in set_enable_if_allowed test power: regulator: Perform regulator setup inside uclass test: dm: regulator: provide test of auto setup drivers/power/regulator/regulator-uclass.c | 71 ++++++++++++++++++++-- drivers/power/regulator/regulator_common.c | 22 ------- drivers/power/regulator/regulator_common.h | 21 ------- include/power/regulator.h | 2 + test/dm/regulator.c | 27 +++++++- 5 files changed, 92 insertions(+), 51 deletions(-) -- 2.39.2