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

2015-12-30 Thread Leilk Liu
This patch adds dtsi node of spi for mt2701. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- 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

[PATCH 0/4] SPI: support mt2701 IC

2015-12-30 Thread Leilk Liu
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

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

2015-12-30 Thread Leilk Liu
This patch adds spi support for mt2701 IC. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- 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-mt

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

2015-12-30 Thread Leilk Liu
This patch adds a DT binding documentation for the MT2701 soc. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- .../devicetree/bindings/spi/spi-mt65xx.txt |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-mt65

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

2015-12-30 Thread Leilk Liu
This patch merge all identical compat into on mtk_common_compat and used for all compatible soc. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-mt65

[PATCH v3] spi: mediatek: revise mtk_spi_probe() failure flow

2015-11-25 Thread Leilk Liu
mtk_spi_probe() calls pm_runtime_enable(), after pm_runtime_enable() is called, it should call pm_runtime_disable() in the failure flow. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-)

[PATCH v2] spi: mediatek: revise mtk_spi_probe() failure flow

2015-11-23 Thread Leilk Liu
This patch revises failure flow while pm_runtime_enable(). Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 6

[PATCH 3/4] spi: mediatek: remove needless pair of writel()/readl()

2015-11-19 Thread Leilk Liu
It's not need to re-read and re-write SPI_CMD_REG, so remove it. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 7840067..6c1a96e 100644 --- a/d

[PATCH 2/4] spi: mediatek: remove unrequired description

2015-11-19 Thread Leilk Liu
cs-gpios isn't required with patch "spi: mediatek: single device does not require cs_gpios", so modify the description. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- .../devicetree/bindings/spi/spi-mt65xx.txt |2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH 1/4] spi: mediatek: update document devicetree bindings to fix syntax error

2015-11-19 Thread Leilk Liu
This patch updates document devicetree bindings to fix syntax error. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- .../devicetree/bindings/spi/spi-mt65xx.txt |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/s

[PATCH 4/4] spi: mediatek: revise mtk_spi_probe() failure flow

2015-11-19 Thread Leilk Liu
This patch revises failure flow while pm_runtime_enable(). Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 6

[PATCH v2 0/5] mt8173 spi multiple devices support

2015-10-26 Thread Leilk Liu
controller_data to master->setup; 4. add mt8173 spi multiple devices support; 5. update dts to add cs-gpio and modify cs pin to gpio function. Leilk Liu (5): dt-binding: spi: Mediatek: Update document devicetree bindings to support multiple devices spi: mediatek: remove mtk_spi_config spi: media

[PATCH v2 1/5] dt-binding: spi: Mediatek: Update document devicetree bindings to support multiple devices

2015-10-26 Thread Leilk Liu
This patch updates document devicetree bindings to support multiple devices. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- Documentation/devicetree/bindings/spi/spi-mt65xx.txt | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bi

[PATCH v2 4/5] spi: mediatek: mt8173 spi multiple devices support

2015-10-26 Thread Leilk Liu
ces on other group will also be selected. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 65 ++-- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65x

[PATCH v2 3/5] spi: mediatek: handle controller_data in mtk_spi_setup

2015-10-26 Thread Leilk Liu
controller_data is related with device, so move to master->setup function. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi

[PATCH v2 5/5] arm64: dts: mt8173: spi bus dts support multiple devices

2015-10-26 Thread Leilk Liu
This patch support multiple devices for MT8173 board. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/bo

[PATCH v2 2/5] spi: mediatek: remove mtk_spi_config

2015-10-26 Thread Leilk Liu
mtk_spi_config() and mtk_spi_prepare_message() both initialize spi register, so remove mtk_spi_config() and init all register in mtk_spi_prepare_message(). Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 59 +---

[PATCH 0/5] mt8173 spi multiple devices support

2015-10-13 Thread Leilk Liu
cs-gpio and modify cs pin to gpio function. Leilk Liu (5): dt-binding: spi: Mediatek: Update document devicetree bindings to support multiple devices spi: mediatek: remove mtk_spi_config spi: mediatek: handle controller_data in mtk_spi_setup spi: mediatek: mt8173 spi multiple devi

[PATCH 3/5] spi: mediatek: handle controller_data in mtk_spi_setup

2015-10-13 Thread Leilk Liu
controller_data is related with device, so move to master->setup function. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi

[PATCH 1/5] dt-binding: spi: Mediatek: Update document devicetree bindings to support multiple devices

2015-10-13 Thread Leilk Liu
This patch update document devicetree bindings to support multiple devices. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- Documentation/devicetree/bindings/spi/spi-mt65xx.txt | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindin

[PATCH 2/5] spi: mediatek: remove mtk_spi_config

2015-10-13 Thread Leilk Liu
mtk_spi_config() and mtk_spi_prepare_message() both initialize spi register, so remove mtk_spi_config() and init all register in mtk_spi_prepare_message(). Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 59 +---

[PATCH 4/5] spi: mediatek: mt8173 spi multiple devices support

2015-10-13 Thread Leilk Liu
ces on other group will also be selected. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 65 ++-- 1 file changed, 52 insertions(+), 13 deletions(-) mode change 100755 => 100644 drivers/spi/spi-mt65xx.c diff --g

[PATCH 5/5] arm64: dts: spi bus dts support multiple devices

2015-10-13 Thread Leilk Liu
This patch support multiple devices for MT8173. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/me

[PATCH] spi: mediatek: fix spi cs polarity error

2015-09-07 Thread Leilk Liu
Mediatek spi HW can't set cs inactive(keep cs high) directly. Instead, it supplies pause mode to do it indirectly. If driver unsets SPI_CMD_PAUSE_MODE in CMD_REG, it also needs to reset internal state machine to let cs inactive at once. Signed-off-by: Leilk Liu <leilk@mediatek.

[PATCH 0/3] Fix Mediatek SPI bus driver clock usage error

2015-08-31 Thread Leilk Liu
From: Leilk Liu <leilk@mediatek.com> This series are based on 4.2-rc1 and provide three patches to fix mediatek spi driver clock usage error. spi clock manages flow: CLK_TOP_SYSPLL3_D2 ---> CLK_TOP_SPI_SEL ---> CLK_PERI_SPI0 (source clock) (clock mux) (clo

[PATCH 3/3] spi: Mediatek: Document devicetree bindings update for spi bus

2015-08-31 Thread Leilk Liu
This patch updates spi bindings, fixs clock usage description. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- Documentation/devicetree/bindings/spi/spi-mt65xx.txt | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindin

[PATCH 2/3] spi: mediatek: fix spi clock usage error

2015-08-31 Thread Leilk Liu
spi clock manages flow: CLK_TOP_SYSPLL3_D2 ---> CLK_TOP_SPI_SEL ---> CLK_PERI_SPI0 (source clock) (clock mux) (clock gate) spi driver should choose source clock by clock mux, then enable clock gate. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- dri

[PATCH 1/3] spi: mediatek: remove clk_disable_unprepare()

2015-08-31 Thread Leilk Liu
This patch removes clk_disable_unprepare() in mtk_spi_remove(). clk_disable_prepare/unprepare must be balance, spi-clk is disabled in mtk_spi_probe, so not needs to disable again. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- drivers/spi/spi-mt65xx.c | 1 - 1 file changed, 1 de

[PATCH v7] arm64: dts: Add spi bus dts

2015-08-31 Thread Leilk Liu
This patch adds MT8173 spi bus controllers into device tree. Signed-off-by: Leilk Liu <leilk@mediatek.com> --- Change in this patch: 1. fix spi clock flow usage error. --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 18 ++ arch/arm64/boot/dts/mediatek/mt8173.dtsi

[PATCH] spi: mediatek: fix SPI_CMD_PAUSE_IE macro error

2015-08-27 Thread Leilk Liu
enable pause interrupt should use SPI_CMD_PAUSE_IE MACRO, so fix it. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index eaadc7e..d882261 100644

[PATCHi v3 0/4] Fixup mediatek spi driver

2015-08-23 Thread Leilk Liu
From: Leilk Liu leilk@mediatek.com This series are based on 4.2-rc1 and provide four patches to fix mediatek spi driver. Change in v3: 1. The follow patches are applied, so remove them from series: - spi: mediatek: fix spi incorrect endian usage - spi: medaitek: revise quirks

[PATCH v3 1/4] spi: mediatek: add linux/io.h include file

2015-08-23 Thread Leilk Liu
mediatek spi driver uses readl/writel, so add linux/io.h, even so it's implicitly imported by spi/spi.h Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index

[PATCH v3 3/4] spi: mediatek: add PM clk_prepare_enable fail flow

2015-08-23 Thread Leilk Liu
This patch adds PM clk_prepare_enable fail flow. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index f81618c..e14f583 100644

[PATCH v3 4/4] spi: mediatek: replace *_time name

2015-08-23 Thread Leilk Liu
This patch replaces *_time name in mtk_spi_prepare_transfer(). Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index e14f583

[PATCH v3 2/4] spi: mediatek: replace int with u32, delete TAB and define MTK_SPI_PAUSE_INT_STATUS marco

2015-08-23 Thread Leilk Liu
this patch replaces int with u32, deletes TAB, and defines MTK_SPI_PAUSE_INT_STATUS marco. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi

[PATCH v2 0/4] Fixup mediatek spi driver

2015-08-20 Thread Leilk Liu
This series are based on 4.2-rc1 and provide four patches to fix mediatek spi driver. Change in v2: 1. The patch spi: mediatek: remove redundant clock in prepare_hardware/unprepare_hardware is applied, so remove it from series. 2. fix incorrect endian usage to support little-endian and

[PATCH v2 1/4] spi: mediatek: fix spi incorrect endian usage

2015-08-20 Thread Leilk Liu
TX_ENDIAN/RX_ENDIAN bits define whether to reverse the endian order of the data DMA from/to memory. The endian order should keep the same with cpu endian. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 38 ++-- include

[PATCH v2 3/4] spi: mediatek: use BIT() to instead of SPI_CMD_*_OFFSET

2015-08-20 Thread Leilk Liu
This patch removes SPI_CMD_*_OFFSET defines, and uses the BIT(x) defines instead. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b

[PATCH v2 2/4] spi: medaitek: revise quirks compatibility style

2015-08-20 Thread Leilk Liu
The quirks are true/false, so define these as bool. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 79286c8

[PATCH v2 4/4] spi: mediatek: revise coding style

2015-08-20 Thread Leilk Liu
This patch revises littery coding style according to comments. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 52 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers

[PATCH] spi: mediatek: fix spi incorrect endian usage and remove redundant clock

2015-08-18 Thread Leilk Liu
This patch fixes incorrect endian usage, removes redundant clock in prepare_hardware/unprepare_hardware and revises coding styles. Signed-off-by: Leilk Liu leilk@mediatek.com --- Change in this patch: 1. fix incorrect endian usage on big-endian system. 2. delete redundant clock in prepare

[PATCH 3/3] spi: mediatek: fix spi incorrect endian usage

2015-08-18 Thread Leilk Liu
TX_ENDIAN/RX_ENDIAN bits define whether to reverse the endian order of the data DMA from/to memory. The endian order should keep the same with cpu endian. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 43 include

[PATCH 2/3] spi: mediatek: remove redundant clock in prepare_hardware/unprepare_hardware

2015-08-18 Thread Leilk Liu
clock in prepare_hardware/unprepare_hardware is redundant with pm_runtime, so remove them. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index

[PATCH 0/3] Fixup mediatek spi driver

2015-08-18 Thread Leilk Liu
Change in this patch: 1. revise coding styles. 2. delete redundant clock in prepare/unprepare_hardware. 3. fix incorrect endian usage on big-endian system. Leilk Liu (3): spi: mediatek: revise coding style spi: mediatek: remove redundant clock in prepare_hardware/unprepare_hardware spi

[PATCH 1/3] spi: mediatek: revise coding style

2015-08-18 Thread Leilk Liu
This patch revises mediatek spi driver coding styles. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 125 --- 1 file changed, 65 insertions(+), 60 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi

[PATCH v6] arm64: dts: Add spi bus dts

2015-08-16 Thread Leilk Liu
This patch adds MT8173 spi bus controllers into device tree. Signed-off-by: Leilk Liu leilk@mediatek.com --- Change in this patch: pinctl and pad-select fields are board specific, so move to mt8173-evb.dtsi, and status = okay. --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 18

[PATCH] spi: Mediatek: fixup cpu_to_le32 incorrect usage

2015-08-13 Thread Leilk Liu
writel() already does a cpu_to_le32 conversion, so remove cpu_to_le32(). Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index ae645fa

[PATCH] spi: Mediatek: fix endian warnings

2015-08-11 Thread Leilk Liu
unsigned int [unsigned] val got restricted __le32 [usertype] noident Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi-mt65xx.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 4676b01

[PATCH v5 0/3] Add Mediatek SPI bus driver

2015-08-07 Thread Leilk Liu
. support fifo mode function. 2. support any non-prime length transfer in dma mode. 3. use interrupt to handle scatterlist. 4. fix review comment. Change in v2: 1. Remove spi bitbang framwork, use can_dma() and transfer_one(). 2. Add PM functions. 3. Fix Mark Brown review comment. Leilk Liu (3

[PATCH v5 1/3] spi: Mediatek: Document devicetree bindings for spi bus

2015-08-07 Thread Leilk Liu
Signed-off-by: Leilk Liu leilk@mediatek.com --- Change in this patch: 1. change this patch title. 2. change MTK SPI device to MTK SPI controller. 3. pad-select is a vendor property, so change it to mediatek,pad-select. 4. modify the property of clock and clock name. 5. explain what the pad

[PATCH v5 3/3] arm64: dts: Add spi bus dts

2015-08-07 Thread Leilk Liu
This patch adds MT8173 spi bus controllers into device tree. Signed-off-by: Leilk Liu leilk@mediatek.com --- Change in this patch: 1. pad-select is a vendor property, so change it to mediatek,pad-select. 2. modify the property of clocks and clock-names. --- arch/arm64/boot/dts/mediatek

[PATCH v5 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-08-07 Thread Leilk Liu
This patch adds basic spi bus for MT8173. Signed-off-by: Leilk Liu leilk@mediatek.com --- Change in this patch: 1. change pad-select to mediatek,pad-select. 2. modify clk relevant implement. --- drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1

Re: [PATCH v4 1/3] dt-binding: spi: Mediatek: Document devicetree bindings for spi bus

2015-08-05 Thread leilk liu
On Tue, 2015-08-04 at 18:42 +0100, Mark Brown wrote: On Wed, Jul 29, 2015 at 07:04:32PM +0800, Leilk Liu wrote: Signed-off-by: Leilk Liu leilk@mediatek.com Please use subject lines reflecting the style for the subsystem so people can spot if patches are relevant to them. OK, I

Re: [PATCH v4 1/3] dt-binding: spi: Mediatek: Document devicetree bindings for spi bus

2015-07-30 Thread leilk liu
Hi Jonas, On Thu, 2015-07-30 at 21:27 +0200, Jonas Gorski wrote: Hi, On Wed, Jul 29, 2015 at 1:04 PM, Leilk Liu leilk@mediatek.com wrote: Signed-off-by: Leilk Liu leilk@mediatek.com --- .../devicetree/bindings/spi/spi-mt65xx.txt | 38 ++ 1 file

Re: [PATCH v4 0/3] Add Mediatek SPI bus driver

2015-07-30 Thread leilk liu
On Thu, 2015-07-30 at 21:29 +0200, Jonas Gorski wrote: Hi, On Wed, Jul 29, 2015 at 1:04 PM, Leilk Liu leilk@mediatek.com wrote: Change in v4: 1. fix Mark Brown review comment. You should say what you actually fixed/changed, not just that you changed something. Also the individual

[PATCH v4 0/3] Add Mediatek SPI bus driver

2015-07-29 Thread Leilk Liu
. Add PM functions. 3. Fix Mark Brown review comment. Leilk Liu (3): dt-binding: spi: Mediatek: Document devicetree bindings for spi bus spi: mediatek: Add spi bus for Mediatek MT8173 arm64: dts: Add spi bus dts .../devicetree/bindings/spi/spi-mt65xx.txt | 38 ++ arch/arm64/boot/dts

[PATCH v4 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-07-29 Thread Leilk Liu
This patch adds basic spi bus for MT8173. Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1 + drivers/spi/spi-mt65xx.c | 732 +++ include/linux

[PATCH v4 3/3] arm64: dts: Add spi bus dts

2015-07-29 Thread Leilk Liu
This patch adds MT8173 spi bus controllers into device tree. Signed-off-by: Leilk Liu leilk@mediatek.com --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 23 +++ 1 file changed, 23 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts

[PATCH v4 1/3] dt-binding: spi: Mediatek: Document devicetree bindings for spi bus

2015-07-29 Thread Leilk Liu
Signed-off-by: Leilk Liu leilk@mediatek.com --- .../devicetree/bindings/spi/spi-mt65xx.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-mt65xx.txt diff --git a/Documentation/devicetree/bindings/spi/spi

Re: [PATCH v3 3/4] spi: mediatek: Add spi bus for Mediatek MT8173

2015-07-26 Thread leilk liu
On Fri, 2015-07-24 at 18:49 +0100, Mark Brown wrote: On Thu, Jul 23, 2015 at 05:10:42PM +0800, Leilk Liu wrote: This basically seems fine but there's a couple of issues that should be relatively easy to fix: + mdata-cur_transfer = xfer; + mtk_spi_prepare_transfer(master, xfer

Re: [PATCH v3 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for spi bus

2015-07-26 Thread leilk liu
On Fri, 2015-07-24 at 18:34 +0100, Mark Brown wrote: On Thu, Jul 23, 2015 at 05:10:41PM +0800, Leilk Liu wrote: Change-Id: I6cadbf2e51d2cc4eacd518a24d5a9a1da93d4db5 Signed-off-by: Leilk Liu leilk@mediatek.com Please don't include noise like Change-Id in upstream commits and please use

[PATCH v3 3/4] spi: mediatek: Add spi bus for Mediatek MT8173

2015-07-23 Thread Leilk Liu
This patch adds basic spi bus for MT8173. Change-Id: I52a48526105f3de49f6253d1ffb449759a2a8140 Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1 + drivers/spi/spi-mt65xx.c | 817

[PATCH v3 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for spi bus

2015-07-23 Thread Leilk Liu
Change-Id: I6cadbf2e51d2cc4eacd518a24d5a9a1da93d4db5 Signed-off-by: Leilk Liu leilk@mediatek.com --- .../devicetree/bindings/spi/spi-mt65xx.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-mt65xx.txt diff

[PATCH v3 4/4] arm64: dts: Add spi bus dts

2015-07-23 Thread Leilk Liu
This patch adds MT8173 spi bus controllers into device tree. Change-Id: I70edf3e4a366d856499dc855b53d726ce4668a39 Signed-off-by: Leilk Liu leilk@mediatek.com --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 23 +++ 1 file changed, 23 insertions(+) diff --git a/arch/arm64

[PATCH v3 0/4] Add Mediatek SPI bus driver

2015-07-23 Thread Leilk Liu
Change in v3: 1. support fifo mode function. 2. support any non-prime length transfer in dma mode. 3. use interrupt to handle scatterlist. 4. fix review comment. Leilk Liu (4): spi: support spi without dma channel to use can_dma() dt-bindings: ARM: Mediatek: Document devicetree bindings

[PATCH v3 1/4] spi: support spi without dma channel to use can_dma()

2015-07-23 Thread Leilk Liu
For spi without dma channel and use can_dma(), it can use master-dev for struct device. Change-Id: I5b320e1742767c2ea4368410fb49c6679e28af6b Signed-off-by: Leilk Liu leilk@mediatek.com --- drivers/spi/spi.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff

Re: [PATCH v2 3/4] spi: mediatek: Add spi bus for Mediatek MT8173

2015-07-08 Thread leilk liu
Hello Daniel, On Wed, 2015-07-01 at 12:06 +0800, Daniel Kurtz wrote: Hi Leilk, Please see comments inline... On Mon, Jun 29, 2015 at 9:04 PM, Leilk Liu leilk@mediatek.com wrote: This patch adds basic spi bus for MT8173. Signed-off-by: Leilk Liu leilk@mediatek.com Signed-off

Re: [PATCH v2 3/4] spi: mediatek: Add spi bus for Mediatek MT8173

2015-07-02 Thread leilk liu
Hi Alexey, +config SPI_MT65XX + tristate MediaTek SPI controller + depends on ARCH_MEDIATEK || COMPILE_TEST + help + This selects the MediaTek(R) SPI bus driver. + If you want to use MediaTek(R) SPI interface, + say Y or M here.If you are

Re: [PATCH v2 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for spi bus

2015-07-02 Thread leilk liu
+ +- pad-select: should specify spi pad used, only required for MT8173. + This value should be 0~3. + +Example: + +- SoC Specific Portion: +spi: spi@1100a000 { + compatible = mediatek,mt8173-spi; + reg = 0 0x1100a000 0 0x1000; + interrupts = GIC_SPI

[PATCH v2 3/4] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-29 Thread Leilk Liu
This patch adds basic spi bus for MT8173. Signed-off-by: Leilk Liu leilk@mediatek.com Signed-off-by: Eddie Huang eddie.hu...@mediatek.com --- drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1 + drivers/spi/spi-mt65xx.c | 656 +++ 3

[PATCH v2 4/4] arm64: dts: Add spi bus dts

2015-06-29 Thread Leilk Liu
This patch adds MT8173 spi bus controllers into device tree. Signed-off-by: Leilk Liu leilk@mediatek.com --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173

[PATCH v2 1/4] spi: support spi without dma channel to use can_dma()

2015-06-29 Thread Leilk Liu
For spi without dma channel and use can_dma(), it can use master-dev for struct device. Signed-off-by: Leilk Liu leilk@mediatek.com Signed-off-by: Eddie Huang eddie.hu...@mediatek.com --- drivers/spi/spi.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff

[PATCH v2 0/4] Add Mediatek SPI bus driver

2015-06-29 Thread Leilk Liu
need to enable RX. Some workarounds are done in SPI driver code base on v4.1-rc1. Change in v2: 1. Remove spi bitbang framwork, use can_dma() and transfer_one(). 2. Add PM functions. 3. Fix Mark Brown review comment. Leilk Liu (4): spi: support spi without dma channel to use can_dma() dt

[PATCH v2 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for spi bus

2015-06-29 Thread Leilk Liu
Signed-off-by: Leilk Liu leilk@mediatek.com --- .../devicetree/bindings/spi/spi-mt65xx.txt | 32 ++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-mt65xx.txt diff --git a/Documentation/devicetree/bindings/spi/spi