get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/814602/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 814602,
    "url": "http://patchwork.ozlabs.org/api/patches/814602/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/rtc-linux/patch/1505635252-27716-5-git-send-email-chen.zhong@mediatek.com/",
    "project": {
        "id": 9,
        "url": "http://patchwork.ozlabs.org/api/projects/9/?format=api",
        "name": "Linux RTC development",
        "link_name": "rtc-linux",
        "list_id": "linux-rtc.vger.kernel.org",
        "list_email": "linux-rtc@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1505635252-27716-5-git-send-email-chen.zhong@mediatek.com>",
    "list_archive_url": null,
    "date": "2017-09-17T08:00:51",
    "name": "[v4,4/5] input: Add MediaTek PMIC keys support",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "02067e6ab7ce49821d46efd87c86c13e0d0c3af5",
    "submitter": {
        "id": 72090,
        "url": "http://patchwork.ozlabs.org/api/people/72090/?format=api",
        "name": "Chen Zhong",
        "email": "chen.zhong@mediatek.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/rtc-linux/patch/1505635252-27716-5-git-send-email-chen.zhong@mediatek.com/mbox/",
    "series": [
        {
            "id": 3485,
            "url": "http://patchwork.ozlabs.org/api/series/3485/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/rtc-linux/list/?series=3485",
            "date": "2017-09-17T08:00:49",
            "name": "Add MediaTek PMIC keys support",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/3485/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/814602/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/814602/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-rtc-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-rtc-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xw1nx6zw9z9t0F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 18:02:29 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751593AbdIQIBu (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 17 Sep 2017 04:01:50 -0400",
            "from mailgw01.mediatek.com ([218.249.47.110]:44675 \"EHLO\n\tmailgw01.mediatek.com\" rhost-flags-OK-FAIL-OK-FAIL) by\n\tvger.kernel.org with ESMTP id S1751340AbdIQIBG (ORCPT\n\t<rfc822; linux-rtc@vger.kernel.org>); Sun, 17 Sep 2017 04:01:06 -0400",
            "from mtkcas36.mediatek.inc [(172.27.4.250)] by\n\tmailgw01.mediatek.com (envelope-from <chen.zhong@mediatek.com>)\n\t(mailgw01.mediatek.com ESMTP with TLS)\n\twith ESMTP id 1797287264; Sun, 17 Sep 2017 16:00:53 +0800",
            "from MTKCAS32.mediatek.inc (172.27.4.184) by\n\tMTKMBS31DR.mediatek.inc\n\t(172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1210.3;\n\tSun, 17 Sep 2017 16:00:38 +0800",
            "from localhost.localdomain (10.17.3.153) by MTKCAS32.mediatek.inc\n\t(172.27.4.170) with Microsoft SMTP Server id 15.0.1210.3 via\n\tFrontend Transport; Sun, 17 Sep 2017 16:00:52 +0800"
        ],
        "X-UUID": "67335044cf354a539a9a40cfb7cd070b-20170917",
        "From": "Chen Zhong <chen.zhong@mediatek.com>",
        "To": "Dmitry Torokhov <dmitry.torokhov@gmail.com>,\n\tRob Herring <robh+dt@kernel.org>, Lee Jones <lee.jones@linaro.org>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>",
        "CC": "Mark Rutland <mark.rutland@arm.com>,\n\tMatthias Brugger <matthias.bgg@gmail.com>,\n\tEddie Huang <eddie.huang@mediatek.com>,\n\tAlessandro Zummo <a.zummo@towertech.it>,\n\tAndi Shyti <andi.shyti@samsung.com>,\n\tJaechul Lee <jcsing.lee@samsung.com>,\n\tKrzysztof Kozlowski <krzk@kernel.org>,\n\tLinus Walleij <linus.walleij@linaro.org>,\n\tChen Zhong <chen.zhong@mediatek.com>,\n\t<linux-input@vger.kernel.org>, <devicetree@vger.kernel.org>,\n\t<linux-arm-kernel@lists.infradead.org>,\n\t<linux-mediatek@lists.infradead.org>,\n\t<linux-kernel@vger.kernel.org>, <linux-rtc@vger.kernel.org>",
        "Subject": "[PATCH v4 4/5] input: Add MediaTek PMIC keys support",
        "Date": "Sun, 17 Sep 2017 16:00:51 +0800",
        "Message-ID": "<1505635252-27716-5-git-send-email-chen.zhong@mediatek.com>",
        "X-Mailer": "git-send-email 1.7.9.5",
        "In-Reply-To": "<1505635252-27716-1-git-send-email-chen.zhong@mediatek.com>",
        "References": "<1505635252-27716-1-git-send-email-chen.zhong@mediatek.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MTK": "N",
        "Sender": "linux-rtc-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-rtc.vger.kernel.org>",
        "X-Mailing-List": "linux-rtc@vger.kernel.org"
    },
    "content": "This patch add support to handle MediaTek PMIC MT6397/MT6323 key\ninterrupts including pwrkey and homekey, also add setting for\nlong press key shutdown behavior.\n\nSigned-off-by: Chen Zhong <chen.zhong@mediatek.com>\n---\n drivers/input/keyboard/Kconfig         |    9 +\n drivers/input/keyboard/Makefile        |    1 +\n drivers/input/keyboard/mtk-pmic-keys.c |  354 ++++++++++++++++++++++++++++++++\n 3 files changed, 364 insertions(+)\n create mode 100644 drivers/input/keyboard/mtk-pmic-keys.c",
    "diff": "diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig\nindex 4c4ab1c..bd4e20a 100644\n--- a/drivers/input/keyboard/Kconfig\n+++ b/drivers/input/keyboard/Kconfig\n@@ -756,4 +756,13 @@ config KEYBOARD_BCM\n \t  To compile this driver as a module, choose M here: the\n \t  module will be called bcm-keypad.\n \n+config KEYBOARD_MTK_PMIC\n+\ttristate \"MediaTek PMIC keys support\"\n+\tdepends on MFD_MT6397\n+\thelp\n+\t  Say Y here if you want to use the pmic keys (powerkey/homekey).\n+\n+\t  To compile this driver as a module, choose M here: the\n+\t  module will be called pmic-keys.\n+\n endif\ndiff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile\nindex d2338ba..20c0b98 100644\n--- a/drivers/input/keyboard/Makefile\n+++ b/drivers/input/keyboard/Makefile\n@@ -40,6 +40,7 @@ obj-$(CONFIG_KEYBOARD_MATRIX)\t\t+= matrix_keypad.o\n obj-$(CONFIG_KEYBOARD_MAX7359)\t\t+= max7359_keypad.o\n obj-$(CONFIG_KEYBOARD_MCS)\t\t+= mcs_touchkey.o\n obj-$(CONFIG_KEYBOARD_MPR121)\t\t+= mpr121_touchkey.o\n+obj-$(CONFIG_KEYBOARD_MTK_PMIC) \t+= mtk-pmic-keys.o\n obj-$(CONFIG_KEYBOARD_NEWTON)\t\t+= newtonkbd.o\n obj-$(CONFIG_KEYBOARD_NOMADIK)\t\t+= nomadik-ske-keypad.o\n obj-$(CONFIG_KEYBOARD_NSPIRE)\t\t+= nspire-keypad.o\ndiff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c\nnew file mode 100644\nindex 0000000..23b6ee4\n--- /dev/null\n+++ b/drivers/input/keyboard/mtk-pmic-keys.c\n@@ -0,0 +1,354 @@\n+/*\n+ * Copyright (C) 2017 MediaTek, Inc.\n+ *\n+ * Author: Chen Zhong <chen.zhong@mediatek.com>\n+ *\n+ * This software is licensed under the terms of the GNU General Public\n+ * License version 2, as published by the Free Software Foundation, and\n+ * may be copied, distributed, and modified under those terms.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ */\n+\n+#include <linux/module.h>\n+#include <linux/kernel.h>\n+#include <linux/input.h>\n+#include <linux/interrupt.h>\n+#include <linux/platform_device.h>\n+#include <linux/kernel.h>\n+#include <linux/of.h>\n+#include <linux/of_device.h>\n+#include <linux/regmap.h>\n+#include <linux/mfd/mt6323/registers.h>\n+#include <linux/mfd/mt6397/registers.h>\n+#include <linux/mfd/mt6397/core.h>\n+\n+#define MTK_PMIC_PWRKEY_RST_EN_MASK\t0x1\n+#define MTK_PMIC_PWRKEY_RST_EN_SHIFT\t6\n+#define MTK_PMIC_HOMEKEY_RST_EN_MASK\t0x1\n+#define MTK_PMIC_HOMEKEY_RST_EN_SHIFT\t5\n+#define MTK_PMIC_RST_DU_MASK\t\t0x3\n+#define MTK_PMIC_RST_DU_SHIFT\t\t8\n+\n+#define MTK_PMIC_PWRKEY_RST\t\t\\\n+\t(MTK_PMIC_PWRKEY_RST_EN_MASK << MTK_PMIC_PWRKEY_RST_EN_SHIFT)\n+#define MTK_PMIC_HOMEKEY_RST\t\t\\\n+\t(MTK_PMIC_HOMEKEY_RST_EN_MASK << MTK_PMIC_HOMEKEY_RST_EN_SHIFT)\n+\n+#define MTK_PMIC_PWRKEY_INDEX\t0\n+#define MTK_PMIC_HOMEKEY_INDEX\t1\n+#define MTK_PMIC_MAX_KEY_COUNT\t2\n+\n+struct mtk_pmic_keys_regs {\n+\tu32 deb_reg;\n+\tu32 deb_mask;\n+\tu32 intsel_reg;\n+\tu32 intsel_mask;\n+};\n+\n+#define MTK_PMIC_KEYS_REGS(_deb_reg, _deb_mask,\t\t\\\n+\t_intsel_reg, _intsel_mask)\t\t\t\\\n+{\t\t\t\t\t\t\t\\\n+\t.deb_reg\t\t= _deb_reg,\t\t\\\n+\t.deb_mask\t\t= _deb_mask,\t\t\\\n+\t.intsel_reg\t\t= _intsel_reg,\t\t\\\n+\t.intsel_mask\t\t= _intsel_mask,\t\t\\\n+}\n+\n+struct mtk_pmic_regs {\n+\tconst struct mtk_pmic_keys_regs keys_regs[MTK_PMIC_MAX_KEY_COUNT];\n+\tu32 pmic_rst_reg;\n+};\n+\n+static const struct mtk_pmic_regs mt6397_regs = {\n+\t.keys_regs[MTK_PMIC_PWRKEY_INDEX] =\n+\t\tMTK_PMIC_KEYS_REGS(MT6397_CHRSTATUS,\n+\t\t0x8, MT6397_INT_RSV, 0x10),\n+\t.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =\n+\t\tMTK_PMIC_KEYS_REGS(MT6397_OCSTATUS2,\n+\t\t0x10, MT6397_INT_RSV, 0x8),\n+\t.pmic_rst_reg = MT6397_TOP_RST_MISC,\n+};\n+\n+static const struct mtk_pmic_regs mt6323_regs = {\n+\t.keys_regs[MTK_PMIC_PWRKEY_INDEX] =\n+\t\tMTK_PMIC_KEYS_REGS(MT6323_CHRSTATUS,\n+\t\t0x2, MT6323_INT_MISC_CON, 0x10),\n+\t.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =\n+\t\tMTK_PMIC_KEYS_REGS(MT6323_CHRSTATUS,\n+\t\t0x4, MT6323_INT_MISC_CON, 0x8),\n+\t.pmic_rst_reg = MT6323_TOP_RST_MISC,\n+};\n+\n+struct mtk_pmic_keys_info {\n+\tstruct mtk_pmic_keys *keys;\n+\tconst struct mtk_pmic_keys_regs *regs;\n+\tunsigned int keycode;\n+\tint irq;\n+\tbool wakeup:1;\n+};\n+\n+struct mtk_pmic_keys {\n+\tstruct input_dev *input_dev;\n+\tstruct device *dev;\n+\tstruct regmap *regmap;\n+\tstruct mtk_pmic_keys_info keys[MTK_PMIC_MAX_KEY_COUNT];\n+};\n+\n+enum mtk_pmic_keys_lp_mode {\n+\tLP_DISABLE,\n+\tLP_ONEKEY,\n+\tLP_TWOKEY,\n+};\n+\n+static void mtk_pmic_keys_lp_reset_setup(struct mtk_pmic_keys *keys,\n+\t\tu32 pmic_rst_reg)\n+{\n+\tint ret;\n+\tu32 long_press_mode, long_press_debounce;\n+\n+\tret = of_property_read_u32(keys->dev->of_node,\n+\t\t\"debounce-interval\", &long_press_debounce);\n+\tif (ret)\n+\t\tlong_press_debounce = 0;\n+\n+\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t   MTK_PMIC_RST_DU_MASK << MTK_PMIC_RST_DU_SHIFT,\n+\t\t\t   long_press_debounce << MTK_PMIC_RST_DU_SHIFT);\n+\n+\tret = of_property_read_u32(keys->dev->of_node,\n+\t\t\"mediatek,long-press-mode\", &long_press_mode);\n+\tif (ret)\n+\t\tlong_press_mode = LP_DISABLE;\n+\n+\tswitch (long_press_mode) {\n+\tcase LP_ONEKEY:\n+\t\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t\t   MTK_PMIC_PWRKEY_RST,\n+\t\t\t\t   MTK_PMIC_PWRKEY_RST);\n+\t\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t\t   MTK_PMIC_HOMEKEY_RST,\n+\t\t\t\t   0);\n+\t\tbreak;\n+\tcase LP_TWOKEY:\n+\t\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t\t   MTK_PMIC_PWRKEY_RST,\n+\t\t\t\t   MTK_PMIC_PWRKEY_RST);\n+\t\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t\t   MTK_PMIC_HOMEKEY_RST,\n+\t\t\t\t   MTK_PMIC_HOMEKEY_RST);\n+\t\tbreak;\n+\tcase LP_DISABLE:\n+\t\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t\t   MTK_PMIC_PWRKEY_RST,\n+\t\t\t\t   0);\n+\t\tregmap_update_bits(keys->regmap, pmic_rst_reg,\n+\t\t\t\t   MTK_PMIC_HOMEKEY_RST,\n+\t\t\t\t   0);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+}\n+\n+static irqreturn_t mtk_pmic_keys_irq_handler_thread(int irq, void *data)\n+{\n+\tstruct mtk_pmic_keys_info *info = data;\n+\tu32 key_deb, pressed;\n+\n+\tregmap_read(info->keys->regmap, info->regs->deb_reg, &key_deb);\n+\n+\tkey_deb &= info->regs->deb_mask;\n+\n+\tpressed = !key_deb;\n+\n+\tinput_report_key(info->keys->input_dev, info->keycode, pressed);\n+\tinput_sync(info->keys->input_dev);\n+\n+\tdev_dbg(info->keys->dev, \"(%s) key =%d using PMIC\\n\",\n+\t\t pressed ? \"pressed\" : \"released\", info->keycode);\n+\n+\treturn IRQ_HANDLED;\n+}\n+\n+static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,\n+\t\tstruct mtk_pmic_keys_info *info)\n+{\n+\tint ret;\n+\n+\tinfo->keys = keys;\n+\n+\tret = regmap_update_bits(keys->regmap, info->regs->intsel_reg,\n+\t\t\t\t info->regs->intsel_mask,\n+\t\t\t\t info->regs->intsel_mask);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tret = devm_request_threaded_irq(keys->dev, info->irq, NULL,\n+\t\t\t\t\tmtk_pmic_keys_irq_handler_thread,\n+\t\t\t\t\tIRQF_ONESHOT | IRQF_TRIGGER_HIGH,\n+\t\t\t\t\t\"mtk-pmic-keys\", info);\n+\tif (ret) {\n+\t\tdev_err(keys->dev, \"Failed to request IRQ: %d: %d\\n\",\n+\t\t\tinfo->irq, ret);\n+\t\treturn ret;\n+\t}\n+\n+\tinput_set_capability(keys->input_dev, EV_KEY, info->keycode);\n+\n+\treturn 0;\n+}\n+\n+#ifdef CONFIG_PM_SLEEP\n+static int mtk_pmic_keys_suspend(struct device *dev)\n+{\n+\tstruct mtk_pmic_keys *keys = dev_get_drvdata(dev);\n+\tint index;\n+\n+\tfor (index = 0; index < MTK_PMIC_MAX_KEY_COUNT; index++) {\n+\t\tif (keys->keys[index].wakeup)\n+\t\t\tenable_irq_wake(keys->keys[index].irq);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int mtk_pmic_keys_resume(struct device *dev)\n+{\n+\tstruct mtk_pmic_keys *keys = dev_get_drvdata(dev);\n+\tint index;\n+\n+\tfor (index = 0; index < MTK_PMIC_MAX_KEY_COUNT; index++) {\n+\t\tif (keys->keys[index].wakeup)\n+\t\t\tdisable_irq_wake(keys->keys[index].irq);\n+\t}\n+\n+\treturn 0;\n+}\n+#endif\n+\n+static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,\n+\t\t\tmtk_pmic_keys_resume);\n+\n+static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {\n+\t{\n+\t\t.compatible = \"mediatek,mt6397-keys\",\n+\t\t.data = &mt6397_regs,\n+\t}, {\n+\t\t.compatible = \"mediatek,mt6323-keys\",\n+\t\t.data = &mt6323_regs,\n+\t}, {\n+\t\t/* sentinel */\n+\t}\n+};\n+MODULE_DEVICE_TABLE(of, of_mtk_pmic_keys_match_tbl);\n+\n+static int mtk_pmic_keys_probe(struct platform_device *pdev)\n+{\n+\tint error, index = 0;\n+\tunsigned int keycount;\n+\tunsigned int keycodes[MTK_PMIC_MAX_KEY_COUNT];\n+\tunsigned int wakeup_srcs[MTK_PMIC_MAX_KEY_COUNT] = {0};\n+\tstruct mt6397_chip *pmic_chip = dev_get_drvdata(pdev->dev.parent);\n+\tstruct mtk_pmic_keys *keys;\n+\tconst struct mtk_pmic_regs *mtk_pmic_regs;\n+\tstruct input_dev *input_dev;\n+\tconst struct of_device_id *of_id =\n+\t\tof_match_device(of_mtk_pmic_keys_match_tbl, &pdev->dev);\n+\n+\tkeys = devm_kzalloc(&pdev->dev, sizeof(*keys), GFP_KERNEL);\n+\tif (!keys)\n+\t\treturn -ENOMEM;\n+\n+\tkeys->dev = &pdev->dev;\n+\tkeys->regmap = pmic_chip->regmap;\n+\tmtk_pmic_regs = of_id->data;\n+\n+\tkeys->input_dev = input_dev = devm_input_allocate_device(keys->dev);\n+\tif (!input_dev) {\n+\t\tdev_err(keys->dev, \"input allocate device fail.\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tinput_dev->name = \"mtk-pmic-keys\";\n+\tinput_dev->id.bustype = BUS_HOST;\n+\tinput_dev->id.vendor = 0x0001;\n+\tinput_dev->id.product = 0x0001;\n+\tinput_dev->id.version = 0x0001;\n+\n+\tkeycount = device_property_read_u32_array(keys->dev, \"linux,keycodes\",\n+\t\t\t\t\t\t  NULL, 0);\n+\tif (keycount > MTK_PMIC_MAX_KEY_COUNT) {\n+\t\tdev_err(keys->dev, \"too many keys defined (%d)\\n\", keycount);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\terror = device_property_read_u32_array(keys->dev, \"linux,keycodes\",\n+\t\t\t\t\t       keycodes, keycount);\n+\tif (error) {\n+\t\tdev_err(keys->dev,\n+\t\t\t\"failed to read linux,keycode property: %d\\n\", error);\n+\t\treturn error;\n+\t}\n+\n+\tif (device_property_read_bool(keys->dev, \"wakeup-source\")) {\n+\t\terror = device_property_read_u32_array(keys->dev,\n+\t\t\t\t\t\t       \"mediatek,wakeup-keys\",\n+\t\t\t\t\t\t       wakeup_srcs, keycount);\n+\t\tif (error) {\n+\t\t\tdev_err(keys->dev,\n+\t\t\t\t\"failed to read wakeup-source property: %d\\n\",\n+\t\t\t\terror);\n+\t\t\treturn error;\n+\t\t}\n+\t}\n+\n+\tfor (index = 0; index < keycount; index++) {\n+\t\tkeys->keys[index].regs = &mtk_pmic_regs->keys_regs[index];\n+\n+\t\tkeys->keys[index].irq = platform_get_irq(pdev, index);\n+\t\tif (keys->keys[index].irq < 0)\n+\t\t\treturn keys->keys[index].irq;\n+\n+\t\tkeys->keys[index].keycode = keycodes[index];\n+\n+\t\tif (wakeup_srcs[index])\n+\t\t\tkeys->keys[index].wakeup = true;\n+\n+\t\terror = mtk_pmic_key_setup(keys, &keys->keys[index]);\n+\t\tif (error)\n+\t\t\treturn error;\n+\t}\n+\n+\terror = input_register_device(input_dev);\n+\tif (error) {\n+\t\tdev_err(&pdev->dev,\n+\t\t\t\"register input device failed (%d)\\n\", error);\n+\t\treturn error;\n+\t}\n+\n+\tmtk_pmic_keys_lp_reset_setup(keys, mtk_pmic_regs->pmic_rst_reg);\n+\n+\tplatform_set_drvdata(pdev, keys);\n+\n+\treturn 0;\n+}\n+\n+static struct platform_driver pmic_keys_pdrv = {\n+\t.probe = mtk_pmic_keys_probe,\n+\t.driver = {\n+\t\t   .name = \"mtk-pmic-keys\",\n+\t\t   .of_match_table = of_mtk_pmic_keys_match_tbl,\n+\t\t   .pm = &mtk_pmic_keys_pm_ops,\n+\t},\n+};\n+\n+module_platform_driver(pmic_keys_pdrv);\n+\n+MODULE_LICENSE(\"GPL v2\");\n+MODULE_AUTHOR(\"Chen Zhong <chen.zhong@mediatek.com>\");\n+MODULE_DESCRIPTION(\"MTK pmic-keys driver v0.1\");\n",
    "prefixes": [
        "v4",
        "4/5"
    ]
}