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 4270EC001DC for ; Sat, 15 Jul 2023 18:34:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F193E8615A; Sat, 15 Jul 2023 20:34: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=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="ZSBdxFML"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E96D8619C; Sat, 15 Jul 2023 20:34:49 +0200 (CEST) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 1E08286146 for ; Sat, 15 Jul 2023 20:34:47 +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-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3141fa31c2bso2924659f8f.2 for ; Sat, 15 Jul 2023 11:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689446086; x=1692038086; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1pmKLsO5jT85U80I7wTanTpNYxyBte1hPiGB6EONZGA=; b=ZSBdxFML6JtPSuRqs0HuWsAuAhFpElgpV9uQJ7CQ0bOnB4J0fYFp3BXbR2tHOIhpUa Lq76AZYlub+sHshOobkgg9YWC0CWfoP6rpkdmVHIAV9IIQW1RcKlsSpodVVoGzoMSgKS MZL2AULy5zPtToXrucPHOKJ05PIgRZpvWOlwzSVp+mqJXOjTRx3J4/6wqUu1x+smT3OK 4gOuR8ZqgI4hH8Gv/0y7o5SMtQDMSlKgGQwJc2gJoGCZkyHJiK96ujItAormhIgpMHRy T7N+t8NQTVDFpsAv186XVxv+NrowZEQ0ugMppK1miWiSRoBkaQiR140JaKXsZrA5sfI+ vhcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689446086; x=1692038086; 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=1pmKLsO5jT85U80I7wTanTpNYxyBte1hPiGB6EONZGA=; b=Fl44F4XfuAXACLqdJ4agLHGq9Pt/gUHgzjvjh4QQMgL/0jdC1/jFLrHPNJyRNCmQw/ jfuhd7yhT9UIhbsvTGHWZi0rUHPv4MY9T0eMJbFeII2YS5ZvEDVz6/8FxQ/+D3jZCHRG w+ws+hbc0RMGksAqUaJINASGb7GSpE6zdLOMLUdRnhpVIfl6RyqO25pJfCGqOozoyX4I ZUZGJS4w8DCzZTvPtev3bKt0XGY+jsbUG4+JErDYXmlqH/CVfpYmSeEyPzMA040SjWYd VDkY4Ahw9GX/zX6l2bsa8jfZ9DEJqbHsUGodADRS4ZRBsxr1zGQRsoJLEP73IQ5IZoSq ZsNA== X-Gm-Message-State: ABy/qLZ7AE1MhLu53qmuvFQjgA1fpc38Ik+/qgqTEUpvuQvF/dkBbFZA YVj4WsEVgYNnOt7O+a7FIc0= X-Google-Smtp-Source: APBJJlFL7MPBjz6Q4Cl4LM7jeOZBZP1eDcQu1uuruNBzKgY2Kor5p5TSNfTRB1mk04uD4bws0YUxPA== X-Received: by 2002:a5d:6b8f:0:b0:316:ee41:f1bf with SMTP id n15-20020a5d6b8f000000b00316ee41f1bfmr5127497wrx.12.1689446086268; Sat, 15 Jul 2023 11:34:46 -0700 (PDT) Received: from xeon.. ([188.163.112.64]) by smtp.gmail.com with ESMTPSA id j1-20020a5d4641000000b0031434936f0dsm14365073wrs.68.2023.07.15.11.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 11:34:45 -0700 (PDT) From: Svyatoslav Ryhel To: Jaehoon Chung , Simon Glass , Patrick Delaunay , Svyatoslav Ryhel Cc: u-boot@lists.denx.de Subject: [PATCH v2 0/2] power: pmic: add TPS65913 support Date: Sat, 15 Jul 2023 21:34:29 +0300 Message-Id: <20230715183431.5318-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 Existing PALMAS PMIC driver is fully compatible with TI TPS65913 PMIC found in many Tegra 4 devices, like Tegra Note 7 and ASUS TF701T. Add TPS65913 dts compatible with TPS659038 data. Issue with regulators is more general then I though initially. It touches all pmic regulators. Currently device tree entries of regulators are completely ignored and regulators are probed only if they are called by the device which uses it. This results into two issues: regulators which must run under boot-on or always-on mode are ignored and not enabled; dts props like voltage are not applied to the regulator so the regulator may be enabled with random actual voltage, which may have unexpected consequences. Second patch changes this behavior. Post-probe function is introduced which performs probing of each pmics child and if it is a regulator, regulator_autoset function is called, which handles always-on and boot-on regulators, but if none of those props are set, the regulator is disabled. Later disabled regulators can be re-enabled by devices which use them without issues. I have tested this change on multiple devices with different PMICs (LG P895, max77663; TF300T with TPS65911; HTC One X with TPS80031; Tegratab with TPS65913). Without this patch they behave as described in the third paragraph. With patch behavior is correct. --- Changes from v1: - implemented general fix of regulator behavior, which include: - introduction of post-probe into pmic-uclass driver - probing all pmic childs in post-probe - check if device is regulator > autoset if regulator is boot-on or always-on else disable regulator --- Svyatoslav Ryhel (2): power: pmic: support TI TPS65913 PMIC power: pmic: fix regulators behaviour drivers/power/pmic/palmas.c | 1 + drivers/power/pmic/pmic-uclass.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) -- 2.39.2