Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp903382rdb; Tue, 19 Sep 2023 13:53:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOPs4uvVVlllh+bZOctOXx4hTKcf1vFl9ADixoAKetN4Z1v522tpV6ifyZoIsVzdq2bSNF X-Received: by 2002:a17:902:c211:b0:1c5:64aa:b97a with SMTP id 17-20020a170902c21100b001c564aab97amr526777pll.38.1695156784979; Tue, 19 Sep 2023 13:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695156784; cv=none; d=google.com; s=arc-20160816; b=AIpB+h6WDm/g1z7ey5t0SHWEygcrkIbbtsGfdpO09B7ck6LdoUXmfHfQ+9RL+SjF3Z LYz1/yEWUmkTidWujuTNqcc0XHjBq2hnLnCFZCV+laHD0LUeWm0xex7zbiZVRj9HmmZV i3cmYB6C3uY26Pby/S+pBmLehvv6qcgbimnV+Oo3dRi1pOww2mT2WPy5kJcBgBNGhkZ4 jM5DCRLaiPLnAGRWfvcV//ekbDwX1XpqiVwuA5RTDX5IudyG56xBzOIp2nPvslkvoFzZ +Gog9cTJ9fdRGfpe8QHIaKuL6UYAduEczi2mfqniDfo5jqpICsbh9kptyyGwY7EKStkP WZdQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=X6CKpAG43kDaRgAjwqU+vZjV81A+xQpp6ulVqMp+1DNyajgXmy75h0MlFfXGDxqpZE 3DcKBi+CjhIE2Ei0k1WP4vQynCD8qkC36BmjT9tb3RTLNjRqXFSheiwWpfeEQuhHiqsv PDJ3WFgksj9IrqgUJ0dqvKNXfJzQUATpQbJXW7z+o4PV1HxPcsFKJFbDwqt4/6jbHsm7 azR5Bv6KQ5ADaioudKt8s4IBBNNYtDMt7ONXmqh3Nw/bjoqoGtdj7BeZiYa2NGewwsIK XlhFSG+oTTcwJ/LjpLBDenh8CPp84yV1Ffw9VHTxHhuhG2Lper/HUx3cMy8LW6HNdoNs dnog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nLVfyZne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id p7-20020a170902e74700b001bba564e2d9si10411461plf.0.2023.09.19.13.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 13:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nLVfyZne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CB0C380BE0BF; Tue, 19 Sep 2023 03:48:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjISKrq (ORCPT + 99 others); Tue, 19 Sep 2023 06:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbjISKrj (ORCPT ); Tue, 19 Sep 2023 06:47:39 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64CB312B for ; Tue, 19 Sep 2023 03:47:32 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-690bc3f82a7so1005293b3a.0 for ; Tue, 19 Sep 2023 03:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120452; x=1695725252; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; b=nLVfyZneTcBJ/lTRGHVYuKIhZKV9MUSv/+e5lYgHPZIrNtLR1Q4Jp+e6/q4YqWg4cJ 9w/sAHM68WJnsjp0tw1+qejgP5qMnYJ0QXLvAsm/ftp+xnC8d2QnCp7I2jKZ19EP/J9d iBN6pqwtESAE+nAm7qvjfi3oi8FeSnlKetiDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120452; x=1695725252; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; b=jyTqU/aYQGWXaAOwUy0/uV66rPhgwIFIC2RqhMXhvzPZvay23GHBWhc7+432XPI9yv CAehncKM1la3yUEUTSh9lSmg3KP+io2o1uNuyB8YjEF4mg+UP64uztbGmNN5V2+ued4C byTy0cBJbWJLrkJoz7tD3VGgZhV+F078hSZqeW8z22vxMl8+HA1nz8fUD/4HvRm2W18B WqJRW60Y+5is2hX2tRtXw7f7/GtmBEztpmmT7jvMz9f5w0y8/BlFNIvDAbIWgSMu5Y8+ d/iO95TxKGaMnuq+LRNiJkCfDOoBDGaeKsA+MW2ZWDvxFaUiqZ1f8KaDO2U9MdFmwObQ 77Ww== X-Gm-Message-State: AOJu0YznvQAqtkQlk5xC3wSiBgACSc3d5ziuoklBDAxaCko4c4lZNwio GSBAlSCKge+7hMn5JFZyRYAObA== X-Received: by 2002:a05:6a21:498e:b0:142:aced:c643 with SMTP id ax14-20020a056a21498e00b00142acedc643mr10956371pzc.31.1695120451840; Tue, 19 Sep 2023 03:47:31 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:31 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 03/12] regulator: dt-bindings: mt6358: Add regulator-allowed-modes property Date: Tue, 19 Sep 2023 18:43:46 +0800 Message-ID: <20230919104357.3971512-4-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:09 -0700 (PDT) The MT6358 PMIC allows changing operating modes for the buck regulators, but not the LDOs. Existing device trees and the Linux implementation already utilize this through the standard regulator-allowed-modes property. The values currently used in existing device trees are simply raw numbers. The values in the Linux driver are matching numbers defined with macros denoting the two supported modes. Turns out these two modes are common across parts of the larger MT63xx PMIC family. The MT6397 regulator binding already has macros for the two modes, with matching numbers. Codify the supported values for regulator-allowed-modes for the MT6358 in the device tree binding: 0 and 1 are supported for buck regulators, and the property should not be present for LDO regulators. Users should use the dt-bindings/regulator/mediatek,mt6397-regulator.h header for the macros, instead of using raw numbers. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - new patch .../regulator/mediatek,mt6358-regulator.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 5daef024de3e..62e8fa6b4306 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -23,48 +23,71 @@ patternProperties: description: Buck regulators type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: + description: | + Buck regulatpr operating modes allowed. Valid values below. + Users should use the macros from dt-bindings/regulator/mediatek,mt6397-regulator.h + 0 (MT6397_BUCK_MODE_AUTO): Auto PFM/PWM mode + 1 (MT6397_BUCK_MODE_FORCE_PWM): Forced PWM mode + items: + enum: [0, 1] unevaluatedProperties: false "^ldo_v(a|rf)12$": description: LDOs with fixed 1.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_v((aux|cn|io|rf)18|camio)$": description: LDOs with fixed 1.8V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vxo22$": description: LDOs with fixed 2.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_v(aud|bif|cn|fe|io)28$": description: LDOs with fixed 2.8V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vusb$": description: LDOs with fixed 3.0V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vsram_(gpu|others|proc1[12])$": description: LDOs with variable output type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": description: LDOs with variable output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false required: @@ -74,6 +97,8 @@ additionalProperties: false examples: - | + #include + regulator { compatible = "mediatek,mt6358-regulator"; @@ -83,6 +108,8 @@ examples: regulator-max-microvolt = <900000>; regulator-ramp-delay = <6250>; regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; }; ldo_vsram_gpu { -- 2.42.0.459.ge4e396fd5e-goog