From patchwork Wed Jul 20 14:48:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 12924100 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 2752BC433EF for ; Wed, 20 Jul 2022 14:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235197AbiGTOso (ORCPT ); Wed, 20 Jul 2022 10:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235140AbiGTOsm (ORCPT ); Wed, 20 Jul 2022 10:48:42 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317FD51A3A for ; Wed, 20 Jul 2022 07:48:41 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id bk26so26455204wrb.11 for ; Wed, 20 Jul 2022 07:48:41 -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:to:cc; bh=bLWM+s+iR5LdVaHPuafu7iCm3mwz2NHAzkIzkY8xmTY=; b=3o97zfA5+8dQXwtwy7pQ9pIIsD5FJ3qzv88L5rTytIICFhHWbxdWnJ9vUD26bICVLZ b4WQu8J+7rgfsC3O53slfyN9BObsbC0xNBezoPWL6JvxhPsCac/td0xgxZAAV2A6TtyA 4fLEJ1TIJRgwWxfwo+JPQdzaQiqGUbTZbTFh57fmlNNc7wH3Am48OgcX1yT5GO2Ph5ep jLuFQRALqw50jBJQb7SNOjZbTZkmbsZP7i7I2SZ8jlE20tl3ya59X7uUoVYLB/OxgXWY YVKnie59wwIK2I5VIWeQ+ESe12NplRAeK0z7sxIO0TGu4ZME7CKjxHvvEgNtfeuQeO2c 1JMQ== 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:to:cc; bh=bLWM+s+iR5LdVaHPuafu7iCm3mwz2NHAzkIzkY8xmTY=; b=RQR93RAtSOfUxwiW7XoXL+wJO4/Kc8WQTlkKP8V0dTKSwSJYjX+Jn0utPYE7a4rRpX unn8HMiUar2iRr7ChP54VXbk4oM7idyigm7OwChbfLoOJ7abcozLtTYueqsiiStKZwAE Ft13kRHWxlVrgaNj1/HW8z9Y9xVZZQaMPshUXvpWJsnOZAlNmpq5wZ+cCLmesufbvFvh ndirIsAIUZoW38SCfy0kyvdNJLAtpU2QrJ4NWqVqh781tLBQk+qR+SrRthhyIbeTMC8S RaNbs/hN2RRX+fs8Ux6JbzsB1zI0ysIeScporV3xJAsamgkdLoqoJ8MDxP1dXkZD30Kj 5TBw== X-Gm-Message-State: AJIora/BTAXMhA/A/C08NLHaxcwvi4rl2WTB119IQhp5i//l5eL7PuXz 1xiw9c08jcyU/pAMSc9zL3vm1A== X-Google-Smtp-Source: AGRyM1uqyELZOTi1y1+BWMg0rNkGod1uVK9t35VqzqBXcj/DigJ522rSj8SmtDKiiJo4GtoMoIymsA== X-Received: by 2002:a5d:6110:0:b0:21e:4fe4:f7ba with SMTP id v16-20020a5d6110000000b0021e4fe4f7bamr727919wrt.69.1658328519755; Wed, 20 Jul 2022 07:48:39 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb19:85e6:1900:c639:22f8:bed9:44dd]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm3321121wmq.7.2022.07.20.07.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:48:39 -0700 (PDT) From: Mattijs Korpershoek Date: Wed, 20 Jul 2022 16:48:37 +0200 Subject: [PATCH v1 1/6] MAINTAINERS: input: add mattijs for mt6779-keypad MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v1-1-ef9fc29dbff4@baylibre.com> References: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> To: Rob Herring , Krzysztof Kozlowski , Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Fabien Parent , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.0-dev-54fef Precedence: bulk List-ID: X-Mailing-List: linux-input@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 264e7a72afd6..f7a0bae74dc8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12771,6 +12771,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 Wed Jul 20 14:48:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 12924099 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 9DA42CCA487 for ; Wed, 20 Jul 2022 14:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235140AbiGTOsp (ORCPT ); Wed, 20 Jul 2022 10:48:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235267AbiGTOsn (ORCPT ); Wed, 20 Jul 2022 10:48:43 -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 1DA695004D for ; Wed, 20 Jul 2022 07:48:42 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id e15so21219308wro.5 for ; Wed, 20 Jul 2022 07:48:42 -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:to:cc; bh=CQqnkWpbbaS2vb+KWbLHEgGJa35COvg0f6M4mKs8LZA=; b=gM4/9BiXFiOOF1pc8rgeisC4TUSBONj/s9Sy2t01T6VAZqA0lBUcN3sRDHFYbZtOI6 fPmNsPEJ99S3Xd0i+4MxIwLP5upJaJfO9xo8gZuMcpnlDLuIz1SraiwzqYZDA8OcCPB0 7ZrIqTKhUJwbVIgRP+eHTW+mKi90Rke39pJ+cvi96yAS1ymoDAexRKFyNVLl2qSyWXpg hXdJtfEzbiPVk3uYcg+8IGhNTtPgNFv6wotdrb/3sYMTJ3tjSrWC5Ej/UN0o16ah9Pto M0IDd6ZuZmpMsLe/MKChPecYegGtL3KV4ugh9UxiL0g3mH1AJ1Gv17vZzYAkKPQ5+obJ tNig== 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:to:cc; bh=CQqnkWpbbaS2vb+KWbLHEgGJa35COvg0f6M4mKs8LZA=; b=0pmZNgJPhOyNjpDVP6LPVv3cJUXXaLajihAeqhQtyogaRysk9JOWp3FV8d6ces97Hw 1oKztO4xiW06DQIQU8+mOS+Bvh1nof87Mhd3BOrRjRo5dBLR9yBC3jpMRU8rhr5J/Iwz bGy9h4Pf8CyxyevXNEoE+3i8fCeekgvY1tX1o6ESBJGgAFKAWonpmzJpFJt0sGA3lN7V x7FdIuh5+bfbMmqkMhP6t3umUx1YhNQjNe8eLYpiTNclLPoFwrN+Xhq5GD/LEkAleEBL tqS6yH1elnnn61QHocQhh3HliacBMPE2NgllAlck1tF42mid/1LTFCmwzStHnS1xyxAi O6gQ== X-Gm-Message-State: AJIora/TQYnIIHtI2nU+1SpQbg0XTzjfOCSI0s/uKyE/Ro6rOdk9GN/8 Tcfx2metin3vRd0YE/F9l6mNMQ== X-Google-Smtp-Source: AGRyM1vSS3WWayKFuKSqLFjnoDRL0BND5b5er92x5l1u2SV4uA4ZpHgfX/joTCI73kGMN0viOyARJQ== X-Received: by 2002:adf:e911:0:b0:21e:3a7b:495c with SMTP id f17-20020adfe911000000b0021e3a7b495cmr6677995wrm.388.1658328520469; Wed, 20 Jul 2022 07:48:40 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb19:85e6:1900:c639:22f8:bed9:44dd]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm3321121wmq.7.2022.07.20.07.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:48:40 -0700 (PDT) From: Mattijs Korpershoek Date: Wed, 20 Jul 2022 16:48:38 +0200 Subject: [PATCH v1 2/6] dt-bindings: mediatek,mt6779-keypad: use unevaluatedProperties MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v1-2-ef9fc29dbff4@baylibre.com> References: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> To: Rob Herring , Krzysztof Kozlowski , Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Fabien Parent , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.0-dev-54fef Precedence: bulk List-ID: X-Mailing-List: linux-input@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". mt6779-keypad includes matrix-keymap.yaml so replace additionalProperties:false by unevaluatedProperties:false. 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 Wed Jul 20 14:48:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 12924101 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 41C01C43334 for ; Wed, 20 Jul 2022 14:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235089AbiGTOsq (ORCPT ); Wed, 20 Jul 2022 10:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235373AbiGTOsn (ORCPT ); Wed, 20 Jul 2022 10:48:43 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7C0751A26 for ; Wed, 20 Jul 2022 07:48:42 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id bk26so26455300wrb.11 for ; Wed, 20 Jul 2022 07:48:42 -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:to:cc; bh=EOTw2SZsHwugM+Ez0nEALoToqSbMZWPKVYP438H1mxU=; b=oMm7LoJwBASOpcAnoe5ZW0VcoBtpNp4qdQXkxDMqfsYACtq2XOkYP+zDZPKLL4wMBw YgIqj4c9bDXecsVxFerVyCof9sXAssTSpDgeyJzMUqvcp5rJryAbqDSHlATe3jt96iHG WDtXCJY7Y6NcZXZsGo3/Pww8583CYWbnViwflztE1ocPMbOBgWan5EX/aj1cCeoZuy9i 9faahOs5YUZNPf85kg/MwQEMmex/wyjlyUCRmxo4MPNf1qV7Ep+U/pgIAQiOYRiTGjQC ZBxpaNtME1cHVV7UMwlhbx1u60srMx9Fp1zRqRjrcLpKx1kk1sNzoYkkn7iaHCbpVNRl 3ihA== 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:to:cc; bh=EOTw2SZsHwugM+Ez0nEALoToqSbMZWPKVYP438H1mxU=; b=e2dWsoatdQnsXhkHqs/sUppolgkB79eG52n0STVXnLjP8RKw3LPhskiWNTXdiAhDMD UgYMENgrsmb6niVMBGISKvBMMFuCyJ4/+yqjWMdzcb5Ma+jOgA7Xov8cWGIiUZeE43b6 HWvWOPtFOD+Twd09ZxQw87dD0KW0u8Aa5XYY83H7SgPGctD2zI2fyNeaenNDmEiLoRyF rd9pdcxivjuDR51VV6mche93L8P8kvqPjcHsjjsanvwXAuHBI6bMe3xk45gHIi+0Mh6x MldY2tn97ccCFlYWXDb88Mk2EpublCo89bxc37SGL5/Ty0nZTZrPjzka3wqdlB+rL0ga w6TQ== X-Gm-Message-State: AJIora84PuTkNwpU7mK1n9wkdewgP2SEiDE+TASA93TQxuCMYSWwTUPa nLNGPIJzLvWYjXSi98shTrXpIg== X-Google-Smtp-Source: AGRyM1vk48vhBISpLi0CcOr9kKDWKs0EqlrNQDdVJdrT6hsTP+HmSTbFh6RCGQZsl1ZBg+vkqVqr/A== X-Received: by 2002:a05:6000:1789:b0:21d:7279:f455 with SMTP id e9-20020a056000178900b0021d7279f455mr30432550wrg.542.1658328521299; Wed, 20 Jul 2022 07:48:41 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb19:85e6:1900:c639:22f8:bed9:44dd]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm3321121wmq.7.2022.07.20.07.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:48:41 -0700 (PDT) From: Mattijs Korpershoek Date: Wed, 20 Jul 2022 16:48:39 +0200 Subject: [PATCH v1 3/6] dt-bindings: mediatek,mt6779-keypad: add mediatek,double-keys MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v1-3-ef9fc29dbff4@baylibre.com> References: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> To: Rob Herring , Krzysztof Kozlowski , Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Fabien Parent , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.0-dev-54fef Precedence: bulk List-ID: X-Mailing-List: linux-input@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 Currently, only single key detection is supported (by default) Add an optional property, mediatek,double-keys to support double key detection. Double key support exists to minimize cost, since it reduces the number of pins required for physical keys. 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 ca8ae40a73f7..03c9555849e5 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,double-keys: + description: | + use double key matrix instead of single key + when set, each (row,column) is a group that can detect 2 keys + type: boolean + required: - compatible - reg From patchwork Wed Jul 20 14:48:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 12924104 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 08DB5CCA480 for ; Wed, 20 Jul 2022 14:48:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237308AbiGTOs4 (ORCPT ); Wed, 20 Jul 2022 10:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237346AbiGTOsv (ORCPT ); Wed, 20 Jul 2022 10:48:51 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F2FF5004D for ; Wed, 20 Jul 2022 07:48:44 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id z13so6895319wro.13 for ; Wed, 20 Jul 2022 07:48:44 -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:to:cc; bh=gQDJGZNgsqUtHpgMiFLZZA7/paFhPF+yVUYXcvVHSs4=; b=jWvb+ECCiickXJZCiLpfv+eAtXoL6RKmAzIinxV0NAV2ZFpFUzjSQMTGWH/ioJk54c WM+yJ0qYotLbZ7Ab3S4p4q5VPrOKdDw0IPyh6RKGkePFugxfcSfoLCKKVrhhZdLIbHYA YuKYzPBjY3Mo/28Q0U8+5FNBFkMy9YFyHVaDl+wjUAR267zKJlGW7I0dpgzcvYvvaQz6 hKNBJz+CjbSJIp08nXtstVcxHE9BbQoA0WHlxZ9RWMEnCJlNY1tEMvAlfQIIJs31Khos witQDQ4775d0nxnh1BEviyI9PFhUz0t+fYPBaaO8a3avTfMXnpfMB0fvNGG5w2/id6yg JkMQ== 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:to:cc; bh=gQDJGZNgsqUtHpgMiFLZZA7/paFhPF+yVUYXcvVHSs4=; b=SJb2lQBXj1GBXFgOKNJBH04ejSknwYpTV90vGee91XtKdtetk2I8WKU2AUJrE4Mp2x e1ludK2iYLDuhOvdIjbD8TC181PpqnmvEBvDQqhWze9MOHkcYBRo4uOk7ovjKlE5yVlS OpQ5qbBAfHlP1oLy1pqXc1buxUjn4jpIi8T+RzZlpBUfm5PMI1Ye6RjPV6wmRhWgc6nF RXAvCWM2KhVwhT5wIKwJvxP9Ryb9fgcO35uYATsrvfgnwJ3S5pC37iBK87YLQTXQKAbF xSsVxKkR/iqUr184w5nQuaKUVOu0XlHwSUsQFkqSIQQGgplqhDh+zqfpgPg/nyNMrFb1 cxqA== X-Gm-Message-State: AJIora9gexnFzrX5Q7CrxXoNJBDnRzqIiEiou8iIEyq9ka0bJPeKyTOE ZcdtYM2xZSFmGTItWAWup+TT+Q== X-Google-Smtp-Source: AGRyM1vhz6wly+GUBEO58Zqu+ASDQ0cB1MEncpppa77b4G7K6pbiuEC/CLbU03zVZ2Y8w2dFJns6HA== X-Received: by 2002:a5d:64e2:0:b0:21d:38e8:2497 with SMTP id g2-20020a5d64e2000000b0021d38e82497mr29420012wri.142.1658328522069; Wed, 20 Jul 2022 07:48:42 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb19:85e6:1900:c639:22f8:bed9:44dd]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm3321121wmq.7.2022.07.20.07.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:48:41 -0700 (PDT) From: Mattijs Korpershoek Date: Wed, 20 Jul 2022 16:48:40 +0200 Subject: [PATCH v1 4/6] Input: mt6779-keypad - support double keys matrix MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v1-4-ef9fc29dbff4@baylibre.com> References: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> To: Rob Herring , Krzysztof Kozlowski , Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Fabien Parent , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.0-dev-54fef Precedence: bulk List-ID: X-Mailing-List: linux-input@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,double-keys device tree property. Signed-off-by: Mattijs Korpershoek Reviewed-by: Matthias Brugger diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c index bf447bf598fb..9a5dbd415dac 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) @@ -31,6 +32,7 @@ struct mt6779_keypad { struct clk *clk; u32 n_rows; u32 n_cols; + bool double_keys; DECLARE_BITMAP(keymap_state, MTK_KPD_NUM_BITS); }; @@ -67,8 +69,13 @@ 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; + if (keypad->double_keys) { + row = key / 13; + col = (key % 13) / 2; + } else { + row = key / 9; + col = key % 9; + } scancode = MATRIX_SCAN_CODE(row, col, row_shift); /* 1: not pressed, 0: pressed */ @@ -150,6 +157,8 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev) wakeup = device_property_read_bool(&pdev->dev, "wakeup-source"); + keypad->double_keys = device_property_read_bool(&pdev->dev, "mediatek,double-keys"); + dev_dbg(&pdev->dev, "n_row=%d n_col=%d debounce=%d\n", keypad->n_rows, keypad->n_cols, debounce); @@ -166,6 +175,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 (keypad->double_keys) + 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 Wed Jul 20 14:48:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 12924102 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 7ACCEC43334 for ; Wed, 20 Jul 2022 14:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237229AbiGTOsu (ORCPT ); Wed, 20 Jul 2022 10:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236076AbiGTOsr (ORCPT ); Wed, 20 Jul 2022 10:48:47 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D97152883 for ; Wed, 20 Jul 2022 07:48:43 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id u5so3417919wrm.4 for ; Wed, 20 Jul 2022 07:48:43 -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:to:cc; bh=VGUb9DmOvoGv8nh5rqV1xHbR9kL6IKYbqd/qwv1q+CA=; b=jRL5JcT9oKaeo7HwZrYobK/YmXLf7T2OTvQbB+5Tt4Ej73xiicgN2WuAV9zlw2rEKj gBD1wR+vAFAyQ36BarOC42aGFh0Z+CUVKmoz8jocS+Sr1oFSoZdpIpLnfx+p6ZO2A1ou AAcutHoNxH3HiLedSavddURbO+/DeoJdbuK1UKbsYvq/AEfupOK/Luj7ZiWHbwkOSZy2 aHRgAVTfYYziWX4EbaYfxDteMDi0fDZibAkzqfnGLqb6TtdUDY9XJZimypikQHHkA/RS HwXgTHe4cGSkZD6UzZkh/rw9pNfYj2qyAa5Grv7CnZLvskr1FGDTqRsjvNQ4XaQ9hQ0Y SVRA== 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:to:cc; bh=VGUb9DmOvoGv8nh5rqV1xHbR9kL6IKYbqd/qwv1q+CA=; b=16R22Bc9EoTib3usRGnSfLVYudoPeF0xkr8K2ccm856dXGlQ0tl9hACM+XmVL+l4aZ znhJ2r+4gGfy8AwP6pwKoqHMM6T6r8SbDj+YqUvH0DuyIX5o2g9tQ29kZLCH8mG1UuBX poSv6K6ul4+Ym9ZjgwEoe49JdoOFvjzLqqpPT5VejLUH45umEHMA0gUuBGV+7v0WqcjH NQDDCW5S7tXNsR2ZQc0HFXx7Jdn1/EP7Vq9F52VqPdsfHoe5PfDVbFtKIDUpFr3Gv2MI Tdp5njmGQCSpTCxvfK0byeQZlMVDAOOIk4orTtEgWRjE2KEwtG5ZLRYnDHboGJNxUj7B /G2Q== X-Gm-Message-State: AJIora+jjRhDukkQt8Hnag7r+EJLMjdOqdQAYqorfxxeD1nVcbCCvd4j TeGJbPGF764sofGiHS4FzNRP9g== X-Google-Smtp-Source: AGRyM1vTy640y2iV3Q5noFGBYMKVc349uYWye3eyUbUhWj27qZA/i9aPmd4vKm57vaVf4wNmnxmupw== X-Received: by 2002:a5d:648a:0:b0:21d:b684:9c76 with SMTP id o10-20020a5d648a000000b0021db6849c76mr30956265wri.463.1658328522794; Wed, 20 Jul 2022 07:48:42 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb19:85e6:1900:c639:22f8:bed9:44dd]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm3321121wmq.7.2022.07.20.07.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:48:42 -0700 (PDT) From: Mattijs Korpershoek Date: Wed, 20 Jul 2022 16:48:41 +0200 Subject: [PATCH v1 5/6] arm64: dts: mediatek: mt8183: add keyboard node MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v1-5-ef9fc29dbff4@baylibre.com> References: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> To: Rob Herring , Krzysztof Kozlowski , Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Fabien Parent , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.0-dev-54fef Precedence: bulk List-ID: X-Mailing-List: linux-input@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 Wed Jul 20 14:48:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 12924103 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 565D6C43334 for ; Wed, 20 Jul 2022 14:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239484AbiGTOsz (ORCPT ); Wed, 20 Jul 2022 10:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236004AbiGTOst (ORCPT ); Wed, 20 Jul 2022 10:48:49 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C49952DD5 for ; Wed, 20 Jul 2022 07:48:45 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id j29-20020a05600c1c1d00b003a2fdafdefbso1423858wms.2 for ; Wed, 20 Jul 2022 07:48:44 -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:to:cc; bh=o7NWJMKmrg5UzWFssb9UC6+9fr3X64sVc8zqbdDmg/4=; b=35Q7aaLTpf6XHFiAk3xPyLuE7i3lVuBjTEOr4YEtua/WiSxQNGV5E7wgmPYZvrXdMz cb8+kgykVVSkEBD2kqKYw3w87eRLhTkDH4ekVHbv6Ct3OZOx8qIPGI9GE+lXGbLcXKa5 677DZ1rDcZ1/vIdTs1a+kY5+jO4kbzxHXkF7rp3f8V3OVj2+AbMMjUcF0WPkDlQaJkN+ lGn1dr92MXwPIn5iTDypPp9qq3tn8ZCYf9mlO7foOBdNrj85JwjhbuitB1nUgnvX8WM/ txABYDNzMJXhCuTSuSUzbZHYOmgX7XUJbgn9PnY/mM1+iErCmsEpGi3f36wb/3TcvYFL 4QiA== 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:to:cc; bh=o7NWJMKmrg5UzWFssb9UC6+9fr3X64sVc8zqbdDmg/4=; b=nAELJAXlXmenx27QE9z+C0FhOFqYpJRUi6zEVz9EEWCm7VRMCt+MJ5RJdyPzTcOG62 5Vy91hKyWdCUrXEKCw8bXGsV58YekYEbgh9AsNrmyIw68ytb/sDlxPcVtDD8R9wxbk0b SITjNYcwjKVGg9Su94Ur760Lv+7I7vtJfM+IEJV2/Sj6F03zVWt54Ly+en01vNEIPviT Igj29ROCxyxNTOCFmsytuwXqBkrvtqIP4Cm2QU/m5ng3mkBhcPI3Ghmv8IaB4Js7NVMR 46xfWUSiCYQamKPgvuyhhN+lV5p0RfKEIN1yJeH1yCcFy7XT4CE5FWkE/IIeLehEn3AB UP0Q== X-Gm-Message-State: AJIora9UPk6lj8cMi+azrTMwzfm2n38rZgkVa9Pf9Cy2MUYKsj3MPr+a FfQIB3UhW97ZddLNguIzOncfIA== X-Google-Smtp-Source: AGRyM1ucwB2vU/aGRAvjhlYFu9788qVNYbD0PNW11PcdfR+3DHacpm9xpneOLojFxCjqxsBH2JlD1w== X-Received: by 2002:a05:600c:cd:b0:3a3:f40:8776 with SMTP id u13-20020a05600c00cd00b003a30f408776mr4254459wmm.9.1658328523535; Wed, 20 Jul 2022 07:48:43 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb19:85e6:1900:c639:22f8:bed9:44dd]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm3321121wmq.7.2022.07.20.07.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:48:43 -0700 (PDT) From: Mattijs Korpershoek Date: Wed, 20 Jul 2022 16:48:42 +0200 Subject: [PATCH v1 6/6] arm64: dts: mediatek: mt8183-pumpkin: add keypad support MIME-Version: 1.0 Message-Id: <20220720-mt8183-keypad-v1-6-ef9fc29dbff4@baylibre.com> References: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> In-Reply-To: <20220720-mt8183-keypad-v1-0-ef9fc29dbff4@baylibre.com> To: Rob Herring , Krzysztof Kozlowski , Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Fabien Parent , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.0-dev-54fef Precedence: bulk List-ID: X-Mailing-List: linux-input@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..add697c94b05 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,double-keys; +}; + &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 = ,