Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp145974lqr; Wed, 5 Jun 2024 01:26:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXruWFhacpBe2FDD44C9viMOV1isvHqZkqqryx4fZmeyKHmidJsjwz1Rt1GjjBasJqt/7XUc1gjNnBNW3KUrKVq+PrHaEuVGrtDdOzH6w== X-Google-Smtp-Source: AGHT+IEfffyirI5Y6tZ8QbkfrtSPkDkrnS9HyziTmWV9OLNGUuTULgeaIBXzYRH+h30cLBXX17VA X-Received: by 2002:a05:622a:452:b0:43d:e16b:d8fb with SMTP id d75a77b69052e-4402b64eb27mr18808341cf.54.1717575987524; Wed, 05 Jun 2024 01:26:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717575987; cv=pass; d=google.com; s=arc-20160816; b=x61uro17DNfXCY4P9tAaaHiEmLC2+nC2yjr7JYd+xg4taXTImaFAEHSMjl4FaYWmSR xdcbMPtqySsvDElNLNMRzmwPDwBXsQmW0iT7058yxX62f/86KYyXJNk7kJHF2n+JFtXH MvTIJOVxUYNjODwBGQsbd+uox/iebA9vyxyTal+8f9RQ+qhnyx0TqE2iKXmqE2wfYWf0 AgdaPXKzctb6M4POl8vNpJZDC6kbTYN96F5DEtuaM5TXjL0x3xjU4jaDRpLMEvAUTig9 P//6Gt/PSQ2JGTSsRMEuGdFFmXkRQP7yK1Zof5SwaKx7DxYcY15qxoESd/Au1LJXRjtU BiCA== 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:message-id:date:subject:to:from :dkim-signature; bh=RJv1sYTRVMr7FTjeuQa/7/Qu+8HkgnWrXnXH071JoWo=; fh=MaMomxa1CraizNH6mQRx/F90OErni3oJV2gWR5Y9rME=; b=NbEToehPpHVIjwke6mu5UkKy3Im7OU146m5pP0Ux+QZWbzl0LcfCy96SNdZZ/pTt9B uQZZQpLV9FogSfe+O0Qfmc87cgsfNkBXkTAY0XFtHQjxttSnW4rSLmurWQrKPU8eSetS 5GsGJ32/XMCtjpYu336/gB31bpsY+arbSCR+cXMin9gML5zxcIw/B1heAx0wp0+uIwW9 wHvg0nXR1W2nemp84/+Mal7MSi4sdJqwLkY3741o2BYB0PYVemMKDt7SgdnaRB3+YICn JAL7C85VRbMncIJYPjnVtNewzI0/0QdsRNQVjtNE+hYKC8QaGg5g3ZpdCvelIzXyY8Ax 4vKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20220719 header.b=w2Ixvx7h; arc=pass (i=1 spf=pass spfdomain=kemnade.info dkim=pass dkdomain=kemnade.info); spf=pass (google.com: domain of linux-kernel+bounces-201986-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201986-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff25c39c3si128283971cf.791.2024.06.05.01.26.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 01:26:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201986-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=fail header.i=@kemnade.info header.s=20220719 header.b=w2Ixvx7h; arc=pass (i=1 spf=pass spfdomain=kemnade.info dkim=pass dkdomain=kemnade.info); spf=pass (google.com: domain of linux-kernel+bounces-201986-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201986-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3457B1C21231 for ; Wed, 5 Jun 2024 08:26:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEFFF1922E8; Wed, 5 Jun 2024 08:19:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="w2Ixvx7h" Received: from mail2.andi.de1.cc (vmd64148.contaboserver.net [161.97.139.27]) (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 B206C1946BA; Wed, 5 Jun 2024 08:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=161.97.139.27 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717575579; cv=none; b=tbogx/FJK4YevF5OJBYuNvIcVNb8U3gNVn4MsXH0Y9fnHEdevJxXQ8yAqGXZJMCLGYnm3Ljna8XZ49pWGyW33JWhliZ0BDTjwdn7UDnsxYmBrpu4qaoz4UpFNyynmVin4QSJ4ECQVhR0nBpaIyKqyx8yZSihzn7C7wC724z7VTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717575579; c=relaxed/simple; bh=awnecWctzKrmH2Q9F9eUI1sO1/cE+Y+MWy1YkQh6Tsk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=PtkVCKDSwCApTcYv83qaBO2Kxq8SnTs9Y7jPJozMlFIWh1up39z1kAV2Mz8wbHQ0/jZHbgHqkvcP0Crrc3+rH7OT4bWO3PN6Z56beZs8JWjxzi972Fd2RRimQHQhwMNY+mVDAvRyHPAeQpy8J6vZIukMq2ze1ncrSJD5922aqfQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=w2Ixvx7h; arc=none smtp.client-ip=161.97.139.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Received: from mail.andi.de1.cc ([2a02:c205:3004:2154::1]) by mail2.andi.de1.cc with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sElrk-008sMe-13; Wed, 05 Jun 2024 10:19:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RJv1sYTRVMr7FTjeuQa/7/Qu+8HkgnWrXnXH071JoWo=; b=w2Ixvx7hYXXkVD6thSD6tSLEs1 rJdMaawDNbgs3OH72we4bzwon+ObclyH4Ay+4yjIuBxtSDjEFymuCZ2KXqbAG6M7MYtZDO6Yf9tC0 ncAwIjDbEsv5ZQRby+GLgjsvPNUjxfTMQVrOuJaqDzlIAo6JfV2+WFAotorvwgxjqHb45I2Q4HPu6 RCg5/x8fW6611ncgQL9Xa8zoVHBgCQ5NeRZaW1f4ysj/kIMfIoA1RlonD1lnwys2BJpygkbjhn1y6 ZFaYUaxv1C2fWtFwHO58mQaXjrtwGLwpfLLGwA4OHcr4mGSmzSlwuCVyL8OINyTr8SAHmur22kyfv uD6YV8nA==; Received: from p200300c20737c2001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:c2:737:c200:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sElri-002fQU-2Q; Wed, 05 Jun 2024 10:19:28 +0200 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1sElrj-000Ytt-20; Wed, 05 Jun 2024 10:19:27 +0200 From: Andreas Kemnade To: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, andreas@kemnade.info, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3] dt-bindings: regulator: twl-regulator: convert to yaml Date: Wed, 5 Jun 2024 10:19:06 +0200 Message-Id: <20240605081906.134141-1-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Convert the regulator bindings to yaml files. To allow only the regulator compatible corresponding to the toplevel mfd compatible, split the file into one per device. Drop one twl5030 compatible due to no documentation on mfd side and no users of the twl5030. Signed-off-by: Andreas Kemnade --- Changes in v3: - define regulator stuff in toplevel - simplified regulator-inital-mode - extended example to contain both regulator-initial-mode and retain-on-reset Changes in v2: - add regulators directly to ti,twl.yaml - less restrictions on regulator node name .../devicetree/bindings/mfd/ti,twl.yaml | 167 +++++++++++++++++- .../bindings/regulator/twl-regulator.txt | 80 --------- 2 files changed, 165 insertions(+), 82 deletions(-) delete mode 100644 Documentation/devicetree/bindings/regulator/twl-regulator.txt diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml index c2357fecb56c..e4a9bc97e597 100644 --- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml @@ -22,6 +22,32 @@ allOf: contains: const: ti,twl4030 then: + patternProperties: + "^regulator-": + properties: + compatible: + enum: + - ti,twl4030-vaux1 + - ti,twl4030-vaux2 + - ti,twl4030-vaux3 + - ti,twl4030-vaux4 + - ti,twl4030-vmmc1 + - ti,twl4030-vmmc2 + - ti,twl4030-vpll1 + - ti,twl4030-vpll2 + - ti,twl4030-vsim + - ti,twl4030-vdac + - ti,twl4030-vintana2 + - ti,twl4030-vio + - ti,twl4030-vdd1 + - ti,twl4030-vdd2 + - ti,twl4030-vintana1 + - ti,twl4030-vintdig + - ti,twl4030-vusb1v5 + - ti,twl4030-vusb1v8 + - ti,twl4030-vusb3v1 + ti,retain-on-reset: false + properties: madc: type: object @@ -50,13 +76,34 @@ allOf: properties: compatible: const: ti,twl4030-wdt - - if: properties: compatible: contains: const: ti,twl6030 then: + patternProperties: + "^regulator-": + properties: + compatible: + enum: + - ti,twl6030-vaux1 + - ti,twl6030-vaux2 + - ti,twl6030-vaux3 + - ti,twl6030-vmmc + - ti,twl6030-vpp + - ti,twl6030-vusim + - ti,twl6030-vana + - ti,twl6030-vcxio + - ti,twl6030-vdac + - ti,twl6030-vusb + - ti,twl6030-v1v8 + - ti,twl6030-v2v1 + - ti,twl6030-vdd1 + - ti,twl6030-vdd2 + - ti,twl6030-vdd3 + regulator-initial-mode: false + properties: gpadc: type: object @@ -69,6 +116,26 @@ allOf: contains: const: ti,twl6032 then: + patternProperties: + "^regulator-": + unevaluatedProperties: false + properties: + compatible: + enum: + - ti,twl6032-ldo1 + - ti,twl6032-ldo2 + - ti,twl6032-ldo3 + - ti,twl6032-ldo4 + - ti,twl6032-ldo5 + - ti,twl6032-ldo6 + - ti,twl6032-ldo7 + - ti,twl6032-ldoln + - ti,twl6032-ldousb + - ti,twl6032-smps3 + - ti,twl6032-smps4 + - ti,twl6032-vio + regulator-initial-mode: false + properties: gpadc: type: object @@ -112,6 +179,27 @@ properties: interrupts: maxItems: 1 +patternProperties: + "^regulator-": + type: object + unevaluatedProperties: false + $ref: /schemas/regulator/regulator.yaml + properties: + compatible: true + regulator-initial-mode: + enum: + - 0x08 # Sleep mode, the nominal output voltage is maintained + # with low power consumption with low load current capability + - 0x0e # Active mode, the regulator can deliver its nominal output + # voltage with full-load current capability + ti,retain-on-reset: + description: + Does not turn off the supplies during warm + reset. Could be needed for VMMC, as TWL6030 + reset sequence for this signal does not comply + with the SD specification. + type: boolean + unevaluatedProperties: false required: @@ -131,9 +219,84 @@ examples: compatible = "ti,twl6030"; reg = <0x48>; interrupts = <39>; /* IRQ_SYS_1N cascaded to gic */ + interrupt-parent = <&gic>; interrupt-controller; #interrupt-cells = <1>; - interrupt-parent = <&gic>; + + gpadc { + compatible = "ti,twl6030-gpadc"; + interrupts = <6>; + }; + + rtc { + compatible = "ti,twl4030-rtc"; + interrupts = <8>; + }; + + regulator-vaux1 { + compatible = "ti,twl6030-vaux1"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <3000000>; + }; + + regulator-vmmc1 { + compatible = "ti,twl6030-vmmc"; + ti,retain-on-reset; + }; }; }; + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@48 { + compatible = "ti,twl4030"; + reg = <0x48>; + interrupts = <7>; /* SYS_NIRQ cascaded to intc */ + interrupt-parent = <&intc>; + interrupt-controller; + #interrupt-cells = <1>; + + bci { + compatible = "ti,twl4030-bci"; + interrupts = <9>, <2>; + bci3v1-supply = <&vusb3v1>; + io-channels = <&twl_madc 11>; + io-channel-names = "vac"; + }; + + twl_madc: madc { + compatible = "ti,twl4030-madc"; + interrupts = <3>; + #io-channel-cells = <1>; + }; + + pwrbutton { + compatible = "ti,twl4030-pwrbutton"; + interrupts = <8>; + }; + + rtc { + compatible = "ti,twl4030-rtc"; + interrupts = <11>; + }; + + regulator-vaux1 { + compatible = "ti,twl4030-vaux1"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <3000000>; + regulator-initial-mode = <0xe>; + }; + + vusb3v1: regulator-vusb3v1 { + compatible = "ti,twl4030-vusb3v1"; + }; + + watchdog { + compatible = "ti,twl4030-wdt"; + }; + }; + }; +... diff --git a/Documentation/devicetree/bindings/regulator/twl-regulator.txt b/Documentation/devicetree/bindings/regulator/twl-regulator.txt deleted file mode 100644 index 549f80436deb..000000000000 --- a/Documentation/devicetree/bindings/regulator/twl-regulator.txt +++ /dev/null @@ -1,80 +0,0 @@ -TWL family of regulators - -Required properties: -For twl6030 regulators/LDOs -- compatible: - - "ti,twl6030-vaux1" for VAUX1 LDO - - "ti,twl6030-vaux2" for VAUX2 LDO - - "ti,twl6030-vaux3" for VAUX3 LDO - - "ti,twl6030-vmmc" for VMMC LDO - - "ti,twl6030-vpp" for VPP LDO - - "ti,twl6030-vusim" for VUSIM LDO - - "ti,twl6030-vana" for VANA LDO - - "ti,twl6030-vcxio" for VCXIO LDO - - "ti,twl6030-vdac" for VDAC LDO - - "ti,twl6030-vusb" for VUSB LDO - - "ti,twl6030-v1v8" for V1V8 LDO - - "ti,twl6030-v2v1" for V2V1 LDO - - "ti,twl6030-vdd1" for VDD1 SMPS - - "ti,twl6030-vdd2" for VDD2 SMPS - - "ti,twl6030-vdd3" for VDD3 SMPS -For twl6032 regulators/LDOs -- compatible: - - "ti,twl6032-ldo1" for LDO1 LDO - - "ti,twl6032-ldo2" for LDO2 LDO - - "ti,twl6032-ldo3" for LDO3 LDO - - "ti,twl6032-ldo4" for LDO4 LDO - - "ti,twl6032-ldo5" for LDO5 LDO - - "ti,twl6032-ldo6" for LDO6 LDO - - "ti,twl6032-ldo7" for LDO7 LDO - - "ti,twl6032-ldoln" for LDOLN LDO - - "ti,twl6032-ldousb" for LDOUSB LDO - - "ti,twl6032-smps3" for SMPS3 SMPS - - "ti,twl6032-smps4" for SMPS4 SMPS - - "ti,twl6032-vio" for VIO SMPS -For twl4030 regulators/LDOs -- compatible: - - "ti,twl4030-vaux1" for VAUX1 LDO - - "ti,twl4030-vaux2" for VAUX2 LDO - - "ti,twl5030-vaux2" for VAUX2 LDO - - "ti,twl4030-vaux3" for VAUX3 LDO - - "ti,twl4030-vaux4" for VAUX4 LDO - - "ti,twl4030-vmmc1" for VMMC1 LDO - - "ti,twl4030-vmmc2" for VMMC2 LDO - - "ti,twl4030-vpll1" for VPLL1 LDO - - "ti,twl4030-vpll2" for VPLL2 LDO - - "ti,twl4030-vsim" for VSIM LDO - - "ti,twl4030-vdac" for VDAC LDO - - "ti,twl4030-vintana2" for VINTANA2 LDO - - "ti,twl4030-vio" for VIO LDO - - "ti,twl4030-vdd1" for VDD1 SMPS - - "ti,twl4030-vdd2" for VDD2 SMPS - - "ti,twl4030-vintana1" for VINTANA1 LDO - - "ti,twl4030-vintdig" for VINTDIG LDO - - "ti,twl4030-vusb1v5" for VUSB1V5 LDO - - "ti,twl4030-vusb1v8" for VUSB1V8 LDO - - "ti,twl4030-vusb3v1" for VUSB3V1 LDO - -Optional properties: -- Any optional property defined in bindings/regulator/regulator.txt -For twl4030 regulators/LDOs: - - regulator-initial-mode: - - 0x08 - Sleep mode, the nominal output voltage is maintained with low power - consumption with low load current capability. - - 0x0e - Active mode, the regulator can deliver its nominal output voltage - with full-load current capability. - -Example: - - xyz: regulator@0 { - compatible = "ti,twl6030-vaux1"; - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <3000000>; - }; - -For twl6030 regulators/LDOs: - - - ti,retain-on-reset: Does not turn off the supplies during warm - reset. Could be needed for VMMC, as TWL6030 - reset sequence for this signal does not comply - with the SD specification. -- 2.39.2