From: Matthias Brugger <matthias.bgg@gmail.com>
To: Chen Zhong <chen.zhong@mediatek.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Lee Jones <lee.jones@linaro.org>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] input: Add MediaTek PMIC keys support
Date: Wed, 2 Aug 2017 12:33:08 +0200 [thread overview]
Message-ID: <a6b77a6e-00bb-8aa1-86fe-f158bd96abbc@gmail.com> (raw)
In-Reply-To: <1501643840-21485-4-git-send-email-chen.zhong@mediatek.com>
On 08/02/2017 05:17 AM, Chen Zhong wrote:
> This patch add support to handle MediaTek PMIC MT6397/MT6323 key
> interrupts including pwrkey and homekey, also add setting for
> long press key shutdown behavior.
>
> Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> ---
> drivers/input/keyboard/mtk-pmic-keys.c | 320 ++++++++++++++++++++++++++++++++
> 1 file changed, 320 insertions(+)
> create mode 100644 drivers/input/keyboard/mtk-pmic-keys.c
>
> diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
> new file mode 100644
> index 0000000..0ea7d17
> --- /dev/null
> +++ b/drivers/input/keyboard/mtk-pmic-keys.c
> @@ -0,0 +1,320 @@
> +/*
> + * Copyright (C) 2017 MediaTek, Inc.
> + *
> + * Author: Chen Zhong <chen.zhong@mediatek.com>
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include <linux/ioctl.h>
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/input.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/kernel.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/regmap.h>
> +#include <linux/mfd/mt6323/registers.h>
> +#include <linux/mfd/mt6397/registers.h>
> +#include <linux/mfd/mt6397/core.h>
> +#include <linux/slab.h>
> +#include <linux/irqdomain.h>
> +
> +#define PWRKEY_RST_EN_MASK 0x1
> +#define PWRKEY_RST_EN_SHIFT 6
> +#define HOMEKEY_RST_EN_MASK 0x1
> +#define HOMEKEY_RST_EN_SHIFT 5
> +#define RST_DU_MASK 0x3
> +#define RST_DU_SHIFT 8
> +
> +struct pmic_keys_regs {
> + u32 deb_reg;
> + u32 deb_mask;
> + u32 intsel_reg;
> + u32 intsel_mask;
> +};
> +
> +#define PMIC_KEYS_REGS(_deb_reg, _deb_mask, _intsel_reg, _intsel_mask) \
> +{ \
> + .deb_reg = _deb_reg, \
> + .deb_mask = _deb_mask, \
> + .intsel_reg = _intsel_reg, \
> + .intsel_mask = _intsel_mask, \
> +}
> +
> +struct pmic_regs {
> + const struct pmic_keys_regs pwrkey_regs;
> + const struct pmic_keys_regs homekey_regs;
> + u32 pmic_rst_reg;
> +};
> +
> +static const struct pmic_regs mt6397_regs = {
> + .pwrkey_regs = PMIC_KEYS_REGS(MT6397_CHRSTATUS,
> + 0x8, MT6397_INT_RSV, 0x10),
> + .homekey_regs = PMIC_KEYS_REGS(MT6397_OCSTATUS2,
> + 0x10, MT6397_INT_RSV, 0x8),
> + .pmic_rst_reg = MT6397_TOP_RST_MISC,
> +};
> +
> +static const struct pmic_regs mt6323_regs = {
> + .pwrkey_regs = PMIC_KEYS_REGS(MT6323_CHRSTATUS,
> + 0x2, MT6323_INT_MISC_CON, 0x10),
> + .homekey_regs = PMIC_KEYS_REGS(MT6323_CHRSTATUS,
> + 0x4, MT6323_INT_MISC_CON, 0x8),
> + .pmic_rst_reg = MT6323_TOP_RST_MISC,
> +};
Where are this MTxxxx_CHRSTATUS defined?
Regards,
Matthias
next prev parent reply other threads:[~2017-08-02 10:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 3:17 [PATCH 0/4] " Chen Zhong
2017-08-02 3:17 ` [PATCH 1/4] dt-bindings: input: Add document bindings for mtk-pmic-keys Chen Zhong
2017-08-02 3:17 ` [PATCH 2/4] dt-bindings: mfd: Add bindings for the keys as subnode of PMIC Chen Zhong
2017-08-02 3:17 ` [PATCH 3/4] input: Add MediaTek PMIC keys support Chen Zhong
2017-08-02 5:10 ` Dmitry Torokhov
2017-08-02 13:41 ` Chen Zhong
2017-08-02 10:33 ` Matthias Brugger [this message]
2017-08-02 13:46 ` Chen Zhong
2017-08-02 3:17 ` [PATCH 4/4] mfd: mt6397: Add PMIC keys support to MT6397 driver Chen Zhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6b77a6e-00bb-8aa1-86fe-f158bd96abbc@gmail.com \
--to=matthias.bgg@gmail.com \
--cc=chen.zhong@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®