2015-12-31 02:59:30

by Leilk Liu

[permalink] [raw]
Subject: [PATCH 0/4] SPI: support mt2701 IC

This series are based on 4.4-rc1 and provide 4 patches to support
mt2701 spi HW.

Change in this series:
1. merge all identical compat to mtk_common_compat;
2. Add spi support for mt2701 IC;
3. add spi dts for mt2701;
4. Add bindings for mediatek MT2701 soc platform.

Leilk Liu (4):
spi: mediatek: merge all identical compat to mtk_common_compat
spi: mediatek: Add spi support for mt2701 IC
dts: mt2701: add spi dts for mt2701
Document: spi: Add bindings for mediatek MT2701 soc platform

.../devicetree/bindings/spi/spi-mt65xx.txt | 5 ++-
arch/arm/boot/dts/mt2701.dtsi | 39 ++++++++++++++++++++
drivers/spi/spi-mt65xx.c | 18 ++++++---
3 files changed, 55 insertions(+), 7 deletions(-)

--
1.7.9.5


2015-12-31 02:59:39

by Leilk Liu

[permalink] [raw]
Subject: [PATCH 1/4] spi: mediatek: merge all identical compat to mtk_common_compat

This patch merge all identical compat into on mtk_common_compat
and used for all compatible soc.

Signed-off-by: Leilk Liu <[email protected]>
---
drivers/spi/spi-mt65xx.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 563954a..3573c09 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -95,8 +95,7 @@ struct mtk_spi {
const struct mtk_spi_compatible *dev_comp;
};

-static const struct mtk_spi_compatible mt6589_compat;
-static const struct mtk_spi_compatible mt8135_compat;
+static const struct mtk_spi_compatible mtk_common_compat;
static const struct mtk_spi_compatible mt8173_compat = {
.need_pad_sel = true,
.must_tx = true,
@@ -112,9 +111,15 @@ static const struct mtk_chip_config mtk_default_chip_info = {
};

static const struct of_device_id mtk_spi_of_match[] = {
- { .compatible = "mediatek,mt6589-spi", .data = (void *)&mt6589_compat },
- { .compatible = "mediatek,mt8135-spi", .data = (void *)&mt8135_compat },
- { .compatible = "mediatek,mt8173-spi", .data = (void *)&mt8173_compat },
+ { .compatible = "mediatek,mt6589-spi",
+ .data = (void *)&mtk_common_compat,
+ },
+ { .compatible = "mediatek,mt8135-spi",
+ .data = (void *)&mtk_common_compat,
+ },
+ { .compatible = "mediatek,mt8173-spi",
+ .data = (void *)&mt8173_compat,
+ },
{}
};
MODULE_DEVICE_TABLE(of, mtk_spi_of_match);
--
1.7.9.5

2015-12-31 02:59:45

by Leilk Liu

[permalink] [raw]
Subject: [PATCH 2/4] spi: mediatek: Add spi support for mt2701 IC

This patch adds spi support for mt2701 IC.

Signed-off-by: Leilk Liu <[email protected]>
---
drivers/spi/spi-mt65xx.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 3573c09..fe95f3f 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -111,6 +111,9 @@ static const struct mtk_chip_config mtk_default_chip_info = {
};

static const struct of_device_id mtk_spi_of_match[] = {
+ { .compatible = "mediatek,mt2701-spi",
+ .data = (void *)&mtk_common_compat,
+ },
{ .compatible = "mediatek,mt6589-spi",
.data = (void *)&mtk_common_compat,
},
--
1.7.9.5

2015-12-31 02:59:51

by Leilk Liu

[permalink] [raw]
Subject: [PATCH 3/4] dts: mt2701: add spi dts for mt2701

This patch adds dtsi node of spi for mt2701.

Signed-off-by: Leilk Liu <[email protected]>
---
arch/arm/boot/dts/mt2701.dtsi | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index bd88ae9..9ccd1f0 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -194,4 +194,43 @@
clocks = <&uart_clk>;
status = "disabled";
};
+
+ spi0: spi@1100a000 {
+ compatible = "mediatek,mt2701-spi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0 0x1100a000 0 0x100>;
+ interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
+ <&topckgen CLK_TOP_SPI0_SEL>,
+ <&pericfg CLK_PERI_SPI0>;
+ clock-names = "parent-clk", "sel-clk", "spi-clk";
+ status = "disabled";
+ };
+
+ spi1: spi@11016000 {
+ compatible = "mediatek,mt2701-spi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0 0x11016000 0 0x100>;
+ interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
+ <&topckgen CLK_TOP_SPI1_SEL>,
+ <&pericfg CLK_PERI_SPI1>;
+ clock-names = "parent-clk", "sel-clk", "spi-clk";
+ status = "disabled";
+ };
+
+ spi2: spi@11017000 {
+ compatible = "mediatek,mt2701-spi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0 0x11017000 0 0x1000>;
+ interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
+ <&topckgen CLK_TOP_SPI2_SEL>,
+ <&pericfg CLK_PERI_SPI2>;
+ clock-names = "parent-clk", "sel-clk", "spi-clk";
+ status = "disabled";
+ };
};
--
1.7.9.5

2015-12-31 02:59:54

by Leilk Liu

[permalink] [raw]
Subject: [PATCH 4/4] Document: spi: Add bindings for mediatek MT2701 soc platform

This patch adds a DT binding documentation for the MT2701 soc.

Signed-off-by: Leilk Liu <[email protected]>
---
.../devicetree/bindings/spi/spi-mt65xx.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/spi/spi-mt65xx.txt b/Documentation/devicetree/bindings/spi/spi-mt65xx.txt
index ce363c923f..bf489e0 100644
--- a/Documentation/devicetree/bindings/spi/spi-mt65xx.txt
+++ b/Documentation/devicetree/bindings/spi/spi-mt65xx.txt
@@ -2,9 +2,10 @@ Binding for MTK SPI controller

Required properties:
- compatible: should be one of the following.
- - mediatek,mt8173-spi: for mt8173 platforms
- - mediatek,mt8135-spi: for mt8135 platforms
+ - mediatek,mt2701-spi: for mt2701 platforms
- mediatek,mt6589-spi: for mt6589 platforms
+ - mediatek,mt8135-spi: for mt8135 platforms
+ - mediatek,mt8173-spi: for mt8173 platforms

- #address-cells: should be 1.

--
1.7.9.5

2015-12-31 08:32:38

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH 1/4] spi: mediatek: merge all identical compat to mtk_common_compat



On 31/12/15 03:59, Leilk Liu wrote:
> This patch merge all identical compat into on mtk_common_compat
> and used for all compatible soc.
>
> Signed-off-by: Leilk Liu <[email protected]>
> ---

Reviewed-by: Matthias Brugger <[email protected]>

> drivers/spi/spi-mt65xx.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
> index 563954a..3573c09 100644
> --- a/drivers/spi/spi-mt65xx.c
> +++ b/drivers/spi/spi-mt65xx.c
> @@ -95,8 +95,7 @@ struct mtk_spi {
> const struct mtk_spi_compatible *dev_comp;
> };
>
> -static const struct mtk_spi_compatible mt6589_compat;
> -static const struct mtk_spi_compatible mt8135_compat;
> +static const struct mtk_spi_compatible mtk_common_compat;
> static const struct mtk_spi_compatible mt8173_compat = {
> .need_pad_sel = true,
> .must_tx = true,
> @@ -112,9 +111,15 @@ static const struct mtk_chip_config mtk_default_chip_info = {
> };
>
> static const struct of_device_id mtk_spi_of_match[] = {
> - { .compatible = "mediatek,mt6589-spi", .data = (void *)&mt6589_compat },
> - { .compatible = "mediatek,mt8135-spi", .data = (void *)&mt8135_compat },
> - { .compatible = "mediatek,mt8173-spi", .data = (void *)&mt8173_compat },
> + { .compatible = "mediatek,mt6589-spi",
> + .data = (void *)&mtk_common_compat,
> + },
> + { .compatible = "mediatek,mt8135-spi",
> + .data = (void *)&mtk_common_compat,
> + },
> + { .compatible = "mediatek,mt8173-spi",
> + .data = (void *)&mt8173_compat,
> + },
> {}
> };
> MODULE_DEVICE_TABLE(of, mtk_spi_of_match);
>

2015-12-31 22:08:53

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 4/4] Document: spi: Add bindings for mediatek MT2701 soc platform

On Thu, Dec 31, 2015 at 10:59:03AM +0800, Leilk Liu wrote:
> This patch adds a DT binding documentation for the MT2701 soc.
>

Please use subject lines reflecting the style for the subsystem.


Attachments:
(No filename) (193.00 B)
signature.asc (473.00 B)
Download all attachments

2015-12-31 22:15:29

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 4/4] Document: spi: Add bindings for mediatek MT2701 soc platform

On Thu, Dec 31, 2015 at 10:59:03AM +0800, Leilk Liu wrote:
> This patch adds a DT binding documentation for the MT2701 soc.
>
> Signed-off-by: Leilk Liu <[email protected]>

Acked-by: Rob Herring <[email protected]>