Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10588615rwp; Fri, 21 Jul 2023 01:25:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHvsyrIzsGCeCI4c4LKqodJLHWPDPH7T+CnR5g2PlH4oaF9SkvtUudcTzP7aFRT3SJXAEIE X-Received: by 2002:a17:907:7797:b0:99b:48a9:f56d with SMTP id ky23-20020a170907779700b0099b48a9f56dmr1070679ejc.22.1689927913781; Fri, 21 Jul 2023 01:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689927913; cv=none; d=google.com; s=arc-20160816; b=MuWCKjcnLYiVXmhzDfVZb5WZoSKa0G7DmIt/ycU/OvYOmtjnMH9KmsKt4EqNlZuJUX 9sWstD9Cdb9eX8OFE67RC6myC+Xl0mpCLF5XCssd3HLsiHCd7ZXLDNowLoVTkVrsm0rv Q0I1POhSPA/iFEHgFtS1dWVOR/4ugS5USYGxu7pREkvGwbrb3ccLPgMB9JmA2fbGJbQe XBcVAhHYMut9wov95/qmXGlyrDSCIbYbHXlWGOYw3yBPsjLCq3t5oRvufZvxS6rtSZ2w cnNRgcgMwbNxoqatHKdVyA4K6fd9wMcxZ0cV38MEhdKYXWY6Bpj4Z1dR3HJGNTZfIGeo 5KXA== 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=gANVBGVeS5MlGx8TPeBiBkdc2Y9+xr4fJVm3EzJWyww=; fh=VJ01W5r8lnAG5bxIKoK7gZ7nUj903k7qXzCTwY8Msq4=; b=xkImvew5HEMURW4lk+pRi3l+w1kgTgFjkauj256YYi2NTUvzI8ACQJj3dT6NW/60Rq C1YCGCJ0ZnBuAYJevn6pYO3mPtfGGh46jdAuak3lFNSuB0MHyGzJXfX8+DR4s1KD/1lI U1+tsg1yQ5vkJvYDzJ9ATV78wEYI9T/8maWbl3rcEBL+hL71s8pgYH8JqxmPHoGRJUo1 JvejR+Ns8gC+QyuXJZsZW0LpV0PKdBX7vo2i67UE8II9n7NmPprM7JmZGQXRCIhgbzUa OMVsUOCFbvB8kTtj/FnItq97XWdw7/Z9l2Q2OvIz8QPW8vWtbJwIs6FXS5x0VmFYRFBR 0lJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RVPAoXsP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ko20-20020a170907987400b009930e13a56fsi1766216ejc.346.2023.07.21.01.24.49; Fri, 21 Jul 2023 01:25:13 -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=RVPAoXsP; 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 S231372AbjGUIIJ (ORCPT + 99 others); Fri, 21 Jul 2023 04:08:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231360AbjGUIIH (ORCPT ); Fri, 21 Jul 2023 04:08:07 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F472709 for ; Fri, 21 Jul 2023 01:08:05 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bb1baf55f5so12675515ad.0 for ; Fri, 21 Jul 2023 01:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689926885; x=1690531685; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gANVBGVeS5MlGx8TPeBiBkdc2Y9+xr4fJVm3EzJWyww=; b=RVPAoXsPVmL4Vaqkq73MwUfnz+QtYfW/n1CFqxFmm48Qlk+2O2xtNhGZEXSZ7QqcIx 6xXgKb2wgOiiSdtN2o+guY0PKD0Kq0oKWmgO/izgFTQ1ydKkGXfTL8XbjzMAsG307GOE m+wWLbtDmieNJ780rhZfFPwtDB6Zu6ZtjsFdE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689926885; x=1690531685; 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=gANVBGVeS5MlGx8TPeBiBkdc2Y9+xr4fJVm3EzJWyww=; b=l6kJaW35kAB9+eyA7KlI65+ARY+QyKlD+aDF6RQuH9W3BwLm47QrmXLzWk1xuKLBuT fsZLZb5FHkDKlvMqsBCnBH+1igC6pXLwfgMz/+pET9u4v2wKuDQAFmwND4w8EOhSbmpn lYW3VpqyBPkYyS/iRtlt6tGZDLl0cqmktZ4wYLczSAcvviufJ202IjCtjXoekFsVojaB Hp2CPdwuZwrNdibQRLGhi8SL0IDKUN9ZcnG2JcbIUQsnHxwSLxc8Sw48iBs3EOzCBL79 1Ody/lpaJH6td+GigIrRGcqANY4zYnLtxF6R4G2MfGL61dLxngkBdzU7RQ0v3kYdkjOv Z9tw== X-Gm-Message-State: ABy/qLbdfWtdjJKV1vHt/5r0b+13sCI7XCM4vYA4PVkapRXLESRr78D3 cUBh9+muY69sDC+E3urxVHIFYA== X-Received: by 2002:a17:903:2341:b0:1b9:d335:2216 with SMTP id c1-20020a170903234100b001b9d3352216mr1709996plh.20.1689926885282; Fri, 21 Jul 2023 01:08:05 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6d86:d21:714:abab]) by smtp.gmail.com with ESMTPSA id o10-20020a170902bcca00b001b850c9af71sm2740294pls.285.2023.07.21.01.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 01:08:05 -0700 (PDT) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Brown , Liam Girdwood , Matthias Brugger , AngeloGioacchino Del Regno Cc: Chen-Yu Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/7] regulator: mt6358: Remove bogus regulators and improvements Date: Fri, 21 Jul 2023 16:07:41 +0800 Message-ID: <20230721080751.2012318-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: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.41.0.487.g6d72f3e995-goog