From patchwork Wed Oct 5 14:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 12999332 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 72989C433FE for ; Wed, 5 Oct 2022 14:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230297AbiJEO6b (ORCPT ); Wed, 5 Oct 2022 10:58:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbiJEO6H (ORCPT ); Wed, 5 Oct 2022 10:58:07 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB7317CB61 for ; Wed, 5 Oct 2022 07:57:48 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id b7so18730503wrq.9 for ; Wed, 05 Oct 2022 07:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=5LEzJ4YCcZTK5iSxuGcCtaKYesf8mH4mh88+OJy8Eek=; b=Z0relTcGaADogcmitxZSOKrdaUpVfsm9MGuGr/CaYAJCr6pD4x6Kuo0vGjhuNUjOR0 m4tRsM2rax7gyedn8FMTUFRuHpRkfDRsSO7ffhEH7Cp9f+n2A1e1xVXP77w8sXMfEh0M xR9n/U8mgmIOVtkd4opFpN0i+NmS+ERxxICjyYnQzFAuk9Vx2XUFS9pchGvJaxj3iYTg adElNm9hkda9I/struStqpEsd7/KkjXiw1iEbU3fGBx8hlfEd/4Q84sWtSPJo87RGwrh 70aYx0hsI2QEtbXc2cU8q/edTx8UzN4hb89M1vn2m5AhneErnQuKBhh3OfUAEhx9SNK4 VHFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=5LEzJ4YCcZTK5iSxuGcCtaKYesf8mH4mh88+OJy8Eek=; b=6cR575CqIp2iR9U8+jQN231tNW8QesmmdJHnx2L3JESoRNV9Kxcda/RDF9IqvFVO4F 3HurO22i6HPNFCUcOarGLBIoUW4a9OxQZnFE8uFNbZzPX3tT191Tu5dd/TyFlJ7G634i +eBf2NDhj8XPwgthupHu/qCbt3L2+sri3tJn2VDJ06RReqMRDvaCXrAtTRf1lisKmmYA oc5PSLkoZCQ/+efq/lkcsO1B/S3IOMW/l7uDVlpZS7Tp8HivhrDL245GafSe037DBXWW fmmX7LqXpAkOuyxSGqYrTxCFAUK8wSibTR+frQxUWm2je6cePLUIkvx7CpCW6DGJ/OtK 3tag== X-Gm-Message-State: ACrzQf2vKFbC/8wCVEW2azPkh0+c4gQiWVDhPjQSKB1arNAQNwZm7uZj HMeO79y9ZWt8l5AHtB80HHBw+pzmJBY3lNQL X-Google-Smtp-Source: AMsMyM5RIDOP0SBHTgVz9cIeHQ3xf/675SJ1zg0vkMRJgYQZ0smzOghgKmsChaaTYVdn8lhx3g56VQ== X-Received: by 2002:adf:fb05:0:b0:228:6463:b15d with SMTP id c5-20020adffb05000000b002286463b15dmr95901wrr.534.1664981866717; Wed, 05 Oct 2022 07:57:46 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id k38-20020a05600c1ca600b003a3170a7af9sm2313758wms.4.2022.10.05.07.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:57:45 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 05 Oct 2022 16:57:25 +0200 Subject: [PATCH v2 5/5] Input: mtk-pmic-keys: add MT6357 support MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v2-5-f17ba2d2d0a9@baylibre.com> References: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> In-Reply-To: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> To: Lee Jones , Mark Brown , Matthias Brugger , Rob Herring , Liam Girdwood , Krzysztof Kozlowski , Dmitry Torokhov , Chen Zhong Cc: linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=amergnat@baylibre.com; h=from:subject:message-id; bh=K+NtkSoTyty3WNtqny3ZNRZqV9d7SWTjFAQ6sSNyyMw=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjPZtiUzTmaPYNKYUV3W/stU4RFeLEKuVzt2ZzEqp/ Eq6ivv+JAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCYz2bYgAKCRArRkmdfjHURUSiD/ 9sA4ZHNufNW0mMKCBepfnBrZ6W30ICWNvG+puYQvyX/jwxtj2IuDK+24Mh1zWfMtIUQeSW0T57XDoi 0ghn+UGPc1bfvlMsd9/XBIEzfqJBNYOsGZDXJekiMu2RnvOsUDnpwTn5f/mvhXLTURVzqDugUc6Oz3 /PHQNz/FNtHEo1vN8BPoGboWkKJf7QsfaQzD6yljthQ86IyLobiFeTS0umNxK3d7YRWLsUUoxNdxA+ 3iLXSyPZc2o1a8bi5CfWL/zvbWSauPcgj3BpN4jY4+GeUSz32+j1PqxE1vkcfO7SAxSPBr3qzUTnC/ IKwuSMqmMNxoD8NiMcH6tX2CXOSxhNHnTHlyvjOGNDv7krLQyVjGORuKvRS9UVXAO/OCqeOpGNZIhQ JciObzKUp3Q1XfnaczjG/Mh3Hk2EDAkCg+lWTC8s6LI9h2kmuJIsomFnAUs5yfqJspDRTPSdYB3u4w oQ5kxjH7JMve0b8aqTPkQ6hz2Nftwl5bGl1aPtQUUG8viXIvRaucyPrZjhEWAUUeqKdcC99BLlRJjM AmyUMcmlvzo2OwGaVEe8Gw3tIsBer+cDkRvEg3vxGM+Hs2awbUPmNjvBiRI3AzF/JJ1kQ2mYPYYneA mrSVR3VxVlZw0HzMwiz0qDW5WY4BVztDoCexJRkFvYB9qLvqWrx1Y+sTWc2A== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Fabien Parent Add PMIC Keys support on MT6357 SoC. Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat Reviewed-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno Acked-by: Dmitry Torokhov --- drivers/input/keyboard/mtk-pmic-keys.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c index 9b34da0ec260..2a63e0718eb6 100644 --- a/drivers/input/keyboard/mtk-pmic-keys.c +++ b/drivers/input/keyboard/mtk-pmic-keys.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,19 @@ static const struct mtk_pmic_regs mt6331_regs = { .rst_lprst_mask = MTK_PMIC_MT6331_RST_DU_MASK, }; +static const struct mtk_pmic_regs mt6357_regs = { + .keys_regs[MTK_PMIC_PWRKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS, + 0x2, MT6357_PSC_TOP_INT_CON0, 0x5, + MTK_PMIC_PWRKEY_RST), + .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS, + 0x8, MT6357_PSC_TOP_INT_CON0, 0xa, + MTK_PMIC_HOMEKEY_INDEX), + .pmic_rst_reg = MT6357_TOP_RST_MISC, + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, +}; + static const struct mtk_pmic_regs mt6358_regs = { .keys_regs[MTK_PMIC_PWRKEY_INDEX] = MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS, @@ -276,6 +290,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = { }, { .compatible = "mediatek,mt6331-keys", .data = &mt6331_regs, + }, { + .compatible = "mediatek,mt6357-keys", + .data = &mt6357_regs, }, { .compatible = "mediatek,mt6358-keys", .data = &mt6358_regs,