Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1719775 > unrolled thread
| Started by | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| First post | 2017-08-25 08:40 +0200 |
| Last post | 2017-08-26 04:40 +0200 |
| Articles | 14 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH v3 0/5] Add MediaTek PMIC keys support Chen Zhong <chen.zhong@mediatek.com> - 2017-08-25 08:40 +0200
[PATCH v3 3/5] dt-bindings: mfd: Add bindings for the keys as subnode of PMIC Chen Zhong <chen.zhong@mediatek.com> - 2017-08-25 08:40 +0200
Re: [PATCH v3 3/5] dt-bindings: mfd: Add bindings for the keys as subnode of PMIC Lee Jones <lee.jones@linaro.org> - 2017-09-05 09:40 +0200
[PATCH v3 1/5] mfd: mt6397: create irq mappings in mfd core driver Chen Zhong <chen.zhong@mediatek.com> - 2017-08-25 08:40 +0200
Re: [PATCH v3 1/5] mfd: mt6397: create irq mappings in mfd core driver Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-08-25 10:50 +0200
[PATCH v3 5/5] mfd: mt6397: Add PMIC keys support to MT6397 driver Chen Zhong <chen.zhong@mediatek.com> - 2017-08-25 08:40 +0200
Re: [PATCH v3 5/5] mfd: mt6397: Add PMIC keys support to MT6397 driver Lee Jones <lee.jones@linaro.org> - 2017-09-05 09:40 +0200
[PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys Chen Zhong <chen.zhong@mediatek.com> - 2017-08-25 08:40 +0200
Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys Rob Herring <robh@kernel.org> - 2017-08-31 22:00 +0200
Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys Chen Zhong <chen.zhong@mediatek.com> - 2017-09-01 04:10 +0200
Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys Chen Zhong <chen.zhong@mediatek.com> - 2017-09-02 04:20 +0200
Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys Rob Herring <robh@kernel.org> - 2017-09-05 18:10 +0200
Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys Chen Zhong <chen.zhong@mediatek.com> - 2017-09-07 05:10 +0200
Re: [PATCH v3 0/5] Add MediaTek PMIC keys support Chen Zhong <chen.zhong@mediatek.com> - 2017-08-26 04:40 +0200
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-08-25 08:40 +0200 |
| Subject | [PATCH v3 0/5] Add MediaTek PMIC keys support |
| Message-ID | <uigrD-xp-3@gated-at.bofh.it> |
MediaTek PMIC are multi-function devices that can handle key interrupts, typically there are two keys attached to PMIC, which called pwrkey and homekey. PWRKEY usually used to wake up system from sleep. Homekey can used as volume down key due to board design. Long press keys can shutdown PMIC, the mode can be choose to be one key only or two keys together. This series add support for key functions for MediaTek PMIC MT6397/MT6323. Chen Zhong (5): mfd: mt6397: create irq mappings in mfd core driver dt-bindings: input: Add document bindings for mtk-pmic-keys dt-bindings: mfd: Add bindings for the keys as subnode of PMIC input: Add MediaTek PMIC keys support mfd: mt6397: Add PMIC keys support to MT6397 driver .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 +++ Documentation/devicetree/bindings/mfd/mt6397.txt | 6 + drivers/input/keyboard/Kconfig | 9 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mtk-pmic-keys.c | 308 +++++++++++++++++++++ drivers/mfd/mt6397-core.c | 26 +- drivers/rtc/rtc-mt6397.c | 7 +- 7 files changed, 388 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt create mode 100644 drivers/input/keyboard/mtk-pmic-keys.c -- 1.9.1
[toc] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-08-25 08:40 +0200 |
| Subject | [PATCH v3 3/5] dt-bindings: mfd: Add bindings for the keys as subnode of PMIC |
| Message-ID | <uigrD-xp-15@gated-at.bofh.it> |
| In reply to | #1719775 |
This patch adds documentation for device tree bindings for keys support
as the subnode of MT6397/MT6323 PMIC.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
---
Documentation/devicetree/bindings/mfd/mt6397.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
index 522a3bb..d1df77f 100644
--- a/Documentation/devicetree/bindings/mfd/mt6397.txt
+++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
@@ -7,6 +7,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules:
- GPIO
- Clock
- LED
+- Keys
It is interfaced to host controller using SPI interface by a proprietary hardware
called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap.
@@ -40,6 +41,11 @@ Optional subnodes:
- compatible: "mediatek,mt6323-led"
see Documentation/devicetree/bindings/leds/leds-mt6323.txt
+- keys
+ Required properties:
+ - compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
+ see Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
+
Example:
pwrap: pwrap@1000f000 {
compatible = "mediatek,mt8135-pwrap";
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2017-09-05 09:40 +0200 |
| Subject | Re: [PATCH v3 3/5] dt-bindings: mfd: Add bindings for the keys as subnode of PMIC |
| Message-ID | <umgCJ-8ei-1@gated-at.bofh.it> |
| In reply to | #1719776 |
On Fri, 25 Aug 2017, Chen Zhong wrote: > This patch adds documentation for device tree bindings for keys support > as the subnode of MT6397/MT6323 PMIC. > > Acked-by: Rob Herring <robh@kernel.org> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> > --- > Documentation/devicetree/bindings/mfd/mt6397.txt | 6 ++++++ > 1 file changed, 6 insertions(+) For my own reference: Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org> -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-08-25 08:40 +0200 |
| Subject | [PATCH v3 1/5] mfd: mt6397: create irq mappings in mfd core driver |
| Message-ID | <uigrD-xp-17@gated-at.bofh.it> |
| In reply to | #1719775 |
The core driver should create and manage irq mappings instead of leaf drivers. This patch change to pass irq domain to devm_mfd_add_devices() and it will create mapping for irq resources automatically. And remove irq mapping in rtc driver since this has been done in core driver. Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> --- drivers/mfd/mt6397-core.c | 4 ++-- drivers/rtc/rtc-mt6397.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 04a601f..6546d7f 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev) ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs, ARRAY_SIZE(mt6323_devs), NULL, - 0, NULL); + 0, pmic->irq_domain); break; case MT6397_CID_CODE: @@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev) ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs, ARRAY_SIZE(mt6397_devs), NULL, - 0, NULL); + 0, pmic->irq_domain); break; default: diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index 1a61fa5..385f830 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/drivers/rtc/rtc-mt6397.c @@ -322,10 +322,9 @@ static int mtk_rtc_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); rtc->addr_base = res->start; - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start); - if (rtc->irq <= 0) - return -EINVAL; + rtc->irq = platform_get_irq(pdev, 0); + if (rtc->irq < 0) + return rtc->irq; rtc->regmap = mt6397_chip->regmap; rtc->dev = &pdev->dev; -- 1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Date | 2017-08-25 10:50 +0200 |
| Subject | Re: [PATCH v3 1/5] mfd: mt6397: create irq mappings in mfd core driver |
| Message-ID | <uiits-1L5-23@gated-at.bofh.it> |
| In reply to | #1719777 |
On 25/08/2017 at 14:32:29 +0800, Chen Zhong wrote: > The core driver should create and manage irq mappings instead of > leaf drivers. This patch change to pass irq domain to > devm_mfd_add_devices() and it will create mapping for irq resources > automatically. And remove irq mapping in rtc driver since this has > been done in core driver. > > Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> > --- > drivers/mfd/mt6397-core.c | 4 ++-- > drivers/rtc/rtc-mt6397.c | 7 +++---- > 2 files changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c > index 04a601f..6546d7f 100644 > --- a/drivers/mfd/mt6397-core.c > +++ b/drivers/mfd/mt6397-core.c > @@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev) > > ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs, > ARRAY_SIZE(mt6323_devs), NULL, > - 0, NULL); > + 0, pmic->irq_domain); > break; > > case MT6397_CID_CODE: > @@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev) > > ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs, > ARRAY_SIZE(mt6397_devs), NULL, > - 0, NULL); > + 0, pmic->irq_domain); > break; > > default: > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c > index 1a61fa5..385f830 100644 > --- a/drivers/rtc/rtc-mt6397.c > +++ b/drivers/rtc/rtc-mt6397.c > @@ -322,10 +322,9 @@ static int mtk_rtc_probe(struct platform_device *pdev) > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > rtc->addr_base = res->start; > > - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > - rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start); > - if (rtc->irq <= 0) > - return -EINVAL; > + rtc->irq = platform_get_irq(pdev, 0); > + if (rtc->irq < 0) > + return rtc->irq; > > rtc->regmap = mt6397_chip->regmap; > rtc->dev = &pdev->dev; > -- > 1.7.9.5 > -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-08-25 08:40 +0200 |
| Subject | [PATCH v3 5/5] mfd: mt6397: Add PMIC keys support to MT6397 driver |
| Message-ID | <uigrE-xp-23@gated-at.bofh.it> |
| In reply to | #1719775 |
This patch adds compatible strings and interrupts for pmic keys
which serves as child device of MFD.
Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
---
drivers/mfd/mt6397-core.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 6546d7f..77b64bd 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -43,6 +43,16 @@
},
};
+static const struct resource mt6323_keys_resources[] = {
+ DEFINE_RES_IRQ(MT6323_IRQ_STATUS_PWRKEY),
+ DEFINE_RES_IRQ(MT6323_IRQ_STATUS_FCHRKEY),
+};
+
+static const struct resource mt6397_keys_resources[] = {
+ DEFINE_RES_IRQ(MT6397_IRQ_PWRKEY),
+ DEFINE_RES_IRQ(MT6397_IRQ_HOMEKEY),
+};
+
static const struct mfd_cell mt6323_devs[] = {
{
.name = "mt6323-regulator",
@@ -50,6 +60,11 @@
}, {
.name = "mt6323-led",
.of_compatible = "mediatek,mt6323-led"
+ }, {
+ .name = "mtk-pmic-keys",
+ .num_resources = ARRAY_SIZE(mt6323_keys_resources),
+ .resources = mt6323_keys_resources,
+ .of_compatible = "mediatek,mt6323-keys"
},
};
@@ -71,7 +86,12 @@
}, {
.name = "mt6397-pinctrl",
.of_compatible = "mediatek,mt6397-pinctrl",
- },
+ }, {
+ .name = "mtk-pmic-keys",
+ .num_resources = ARRAY_SIZE(mt6397_keys_resources),
+ .resources = mt6397_keys_resources,
+ .of_compatible = "mediatek,mt6397-keys"
+ }
};
static void mt6397_irq_lock(struct irq_data *data)
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2017-09-05 09:40 +0200 |
| Subject | Re: [PATCH v3 5/5] mfd: mt6397: Add PMIC keys support to MT6397 driver |
| Message-ID | <umgCM-8ei-37@gated-at.bofh.it> |
| In reply to | #1719778 |
On Fri, 25 Aug 2017, Chen Zhong wrote: > This patch adds compatible strings and interrupts for pmic keys > which serves as child device of MFD. > > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> > --- > drivers/mfd/mt6397-core.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) For my own reference: Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org> -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-08-25 08:40 +0200 |
| Subject | [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys |
| Message-ID | <uigrE-xp-21@gated-at.bofh.it> |
| In reply to | #1719775 |
This patch adds the device tree binding documentation for the MediaTek
pmic keys found on PMIC MT6397/MT6323.
Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
---
.../devicetree/bindings/input/mtk-pmic-keys.txt | 38 ++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
new file mode 100644
index 0000000..100ec44
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
@@ -0,0 +1,38 @@
+MediaTek MT6397/MT6323 PMIC Keys Device Driver
+
+There are two key functions provided by MT6397/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:
+Documentation/devicetree/bindings/mfd/mt6397.txt
+
+Required properties:
+- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
+- linux,keycodes: Specifies the numeric keycode values to
+ be used for reporting keys presses. The array can
+ contain up to 2 entries.
+
+Optional Properties:
+- wakeup-source: each key can be used as a wakeup source.
+- mediatek,long-press-mode: Long press key shutdown setting, 1 for
+ pwrkey only, 2 for pwrkey/homekey together, others for disabled.
+- debounce-interval: Long press key shutdown debouncing interval time
+ in seconds. 0/1/2/3 for 8/11/14/5 seconds. If not specified defaults to 0.
+
+Example:
+
+ pmic: mt6397 {
+ compatible = "mediatek,mt6397";
+
+ ...
+
+ mt6397keys: mt6397keys {
+ compatible = "mediatek,mt6397-keys";
+ linux,keycodes = <KEY_POWER>, <KEY_VOLUMEDOWN>;
+ wakeup-source = <1>, <0>;
+ mediatek,long-press-mode = <1>;
+ debounce-interval = <0>;
+ };
+ };
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-08-31 22:00 +0200 |
| Subject | Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys |
| Message-ID | <ukDN8-1yc-21@gated-at.bofh.it> |
| In reply to | #1719779 |
On Fri, Aug 25, 2017 at 02:32:30PM +0800, Chen Zhong wrote:
> This patch adds the device tree binding documentation for the MediaTek
> pmic keys found on PMIC MT6397/MT6323.
>
> Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> ---
> .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 ++++++++++++++++++++
> 1 file changed, 38 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
>
> diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> new file mode 100644
> index 0000000..100ec44
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> @@ -0,0 +1,38 @@
> +MediaTek MT6397/MT6323 PMIC Keys Device Driver
> +
> +There are two key functions provided by MT6397/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:
> +Documentation/devicetree/bindings/mfd/mt6397.txt
> +
> +Required properties:
> +- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
> +- linux,keycodes: Specifies the numeric keycode values to
> + be used for reporting keys presses. The array can
> + contain up to 2 entries.
> +
> +Optional Properties:
> +- wakeup-source: each key can be used as a wakeup source.
wakeup-source is defined as a boolean.
> +- mediatek,long-press-mode: Long press key shutdown setting, 1 for
> + pwrkey only, 2 for pwrkey/homekey together, others for disabled.
> +- debounce-interval: Long press key shutdown debouncing interval time
> + in seconds. 0/1/2/3 for 8/11/14/5 seconds. If not specified defaults to 0.
> +
> +Example:
> +
> + pmic: mt6397 {
> + compatible = "mediatek,mt6397";
> +
> + ...
> +
> + mt6397keys: mt6397keys {
> + compatible = "mediatek,mt6397-keys";
> + linux,keycodes = <KEY_POWER>, <KEY_VOLUMEDOWN>;
> + wakeup-source = <1>, <0>;
> + mediatek,long-press-mode = <1>;
> + debounce-interval = <0>;
> + };
> + };
> --
> 1.7.9.5
>
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-09-01 04:10 +0200 |
| Subject | Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys |
| Message-ID | <ukJzb-5GI-11@gated-at.bofh.it> |
| In reply to | #1724544 |
On Thu, 2017-08-31 at 14:52 -0500, Rob Herring wrote:
> On Fri, Aug 25, 2017 at 02:32:30PM +0800, Chen Zhong wrote:
> > This patch adds the device tree binding documentation for the MediaTek
> > pmic keys found on PMIC MT6397/MT6323.
> >
> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> > ---
> > .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 ++++++++++++++++++++
> > 1 file changed, 38 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> >
> > diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> > new file mode 100644
> > index 0000000..100ec44
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> > @@ -0,0 +1,38 @@
> > +MediaTek MT6397/MT6323 PMIC Keys Device Driver
> > +
> > +There are two key functions provided by MT6397/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:
> > +Documentation/devicetree/bindings/mfd/mt6397.txt
> > +
> > +Required properties:
> > +- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
> > +- linux,keycodes: Specifies the numeric keycode values to
> > + be used for reporting keys presses. The array can
> > + contain up to 2 entries.
> > +
> > +Optional Properties:
> > +- wakeup-source: each key can be used as a wakeup source.
>
> wakeup-source is defined as a boolean.
Hi Rob,
We have two keys, maybe one key can be used as a wakeup source, another
not.Since wakeup-source is defined as a boolean, we cannot distinguish
the behavior of the two keys. May i know the better way to do this?
Thank you.
>
> > +- mediatek,long-press-mode: Long press key shutdown setting, 1 for
> > + pwrkey only, 2 for pwrkey/homekey together, others for disabled.
> > +- debounce-interval: Long press key shutdown debouncing interval time
> > + in seconds. 0/1/2/3 for 8/11/14/5 seconds. If not specified defaults to 0.
> > +
> > +Example:
> > +
> > + pmic: mt6397 {
> > + compatible = "mediatek,mt6397";
> > +
> > + ...
> > +
> > + mt6397keys: mt6397keys {
> > + compatible = "mediatek,mt6397-keys";
> > + linux,keycodes = <KEY_POWER>, <KEY_VOLUMEDOWN>;
> > + wakeup-source = <1>, <0>;
> > + mediatek,long-press-mode = <1>;
> > + debounce-interval = <0>;
> > + };
> > + };
> > --
> > 1.7.9.5
> >
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-09-02 04:20 +0200 |
| Subject | Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys |
| Message-ID | <ul6cp-5mJ-1@gated-at.bofh.it> |
| In reply to | #1724544 |
On Thu, 2017-08-31 at 14:52 -0500, Rob Herring wrote:
> On Fri, Aug 25, 2017 at 02:32:30PM +0800, Chen Zhong wrote:
> > This patch adds the device tree binding documentation for the MediaTek
> > pmic keys found on PMIC MT6397/MT6323.
> >
> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
> > ---
> > .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 ++++++++++++++++++++
> > 1 file changed, 38 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> >
> > diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> > new file mode 100644
> > index 0000000..100ec44
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
> > @@ -0,0 +1,38 @@
> > +MediaTek MT6397/MT6323 PMIC Keys Device Driver
> > +
> > +There are two key functions provided by MT6397/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:
> > +Documentation/devicetree/bindings/mfd/mt6397.txt
> > +
> > +Required properties:
> > +- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
> > +- linux,keycodes: Specifies the numeric keycode values to
> > + be used for reporting keys presses. The array can
> > + contain up to 2 entries.
> > +
> > +Optional Properties:
> > +- wakeup-source: each key can be used as a wakeup source.
>
> wakeup-source is defined as a boolean.
Hi Rob,
Could I modify it as this?
mediatek,wakeup-keys = <1>, <0>;
wakeup-source;
Thanks.
>
> > +- mediatek,long-press-mode: Long press key shutdown setting, 1 for
> > + pwrkey only, 2 for pwrkey/homekey together, others for disabled.
> > +- debounce-interval: Long press key shutdown debouncing interval time
> > + in seconds. 0/1/2/3 for 8/11/14/5 seconds. If not specified defaults to 0.
> > +
> > +Example:
> > +
> > + pmic: mt6397 {
> > + compatible = "mediatek,mt6397";
> > +
> > + ...
> > +
> > + mt6397keys: mt6397keys {
> > + compatible = "mediatek,mt6397-keys";
> > + linux,keycodes = <KEY_POWER>, <KEY_VOLUMEDOWN>;
> > + wakeup-source = <1>, <0>;
> > + mediatek,long-press-mode = <1>;
> > + debounce-interval = <0>;
> > + };
> > + };
> > --
> > 1.7.9.5
> >
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-09-05 18:10 +0200 |
| Subject | Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys |
| Message-ID | <umoAh-4Y9-1@gated-at.bofh.it> |
| In reply to | #1725420 |
On Fri, Sep 1, 2017 at 9:16 PM, Chen Zhong <chen.zhong@mediatek.com> wrote: > On Thu, 2017-08-31 at 14:52 -0500, Rob Herring wrote: >> On Fri, Aug 25, 2017 at 02:32:30PM +0800, Chen Zhong wrote: >> > This patch adds the device tree binding documentation for the MediaTek >> > pmic keys found on PMIC MT6397/MT6323. >> > >> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> >> > --- >> > .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 ++++++++++++++++++++ >> > 1 file changed, 38 insertions(+) >> > create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt >> > >> > diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt >> > new file mode 100644 >> > index 0000000..100ec44 >> > --- /dev/null >> > +++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt >> > @@ -0,0 +1,38 @@ >> > +MediaTek MT6397/MT6323 PMIC Keys Device Driver >> > + >> > +There are two key functions provided by MT6397/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: >> > +Documentation/devicetree/bindings/mfd/mt6397.txt >> > + >> > +Required properties: >> > +- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" >> > +- linux,keycodes: Specifies the numeric keycode values to >> > + be used for reporting keys presses. The array can >> > + contain up to 2 entries. >> > + >> > +Optional Properties: >> > +- wakeup-source: each key can be used as a wakeup source. >> >> wakeup-source is defined as a boolean. > > Hi Rob, > > Could I modify it as this? > > mediatek,wakeup-keys = <1>, <0>; > wakeup-source; What do the values and index signify? The power key is index 0 and the value 1 means enable wakeup? Or each value is the raw key (i.e. indexes in linux,keycode) that wakeup is enabled for? I don't think this should be in DT really. It's really up to the user (i.e. userspace) to decide what keys cause wakeup (or maybe that's only suspend). If you default to the power key causes wakeup, do you really need to support different options? If we do put this in DT, then it should be a common binding to specify keys that cause wake-up. Rob
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-09-07 05:10 +0200 |
| Subject | Re: [PATCH v3 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys |
| Message-ID | <umVmy-2sp-11@gated-at.bofh.it> |
| In reply to | #1726829 |
On Tue, 2017-09-05 at 11:05 -0500, Rob Herring wrote: > On Fri, Sep 1, 2017 at 9:16 PM, Chen Zhong <chen.zhong@mediatek.com> wrote: > > On Thu, 2017-08-31 at 14:52 -0500, Rob Herring wrote: > >> On Fri, Aug 25, 2017 at 02:32:30PM +0800, Chen Zhong wrote: > >> > This patch adds the device tree binding documentation for the MediaTek > >> > pmic keys found on PMIC MT6397/MT6323. > >> > > >> > Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> > >> > --- > >> > .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 ++++++++++++++++++++ > >> > 1 file changed, 38 insertions(+) > >> > create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt > >> > > >> > diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt > >> > new file mode 100644 > >> > index 0000000..100ec44 > >> > --- /dev/null > >> > +++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt > >> > @@ -0,0 +1,38 @@ > >> > +MediaTek MT6397/MT6323 PMIC Keys Device Driver > >> > + > >> > +There are two key functions provided by MT6397/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: > >> > +Documentation/devicetree/bindings/mfd/mt6397.txt > >> > + > >> > +Required properties: > >> > +- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" > >> > +- linux,keycodes: Specifies the numeric keycode values to > >> > + be used for reporting keys presses. The array can > >> > + contain up to 2 entries. > >> > + > >> > +Optional Properties: > >> > +- wakeup-source: each key can be used as a wakeup source. > >> > >> wakeup-source is defined as a boolean. > > > > Hi Rob, > > > > Could I modify it as this? > > > > mediatek,wakeup-keys = <1>, <0>; > > wakeup-source; > > What do the values and index signify? The power key is index 0 and the > value 1 means enable wakeup? Or each value is the raw key (i.e. > indexes in linux,keycode) that wakeup is enabled for? > > I don't think this should be in DT really. It's really up to the user > (i.e. userspace) to decide what keys cause wakeup (or maybe that's > only suspend). If you default to the power key causes wakeup, do you > really need to support different options? > > If we do put this in DT, then it should be a common binding to specify > keys that cause wake-up. > > Rob Hi Rob, Yes, we want to describe that power key is index 0 and is a wakeup source, homekey is index 1 and not a wakeup source. Since power key and homekey are two real HW keys, customer can decide which key to be the wakeup source or both due to their hw design, so we put this in DT and can be different for different boards. Thank you. Chen
[toc] | [prev] | [next] | [standalone]
| From | Chen Zhong <chen.zhong@mediatek.com> |
|---|---|
| Date | 2017-08-26 04:40 +0200 |
| Message-ID | <uizaV-3Q9-1@gated-at.bofh.it> |
| In reply to | #1719775 |
Sorry for missing the change history. Changes since v2: - use standard properties for keycodes and debounce time - change to use platform_get_irq in leaf drivers - use better ways to define IRQ resources Changes since v1: - create irq mappings in mfd core driver instead of leaf drivers - remove some unused parts in mtk-pmic-keys driver On Fri, 2017-08-25 at 14:32 +0800, Chen Zhong wrote: > MediaTek PMIC are multi-function devices that can handle key interrupts, > typically there are two keys attached to PMIC, which called pwrkey > and homekey. PWRKEY usually used to wake up system from sleep. Homekey > can used as volume down key due to board design. Long press keys can > shutdown PMIC, the mode can be choose to be one key only or two keys > together. > This series add support for key functions for MediaTek PMIC MT6397/MT6323. > > Chen Zhong (5): > mfd: mt6397: create irq mappings in mfd core driver > dt-bindings: input: Add document bindings for mtk-pmic-keys > dt-bindings: mfd: Add bindings for the keys as subnode of PMIC > input: Add MediaTek PMIC keys support > mfd: mt6397: Add PMIC keys support to MT6397 driver > > .../devicetree/bindings/input/mtk-pmic-keys.txt | 38 +++ > Documentation/devicetree/bindings/mfd/mt6397.txt | 6 + > drivers/input/keyboard/Kconfig | 9 + > drivers/input/keyboard/Makefile | 1 + > drivers/input/keyboard/mtk-pmic-keys.c | 308 +++++++++++++++++++++ > drivers/mfd/mt6397-core.c | 26 +- > drivers/rtc/rtc-mt6397.c | 7 +- > 7 files changed, 388 insertions(+), 7 deletions(-) > create mode 100644 Documentation/devicetree/bindings/input/mtk-pmic-keys.txt > create mode 100644 drivers/input/keyboard/mtk-pmic-keys.c >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web