linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition
@ 2019-05-13 14:21 Fabien Parent
  2019-05-13 14:21 ` [PATCH 2/2] input: keyboard: mtk-pmic-keys: add MT6392 support Fabien Parent
  2019-06-13 20:28 ` [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Fabien Parent @ 2019-05-13 14:21 UTC (permalink / raw)
  To: dmitry.torokhov, robh+dt, mark.rutland, matthias.bgg
  Cc: linux-input, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent

Add the binding documentation of the mtk-pmic-keys for the MT6392 PMICs.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
---
 .../devicetree/bindings/input/mtk-pmic-keys.txt       | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
index 2888d07c2ef0..858f78e7262c 100644
--- a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
+++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
@@ -1,15 +1,18 @@
-MediaTek MT6397/MT6323 PMIC Keys Device Driver
+MediaTek MT6397/MT6392/MT6323 PMIC Keys Device Driver
 
-There are two key functions provided by MT6397/MT6323 PMIC, pwrkey
+There are two key functions provided by MT6397/MT6392/MT6323 PMIC, pwrkey
 and homekey. The key functions are defined as the subnode of the function
 node provided by MT6397/MT6323 PMIC that is being defined as one kind
 of Muti-Function Device (MFD)
 
-For MT6397/MT6323 MFD bindings see:
+For MT6397/MT6392/MT6323 MFD bindings see:
 Documentation/devicetree/bindings/mfd/mt6397.txt
 
 Required properties:
-- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
+- compatible: Should be one of:
+	- "mediatek,mt6397-keys"
+	- "mediatek,mt6392-keys"
+	- "mediatek,mt6323-keys"
 - linux,keycodes: See Documentation/devicetree/bindings/input/keys.txt
 
 Optional Properties:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] input: keyboard: mtk-pmic-keys: add MT6392 support
  2019-05-13 14:21 [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition Fabien Parent
@ 2019-05-13 14:21 ` Fabien Parent
  2019-05-23 22:55   ` Dmitry Torokhov
  2019-06-13 20:28 ` [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition Rob Herring
  1 sibling, 1 reply; 4+ messages in thread
From: Fabien Parent @ 2019-05-13 14:21 UTC (permalink / raw)
  To: dmitry.torokhov, robh+dt, mark.rutland, matthias.bgg
  Cc: linux-input, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent

Add support for MT6392 PMIC's keys.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
---
 drivers/input/keyboard/mtk-pmic-keys.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 8e6ebab05ab4..aaf68cbf7e5b 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/mfd/mt6323/registers.h>
+#include <linux/mfd/mt6392/registers.h>
 #include <linux/mfd/mt6397/core.h>
 #include <linux/mfd/mt6397/registers.h>
 #include <linux/module.h>
@@ -83,6 +84,16 @@ static const struct mtk_pmic_regs mt6323_regs = {
 	.pmic_rst_reg = MT6323_TOP_RST_MISC,
 };
 
+static const struct mtk_pmic_regs mt6392_regs = {
+	.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
+		MTK_PMIC_KEYS_REGS(MT6392_CHRSTATUS,
+		0x2, MT6392_INT_MISC_CON, 0x10),
+	.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
+		MTK_PMIC_KEYS_REGS(MT6392_CHRSTATUS,
+		0x4, MT6392_INT_MISC_CON, 0x8),
+	.pmic_rst_reg = MT6392_TOP_RST_MISC,
+};
+
 struct mtk_pmic_keys_info {
 	struct mtk_pmic_keys *keys;
 	const struct mtk_pmic_keys_regs *regs;
@@ -238,6 +249,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
 	}, {
 		.compatible = "mediatek,mt6323-keys",
 		.data = &mt6323_regs,
+	}, {
+		.compatible = "mediatek,mt6392-keys",
+		.data = &mt6392_regs,
 	}, {
 		/* sentinel */
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] input: keyboard: mtk-pmic-keys: add MT6392 support
  2019-05-13 14:21 ` [PATCH 2/2] input: keyboard: mtk-pmic-keys: add MT6392 support Fabien Parent
@ 2019-05-23 22:55   ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2019-05-23 22:55 UTC (permalink / raw)
  To: Fabien Parent
  Cc: robh+dt, mark.rutland, matthias.bgg, linux-input, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel

On Mon, May 13, 2019 at 04:21:20PM +0200, Fabien Parent wrote:
> Add support for MT6392 PMIC's keys.
> 
> Signed-off-by: Fabien Parent <fparent@baylibre.com>

Apparently this depends on not-yet merged MT6392 support in MFD, so
please merge through MFD tree with the rest of it.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/input/keyboard/mtk-pmic-keys.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
> index 8e6ebab05ab4..aaf68cbf7e5b 100644
> --- a/drivers/input/keyboard/mtk-pmic-keys.c
> +++ b/drivers/input/keyboard/mtk-pmic-keys.c
> @@ -18,6 +18,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/kernel.h>
>  #include <linux/mfd/mt6323/registers.h>
> +#include <linux/mfd/mt6392/registers.h>
>  #include <linux/mfd/mt6397/core.h>
>  #include <linux/mfd/mt6397/registers.h>
>  #include <linux/module.h>
> @@ -83,6 +84,16 @@ static const struct mtk_pmic_regs mt6323_regs = {
>  	.pmic_rst_reg = MT6323_TOP_RST_MISC,
>  };
>  
> +static const struct mtk_pmic_regs mt6392_regs = {
> +	.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
> +		MTK_PMIC_KEYS_REGS(MT6392_CHRSTATUS,
> +		0x2, MT6392_INT_MISC_CON, 0x10),
> +	.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
> +		MTK_PMIC_KEYS_REGS(MT6392_CHRSTATUS,
> +		0x4, MT6392_INT_MISC_CON, 0x8),
> +	.pmic_rst_reg = MT6392_TOP_RST_MISC,
> +};
> +
>  struct mtk_pmic_keys_info {
>  	struct mtk_pmic_keys *keys;
>  	const struct mtk_pmic_keys_regs *regs;
> @@ -238,6 +249,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
>  	}, {
>  		.compatible = "mediatek,mt6323-keys",
>  		.data = &mt6323_regs,
> +	}, {
> +		.compatible = "mediatek,mt6392-keys",
> +		.data = &mt6392_regs,
>  	}, {
>  		/* sentinel */
>  	}
> -- 
> 2.20.1
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition
  2019-05-13 14:21 [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition Fabien Parent
  2019-05-13 14:21 ` [PATCH 2/2] input: keyboard: mtk-pmic-keys: add MT6392 support Fabien Parent
@ 2019-06-13 20:28 ` Rob Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2019-06-13 20:28 UTC (permalink / raw)
  To: Fabien Parent
  Cc: dmitry.torokhov, robh+dt, mark.rutland, matthias.bgg,
	linux-input, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent

On Mon, 13 May 2019 16:21:19 +0200, Fabien Parent wrote:
> Add the binding documentation of the mtk-pmic-keys for the MT6392 PMICs.
> 
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> ---
>  .../devicetree/bindings/input/mtk-pmic-keys.txt       | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-13 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 14:21 [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition Fabien Parent
2019-05-13 14:21 ` [PATCH 2/2] input: keyboard: mtk-pmic-keys: add MT6392 support Fabien Parent
2019-05-23 22:55   ` Dmitry Torokhov
2019-06-13 20:28 ` [PATCH 1/2] dt-bindings: input: mtk-pmic-keys: add MT6392 binding definition Rob Herring

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).