From patchwork Wed Oct 16 05:29:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Delphine CC Chiu X-Patchwork-Id: 836908 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2061.outbound.protection.outlook.com [40.107.117.61]) (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 61F3821E3A4; Wed, 16 Oct 2024 05:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729056600; cv=fail; b=Ur4LT/XdrAEOdnoMJ1s9vw79k8Cfr8Z1BhS4xz1b37DqGiEix+GvPe897cPa4hVIp9NN3QIrrdsvefnR5j/nxESd84zEQGYzGBY7Xyxqd58YRmwxPgsPgSzaz0oukoOyweI7M65v1o2i9TPzIS5IqlC6xP8togdAl4K+S3//a1Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729056600; c=relaxed/simple; bh=IYNNq9ETj6LsRe/zOGH/06DYlUnh0KlvmcGavKRr9KE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=Hp/eOhYbhZE5w5v01VCRr9pqxkAovWSzMPn4hFgy977/sAbfTU53AnmvU62I/yfU5MSW0SGEPUjoT/rf3mgEuQT2kCcE463d+PGKwf8mL/ZvT2HQbyzEpPqiE+zJ9f+cwF5eAw0769z4DXbVtCRx/yP9MO2VTA+/1k6H81oUImo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wiwynn.com; spf=pass smtp.mailfrom=wiwynn.com; dkim=pass (2048-bit key) header.d=wiwynn.com header.i=@wiwynn.com header.b=0gPC92Ck; arc=fail smtp.client-ip=40.107.117.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wiwynn.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wiwynn.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wiwynn.com header.i=@wiwynn.com header.b="0gPC92Ck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bqL4R4z+AaBgmg2maR4txqXu1CuqAaUXPXkfKCqRlYVjBhpGvL9iM+N/aW79XBt7y6Qv3QLdCgWWUKc/in99k8ZARfVaqvXEK3jDjVzz9DlrxkXY+7enJ1Ndw9e0xIZc1QFwDgbSukYwW0km5OMZrYJIZRWeKLTb2lrxN0L0qecTlFSc6X02kZfvJ/7scfPC4CRNvcLIv93bXc4GnivGkU+7xGNlXW+ulADZlFtBG37fM9Qcs/Ny5o6jK9h/Z+7ymZDisdgddCIT/EueyaC1p6DC7Lk5LtwLn4Qd1Y3yG5QxBYrSYEq6nMPE7gdxYFW40d9Vs3WW4HK7+SxVHPoI7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PhMvkrhpT8ytdqaVo9xCyEFm0+nnbXsTERnt0FspZec=; b=vEiyDY1fFea4kiYrIUdvKCgd5q80lUQahCb4kG4rnGgqvpdpeuWZdCj8qYBMIA5n+t0/aKQVaOYIlju7kRmy4wxcBWGDNEuaBZPkAulwxwl4SeI7BpPAm6p2IdIP+S33E5LCK1UqCkyaKveUQtdXwsiXz5Db22E40mEn2oQDGaL71iDkixAX7Af3nVw5I2CbUKA4M7ghNpyLKfDxy/9/IS9vwr8yd+7YHHaaX1DOgTv7w5Tbcctl+IfwOBwt066/zffQF5YPpqP8zU52g57jjSirMDZmJzVZxcWOAq6Y9a2VP76bP6ECV4Zjtd3AG+iWbAkjY4m/VjvfFX3u9N2RYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 211.20.1.79) smtp.rcpttodomain=stwcx.xyz smtp.mailfrom=wiwynn.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=wiwynn.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wiwynn.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PhMvkrhpT8ytdqaVo9xCyEFm0+nnbXsTERnt0FspZec=; b=0gPC92Ck8FBMZLipybBbQGbMvdGCTiV1vap1qYuPBRi+7fwes60VXsOmMDh5kPqaArxHaCRSlERR+DhH3HMfnM+0uHQVl1vD30UuOodlLosho9HP2BT834PZUWpEo0uQwF8gQ9kNLCGnzIj8MBIsxgMNgaNJQMvLNXIQD6otn1b9gnzRQpkFJpBJHtB897h8g4pXPxMyZwidQ+PTPUg06EF7h6xOC8coPYdOKCFGPwhqrm7IEuZKmlpTPu7A65bVSyBlHSa/u2rolux0Fqx+3Papl4zeRHqF2WHadnPuCX9A44AgITxebAIf4vBd2NHmgMF/kai/EcDYyAfjAt7mWg== Received: from SG2PR01CA0191.apcprd01.prod.exchangelabs.com (2603:1096:4:189::6) by SEZPR04MB6478.apcprd04.prod.outlook.com (2603:1096:101:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Wed, 16 Oct 2024 05:29:51 +0000 Received: from SG1PEPF000082E7.apcprd02.prod.outlook.com (2603:1096:4:189:cafe::3) by SG2PR01CA0191.outlook.office365.com (2603:1096:4:189::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18 via Frontend Transport; Wed, 16 Oct 2024 05:29:22 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 211.20.1.79) smtp.mailfrom=wiwynn.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=wiwynn.com; Received-SPF: Fail (protection.outlook.com: domain of wiwynn.com does not designate 211.20.1.79 as permitted sender) receiver=protection.outlook.com; client-ip=211.20.1.79; helo=localhost.localdomain; Received: from localhost.localdomain (211.20.1.79) by SG1PEPF000082E7.mail.protection.outlook.com (10.167.240.10) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Wed, 16 Oct 2024 05:29:49 +0000 From: Delphine CC Chiu To: patrick@stwcx.xyz, Pavel Machek , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nate Case Cc: Ricky CX Wu , Delphine CC Chiu , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] dt-bindings: leds: pca955x: Convert text bindings to YAML Date: Wed, 16 Oct 2024 13:29:38 +0800 Message-Id: <20241016052941.416034-1-Delphine_CC_Chiu@wiwynn.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG1PEPF000082E7:EE_|SEZPR04MB6478:EE_ X-MS-Office365-Filtering-Correlation-Id: 187a791d-4919-4df3-a00c-08dceda38e5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|7416014|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: AyvuLqP2rxzUmriie7yo4JAYXZ+fid4FaOquwJ7P2Nxoo90L1UZ70++7veNr3N7hT0QhWHSbqbAXF8xXtN5w3H1SCi4oF9yyDnh9b3taHxqFsmXxZd3+fmuSSOHbtdcjhqUNVdtAbs/H5W/NebD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ERccZrX2H9oodN8GtBs/U60TVcf5kwWAwSmukbhM6BDlP4h4AxQUcSMA5U+/oo1IKAijEsJaJJqNA5ll1Xj7F26J+ZfE4kbddaKplWxyKZpymXgM+c4CYlvXoEcKU1N2GIQMMm+/fR X-Forefront-Antispam-Report: CIP:211.20.1.79; CTRY:TW; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:211-20-1-79.hinet-ip.hinet.net; CAT:NONE; SFS:(13230040)(36860700013)(7416014)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: wiwynn.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 05:29:49.6820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 187a791d-4919-4df3-a00c-08dceda38e5f X-MS-Exchange-CrossTenant-Id: da6e0628-fc83-4caf-9dd2-73061cbab167 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=da6e0628-fc83-4caf-9dd2-73061cbab167; Ip=[211.20.1.79]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: SG1PEPF000082E7.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6478 From: Ricky CX Wu Convert the text bindings of pca955x to YAML so it could be used to validate the DTS. Signed-off-by: Ricky CX Wu Signed-off-by: Delphine CC Chiu --- .../devicetree/bindings/leds/leds-pca955x.txt | 89 ---------- .../devicetree/bindings/leds/nxp,pca955x.yaml | 161 ++++++++++++++++++ 2 files changed, 161 insertions(+), 89 deletions(-) delete mode 100644 Documentation/devicetree/bindings/leds/leds-pca955x.txt create mode 100644 Documentation/devicetree/bindings/leds/nxp,pca955x.yaml diff --git a/Documentation/devicetree/bindings/leds/leds-pca955x.txt b/Documentation/devicetree/bindings/leds/leds-pca955x.txt deleted file mode 100644 index 817f460f3a72..000000000000 --- a/Documentation/devicetree/bindings/leds/leds-pca955x.txt +++ /dev/null @@ -1,89 +0,0 @@ -* NXP - pca955x LED driver - -The PCA955x family of chips are I2C LED blinkers whose pins not used -to control LEDs can be used as general purpose I/Os. The GPIO pins can -be input or output, and output pins can also be pulse-width controlled. - -Required properties: -- compatible : should be one of : - "nxp,pca9550" - "nxp,pca9551" - "nxp,pca9552" - "ibm,pca9552" - "nxp,pca9553" -- #address-cells: must be 1 -- #size-cells: must be 0 -- reg: I2C slave address. depends on the model. - -Optional properties: -- gpio-controller: allows pins to be used as GPIOs. -- #gpio-cells: must be 2. -- gpio-line-names: define the names of the GPIO lines - -LED sub-node properties: -- reg : number of LED line. - from 0 to 1 for the pca9550 - from 0 to 7 for the pca9551 - from 0 to 15 for the pca9552 - from 0 to 3 for the pca9553 -- type: (optional) either - PCA955X_TYPE_NONE - PCA955X_TYPE_LED - PCA955X_TYPE_GPIO - see dt-bindings/leds/leds-pca955x.h (default to LED) -- label : (optional) - see Documentation/devicetree/bindings/leds/common.txt -- linux,default-trigger : (optional) - see Documentation/devicetree/bindings/leds/common.txt - -Examples: - -pca9552: pca9552@60 { - compatible = "nxp,pca9552"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x60>; - - gpio-controller; - #gpio-cells = <2>; - gpio-line-names = "GPIO12", "GPIO13", "GPIO14", "GPIO15"; - - gpio@12 { - reg = <12>; - type = ; - }; - gpio@13 { - reg = <13>; - type = ; - }; - gpio@14 { - reg = <14>; - type = ; - }; - gpio@15 { - reg = <15>; - type = ; - }; - - led@0 { - label = "red:power"; - linux,default-trigger = "default-on"; - reg = <0>; - type = ; - }; - led@1 { - label = "green:power"; - reg = <1>; - type = ; - }; - led@2 { - label = "pca9552:yellow"; - reg = <2>; - type = ; - }; - led@3 { - label = "pca9552:white"; - reg = <3>; - type = ; - }; -}; diff --git a/Documentation/devicetree/bindings/leds/nxp,pca955x.yaml b/Documentation/devicetree/bindings/leds/nxp,pca955x.yaml new file mode 100644 index 000000000000..70f8c1dfa75a --- /dev/null +++ b/Documentation/devicetree/bindings/leds/nxp,pca955x.yaml @@ -0,0 +1,161 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/nxp,pca955x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP PCA955X LED controllers + +maintainers: + - Nate Case + +description: | + The PCA955x family of chips are I2C LED blinkers whose pins not used + to control LEDs can be used as general purpose I/Os. The GPIO pins can + be input or output, and output pins can also be pulse-width controlled. + + For more product information please see the link below: + - https://www.nxp.com/docs/en/data-sheet/PCA9552.pdf + +properties: + compatible: + enum: + - nxp,pca9550 + - nxp,pca9551 + - nxp,pca9552 + - ibm,pca9552 + - nxp,pca9553 + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + gpio-controller: true + + gpio-line-names: + minItems: 1 + maxItems: 16 + + '#gpio-cells': + const: 2 + +patternProperties: + "^led@[0-9a-f]+$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + type: + description: | + Output configuration, see include/dt-bindings/leds/leds-pca955x.h + $ref: /schemas/types.yaml#/definitions/uint32 + default: 0 + minimum: 0 + maximum: 4 + + required: + - reg + +allOf: + - if: + properties: + compatible: + contains: + enum: + - nxp,pca9550 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + maximum: 1 + else: + if: + properties: + compatible: + contains: + enum: + - nxp,pca9551 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + maximum: 7 + else: + if: + properties: + compatible: + contains: + enum: + - nxp,pca9552 + - ibm,pca9552 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + maximum: 15 + else: + if: + properties: + compatible: + contains: + enum: + - nxp,pca9553 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + maximum: 3 + +additionalProperties: false + +examples: + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@60 { + compatible = "nxp,pca9552"; + reg = <0x60>; + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + label = "red:power"; + linux,default-trigger = "default-on"; + type = ; + }; + led@1 { + reg = <1>; + label = "green:power"; + type = ; + }; + led@2 { + reg = <2>; + label = "pca9552:yellow"; + type = ; + }; + led@3 { + reg = <3>; + label = "pca9552:white"; + type = ; + }; + }; + }; + +...