From patchwork Tue Jul 26 12:56:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593866 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 197E4CCA489 for ; Tue, 26 Jul 2022 12:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238906AbiGZM4e (ORCPT ); Tue, 26 Jul 2022 08:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238881AbiGZM4c (ORCPT ); Tue, 26 Jul 2022 08:56:32 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDF54255B8 for ; Tue, 26 Jul 2022 05:56:30 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id b26so20054345wrc.2 for ; Tue, 26 Jul 2022 05:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=70sJgJ6M2wTNfwQJ3+bkMBP++3esJkgb8mg1Y3AHAIo=; b=uCZGOkTjzgvg0EGIHfkTrXgEILq36uTtM8gTe/90Li/u6m4RWaLWhuE1JMgp4sVdhr nBXnHLsXXOSeWLOXJ0FHTchVsF9rcMEgC/i0gCjYVVr94LcSaaLfvzCO7IgEm6rgyvzr cHcVisccg3W7PRg2j5JgRfCXS0pURtzJ3xznFjVv9JkQuDji612ViwKLyhfEqURzfe6A vtDiOLM5MrqxfyIKhvHxStZnugMbFV0bqOcHCehraaKtBEtpq4G9hPuuQhui/zF0etoQ gEZ16hmESIpCnRqhX4ISn5i9n4a/lIjwdW1DzbNJfd5JHGDAKrckY0f1xaUZ5BpCCvIo wvbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=70sJgJ6M2wTNfwQJ3+bkMBP++3esJkgb8mg1Y3AHAIo=; b=W1nHYoxhcxOuYEQk13mI/V5hOplfV6kkUTbK3/KE/rxyc7je2kIF348JYratXR1ABa kXmhW+ErCZRnPkRy9js/2PTBWIf9xfRr4Atla4HlVd8yoo1+6Hx+e7ZtrXjvHCsr1B+9 mPyI+j+rxnb2W3OfpWXupX5Qxk8cX5sG7pLuz0A2D9jKfGa4nGWSnNgxPKg5tVTswFiF YOW8QmcTyFXTDloI1aBg7xyRvY06QfDTx4f6XKksWc8taNeRaRpQd0H8LVx9jxIaB1lM 1xzIi11XeHGxlrNXXSB218AcLQkaYigkcNl2dr/Mxm00VH30uBfDxit62ppAiige5tga /+lg== X-Gm-Message-State: AJIora+uQ3sN9MsZVebLMyyt+KyziUgOJM6VLRhNljHp0i9DwgUrdR4t Xff6GF2Ktc9D2Y3IvIhQwCiLqQ== X-Google-Smtp-Source: AGRyM1vh+7xD0uRlVRAT6+8Kk92s+Z9rVWNc12KDQ9vbMZkTR+6hQDfwJmTnKb4erZvbSYKsoe4YNA== X-Received: by 2002:adf:e192:0:b0:21d:62ee:ef10 with SMTP id az18-20020adfe192000000b0021d62eeef10mr11127350wrb.693.1658840189248; Tue, 26 Jul 2022 05:56:29 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:28 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:06 +0200 Subject: [PATCH v2 1/7] MAINTAINERS: input: add mattijs for mt6779-keypad MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-1-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org As stated in [1]: Fengping has no longer interest and time to maintain this driver so he agreed to transfer maintainership over to me. Add a dedicated maintainer entry as well for the driver to make sure that I can help with patch reviews. [1] https://lore.kernel.org/r/20220421140255.2781505-1-mkorpershoek@baylibre.com Signed-off-by: Mattijs Korpershoek diff --git a/MAINTAINERS b/MAINTAINERS index 1de6a8fbf0a8..f2f0696caf6a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12805,6 +12805,12 @@ S: Supported F: Documentation/devicetree/bindings/media/mediatek-jpeg-*.yaml F: drivers/media/platform/mediatek/jpeg/ +MEDIATEK KEYPAD DRIVER +M: Mattijs Korpershoek +S: Supported +F: Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml +F: drivers/input/keyboard/mt6779-keypad.c + MEDIATEK MDP DRIVER M: Minghsiu Tsai M: Houlong Wei From patchwork Tue Jul 26 12:56:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593593 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36806CCA48B for ; Tue, 26 Jul 2022 12:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238863AbiGZM4e (ORCPT ); Tue, 26 Jul 2022 08:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238896AbiGZM4d (ORCPT ); Tue, 26 Jul 2022 08:56:33 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19944255AC for ; Tue, 26 Jul 2022 05:56:32 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id q18so9604879wrx.8 for ; Tue, 26 Jul 2022 05:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=CDEPpnFfFeQNRb6h6qaD2GBuBJjRD788qOFTnSwzmr8=; b=FlHwpR/BGdgeA1Qo4EPCLGZN9pJSYx3Shj8vGvPfjgcvjNQGVL50PDnnpy/7cfmHHC W/dUzWuhGJmzIjpmlXsRbdpsBFivMx4GbzsXMA3Dlo22lTILBBElionRNVHKILNRfgQ1 0PoOv+/1cKxGPYQe1NG9r4B0V/F+1NOUsGej+RnyQ4JzvvWCZJE1isN/yWhM3paK/yF6 9Dml/P6kNoPbaTA69UFHrKxZlQqihJelbV1q2/l5KKv6fsI+sLdtmcXZ+F82bF0/drpN 7tfND2OUcC0bTi5J6lW5oMGiEdlVignPik5jBiFK9wMpEUCy5q69zBavlMiDANCUBGk4 JRjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=CDEPpnFfFeQNRb6h6qaD2GBuBJjRD788qOFTnSwzmr8=; b=EDfPVxw6lJBZ9cWEmAPmaYRGDZ4eCslAYfBt6JldYXyq5VqnSa7jW1MiofHJ5dTaYh vUJmWZJpccqCHSwYR41njIFs7k7qd9HmrGVeJE7SuezoZm5iI0yylds+yKdo5KkN9HRB abkAG3MaNEf7rhmaPpXb9m63ntI9dTRmeIDAnG8oC5ahH8UBY2y0Z4QYh6yWqWXf0DtB YCSH/myoWi0SfdIm9dT7aHm8DRVOzyvv8tifXjCAbT9DZf5sPWapEBunwNOnmvW8lz5U MQhVLO1sczBI74vmOIJmmJdgE9isTDchcrFuqO08FJAoaplbl6hhK4YuU5aNWln6YZHQ q9JA== X-Gm-Message-State: AJIora8xSdLgHdH/BWuwsbKQDP+2G9ap2kW2jRGCxjT3ssMmaOVKJSwl ApGrdA5qF20V8czFFXqWmxe5Eg== X-Google-Smtp-Source: AGRyM1sLSFIrbCMWof8a52ULbmaqJoWBEBO19cwgtC1nBgI86bN7MgA7Xp4VETkGqmgn11gRmyyQaA== X-Received: by 2002:adf:fd8f:0:b0:21e:bcb4:f731 with SMTP id d15-20020adffd8f000000b0021ebcb4f731mr199816wrr.537.1658840190488; Tue, 26 Jul 2022 05:56:30 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:30 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:07 +0200 Subject: [PATCH v2 2/7] dt-bindings: mediatek,mt6779-keypad: use unevaluatedProperties MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-2-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org writing-bindings.rst states: > - If schema includes other schema (e.g. /schemas/i2c/i2c-controller.yaml) use > "unevaluatedProperties:false". In other cases, usually use > "additionalProperties:false". All 3 properties from matrix-keymap.yaml are valid for the MediaTek keypad: * keypad,num-rows and keypad,num-cols configure the KP_SEL register * linux,keymap represents the (at most) 8x8 hardware matrix Signed-off-by: Mattijs Korpershoek diff --git a/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml b/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml index 03ebd2665d07..ca8ae40a73f7 100644 --- a/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml +++ b/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml @@ -56,7 +56,7 @@ required: - clocks - clock-names -additionalProperties: false +unevaluatedProperties: false examples: - | From patchwork Tue Jul 26 12:56:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593592 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 077C7CCA490 for ; Tue, 26 Jul 2022 12:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238655AbiGZM4g (ORCPT ); Tue, 26 Jul 2022 08:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238242AbiGZM4e (ORCPT ); Tue, 26 Jul 2022 08:56:34 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 001B625C73 for ; Tue, 26 Jul 2022 05:56:32 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id v17so1088410wrr.10 for ; Tue, 26 Jul 2022 05:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=x4rd2qMk0FSrQt9Tp0ZdFh0cgNgJW8TRDOygBl1e4h8=; b=jBV9Ngo00RRoTUt2Xj5EYf/dE7L2U6bM74cr7SdwSryF4TUdRF1/eYGJr24ZvLjOlb QUskTKO7LRHcn+sdJZ3dlJOAPsmTAXCxNky0QjNdgrMFQVB8KsdPEn7STZTnADd3SMVe IrLjc8eCQ+ATkshZj9pm9LJ6QNSyxhQE0ilkKiYgTZIb7HXL77wkLY6VsxGiwzI84BRj UlTUnPpGrnYPhK00P1ysdWbDxJSvNJ9hjxZI8R3s4fiA17U7Hyy40oNHdeULJbX7f5XQ k99JyD9NV+/jcOZO4DrWF4XY0lLGnWCNXIXNdgwq4W6To6zT/djTDwRuLP4BRTJWPsu5 ai1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=x4rd2qMk0FSrQt9Tp0ZdFh0cgNgJW8TRDOygBl1e4h8=; b=8MjwfiQjJMtfmBvFw5pKdPiQlmlBplXuvD9fLX2WygEHnco/fr9FCD6Pv8sVEAPw7T fjfC/HbCwcwZM1p9q5I0TX4Vgia/LwUQF1OVFDbJFxn9mLRjiEDwYwkWmQngaVfdSltD GL9P+XaHw6byrtQracTo01tQ2wke+nBj4lDXh3CLJ/TK701/y/C16Oq02Yp+4OJavoeW IddLQv8BH9dkSROm0THblePnJ9dHwejGsqE3FhsSLpychnbaxh1jN1I8ELItgjMnxghe sAc//CeSCk9HFNLNiLETzb8Abj1I0mZnGHuDI4Agt3+wFdCBuxeuCExqKWWnBPCkObtN MChg== X-Gm-Message-State: AJIora9mm8+zupP3Qf+uPw7Ohm/h9BJFuhi4KexKIadtvgAisGIYxLjj jwAMn110KXY3hNkZred3cIxOcw== X-Google-Smtp-Source: AGRyM1uKvnBcknnv711COXWaOOlOVb5UPvyj/NuyjcwMG8AesFqGx+UzkQqX5RP1klFJxFLrocFwFA== X-Received: by 2002:adf:ef8d:0:b0:21e:a5e3:35af with SMTP id d13-20020adfef8d000000b0021ea5e335afmr2009077wro.671.1658840191473; Tue, 26 Jul 2022 05:56:31 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:31 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:08 +0200 Subject: [PATCH v2 3/7] dt-bindings: mediatek,mt6779-keypad: add mediatek,keys-per-group MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-3-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The MediaTek keypad has 2 modes of detecting key events: * single key: each (row, column) can detect one key * double key: each (row, column) is a group of 2 keys With double key, two keys are physically wired to one (row, column) pin. These keys are in the same "group". Multiple keys in the same group reduces the number of pins which minimizes cost. Add a keys-per-group property to describe this. Signed-off-by: Mattijs Korpershoek Reviewed-by: Krzysztof Kozlowski diff --git a/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml b/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml index ca8ae40a73f7..387d0448ff77 100644 --- a/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml +++ b/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml @@ -49,6 +49,12 @@ properties: maximum: 256 default: 16 + mediatek,keys-per-group: + description: each (row, column) group has multiple keys + $ref: /schemas/types.yaml#/definitions/uint32 + default: 1 + maximum: 2 + required: - compatible - reg From patchwork Tue Jul 26 12:56:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593865 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6C99CCA47E for ; Tue, 26 Jul 2022 12:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238888AbiGZM4i (ORCPT ); Tue, 26 Jul 2022 08:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238927AbiGZM4f (ORCPT ); Tue, 26 Jul 2022 08:56:35 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1835B255B7 for ; Tue, 26 Jul 2022 05:56:34 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id a18-20020a05600c349200b003a30de68697so945787wmq.0 for ; Tue, 26 Jul 2022 05:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=l4jlp8HIWV0/SRrpgeD2QZ+LASZjXbcoqy54oDuJlGI=; b=NADnXKatNswe0C+IvCk4tc03ZUzTZpk3sn84+xoWFiXrPT7GWye0NSZqFr6/NdWSMl 9/wwttzMyxUIRsDBbIdZOICfo12+KUVdTwlxduE0LVIfJEwHRpjrP+BQvWIwD92wltrf Z4JeojrM6kR0yRjW8ttUZB/sxfUIk7INP2z2HcsbEotWV+FhQuM+6LyvEhnxFGpljCbR NhKwNEpYDi2Cb9wOTklQu+nhfHDsfKGzzZ5mOy6hKjHIiiqKP/4uRpuHa1sfZUTiMfgs dhjvKJ2JvtAya2HRtktEp9b/RfFy9SPjNLaezvbyVO7g3ruZvijW7iUTKtjNG/cwLDXJ f67g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=l4jlp8HIWV0/SRrpgeD2QZ+LASZjXbcoqy54oDuJlGI=; b=GRLiJ6nHiID9Pu3JhUXTCkGgGmuyx4btGqpqS1luEkQ3QM0EQkod4kGhSrQwHMsri+ SliRLSioNI/zbqVvefuFRcylwXZsU7/TFXNv5yQUeHGB6Ifgrzxb0gOZnMGGRItLbssL rrNXSF2PT/jtVebFCJyV8SAuWnlpeGLFzjWW6DaqkwyjRbr+EJGP4AXK+aTqfaS9kj37 Cl3QVe8sa3lnnupJBB77hmCnlX88OKYVi9ygt4GgqQ1H+Hoigu6NS7OMrXD/+2Ug45oE /yx6eASHHcFBXjqZ4hq1wNCe98y/T9zBaR1cVcEiMff2iSN1HsXUO90QGMwQ0Wn2pfZZ Tedg== X-Gm-Message-State: AJIora8fNKI5eWQUJLd20eaWOn53E9rLFgnHKBSxRp3QxGWD09HV0AgP gOrOhTv8wu7sXc9Y/ltpEzp5Vw== X-Google-Smtp-Source: AGRyM1tJyMC7Q+SkCcyxEXUMIyPM4vmZWiT2BfgqRy3V7c+2kZ2ogfDtq4Kq/q1vb7+t2z0rbSWCXQ== X-Received: by 2002:a05:600c:1e27:b0:3a3:26dd:5757 with SMTP id ay39-20020a05600c1e2700b003a326dd5757mr3180782wmb.45.1658840192552; Tue, 26 Jul 2022 05:56:32 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:32 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:09 +0200 Subject: [PATCH v2 4/7] Input: mt6779-keypad - prepare double keys support with calc_row_col MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-4-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The MediaTek keypad can operate in two modes: single key or double key. The driver only supports single key mode. In double key mode, the row/column calculation based on the key is different. Add a calc_row_col function pointer which will be different based on single/double key mode. No functional change. Suggested-by: AngeloGioacchino Del Regno Signed-off-by: Mattijs Korpershoek diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c index bf447bf598fb..39c931974bde 100644 --- a/drivers/input/keyboard/mt6779-keypad.c +++ b/drivers/input/keyboard/mt6779-keypad.c @@ -31,6 +31,7 @@ struct mt6779_keypad { struct clk *clk; u32 n_rows; u32 n_cols; + void (*calc_row_col)(unsigned int key, unsigned int *row, unsigned int *col); DECLARE_BITMAP(keymap_state, MTK_KPD_NUM_BITS); }; @@ -67,8 +68,7 @@ static irqreturn_t mt6779_keypad_irq_handler(int irq, void *dev_id) continue; key = bit_nr / 32 * 16 + bit_nr % 32; - row = key / 9; - col = key % 9; + keypad->calc_row_col(key, &row, &col); scancode = MATRIX_SCAN_CODE(row, col, row_shift); /* 1: not pressed, 0: pressed */ @@ -94,6 +94,14 @@ static void mt6779_keypad_clk_disable(void *data) clk_disable_unprepare(data); } +static void mt6779_keypad_calc_row_col_single(unsigned int key, + unsigned int *row, + unsigned int *col) +{ + *row = key / 9; + *col = key % 9; +} + static int mt6779_keypad_pdrv_probe(struct platform_device *pdev) { struct mt6779_keypad *keypad; @@ -148,6 +156,8 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev) return -EINVAL; } + keypad->calc_row_col = mt6779_keypad_calc_row_col_single; + wakeup = device_property_read_bool(&pdev->dev, "wakeup-source"); dev_dbg(&pdev->dev, "n_row=%d n_col=%d debounce=%d\n", From patchwork Tue Jul 26 12:56:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593591 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF048CCA47E for ; Tue, 26 Jul 2022 12:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238999AbiGZM44 (ORCPT ); Tue, 26 Jul 2022 08:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238668AbiGZM4h (ORCPT ); Tue, 26 Jul 2022 08:56:37 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4BC0252BB for ; Tue, 26 Jul 2022 05:56:35 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id k11so19575639wrx.5 for ; Tue, 26 Jul 2022 05:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=tD4ST1GLkFfCdHd4u8ts0UQsGiLNPqXx0HKCsoNVuT4=; b=W3PAGeT94Vn3xX26lGfe1+Mze8r0I2iBziCUdIepLwzWyJcCogiZ1vOTm0eHPt5klL rk+K65pbpke7ZjTLRiJSZFeTSCqP1pXtcRFVHOUCGaXTCF6U1V5r1rrLbk11gAw3M42b lRdieESewrHcHaGkUS4QBvUd0j6rWb9aR6oIG0q4HH5r3RDCL0fpZS4eMnR+GO5pskrZ ldCnwO1Oi+XTVgQhz32OdRTwJORQJNeyil4llKTmwhrRBT9Aoo6nC+n6uKwDFiBDmn5d rtFhkaCCD7enY/2GIdh8vExjEntnpuY7TS2k/hqRFQoZGJvv3h2Anv9EGjjkydWvZY4J H31A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=tD4ST1GLkFfCdHd4u8ts0UQsGiLNPqXx0HKCsoNVuT4=; b=JE/ogULPatxBqP+jFkKBrvd6dQkM0HQeaueRFDEF0+YJIy6IQ5Uv3DVxzDZktQdVT1 gS48Bn4yDaEtxnboBtxb4DTV6ThNPKd1CRQ44pBuNelhdCIg8PdD1huCaVbml3XXoT8m emXjqJlUUnoUUp525n+wf3NhOn6JA7DMkUk+TSvuy+XGChV7VfFbyyLZLHe2Y3kWGIFy v1polMIrlYcBWozjdZDu/MmSOsFJ77/B7zv1r54s2ZvRGp2qaBLx22YNLAYw61+827M7 wTyCYYY5eeP3zT4h9+2z8ZGK5pqH15lzTJsrrIWRgAgwHclfFRhFEFlwY766n7uqMNvG di7w== X-Gm-Message-State: AJIora8dANbDnuJuiAASc+0l/T7evRGQ3v5eEeqsdkMK3iX6Gzu4teRh ZMe7KPfmubd5dqYajv8RB50ZuA== X-Google-Smtp-Source: AGRyM1vGYy9Kw+JfFrw9aIUXm7WvvvklWWEd28eEP4n/Z10dPqxoPZS1XDoRwK4BuI36L3XZc42XtQ== X-Received: by 2002:a05:6000:1d89:b0:21d:5655:eb72 with SMTP id bk9-20020a0560001d8900b0021d5655eb72mr10702395wrb.110.1658840193779; Tue, 26 Jul 2022 05:56:33 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:33 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:10 +0200 Subject: [PATCH v2 5/7] Input: mt6779-keypad - support double keys matrix MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-5-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org MediaTek keypad has 2 modes of detecting key events: - single key: each (row, column) can detect one key - double key: each (row, column) is a group of 2 keys Double key support exists to minimize cost, since it reduces the number of pins required for physical keys. Double key is configured by setting BIT(0) of the KP_SEL register. Enable double key matrix support based on the mediatek,keys-per-group device tree property. Signed-off-by: Mattijs Korpershoek diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c index 39c931974bde..f70b02396de4 100644 --- a/drivers/input/keyboard/mt6779-keypad.c +++ b/drivers/input/keyboard/mt6779-keypad.c @@ -18,6 +18,7 @@ #define MTK_KPD_DEBOUNCE_MASK GENMASK(13, 0) #define MTK_KPD_DEBOUNCE_MAX_MS 256 #define MTK_KPD_SEL 0x0020 +#define MTK_KPD_SEL_DOUBLE_KP_MODE BIT(0) #define MTK_KPD_SEL_COL GENMASK(15, 10) #define MTK_KPD_SEL_ROW GENMASK(9, 4) #define MTK_KPD_SEL_COLMASK(c) GENMASK((c) + 9, 10) @@ -102,12 +103,21 @@ static void mt6779_keypad_calc_row_col_single(unsigned int key, *col = key % 9; } +static void mt6779_keypad_calc_row_col_double(unsigned int key, + unsigned int *row, + unsigned int *col) +{ + *row = key / 13; + *col = (key % 13) / 2; +} + static int mt6779_keypad_pdrv_probe(struct platform_device *pdev) { struct mt6779_keypad *keypad; void __iomem *base; int irq; u32 debounce; + u32 keys_per_group; bool wakeup; int error; @@ -156,7 +166,20 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev) return -EINVAL; } - keypad->calc_row_col = mt6779_keypad_calc_row_col_single; + if (device_property_read_u32(&pdev->dev, "mediatek,keys-per-group", &keys_per_group)) + keys_per_group = 1; + + switch (keys_per_group) { + case 1: + keypad->calc_row_col = mt6779_keypad_calc_row_col_single; + break; + case 2: + keypad->calc_row_col = mt6779_keypad_calc_row_col_double; + break; + default: + dev_err(&pdev->dev, "Invalid keys-per-group: %d\n", keys_per_group); + return -EINVAL; + } wakeup = device_property_read_bool(&pdev->dev, "wakeup-source"); @@ -176,6 +199,10 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev) regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE, (debounce * (1 << 5)) & MTK_KPD_DEBOUNCE_MASK); + if (keys_per_group == 2) + regmap_update_bits(keypad->regmap, MTK_KPD_SEL, + MTK_KPD_SEL_DOUBLE_KP_MODE, MTK_KPD_SEL_DOUBLE_KP_MODE); + regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_ROW, MTK_KPD_SEL_ROWMASK(keypad->n_rows)); regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_COL, From patchwork Tue Jul 26 12:56:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593590 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27ADFC433EF for ; Tue, 26 Jul 2022 12:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238744AbiGZM46 (ORCPT ); Tue, 26 Jul 2022 08:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238932AbiGZM4i (ORCPT ); Tue, 26 Jul 2022 08:56:38 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E04FD275DE for ; Tue, 26 Jul 2022 05:56:36 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id a11so8678755wmq.3 for ; Tue, 26 Jul 2022 05:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=Z13ENY+8S7e7mR5lKKViQxv3bJ9pD8bL59xMmRnI17k=; b=fTXqLeB+Ueyf/kQFYoQqCwqr9S5mAFaty7VxI+pA8+ddia5BvIAtZxhIdfLDcKEiD8 uIQA6CQyneloEz3lUFwqsGWcHgZm98oX7fb+edSZ2K0EV1g3Qwz03Hj8HUI8/5nxt5uE isp1TfsivHl7QpCKGOWd4rQqmODsyyS4FpX78pdlcdg0iE+zZ9KmLHU72eY2xX+VdRUf zhsoSvqPy2NA41DMwk+j/nn6ukIwgmxr9YZf1KJWJRstRBKmeZArTQSB+yEIy30LGoni 0cZuBdp4Cp2SYX1zl+NyNpzOwdOFMlwPRlZRjwBlWnYGXeKeu5oSxJJUt5JmJ+4Kbmfu HHKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=Z13ENY+8S7e7mR5lKKViQxv3bJ9pD8bL59xMmRnI17k=; b=dZiA7tzTMZLnGfGdl7JeXwFKkU5Wfjf+TRVOaC11eop2XtxqCaCPrsdJg7fSyg0AYU eI6bGor11oRGycDL+MFLr1stZnhzmybeIzk1Prc31zyj+H07SDAGTHZynKjk5LF/+AmT Yt93cWeI8kd/9FRObamMzU0XHRGgKRQT7JZna5cqspDclrfqjcmo3xwjZIFXJlXYpfoC fcD7+8SCRIwW5P0gYu/fHp42wLFHx3H1wfgNkgBVzJN2HK2ReaxRnRc0CqlVww0/qZ4r 9xUeG4UrTuu3fYa9yfeS+manrTKWx7nQe0Z18vJZJLxXGleVvJbODmcoDDgkhMEVpcD/ lXVA== X-Gm-Message-State: AJIora/rXIbSeEQW9m3vWh4tGdiCk4odQl0bLUryFlL5BuxL/OFKqqQQ 8cx+W/NGE6k0bFeGRNvDjLRAGg== X-Google-Smtp-Source: AGRyM1vl+YcUxJuwnM9p6qUahJHbYsyHSqdIeYD+E93+OvEhN+WoRh0CsBISgrEp4sQye2RUf1gZNw== X-Received: by 2002:a05:600c:1f08:b0:3a3:1b00:c201 with SMTP id bd8-20020a05600c1f0800b003a31b00c201mr12396445wmb.171.1658840195057; Tue, 26 Jul 2022 05:56:35 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:34 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:11 +0200 Subject: [PATCH v2 6/7] arm64: dts: mediatek: mt8183: add keyboard node MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-6-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Fabien Parent MT8183 has an on-SoC keyboard controller commonly used for volume up/down buttons. List it in the SoC dts so that boards can enable/use it. Signed-off-by: Fabien Parent Signed-off-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index 9d32871973a2..9d8fdebaabe3 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -943,6 +943,15 @@ pwrap: pwrap@1000d000 { clock-names = "spi", "wrap"; }; + keyboard: keyboard@10010000 { + compatible = "mediatek,mt6779-keypad"; + reg = <0 0x10010000 0 0x1000>; + interrupts = ; + clocks = <&clk26m>; + clock-names = "kpd"; + status = "disabled"; + }; + scp: scp@10500000 { compatible = "mediatek,mt8183-scp"; reg = <0 0x10500000 0 0x80000>, From patchwork Tue Jul 26 12:56:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 593864 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00074CCA48B for ; Tue, 26 Jul 2022 12:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239016AbiGZM45 (ORCPT ); Tue, 26 Jul 2022 08:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238166AbiGZM4i (ORCPT ); Tue, 26 Jul 2022 08:56:38 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4C4275D1 for ; Tue, 26 Jul 2022 05:56:36 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id id17so8696816wmb.1 for ; Tue, 26 Jul 2022 05:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:date:subject:mime-version:content-transfer-encoding:message-id :references:in-reply-to:cc; bh=Pv8Wb/XUfgDvlUBb7xZCItYlnc14Qbd8klbk0fBR/cI=; b=JQC0LDeiyCTONLO9wJzCR3DZayr2OeSY97UtihVtK2Bg//mORTzwXNPQ+3bZvguNmQ G8HgNDfEkkPic2mCzlej2yTg5sJBWpWQOKJW4hmFNVLOtUNlTHZLmvnLaYTGO57swON9 JnMb07hRleek6DOVe9ppMcxjCwr4KlqQ5aYSfJsjWJ43VFGGsOTp1NkHXUuBaFtIwwkt /bgJS8DYAK1Zn8Fw53JRW+sZoWXXjJs3uWAfYWySQg+Yc5Wpnwa6Ee7Xuue3cpQ89FD+ e5reycwqnH7QxWvpijS7glQJuXIBJEVn4DgeAUml+0SWnmHj/ADspwBVxwBwtXp/TTOc 0OTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version :content-transfer-encoding:message-id:references:in-reply-to:cc; bh=Pv8Wb/XUfgDvlUBb7xZCItYlnc14Qbd8klbk0fBR/cI=; b=uBC69LMW9Fk5v566yy3xhw1psR11rHnnJ4gE5w+EOXAo08hYda8eS7hTq27m4K/Vku cuDQEKvkqSucv2lUgKFuA+Tp6pAgPcz7UrbnaAWA1kzc0ieobfWE93THyyjgZDpInHL7 1pT/au0u/bWyx+vVK2z5obCe1xM4vHCX54A6MhQCSX3g1qr4il5C/ngkXUUGm5vB9aul 9STyDDWWgUntpr/btZJq0lKtmYdlrXhMfA3wa4j/GxWhddYTJ2wPqJUqRWMuJdvs8Mqq Q7gVg9guliBH+V9TMv15KkzVtNn2SLGX3Cr1l0ikqziSCZUg0Tvokg10e2LcD2AB2L22 bN/g== X-Gm-Message-State: AJIora/n0SvU7KpUNezOL0C1x9BAurPnKL4AePX95QdfaAGUf6yTbcDh NSdQb2WNlsxElSFGTH8MfuyNiw== X-Google-Smtp-Source: AGRyM1vvvRdQPmoQCB+VQgE8Mf8j6lPcMzabj6A5fEyQBKVFOEwxFB9YOwKu5xXK1jyzEiBm23752g== X-Received: by 2002:a05:600c:19cc:b0:3a3:3cfe:d548 with SMTP id u12-20020a05600c19cc00b003a33cfed548mr12225185wmq.6.1658840196274; Tue, 26 Jul 2022 05:56:36 -0700 (PDT) Received: from [192.168.2.253] ([82.66.159.240]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b0020fff0ea0a3sm14171549wrp.116.2022.07.26.05.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 05:56:35 -0700 (PDT) From: Mattijs Korpershoek Date: Tue, 26 Jul 2022 14:56:12 +0200 Subject: [PATCH v2 7/7] arm64: dts: mediatek: mt8183-pumpkin: add keypad support MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v2-7-6d42c357cb76@baylibre.com> References: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v2-0-6d42c357cb76@baylibre.com> Cc: linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Fabien Parent , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent X-Mailer: b4 0.10.0-dev-78725 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Fabien Parent Add device-tree bindings for the keypad driver on the MT8183 Pumpkin board. The MT8183 Pumpkin board has 2 buttons connected using: KPROW0, KPROW1 and KPCOL0. Signed-off-by: Fabien Parent Signed-off-by: Mattijs Korpershoek diff --git a/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts b/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts index 530e0c9ce0c9..a1d01639df30 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts +++ b/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts @@ -7,6 +7,7 @@ /dts-v1/; #include +#include #include "mt8183.dtsi" #include "mt6358.dtsi" @@ -122,6 +123,18 @@ &i2c6 { clock-frequency = <100000>; }; +&keyboard { + pinctrl-names = "default"; + pinctrl-0 = <&keyboard_pins>; + status = "okay"; + linux,keymap = ; + keypad,num-rows = <2>; + keypad,num-columns = <1>; + debounce-delay-ms = <32>; + mediatek,keys-per-group = <2>; +}; + &mmc0 { status = "okay"; pinctrl-names = "default", "state_uhs"; @@ -226,6 +239,14 @@ pins_cmd_dat { }; }; + keyboard_pins: keyboard { + pins_keyboard { + pinmux = , + , + ; + }; + }; + mmc0_pins_default: mmc0-pins-default { pins_cmd_dat { pinmux = ,