From patchwork Mon Aug 19 04:58:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 13767905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F33FAC3DA4A for ; Mon, 19 Aug 2024 05:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2rL9e50K+KTD0iWv/ZJJXKGxKFtaByRAx8vVdC/BQNE=; b=iKMe2FFGqdHwidlc8fc0Vner6Q /GvT0gPGn8wRIsax5NmIsiz0DWLbuoHfdqSY+xGvzHFBmAgR7b7Bt5KuqayMvycZm9yPlIHWpXpEz eUOp8LdhOwAPAo7NvnanEOyL3XEyPbfV5q8RqbR7SCpXhzulNkQixS9ZY7hA8C5HFtX0KVii/c5m4 tiNCLvx3+5IsHcSZlKl+kAj2/MD0DtQ2TkJscZ++uAeA1lM86MwHKtmIKmk0h6kcAL+IZWtLKPry+ OiPAZsXFAIq2F8SjaeSNFZK8OJYziyhGGZvsh9C2Yya5jiQwNqh7pARgmbxHJjqzMt/FANDAtZh5t VAxjStHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sfuZn-00000000NBk-2EBm; Mon, 19 Aug 2024 05:05:07 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sfuTV-00000000LZ8-1WIw for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 04:58:38 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-201df0b2df4so30677865ad.0 for ; Sun, 18 Aug 2024 21:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724043517; x=1724648317; darn=lists.infradead.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=2rL9e50K+KTD0iWv/ZJJXKGxKFtaByRAx8vVdC/BQNE=; b=MUSiHwO3G1NQO8Thmt5LuV9lvxsK7nUQW9rBVwkiFcbVPEtMU5y+d+Al/dKgeOxUAi yiVkC/xwVxv9YLtAUMjTzVPGQAZJqH/0d/zK1EYnzLAlMZi5gpjxiLTd+hRPTx8lHYjR hhoLwGe48F8xob6R8PK2jZhp3OtME6p4OTsyu8QxR6N/fTVutnAfPIp5G7XJbZMem1rz J5pfZxEmgBVevRJSggOXqfNgVRW13Aak/0rDrW1374JAGfc5eYXLdIn+uHB8ODck6I3q HOgyS4llXFcJuWeb0ZAas56NnjbAcU+Fdt4ZmT0hiNP+BRbhvG6Q27KcSJcSjg6VASpB s81w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724043517; x=1724648317; 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=2rL9e50K+KTD0iWv/ZJJXKGxKFtaByRAx8vVdC/BQNE=; b=RI1OrazD/1gq1BuoGppuMPjiaxyQWbKDPkG0eJX3dy8i17g3siJksSFRs8x7sus+GT NBhJf3E8P3mTENRKZi1TCa0TgWucaXnPSgwfPXkljpP2bHvQGHvkidU2TBREmICsh61J 3t859b84nbhsj0YvK2n2FRjeYESsjFwrBFnFgNn9KzQ1YpO+WMMwJMvAXgxNxYAMd6fb ITrnBdgdgr3Z3R2G1OHpjwOzVQetgUbYi4Np2tuCCtNUd5s6sZcDL2Sa3BVUoZ9V6hT+ tSFIvAn1jZlgZjMfk5i699cHrDqG6Szeo1rhYBrrnTLLlBXXxC5y5WQaznbI1OakPoYw rUVA== X-Forwarded-Encrypted: i=1; AJvYcCV5QA9nKNEcGxqrQtyv11N9XT4ZC4JdDdFxc4GxKxc8WkBdNqtPHBMV5CFRLpxGKeQrTQzTN0siv0jKNsPn88N/rpkpaZrfbviw7sKyPnYJ/Qg373A= X-Gm-Message-State: AOJu0YyleeaIr2sk/SNfxO11WqxqH2NiwgWNwk5gaIlFbh0JU8kCalTK DeLY1Blpzf2zuExIUXWTyxsWKL8Dp476kT2SvZT1CRIVqc1AB+0b X-Google-Smtp-Source: AGHT+IHRfw+SZ9RF2mv8HemU9qcOBYNa4aOGEE+5+suKU5vhvp5qcT10dqeZbTjbknB4zaBQdB79yA== X-Received: by 2002:a17:902:f988:b0:201:ff75:fa3a with SMTP id d9443c01a7336-20203ea01c9mr85637105ad.23.1724043516489; Sun, 18 Aug 2024 21:58:36 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:4eb5:4500:6efc:6c24]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-202068497b4sm43483445ad.269.2024.08.18.21.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2024 21:58:36 -0700 (PDT) From: Dmitry Torokhov To: Arnd Bergmann , Mark Brown , Krzysztof Kozlowski Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 09/14] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding Date: Sun, 18 Aug 2024 21:58:06 -0700 Message-ID: <20240819045813.2154642-10-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog In-Reply-To: <20240819045813.2154642-1-dmitry.torokhov@gmail.com> References: <20240819045813.2154642-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240818_215837_424894_E0398C0D X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The binding with a sub-node per each key is very verbose and is hard to use with static device properties. Allow standard matrix keymap binding in addition to the verbose one. Signed-off-by: Dmitry Torokhov --- .../input/samsung,s3c6410-keypad.yaml | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml index a53569aa0ee7..28a318a0ff7e 100644 --- a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml +++ b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml @@ -16,6 +16,10 @@ description: maintainers: - Krzysztof Kozlowski +allOf: + - $ref: input.yaml# + - $ref: matrix-keymap.yaml# + properties: compatible: enum: @@ -37,6 +41,10 @@ properties: wakeup-source: true + keypad,num-columns: true + keypad,num-rows: true + linux,keymap: true + linux,input-no-autorepeat: type: boolean description: @@ -81,12 +89,33 @@ patternProperties: - keypad,row - linux,code +dependencies: + linux,keymap: + required: + - keypad,num-columns + - keypad,num-rows + required: - compatible - reg - interrupts - - samsung,keypad-num-columns - - samsung,keypad-num-rows + +if: + required: + - linux,keymap +then: + properties: + samsung,keypad-num-columns: false + samsung,keypad-num-rows: false + patternProperties: + '^key-[0-9a-z]+$': false +else: + properties: + keypad,num-columns: false + keypad,num-rows: false + required: + - samsung,keypad-num-columns + - samsung,keypad-num-rows additionalProperties: false @@ -94,8 +123,9 @@ examples: - | #include #include + #include - keypad@100a0000 { + keypad1@100a0000 { compatible = "samsung,s5pv210-keypad"; reg = <0x100a0000 0x100>; interrupts = ; @@ -119,3 +149,24 @@ examples: linux,code = <3>; }; }; + - | + #include + #include + #include + + keypad2@100a0000 { + compatible = "samsung,s5pv210-keypad"; + reg = <0x100a0000 0x100>; + interrupts = ; + clocks = <&clock CLK_KEYIF>; + clock-names = "keypad"; + + keypad,num-rows = <2>; + keypad,num-columns = <8>; + linux,keymap = < + MATRIX_KEY(0, 3, 2) + MATRIX_KEY(0, 4, 3) + >; + linux,input-no-autorepeat; + wakeup-source; + };