Commit cd01569b authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Dmitry Torokhov

Input: mtk-pmic-keys - add support for MT6331 PMIC keys

Add support for PMIC Keys of the MT6331 PMIC.
Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220913123941.385349-1-angelogioacchino.delregno@collabora.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent e7ed42a4
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mfd/mt6323/registers.h> #include <linux/mfd/mt6323/registers.h>
#include <linux/mfd/mt6331/registers.h>
#include <linux/mfd/mt6358/registers.h> #include <linux/mfd/mt6358/registers.h>
#include <linux/mfd/mt6397/core.h> #include <linux/mfd/mt6397/core.h>
#include <linux/mfd/mt6397/registers.h> #include <linux/mfd/mt6397/registers.h>
...@@ -22,6 +23,10 @@ ...@@ -22,6 +23,10 @@
#define MTK_PMIC_PWRKEY_RST BIT(6) #define MTK_PMIC_PWRKEY_RST BIT(6)
#define MTK_PMIC_HOMEKEY_RST BIT(5) #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_PWRKEY_INDEX 0
#define MTK_PMIC_HOMEKEY_INDEX 1 #define MTK_PMIC_HOMEKEY_INDEX 1
#define MTK_PMIC_MAX_KEY_COUNT 2 #define MTK_PMIC_MAX_KEY_COUNT 2
...@@ -72,6 +77,19 @@ static const struct mtk_pmic_regs mt6323_regs = { ...@@ -72,6 +77,19 @@ static const struct mtk_pmic_regs mt6323_regs = {
.rst_lprst_mask = MTK_PMIC_RST_DU_MASK, .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 = { static const struct mtk_pmic_regs mt6358_regs = {
.keys_regs[MTK_PMIC_PWRKEY_INDEX] = .keys_regs[MTK_PMIC_PWRKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS, MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS,
...@@ -255,6 +273,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = { ...@@ -255,6 +273,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
}, { }, {
.compatible = "mediatek,mt6323-keys", .compatible = "mediatek,mt6323-keys",
.data = &mt6323_regs, .data = &mt6323_regs,
}, {
.compatible = "mediatek,mt6331-keys",
.data = &mt6331_regs,
}, { }, {
.compatible = "mediatek,mt6358-keys", .compatible = "mediatek,mt6358-keys",
.data = &mt6358_regs, .data = &mt6358_regs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment