Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298522 > unrolled thread

[PATCH v3 0/5] pinctrl: mediatek: add pinctrl/GPIO/EINT driver for mt2701

Started byBiao Huang <biao.huang@mediatek.com>
First post2015-12-28 08:10 +0100
Last post2015-12-28 09:10 +0100
Articles 8 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/5] pinctrl: mediatek: add pinctrl/GPIO/EINT driver for mt2701 Biao Huang <biao.huang@mediatek.com> - 2015-12-28 08:10 +0100
    [PATCH v3 1/5] ARM: mediatek: Add MT2701 config options for mediatek SoCs. Biao Huang <biao.huang@mediatek.com> - 2015-12-28 08:10 +0100
    [PATCH v3 5/5] arm: dts: Add pinctrl/GPIO/EINT node for mt2701 Biao Huang <biao.huang@mediatek.com> - 2015-12-28 08:20 +0100
      Re: [PATCH v3 5/5] arm: dts: Add pinctrl/GPIO/EINT node for mt2701 Matthias Brugger <matthias.bgg@gmail.com> - 2015-12-31 12:30 +0100
    [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701 Biao Huang <biao.huang@mediatek.com> - 2015-12-28 08:20 +0100
      Re: [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings  for mt2701 Rob Herring <robh@kernel.org> - 2015-12-29 19:40 +0100
      Re: [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for  mt2701 Matthias Brugger <matthias.bgg@gmail.com> - 2015-12-31 12:20 +0100
    Re: [PATCH v3 4/5] pinctrl: mediatek: Add Pinctrl/GPIO/EINT driver  for mt2701 Yingjoe Chen <yingjoe.chen@mediatek.com> - 2015-12-28 09:10 +0100

#1298522 — [PATCH v3 0/5] pinctrl: mediatek: add pinctrl/GPIO/EINT driver for mt2701

FromBiao Huang <biao.huang@mediatek.com>
Date2015-12-28 08:10 +0100
Subject[PATCH v3 0/5] pinctrl: mediatek: add pinctrl/GPIO/EINT driver for mt2701
Message-ID<qKA6m-732-1@gated-at.bofh.it>
Change in v3:
1. convert to arch_initcall.
2. set direction to input when do input-enable/disable and input-schmitt-enable/disable properties.

Change in v2:
1. add special pinmux setting for some pins.
2. fix mt2701 direction control issue.
3. resort dt-bindings.

Biao Huang (4):
  dt-bindings: mediatek: Modify pinctrl bindings for mt2701
  pinctrl: dt bindings: Add pinfunc header file for mt2701
  pinctrl: mediatek: Add Pinctrl/GPIO/EINT driver for mt2701
  arm: dts: Add pinctrl/GPIO/EINT node for mt2701

Erin Lo (1):
  ARM: mediatek: Add MT2701 config options for mediatek SoCs.

 .../devicetree/bindings/pinctrl/pinctrl-mt65xx.txt |    9 +-
 arch/arm/boot/dts/mt2701-pinfunc.h                 |  735 +++++++
 arch/arm/boot/dts/mt2701.dtsi                      |   19 +
 arch/arm/mach-mediatek/Kconfig                     |    4 +
 drivers/pinctrl/mediatek/Kconfig                   |    6 +
 drivers/pinctrl/mediatek/Makefile                  |    1 +
 drivers/pinctrl/mediatek/pinctrl-mt2701.c          |  586 +++++
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c      |   16 +
 drivers/pinctrl/mediatek/pinctrl-mtk-common.h      |   12 +-
 drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h      | 2323 ++++++++++++++++++++
 10 files changed, 3706 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/mt2701-pinfunc.h
 create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt2701.c
 create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h

-- 
1.7.9.5 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1298524 — [PATCH v3 1/5] ARM: mediatek: Add MT2701 config options for mediatek SoCs.

FromBiao Huang <biao.huang@mediatek.com>
Date2015-12-28 08:10 +0100
Subject[PATCH v3 1/5] ARM: mediatek: Add MT2701 config options for mediatek SoCs.
Message-ID<qKA6m-732-11@gated-at.bofh.it>
In reply to#1298522
From: Erin Lo <erin.lo@mediatek.com>

The upcoming MTK pinctrl driver have a big pin table for each SoC
and we don't want to bloat the kernel binary if we don't need it.
Add config options so we can build for one SoC only. Add MT2701.

Signed-off-by: Erin Lo <erin.lo@mediatek.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-mediatek/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index aeece17..37dd438 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -9,6 +9,10 @@ menuconfig ARCH_MEDIATEK
 
 if ARCH_MEDIATEK
 
+config MACH_MT2701
+	bool "MediaTek MT2701 SoCs support"
+	default ARCH_MEDIATEK
+
 config MACH_MT6589
 	bool "MediaTek MT6589 SoCs support"
 	default ARCH_MEDIATEK
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298525 — [PATCH v3 5/5] arm: dts: Add pinctrl/GPIO/EINT node for mt2701

FromBiao Huang <biao.huang@mediatek.com>
Date2015-12-28 08:20 +0100
Subject[PATCH v3 5/5] arm: dts: Add pinctrl/GPIO/EINT node for mt2701
Message-ID<qKAg1-76e-7@gated-at.bofh.it>
In reply to#1298522
Add pinctrl and GPIO node to mt2701.dtsi

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/boot/dts/mt2701.dtsi |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index dc02f76..bd88ae9 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -17,6 +17,7 @@
 #include <dt-bindings/clock/mt2701-clk.h>
 #include <dt-bindings/reset-controller/mt2701-resets.h>
 #include "skeleton64.dtsi"
+#include "mt2701-pinfunc.h"
 
 / {
 	compatible = "mediatek,mt2701";
@@ -99,6 +100,24 @@
 		#reset-cells = <1>;
 	};
 
+	pio: pinctrl@10005000 {
+		compatible = "mediatek,mt2701-pinctrl";
+		reg = <0 0x1000b000 0 0x1000>;
+		mediatek,pctl-regmap = <&syscfg_pctl_a>;
+		pins-are-numbered;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
+	};
+
+	syscfg_pctl_a: syscfg@10005000 {
+		compatible = "mediatek,mt2701-pctl-a-syscfg", "syscon";
+		reg = <0 0x10005000 0 0x1000>;
+	};
+
 	watchdog: watchdog@10007000 {
 		compatible = "mediatek,mt2701-wdt",
 			     "mediatek,mt6589-wdt";
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299634 — Re: [PATCH v3 5/5] arm: dts: Add pinctrl/GPIO/EINT node for mt2701

FromMatthias Brugger <matthias.bgg@gmail.com>
Date2015-12-31 12:30 +0100
SubjectRe: [PATCH v3 5/5] arm: dts: Add pinctrl/GPIO/EINT node for mt2701
Message-ID<qLJAC-3Lf-7@gated-at.bofh.it>
In reply to#1298525

On 28/12/15 08:09, Biao Huang wrote:
> Add pinctrl and GPIO node to mt2701.dtsi
>
> Signed-off-by: Biao Huang <biao.huang@mediatek.com>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>   arch/arm/boot/dts/mt2701.dtsi |   19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>

Linus, will you take this patch through your branch?

> diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
> index dc02f76..bd88ae9 100644
> --- a/arch/arm/boot/dts/mt2701.dtsi
> +++ b/arch/arm/boot/dts/mt2701.dtsi
> @@ -17,6 +17,7 @@
>   #include <dt-bindings/clock/mt2701-clk.h>
>   #include <dt-bindings/reset-controller/mt2701-resets.h>
>   #include "skeleton64.dtsi"
> +#include "mt2701-pinfunc.h"
>
>   / {
>   	compatible = "mediatek,mt2701";
> @@ -99,6 +100,24 @@
>   		#reset-cells = <1>;
>   	};
>
> +	pio: pinctrl@10005000 {
> +		compatible = "mediatek,mt2701-pinctrl";
> +		reg = <0 0x1000b000 0 0x1000>;
> +		mediatek,pctl-regmap = <&syscfg_pctl_a>;
> +		pins-are-numbered;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +		interrupt-controller;
> +		#interrupt-cells = <2>;
> +		interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
> +	};
> +
> +	syscfg_pctl_a: syscfg@10005000 {
> +		compatible = "mediatek,mt2701-pctl-a-syscfg", "syscon";
> +		reg = <0 0x10005000 0 0x1000>;
> +	};
> +
>   	watchdog: watchdog@10007000 {
>   		compatible = "mediatek,mt2701-wdt",
>   			     "mediatek,mt6589-wdt";
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298526 — [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701

FromBiao Huang <biao.huang@mediatek.com>
Date2015-12-28 08:20 +0100
Subject[PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701
Message-ID<qKAg1-76e-5@gated-at.bofh.it>
In reply to#1298522
Signed-off-by: Biao Huang <biao.huang@mediatek.com>
---
 .../devicetree/bindings/pinctrl/pinctrl-mt65xx.txt |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
index 0480bc3..9ffb0b2 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
@@ -4,10 +4,11 @@ The Mediatek's Pin controller is used to control SoC pins.
 
 Required properties:
 - compatible: value should be one of the following.
-    (a) "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl.
-    (b) "mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl.
-    (c) "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl.
-    (d) "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl.
+	"mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl.
+	"mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl.
+	"mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl.
+	"mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl.
+	"mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl.
 - pins-are-numbered: Specify the subnodes are using numbered pinmux to
   specify pins.
 - gpio-controller : Marks the device node as a gpio controller.
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299078 — Re: [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701

FromRob Herring <robh@kernel.org>
Date2015-12-29 19:40 +0100
SubjectRe: [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701
Message-ID<qL7lE-49U-29@gated-at.bofh.it>
In reply to#1298526
On Mon, Dec 28, 2015 at 03:09:03PM +0800, Biao Huang wrote:
> Signed-off-by: Biao Huang <biao.huang@mediatek.com>
> ---
>  .../devicetree/bindings/pinctrl/pinctrl-mt65xx.txt |    9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

I acked v2 already. Please add acks when posting new versions.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299632 — Re: [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701

FromMatthias Brugger <matthias.bgg@gmail.com>
Date2015-12-31 12:20 +0100
SubjectRe: [PATCH v3 2/5] dt-bindings: mediatek: Modify pinctrl bindings for mt2701
Message-ID<qLJqV-3HX-5@gated-at.bofh.it>
In reply to#1298526

On 28/12/15 08:09, Biao Huang wrote:
> Signed-off-by: Biao Huang <biao.huang@mediatek.com>
> ---
>   .../devicetree/bindings/pinctrl/pinctrl-mt65xx.txt |    9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>

Reviewed-by: Mathias Brugger <matthias.bgg@gmail.com>

> diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
> index 0480bc3..9ffb0b2 100644
> --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
> +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
> @@ -4,10 +4,11 @@ The Mediatek's Pin controller is used to control SoC pins.
>
>   Required properties:
>   - compatible: value should be one of the following.
> -    (a) "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl.
> -    (b) "mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl.
> -    (c) "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl.
> -    (d) "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl.
> +	"mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl.
> +	"mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl.
> +	"mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl.
> +	"mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl.
> +	"mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl.
>   - pins-are-numbered: Specify the subnodes are using numbered pinmux to
>     specify pins.
>   - gpio-controller : Marks the device node as a gpio controller.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298534 — Re: [PATCH v3 4/5] pinctrl: mediatek: Add Pinctrl/GPIO/EINT driver for mt2701

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2015-12-28 09:10 +0100
SubjectRe: [PATCH v3 4/5] pinctrl: mediatek: Add Pinctrl/GPIO/EINT driver for mt2701
Message-ID<qKB2p-7Eb-1@gated-at.bofh.it>
In reply to#1298522
On Mon, 2015-12-28 at 15:09 +0800, Biao Huang wrote:
> Add mt2701 support using mediatek common pinctrl driver.
> MT2701 have some special pins need an extra setting register
> than other ICs, so adding this support to common code.
> 
> Signed-off-by: Biao Huang <biao.huang@mediatek.com>
> Acked-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
<...>
> +
> +static struct platform_driver mtk_pinctrl_driver = {
> +	.probe = mt2701_pinctrl_probe,
> +	.driver = {
> +		.name = "mediatek-mt2701-pinctrl",
> +		.owner = THIS_MODULE,
> +		.of_match_table = mt2701_pctrl_match,
> +	},
> +};
> +
> +static int __init mtk_pinctrl_init(void)
> +{
> +	return platform_driver_register(&mtk_pinctrl_driver);
> +}
> +
> +arch_initcall(mtk_pinctrl_init);


As discussed in
http://lists.infradead.org/pipermail/linux-mediatek/2015-December/003350.html
we should use subsys_initcall() instead.


> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index f307f1d..76279f0 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
<...>
> @@ -347,6 +352,7 @@ static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev,
>  		ret = mtk_pconf_set_pull_select(pctl, pin, true, false, arg);
>  		break;
>  	case PIN_CONFIG_INPUT_ENABLE:
> +		mtk_pmx_gpio_set_direction(pctldev, NULL, pin, true);
>  		ret = mtk_pconf_set_ies_smt(pctl, pin, arg, param);
>  		break;
>  	case PIN_CONFIG_OUTPUT:
> @@ -354,6 +360,7 @@ static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev,
>  		ret = mtk_pmx_gpio_set_direction(pctldev, NULL, pin, false);
>  		break;
>  	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
> +		mtk_pmx_gpio_set_direction(pctldev, NULL, pin, true);
>  		ret = mtk_pconf_set_ies_smt(pctl, pin, arg, param);
>  		break;
>  	case PIN_CONFIG_DRIVE_STRENGTH:

This change is not directly related to adding mt2710 support and change
behavior for all MTK pinctrl drivers, please create a separate patch for
this.

Joe.C


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web