Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1466617lqh; Mon, 6 May 2024 08:30:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5HwtAJ6f308lFUFPo9I+wyLOr8VdYqWO05I0snD4BNNYnrECaxCwTACVsen/uuGf0YTX5Ue3ILgfy5YoY7+as9gMswsCCCe3sE6UnuA== X-Google-Smtp-Source: AGHT+IFV2AfmQkWcU/CpetqMw0ahNsBWOobI7XAXLSKLsmSXMNHVRsacGrq2rfyd+A85IqYQJhs3 X-Received: by 2002:a05:6a00:3a20:b0:6ec:ebf4:3e8a with SMTP id fj32-20020a056a003a2000b006ecebf43e8amr11221148pfb.15.1715009424767; Mon, 06 May 2024 08:30:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715009424; cv=pass; d=google.com; s=arc-20160816; b=bCzzL9oFV69H0GqephhBbOWNNApWqGM5Q2MK4Dh83NhfxQK/V2ZvY7rKjELtpROxvL QI+q9zyt9WrT2VjAgyMaI7E1QfDObwOeZB0EtMCLdScZO91EWQBfRhM4uUVXMSYsIQG6 FawSUDXFDQXvEsfHfWMSpR2J6WkjVggDe31HWNyq2H3mi03ItdI8FcBDb2/fZrE18aDD McoNa/SG8l8G7NCDKZhvFJQ56ulf7aQ89OCMtUyARo3+pyL1vG/wo/Ji3a8jtOGr6bHl 4QuDQq75KvKZ5daPFa3BYWxEoYqaQdsoLCFwfYAMk0GIX7lTiOvIiP027UUN4ve6ip4u MfuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gsVnKMM9gHkV3pY62Vh0hqoywAvUxocbmp/SP0i3NI8=; fh=Wj77nLC6hlOAsb1H1AZQ+yB5J8vH53oH67JdxycAAGU=; b=qoKAlmdj14LbzIDe2xlivNu4J8TmKYX5XM3gBCkWuyKfwRS+lNJWmQnbxanQgGDGnl DMd1svtc53KDEKitYM4fmKqjst34dhKSqrZzjSoT1tDZw2gsrgWOBCe6Dq5iRy8XA0iD 82p9gW4HWrbegH13AWqdOS4uxXfxk/aMNLF2rcJwUAa9YyO/d39xpyRfAs4tj01Wh/vR xpn1+ghZ/tdbzphWSzCjlZ8M9f0oh4ZqRgRQ8IVrSicJCClO/hqUzwEUD2KZuaXVrK5x YY36khG+dn6peE9dqAFWz6Dd+W23jJfroLcjeVtBBXDJzge3X1YCi4DyV0qwRVGl7vLz ub7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MIWaKCl7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q12-20020a056a00084c00b006f4669f0b1dsi4219266pfk.267.2024.05.06.08.30.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 08:30:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MIWaKCl7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 293A2B24A30 for ; Mon, 6 May 2024 15:12:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC9C2157497; Mon, 6 May 2024 15:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MIWaKCl7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 725C615531D; Mon, 6 May 2024 15:10:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715008215; cv=none; b=fv+/pE57d+EnnJJ3zwJ6Nn2JBn0mJjtOjNhCfvPJBzsZlQw2b3sTYrlXW4S3LDiPNxH2lRo0xkK56/UG6Nny17u2C17YCXjrHAupqvVLKmbTjL1iu3uSrqZJ0JHMRduFLXGmujkzaFkms/hwYhrtNADaFr4VyhTF4jXwnW+iM/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715008215; c=relaxed/simple; bh=AkdkaR54sACrEoSvNXOHYSL1x8xDnc3d3gyuETl7sUU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VxAbrCLH2LHxcZRclCdILQTpD8nQVp8tqTg1Qh+h428lDiBnMmP/1NjGmCGjnBROVYCwZv1ePuTR3Ll1L2Eq7o1F7r88LLPZPrSIZcoWkoEspZr1r8v0l9r1NAkcB6NSY5abCCZAE6g/uvBKFxfhOiwPRmGcAB7mkiYNewmufbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MIWaKCl7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4B5CC4DDF1; Mon, 6 May 2024 15:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715008215; bh=AkdkaR54sACrEoSvNXOHYSL1x8xDnc3d3gyuETl7sUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MIWaKCl70QAmGJwYnzJ4aB9Bm4VHKlrVwiBBJVJ4Ag08l46Qn0GcZsIH1d2kUfxv7 GEJ0zt8mw9Y0ShewmqWl++sLpvQx4/rE4Sj+ms4nqOZdC0DMyGqYIJL3dTH7M+1Ojv ywHOlHJNM3YaSYZ7ozZz/jT/PgY3SnMYFxkvxIWDUYbG+xdf+mvwBLjISjqJBc8WSH CBzNNtX0qEwrkyfMrGOJt1mPZyn7sgYT2vGBgaAkQNnSWRyTjxj+vEfwHjFrLxNS3J H2an/u2fkk2SvNMXON25Dbdg0KYkuHM5gX7aVropoZteDfD3GYolBipKIRWiEg66m3 TYyvEtgaaWAgA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s3zyq-000000006CU-2jIX; Mon, 06 May 2024 17:10:16 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Linus Walleij , Bjorn Andersson Cc: Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Das Srinagesh , Satya Priya , Stephen Boyd , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Johan Hovold Subject: [PATCH 10/13] dt-bindings: mfd: pm8008: rework binding Date: Mon, 6 May 2024 17:08:27 +0200 Message-ID: <20240506150830.23709-11-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240506150830.23709-1-johan+linaro@kernel.org> References: <20240506150830.23709-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Rework the pm8008 binding by dropping internal details like register offsets and interrupts and by adding the missing regulator and temperature alarm properties. Note that child nodes are still used for pinctrl and regulator configuration. Also note that the pinctrl state definition will be extended later and could eventually also be shared with other PMICs (e.g. by breaking out bits of qcom,pmic-gpio.yaml). Signed-off-by: Johan Hovold --- .../devicetree/bindings/mfd/qcom,pm8008.yaml | 154 ++++++++++-------- 1 file changed, 90 insertions(+), 64 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml index e1e05921afb4..ac1bab0261b6 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml @@ -19,116 +19,142 @@ properties: const: qcom,pm8008 reg: - description: - I2C slave address. - maxItems: 1 interrupts: maxItems: 1 - description: Parent interrupt. - reset-gpios: maxItems: 1 - "#interrupt-cells": + vdd_l1_l2-supply: true + vdd_l3_l4-supply: true + vdd_l5-supply: true + vdd_l6-supply: true + vdd_l7-supply: true + + gpio-controller: true + + "#gpio-cells": const: 2 - description: | - The first cell is the IRQ number, the second cell is the IRQ trigger - flag. All interrupts are listed in include/dt-bindings/mfd/qcom-pm8008.h. + gpio-ranges: + maxItems: 1 interrupt-controller: true - "#address-cells": - const: 1 + "#interrupt-cells": + const: 2 - "#size-cells": + "#thermal-sensor-cells": const: 0 -patternProperties: - "^gpio@[0-9a-f]+$": + pinctrl: type: object + additionalProperties: false + patternProperties: + "-state$": + type: object + $ref: "#/$defs/qcom-pm8008-pinctrl-state" + unevaluatedProperties: false - description: | - The GPIO peripheral. This node may be specified twice, one for each GPIO. - - properties: - compatible: - items: - - const: qcom,pm8008-gpio - - const: qcom,spmi-gpio + regulators: + type: object + additionalProperties: false + patternProperties: + "^ldo[1-7]$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false - reg: - description: Peripheral address of one of the two GPIO peripherals. - maxItems: 1 +required: + - compatible + - reg + - interrupts + - vdd_l1_l2-supply + - vdd_l3_l4-supply + - vdd_l5-supply + - vdd_l6-supply + - vdd_l7-supply + - gpio-controller + - "#gpio-cells" + - gpio-ranges + - interrupt-controller + - "#interrupt-cells" + - "#thermal-sensor-cells" - gpio-controller: true +additionalProperties: false - gpio-ranges: - maxItems: 1 +$defs: + qcom-pm8008-pinctrl-state: + type: object - interrupt-controller: true + allOf: + - $ref: /schemas/pinctrl/pinmux-node.yaml + - $ref: /schemas/pinctrl/pincfg-node.yaml - "#interrupt-cells": - const: 2 + properties: + pins: + items: + pattern: "^gpio[12]$" - "#gpio-cells": - const: 2 + function: + items: + - enum: + - normal required: - - compatible - - reg - - gpio-controller - - interrupt-controller - - "#gpio-cells" - - gpio-ranges - - "#interrupt-cells" + - pins + - function additionalProperties: false -required: - - compatible - - reg - - interrupts - - "#address-cells" - - "#size-cells" - - "#interrupt-cells" - -additionalProperties: false - examples: - | #include - #include #include i2c { #address-cells = <1>; #size-cells = <0>; - pmic@8 { + pm8008: pmic@8 { compatible = "qcom,pm8008"; reg = <0x8>; - #address-cells = <1>; - #size-cells = <0>; - interrupt-controller; - #interrupt-cells = <2>; interrupt-parent = <&tlmm>; interrupts = <32 IRQ_TYPE_EDGE_RISING>; reset-gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; - pm8008_gpios: gpio@c000 { - compatible = "qcom,pm8008-gpio", "qcom,spmi-gpio"; - reg = <0xc000>; - gpio-controller; - gpio-ranges = <&pm8008_gpios 0 0 2>; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; + vdd_l1_l2-supply = <&vreg_s8b_1p2>; + vdd_l3_l4-supply = <&vreg_s1b_1p8>; + vdd_l5-supply = <&vreg_bob>; + vdd_l6-supply = <&vreg_bob>; + vdd_l7-supply = <&vreg_bob>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pm8008 0 0 2>; + + interrupt-controller; + #interrupt-cells = <2>; + + #thermal-sensor-cells = <0>; + + pinctrl { + gpio-keys-state { + pins = "gpio1"; + function = "normal"; + }; + }; + + regulators { + ldo1 { + regulator-name = "vreg_l1"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <1300000>; + }; }; }; }; -- 2.43.2