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 DEE98EB64DA for ; Tue, 18 Jul 2023 07:05:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8650486689; Tue, 18 Jul 2023 09:05:16 +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="WCCmAaEJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C7DDD86702; Tue, 18 Jul 2023 09:05:14 +0200 (CEST) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (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 6111786637 for ; Tue, 18 Jul 2023 09:05:12 +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-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b701dee4bfso82958141fa.0 for ; Tue, 18 Jul 2023 00:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689663911; x=1692255911; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Jy9nfr4gAQI+xZpRYkb+lyiao197lMn5ADvEKjuqEGI=; b=WCCmAaEJAwc3nMRqbsGbQn1BNrWrwJwmhjPg3kS637hbgZWv8uBG5Y6JVcUnUrjxc0 HOv5ZZyvExAqA8PC8jBZAyC5NgKMWMxH1v9xFGFJ5W/scRipJudHrToqRIJrpxrBTjqg sLZU7AOy8NSftY223wTGUjT0tb45wizsghIJa5Hab45b+YqXHAuGBgYwKfJOkaKOuZ3E PuzMZFtwneP/W3ifWWFqSewTluapwizvD/VwKs/DhHKcpHWwxXzOOlBkmLBy+VTBjjo6 u9kzdofdSLGFY92ZuGzDDib4jsBsUw6z4a7U0eCVbOR3sIgTTtpxi+YBWxIIBsxeVutn DRLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689663911; x=1692255911; 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=Jy9nfr4gAQI+xZpRYkb+lyiao197lMn5ADvEKjuqEGI=; b=OluSaqLcf7BN0ChYdT6ST7w1/zTxezHuEzUa4AVfeSihI07VtSJQXqfV7Zb7WyLq6p W9mX+odf0mTET3E+BKGNz9g1e8uBg8s5Rk3u1YQ56KXa7+cokV7ZTYO/q6f1ZT7NW9o6 8UqqIedDBJlrosrsK6az2Ba0cCX0CtqJmvNkidfrabOkC4vIbjtU5CT16O4vRQTJAxKN TOjzgYwKdZ4fdacIPE1hacHiSMUPwHxU/Zk+Vl+AzmDR9DPy2lUVFp+T6Sr9ZaqiSOHV 6NAyZTdn6Ypg+wh3OgQlAAtla2qlDgRZAWWhrZUZ/PRTE/BpLpc2pQj0NqjOKT7y6UU3 /8iQ== X-Gm-Message-State: ABy/qLbEAgKUgTKIthCZL32qonMNpveGv3/AVov2NvI0knyMBxE7J5Tl 9444ykcCENOscI3wB0tuYg0= X-Google-Smtp-Source: APBJJlGA4ksGmESluASkF5giTK6Lksx6fqgr4m0QAC4sEKvYSOkPaItkzXKDbrI26DtQZxgOSigc1Q== X-Received: by 2002:a05:651c:104e:b0:2b6:c790:150a with SMTP id x14-20020a05651c104e00b002b6c790150amr10417218ljm.22.1689663911275; Tue, 18 Jul 2023 00:05:11 -0700 (PDT) Received: from xeon.. ([188.163.112.64]) by smtp.gmail.com with ESMTPSA id z10-20020a05600c220a00b003fbfea1afffsm1343644wml.27.2023.07.18.00.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 00:05:09 -0700 (PDT) From: Svyatoslav Ryhel To: Simon Glass , Philipp Tomsich , Kever Yang , Kostya Porotchkin , Neil Armstrong , Marek Vasut , Patrick Delaunay , Patrice Chotard , Jagan Teki , Matteo Lisi , Jaehoon Chung , Anatolij Gustschin , Jonas Karlman , Quentin Schulz , Svyatoslav Ryhel , Eugen Hristev Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io, u-boot@dh-electronics.com, uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH v1 0/4] General regulator and pmic uclass improvements Date: Tue, 18 Jul 2023 10:05:00 +0300 Message-Id: <20230718070504.19810-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. power: regulator-uclass: perform regulator setup inside uclass All self-sufficient regulators are set to probe after bind to perform initial setup later in post-probe with pdata from device tree. - self-sufficient regulator is one that is not dependent on any other device (this category does not include pmic regulators for example). I have tested fixed regulators and got correct probing and setup according to device tree. power: pmic-uclass: probe every child on pmic_post_probe All non self-sufficient regulators must be probed after main device is probed (in this case it is pmic_post_probe). In all other aspects pmic regulators behave same. - tested with MAX77663 ldo and sd regulators, no errors or inconsistencies were tracked, regulator props (boot-on, always-on etc) and consumer calls work as expected. power: regulator-uclass: remove all deprecated API use This is where everything gets tricky. All board dedicated API of regulators has to be removed. System presented above should cover all regulators setup but non the less this should be disscussed with maintainers and tested on affected boards. This commit removes and cleans most of those API traces, except tests, I am still a bit confused how to setup testing since this is interference into framework itself. Svyatoslav Ryhel (4): power: regulator: expand basic reference counter onto all uclass power: regulator-uclass: perform regulator setup inside uclass power: pmic-uclass: probe every child on pmic_post_probe power: regulator-uclass: remove all deprecated API use arch/arm/mach-rockchip/board.c | 8 - arch/arm/mach-rockchip/rk3399/rk3399.c | 10 - board/Marvell/octeontx2_cn913x/board.c | 5 - .../amlogic/odroid-go-ultra/odroid-go-ultra.c | 2 - board/dhelectronics/dh_stm32mp1/board.c | 2 - board/engicam/stm32mp1/stm32mp1.c | 3 - board/google/veyron/veyron.c | 6 - board/samsung/common/exynos5-dt.c | 4 - board/samsung/odroid/odroid.c | 10 - board/st/stm32mp1/stm32mp1.c | 9 - drivers/power/pmic/pmic-uclass.c | 10 + drivers/power/regulator/regulator-uclass.c | 234 +++++++----------- drivers/power/regulator/regulator_common.c | 22 -- drivers/power/regulator/regulator_common.h | 21 -- drivers/video/bridge/ps862x.c | 12 +- drivers/video/rockchip/rk_vop.c | 6 +- include/power/regulator.h | 121 +-------- 17 files changed, 106 insertions(+), 379 deletions(-) -- 2.39.2