* [PATCH v3] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys
@ 2022-09-13 12:39 AngeloGioacchino Del Regno
2022-09-13 16:54 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-13 12:39 UTC (permalink / raw)
To: dmitry.torokhov
Cc: matthias.bgg, mkorpershoek, angelogioacchino.delregno,
linux-input, linux-arm-kernel, linux-mediatek, linux-kernel
Add support for PMIC Keys of the MT6331 PMIC.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
v3: Rebased on next-20220909, leftover patch from series
https://patchwork.kernel.org/project/linux-mediatek/list/?series=644591
drivers/input/keyboard/mtk-pmic-keys.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 6404081253ea..9b34da0ec260 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -9,6 +9,7 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/mt6323/registers.h>
+#include <linux/mfd/mt6331/registers.h>
#include <linux/mfd/mt6358/registers.h>
#include <linux/mfd/mt6397/core.h>
#include <linux/mfd/mt6397/registers.h>
@@ -22,6 +23,10 @@
#define MTK_PMIC_PWRKEY_RST BIT(6)
#define MTK_PMIC_HOMEKEY_RST BIT(5)
+#define MTK_PMIC_MT6331_RST_DU_MASK GENMASK(13, 12)
+#define MTK_PMIC_MT6331_PWRKEY_RST BIT(9)
+#define MTK_PMIC_MT6331_HOMEKEY_RST BIT(8)
+
#define MTK_PMIC_PWRKEY_INDEX 0
#define MTK_PMIC_HOMEKEY_INDEX 1
#define MTK_PMIC_MAX_KEY_COUNT 2
@@ -72,6 +77,19 @@ static const struct mtk_pmic_regs mt6323_regs = {
.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
};
+static const struct mtk_pmic_regs mt6331_regs = {
+ .keys_regs[MTK_PMIC_PWRKEY_INDEX] =
+ MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x2,
+ MT6331_INT_MISC_CON, 0x4,
+ MTK_PMIC_MT6331_PWRKEY_RST),
+ .keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
+ MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x4,
+ MT6331_INT_MISC_CON, 0x2,
+ MTK_PMIC_MT6331_HOMEKEY_RST),
+ .pmic_rst_reg = MT6331_TOP_RST_MISC,
+ .rst_lprst_mask = MTK_PMIC_MT6331_RST_DU_MASK,
+};
+
static const struct mtk_pmic_regs mt6358_regs = {
.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS,
@@ -255,6 +273,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
}, {
.compatible = "mediatek,mt6323-keys",
.data = &mt6323_regs,
+ }, {
+ .compatible = "mediatek,mt6331-keys",
+ .data = &mt6331_regs,
}, {
.compatible = "mediatek,mt6358-keys",
.data = &mt6358_regs,
--
2.37.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys
2022-09-13 12:39 [PATCH v3] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys AngeloGioacchino Del Regno
@ 2022-09-13 16:54 ` Dmitry Torokhov
2022-09-14 8:03 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2022-09-13 16:54 UTC (permalink / raw)
To: AngeloGioacchino Del Regno
Cc: matthias.bgg, mkorpershoek, linux-input, linux-arm-kernel,
linux-mediatek, linux-kernel
On Tue, Sep 13, 2022 at 02:39:41PM +0200, AngeloGioacchino Del Regno wrote:
> Add support for PMIC Keys of the MT6331 PMIC.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Applied, thank you. But we also need to add the compatible to the list
in Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
Thanks.
--
Dmitry
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys
2022-09-13 16:54 ` Dmitry Torokhov
@ 2022-09-14 8:03 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-14 8:03 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: matthias.bgg, mkorpershoek, linux-input, linux-arm-kernel,
linux-mediatek, linux-kernel
Il 13/09/22 18:54, Dmitry Torokhov ha scritto:
> On Tue, Sep 13, 2022 at 02:39:41PM +0200, AngeloGioacchino Del Regno wrote:
>> Add support for PMIC Keys of the MT6331 PMIC.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
>
> Applied, thank you. But we also need to add the compatible to the list
> in Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
>
> Thanks.
>
Right. Sending a commit for that asap.
Thank you!
Angelo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-14 8:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 12:39 [PATCH v3] Input: mtk-pmic-keys - Add support for MT6331 PMIC keys AngeloGioacchino Del Regno
2022-09-13 16:54 ` Dmitry Torokhov
2022-09-14 8:03 ` AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).