Message ID | 20230721082903.2038975-1-wenst@chromium.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp77502vqg; Fri, 21 Jul 2023 02:24:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFRMKfxQcMDfNhCqjI7NQxA8kzXf3Uwr+mblbSnWUd9sZIYf0JkQ4xIjZ4TuKU+GNblSGSy X-Received: by 2002:aa7:cf8a:0:b0:51e:1a3e:1a6 with SMTP id z10-20020aa7cf8a000000b0051e1a3e01a6mr1043862edx.20.1689931452454; Fri, 21 Jul 2023 02:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689931452; cv=none; d=google.com; s=arc-20160816; b=g7HT7+goXtVgJY23lGr9dE4kTG3KHsqOngNqnEJhKlLTGOB5bTD2Pul1Scn6He0fye jyfLXd9bVGznWFujfL//W4u+Z7OVBMSY3rzFD076sNIuVEGGkHw8N0rfXnNIt6Qogh1S +VS/7XQZWukdjO98uSWJUoQIGhI1p6UKNdarWh2XCHg0YdOhMqHRl4GVTjnfveO7nLS2 KU1nU6D8q1Gpj0cK1mZnXMDed9WvDbW3h6HVZB7of5Nc6UaWmAkKioFxYmwdJyu8GUox JSaQjmIOMeEuN2TfSOIk1v5WcZ4H5+8QbfM4VGdcRkyD0p6LbFUiK++qCooLAuoSjXbD TJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dsW9tUiaMnSTYVVPWIPxNApYubVnBPMgU9idJbKQccw=; fh=SfnTO7GpW3zzB964eh5mthfKZWMy4oqbu80hrCJiJEw=; b=HlfkNlm25045Ps50kXUb29yCmcI67uTkuoyLupMvzGrj4DMFGMDS/cOAwhuPy+yrvn PYsyA9mxqzS2FnmsGva6peUV2kcxaCPk9J1u629AoGfAlIdo2zTCIBR5CvadWk0ZalyF fRpmKeSykacDi55sLocgnYL68G3RV9rr3LCK9J//Z2aAtYmKz0rUV10+BEediSv0IBnL CjGpGnIvs2IFooRQwoaJEd/THqJDVElnMW38CmvbZi+nEsh9LjB+9b+e1JDBKMzAG5HV Kz47Ez46aDUAVxjrTtgRyKyFKrb22E6kjJtDXHa4L6PwKx/DvZNzqKhY48ogJ0irJj3K lV6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="RI/ryzMx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z26-20020aa7c65a000000b0051dd487b0d6si2007358edr.361.2023.07.21.02.23.48; Fri, 21 Jul 2023 02:24:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="RI/ryzMx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbjGUI3n (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Fri, 21 Jul 2023 04:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbjGUI3j (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Jul 2023 04:29:39 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA587272E for <linux-kernel@vger.kernel.org>; Fri, 21 Jul 2023 01:29:28 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-55e04a83465so1122916eaf.3 for <linux-kernel@vger.kernel.org>; Fri, 21 Jul 2023 01:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689928168; x=1690532968; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dsW9tUiaMnSTYVVPWIPxNApYubVnBPMgU9idJbKQccw=; b=RI/ryzMxMSQ+VKa8HDRrosIKYpZfVgFMqmUw2HHkuJyhFzvVHfiQ11S8jgVDcVHYEA DsYRbZT4S36Ax+tmnHP89wLBRCtRFAlRvKMhMwPIMEBmVw+vkuineABH7dXjVfvIoTMC mp4OWxxT3BHKdgMyynBbWwhIyeMGELX729oac= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689928168; x=1690532968; 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=dsW9tUiaMnSTYVVPWIPxNApYubVnBPMgU9idJbKQccw=; b=gUDnWni3sUGpwVl3xx9eRhKQSa2dn8mx7ZwAVqHo534PN1P3Qh9UcW/JoESo7zTqfd IfZnU4fujHWzsss9I9NmkBPuyV/S0l7X0vGfBVV9Ns95y7MyTDP5vCFgKT8cauXJzdj4 5Ws90qp5AyyOUvq08Xbi5JNnCl3dqlCflkO09lcAZPktAEYjQ2OHXVGSS37TxqBh/ANZ p4tYdfGnDFLUIXCKsgau60MjFScWNq2EhqreVwbETOAEq48sDHc3nLUaGTd7OHW1AUDk 59JwicBSxc3RM4q0AGQwjRYQ2cMOxhPEOOlST0h+9i5m5D0+BsqPHhIYt+ghJxPD9d0c Jz3g== X-Gm-Message-State: ABy/qLY9u9CHfqM7U+DcuORGrkpoPJVAbmhAJNFQ2k9UwS08wMrn7lqB 7LaI1DS0gafq/ILEI5VFjrduqw== X-Received: by 2002:a05:6358:938c:b0:134:df5e:4776 with SMTP id h12-20020a056358938c00b00134df5e4776mr1501426rwb.24.1689928167783; Fri, 21 Jul 2023 01:29:27 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6d86:d21:714:abab]) by smtp.gmail.com with ESMTPSA id d26-20020a63991a000000b0055fe64fd3f4sm2594382pge.9.2023.07.21.01.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 01:29:27 -0700 (PDT) From: Chen-Yu Tsai <wenst@chromium.org> To: Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chen-Yu Tsai <wenst@chromium.org>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND v2 0/7] regulator: mt6358: Remove bogus regulators and improvements Date: Fri, 21 Jul 2023 16:28:52 +0800 Message-ID: <20230721082903.2038975-1-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772018003226712464 X-GMAIL-MSGID: 1772021562888009898 |
Series |
regulator: mt6358: Remove bogus regulators and improvements
|
|
Message
Chen-Yu Tsai
July 21, 2023, 8:28 a.m. UTC
(Resending with Lee added to recipients) Hi, This is v2 of the remainder of the MT6358 regulator driver cleanup and improvement series. v1 can be found here [1]. Changes since v1: - Merged patches dropped - Added patch to move VCN33 regulator status sync after ID check - Added patch to fix VCN33 sync fail error message - Added patch to add missing register definitions Various discrepancies were found while preparing to upstream MT8186 device trees, which utilize the MT6366 PMIC, that is also covered by this driver. Patch 1 should either go through the mfd tree and an immutable branch created for the regulator tree to consume, or given an Ack, merged directly through the regulator tree. Spoiler: a follow-up series dealing with the MT6366 PMIC, which is covered by the same driver, also has an mfd header patch that would need the same treatment. Patches 2~6 should go through the regulator tree, and patch 7 through the soc tree. Patches 2 and 3 should be merged as fixes for v6.5, as the commit they fix was just introduced in -rc1. Patches 5 and 6 depends on "[v3] regulator: Use bitfield values for range selectors" [2] I sent out earlier. This v2 series can be seen as three parts. v1 also had three parts, but one part was fully merged, and then v2 gained another cleanup. Part 1 - Fixing bogus regulators (patches 2, 3, and 7) There are some regulators listed in the bindings and driver that have no corresponding pin on the actual hardware. MediaTek says these are a hardware construct for shared control of the same regulator in the VCN33 case and an alternative control scheme for low power suspend. In the VCN33 case, there's only one actual regulator, so we merge the two and rename them to match the hardware pin. No existing devices use these AFAICT, so this should be safe to change. The driver changes for this part have been merged, but two review comments were not accounted for. They are addressed here with two new patches Part 2 - Robust chip ID checking (patch 4) Angelo suggested making the driver fail to probe if an unexpected chip ID was found. Patch 4 implements this. Part 3 - Output voltage fine tuning support (patches 1, 5, and 6) Many of the LDOs on these PMIC support an extra level of output voltage fine tuning. Most default to no offset, but a couple have a non-zero offset by default. Previously this was unaccounted for in the driver and device tree constraints. On the outputs with non-zero offset, this ends up becoming a discrepancy between the device tree and actual hardware. These two patches adds support for this second level of tuning, modeled as bunch of linear ranges. While it's unlikely we need this level of control, it's nice to be able to read back the accurate hardware settings. Please have a look. After this series is done I'll send out patches for the MT6366 PMIC, which is what started this. That will also include updated YAML bindings for MT6366. I think we can merge MT6358 bindings into them afterwards. Thanks ChenYu [1] https://lore.kernel.org/linux-arm-kernel/20230609083009.2822259-1-wenst@chromium.org/ [2] https://lore.kernel.org/linux-arm-kernel/20230714081408.274567-1-wenst@chromium.org/ Chen-Yu Tsai (7): mfd: mt6358: Add missing registers for LDO voltage calibration regulator: mt6358: Sync VCN33_* enable status after checking ID regulator: mt6358: Fix incorrect VCN33 sync error message regulator: mt6358: Fail probe on unknown chip ID regulator: mt6358: Add output voltage fine tuning to fixed regulators regulator: mt6358: Add output voltage fine tuning to variable LDOs arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators arch/arm64/boot/dts/mediatek/mt6358.dtsi | 11 +- drivers/regulator/mt6358-regulator.c | 314 +++++++++++------------ include/linux/mfd/mt6358/registers.h | 6 + 3 files changed, 151 insertions(+), 180 deletions(-)
Comments
Il 21/07/23 10:28, Chen-Yu Tsai ha scritto: > The MT6358 and MT6366 PMICs, and likely many others from MediaTek, have > a chip ID register, making the chip semi-discoverable. > > The driver currently supports two PMICs and expects to be probed on one > or the other. It does not account for incorrect mfd driver entries or > device trees. While these should not happen, if they do, it could be > catastrophic for the device. The driver should be sure the hardware is > what it expects. > > Make the driver fail to probe if the chip ID presented is not a known > one. > > Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > Fixes: f0e3c6261af1 ("regulator: mt6366: Add support for MT6366 regulator") > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
On Fri, 21 Jul 2023 16:28:52 +0800, Chen-Yu Tsai wrote: > (Resending with Lee added to recipients) > > Hi, > > This is v2 of the remainder of the MT6358 regulator driver cleanup > and improvement series. v1 can be found here [1]. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next Thanks! [2/7] regulator: mt6358: Sync VCN33_* enable status after checking ID commit: 649fee5a17a7f96152fee2fb9111d9a4db535f35 [3/7] regulator: mt6358: Fix incorrect VCN33 sync error message commit: 67cb608838e0aac8efb48828b1165156f99c1af9 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark