[PATCH] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size

2020-11-13 Thread Sugar Zhang
B/s (0) After this patch: dmatest: dma0chan0-copy0: summary 8 tests, 0 failures 179 iops 734873 KB/s (0) After this patch and increase dma clk to 400MHz: dmatest: dma0chan0-copy0: summary 8 tests, 0 failures 259 iops 1062929 KB/s (0) Signed-off-by: Sugar Zhang --- drivers/dma/pl330.c | 2

[PATCH] ASoC: rockchip: spdif: Handle clk by pm runtime

2020-07-13 Thread Sugar Zhang
This patch handle the clk by pm runtime mechanism to simplify the clk management. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_spdif.c | 59 +++-- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/sound/soc/rockchip/rockchip_spdif.c

Re: [PATCH v2 01/13] dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP'

2020-06-28 Thread sugar zhang
On 2020/6/24 15:54, Vinod Koul wrote: On 09-06-20, 09:14, Sugar Zhang wrote: There is no reason to limit the performance on the 'NO-FLUSHP' SoCs, cuz these platforms are just that the 'FLUSHP' instruction is broken. Lets not use terms like cuz... 'because&#x

Re: [PATCH v2 0/13] Patches to improve transfer efficiency for Rockchip SoCs.

2020-06-12 Thread sugar zhang
. Unfortunately it doesn't fix the rk3328 gmac controller. Tested-by: Peter Geis On Mon, Jun 8, 2020 at 9:15 PM Sugar Zhang wrote: Changes in v2: - fix FATAL ERROR: Unable to parse input tree Sugar Zhang (13): dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP

[PATCH v2 03/13] dt-bindings: dma: pl330: Document the quirk 'arm,pl330-periph-burst'

2020-06-08 Thread Sugar Zhang
This patch Adds the quirk 'arm,pl330-periph-burst' for pl330. Signed-off-by: Sugar Zhang --- Changes in v2: None Documentation/devicetree/bindings/dma/arm-pl330.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Doc

[PATCH v2 02/13] dmaengine: pl330: Add quirk 'arm,pl330-periph-burst'

2020-06-08 Thread Sugar Zhang
ansfer for SINGLE request. Finaly, we add the quirk to specify pl330 to use burst transfers only. Signed-off-by: Sugar Zhang --- Changes in v2: None drivers/dma/pl330.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c inde

[PATCH v2 01/13] dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP'

2020-06-08 Thread Sugar Zhang
There is no reason to limit the performance on the 'NO-FLUSHP' SoCs, cuz these platforms are just that the 'FLUSHP' instruction is broken. so, remove the limit to improve the efficiency. Signed-off-by: Sugar Zhang --- Changes in v2: None driv

[PATCH v2 0/13] Patches to improve transfer efficiency for Rockchip SoCs.

2020-06-08 Thread Sugar Zhang
Changes in v2: - fix FATAL ERROR: Unable to parse input tree Sugar Zhang (13): dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP' dmaengine: pl330: Add quirk 'arm,pl330-periph-burst' dt-bindings: dma: pl330: Document the quirk 'arm,pl330-periph-burst

[PATCH v2 04/13] ARM: dts: rk3036: Add 'arm,pl330-periph-burst' for dmac

2020-06-08 Thread Sugar Zhang
This patch Add the quirk to specify to use burst transfer for better compatible and higher performance. Signed-off-by: Sugar Zhang --- Changes in v2: - fix FATAL ERROR: Unable to parse input tree arch/arm/boot/dts/rk3036.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot

[PATCH v1 03/13] dt-bindings: dma: pl330: Document the quirk 'arm,pl330-periph-burst'

2020-06-08 Thread Sugar Zhang
This patch Adds the quirk 'arm,pl330-periph-burst' for pl330. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/dma/arm-pl330.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Documentation/devicetree/bindin

[PATCH v1 02/13] dmaengine: pl330: Add quirk 'arm,pl330-periph-burst'

2020-06-08 Thread Sugar Zhang
ansfer for SINGLE request. Finaly, we add the quirk to specify pl330 to use burst transfers only. Signed-off-by: Sugar Zhang --- drivers/dma/pl330.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index ff0a91f..1941ec6

[PATCH v1 01/13] dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP'

2020-06-08 Thread Sugar Zhang
There is no reason to limit the performance on the 'NO-FLUSHP' SoCs, cuz these platforms are just that the 'FLUSHP' instruction is broken. so, remove the limit to improve the efficiency. Signed-off-by: Sugar Zhang --- drivers/dma/pl330.c | 34 ++

[PATCH v1 0/13] Patches to improve dma transfer efficiency for Rockchip SoCs.

2020-06-08 Thread Sugar Zhang
Sugar Zhang (13): dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP' dmaengine: pl330: Add quirk 'arm,pl330-periph-burst' dt-bindings: dma: pl330: Document the quirk 'arm,pl330-periph-burst' ARM: dts: rk3036: Add 'arm,pl330-periph-burs

[PATCH v1 04/13] ARM: dts: rk3036: Add 'arm,pl330-periph-burst' for dmac

2020-06-08 Thread Sugar Zhang
This patch Add the quirk to specify to use burst transfer for better compatible and higher performance. Signed-off-by: Sugar Zhang --- arch/arm/boot/dts/rk3036.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi index d9a0c9a2

[PATCH v1] dmaengine: pl330: Make sure the debug is idle before doing DMAGO

2020-06-03 Thread Sugar Zhang
to the DBGINST1 Register 6. Write zero to the DBGCMD Register so, we should make sure the debug is idle before step 4/5/6, not only step 6. if not, there maybe a risk that fail to write DBGINST0/1. Signed-off-by: Sugar Zhang --- drivers/dma/pl330.c | 12 ++-- 1 file changed, 6 insertions

[PATCH v1 12/12] ASoC: rockchip: pdm: Correct PDM_CTRL0 reg value

2019-04-03 Thread Sugar Zhang
This patch fix the wrong reg value for rk322x/rk322xh, cuz there is no STORE JUSTIFIED MODE on it. on rk322x/rk322xh, the same bit means PDM_MODE/RESERVED, if the bit is set to RESERVED, the controller will not work. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 7

[PATCH v1 11/12] ASoC: rockchip: pdm: Mark RXFIFO_DATA as volatile and precious

2019-04-03 Thread Sugar Zhang
This patch marks RXFIFO_DATA as precious to avoid being read outside a call from the driver, such as regmap debugfs Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 13 + 1 file changed, 13 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc

[PATCH v1 10/12] ASoC: rockchip: pdm: adjust waterlevel in frame unit

2019-04-03 Thread Sugar Zhang
This patch make the waterlevel more reasonable, because the pdm controller share the single FIFO(128 entries) with each channel. adjust waterlevel in frame to meet the vad or dma frames request. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 3 ++- 1 file changed, 2

[PATCH v1 09/12] dt-bindings: sound: add compatible for rk1808

2019-04-03 Thread Sugar Zhang
This patch adds bindings for rk1808 soc. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip,pdm.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip,pdm.txt b/Documentation/devicetree/bindings/sound/rockchip

[PATCH v1 08/12] ASoC: rockchip: pdm: add compatible for rk1808

2019-04-03 Thread Sugar Zhang
This patch adds support for rk1808, the pdm controller is the same as rk3308. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 4f93a74..3e1c5fd

[PATCH v1 07/12] dt-bindings: sound: rockchip: add compatible for rk3308/px30

2019-04-03 Thread Sugar Zhang
This patch adds bindings for rk3308/px30. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip,pdm.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip,pdm.txt b/Documentation/devicetree/bindings/sound/rockchip

[PATCH v1 06/12] ASoC: rockchip: pdm: fixup pdm fractional div

2019-04-03 Thread Sugar Zhang
This patch adds support fractional div for rk3308. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 172 -- sound/soc/rockchip/rockchip_pdm.h | 9 ++ 2 files changed, 139 insertions(+), 42 deletions(-) diff --git a/sound/soc/rockchip

[PATCH v1 05/12] ASoC: rockchip: pdm: change dma burst to 8

2019-04-03 Thread Sugar Zhang
This patch decreases the transfer bursts to avoid the fifo overrun. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index abbb6d7..c50494b

[PATCH v1 02/12] ASoC: rockchip: pdm: using left justified store mode

2019-04-03 Thread Sugar Zhang
This patch set left justified store mode default. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 1 + sound/soc/rockchip/rockchip_pdm.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index

[PATCH v1 03/12] ASoC: rockchip: pdm: add default regs

2019-04-03 Thread Sugar Zhang
This patch add default regs value for controller. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 8 1 file changed, 8 insertions(+) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 360ebf2..8c1be59 100644 --- a/sound/soc

[PATCH v1 04/12] ASoC: rockchip: pdm: optimize clear logic

2019-04-03 Thread Sugar Zhang
There is no need to reset controller every time, do this once in pdm_probe. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index

[PATCH v1 01/12] ASoC: rockchip: pdm: fix regmap_ops hang issue

2019-04-03 Thread Sugar Zhang
This is because set_fmt ops maybe called when PD is off, and in such case, regmap_ops will lead system hang. enale PD before doing regmap_ops. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_pdm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/rockchip

[PATCH v1 0/12] Patches to update pdm for rockchip socs

2019-04-03 Thread Sugar Zhang
These patches to add support pdm for rk322x/rk1808/rk3308/px30 socs and fix some issues. Sugar Zhang (12): ASoC: rockchip: pdm: fix regmap_ops hang issue ASoC: rockchip: pdm: using left justified store mode ASoC: rockchip: pdm: add default regs ASoC: rockchip: pdm: optimize clear logic

[PATCH] dmaengine: pl330: _stop: clear interrupt status

2019-04-03 Thread Sugar Zhang
| | | clear INTCLR | mask INTEN | | | spin_unlock_irqrestore Signed-off-by: Sugar Zhang

[PATCH v2 1/2] arm64: dts: rockchip: add rk3328 pdm node

2017-08-21 Thread Sugar Zhang
This patch add pdm controller device node for rk3328. Signed-off-by: Sugar Zhang --- Changes in v2: - separate pinctrl pins remove unused fsync clk, it's debug pins arch/arm64/boot/dts/rockchip/rk3328.dtsi | 77 1 file changed, 77 insertions(+) diff

[PATCH v2 2/2] ASoC: rockchip: separate pinctrl pins from each other

2017-08-21 Thread Sugar Zhang
pdm sdi0~3 pins are optional, for example, if 4ch required, only sdi0~1 need to be enabled. Signed-off-by: Sugar Zhang --- Changes in v2: None Documentation/devicetree/bindings/sound/rockchip,pdm.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation

[PATCH v2 0/2] Patches to add support pdm controller for rk3328

2017-08-21 Thread Sugar Zhang
These patches to add support pdm for rk3328 socs. Changes in v2: - separate pinctrl pins remove unused fsync clk, it's debug pins Sugar Zhang (2): arm64: dts: rockchip: add rk3328 pdm node ASoC: rockchip: separate pinctrl pins from each other .../devicetree/bindings/sound/roc

[PATCH] ASoC: rockchip: add bindings for i2s

2017-07-30 Thread Sugar Zhang
This patch add bindings for rk3036/rk3228/rk3328/rk3366 i2s. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip-i2s.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt b/Documentation/devicetree

[PATCH v1 0/2] Patches to add i2s, spdif node for rk3328

2017-07-27 Thread Sugar Zhang
These patches to add i2s, spdif dt nodes for rk3328 soc. Sugar Zhang (2): arm64: dts: rockchip: add rk3328 i2s nodes arm64: dts: rockchip: add rk3328 spdif node arch/arm64/boot/dts/rockchip/rk3328.dtsi | 46 1 file changed, 46 insertions(+) -- 2.7.4

[PATCH v1 2/2] arm64: dts: rockchip: add rk3328 spdif node

2017-07-27 Thread Sugar Zhang
This patch add the spdif dt node for rk3328. Signed-off-by: Sugar Zhang --- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi index f1a284b..d278670

[PATCH v1 1/2] arm64: dts: rockchip: add rk3328 i2s nodes

2017-07-27 Thread Sugar Zhang
This patch add the i2s dt nodes for rk3328. Signed-off-by: Sugar Zhang --- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 33 1 file changed, 33 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi index

[PATCH] arm64: dts: rockchip: add rk3368 spdif node

2017-07-27 Thread Sugar Zhang
This patch add the spdif dt node for rk3368 soc. Signed-off-by: Sugar Zhang --- arch/arm64/boot/dts/rockchip/rk3368.dtsi | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi index 6d5dc05

[PATCH] ARM: dts: rockchip: add spdif for rk322x SoCs

2017-07-26 Thread Sugar Zhang
This patch add the spdif dt node for rk322x SoCs. Signed-off-by: Sugar Zhang --- arch/arm/boot/dts/rk322x.dtsi | 20 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index f3e4ffd..b3b80e1 100644 --- a/arch/arm

[PATCH v1 0/2] Patches to add support pdm controller for rk3328

2017-06-13 Thread Sugar Zhang
These patches to add support pdm for rk3328 socs. Sugar Zhang (2): ASoC: rockchip: add support for pdm controller arm64: dts: rk3328: add pdm node .../devicetree/bindings/sound/rockchip,pdm.txt | 39 ++ arch/arm64/boot/dts/rockchip/rk3328.dtsi | 55 +++ sound/soc/rockchip

[PATCH v1 1/2] ASoC: rockchip: add support for pdm controller

2017-06-13 Thread Sugar Zhang
The Pulse Density Modulation Interface Controller (PDMC) is a PDM interface controller and decoder that support PDM format. It integrates a clock generator driving the PDM microphone and embeds filters which decimate the incoming bit stream to obtain most common audio rates. Signed-off-by: Sugar

[PATCH v1 2/2] arm64: dts: rk3328: add pdm node

2017-06-13 Thread Sugar Zhang
This patch add pdm controller device node for rk3328. Signed-off-by: Sugar Zhang --- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 55 1 file changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328

[PATCH] ARM: dts: rk322x: fix i2s1 pinctrl error

2017-06-09 Thread Sugar Zhang
Signed-off-by: Sugar Zhang --- arch/arm/boot/dts/rk322x.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index 48a0c1c..cc6a27d 100644 --- a/arch/arm/boot/dts/rk322x.dtsi +++ b/arch/arm/boot/dts

[PATCH v1 2/4] ASoC: rockchip: i2s: add support for i2s bclk fs configuration

2017-06-09 Thread Sugar Zhang
this patch add support for i2s bclk fs configuration, we can configure bclk_fs by devicetree as required. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip-i2s.txt | 2 ++ sound/soc/rockchip/rockchip_i2s.c| 9 - 2 files changed, 10

[PATCH v1 4/4] ASoC: rockchip: i2s: fixup clk div

2017-06-09 Thread Sugar Zhang
we found mclk maybe not precise as required because of PLL, but it still can be used and no side effect. for example, if we require mclk 11289600, but get 11289598, it doesn't matter. so using DIV_ROUND_CLOSEST to fix it. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.

[PATCH v1 0/4] Patches to fix some problem for rockchip i2s

2017-06-09 Thread Sugar Zhang
These patches to fix some problem for rockchip i2s. Sugar Zhang (3): ASoC: rockchip: i2s: add a delay before i2s clear ASoC: rockchip: i2s: add support for i2s bclk fs configuration ASoC: rockchip: i2s: fixup clk div zhangjun (1): ASoC: rockchip: i2s: add other configurable formats

[PATCH v1 1/4] ASoC: rockchip: i2s: add a delay before i2s clear

2017-06-09 Thread Sugar Zhang
in order to guarantee i2s lrck signal integrity, when i2s stop, need at least one lrck cycle to ensure signal integrity. the max delay time is when lrck is 8khz, the delay time is 125us(1/8khz), using udelay(150) with a 25us margin. Signed-off-by: Sugar Zhang --- sound/soc/rockchip

[PATCH v1 3/4] ASoC: rockchip: i2s: add other configurable formats

2017-06-09 Thread Sugar Zhang
From: zhangjun simple-audio-card,bitclock-inversion = <1> : bclk falling edge taken simple-audio-card,format = "dsp_a" : pcm no delay mode simple-audio-card,format = "dsp_b" : pcm late 1 mode Signed-off-by: zhangjun Signed-off-by: Sugar Zhang --- sound/soc/ro

[PATCH v1 1/2] ASoC: rockchip: add bindings for spdif controller

2017-06-09 Thread Sugar Zhang
this patch add compatible for rk3228/rk3328 spdif, Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip-spdif.txt | 2 ++ sound/soc/rockchip/rockchip_spdif.c| 4 2 files changed, 6 insertions(+) diff --git a/Documentation/devicetree

[PATCH v1 0/2] Patches to add support spdif for rk322x

2017-06-09 Thread Sugar Zhang
These patches to add support spdif for rk322x socs. Sugar Zhang (2): ASoC: rockchip: add bindings for spdif controller ARM: dts: rk322x: add spdif node .../devicetree/bindings/sound/rockchip-spdif.txt | 2 ++ arch/arm/boot/dts/rk322x.dtsi| 20

[PATCH v1 2/2] ARM: dts: rk322x: add spdif node

2017-06-09 Thread Sugar Zhang
This patch add spdif node for rk322x. Signed-off-by: Sugar Zhang --- arch/arm/boot/dts/rk322x.dtsi | 20 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index 48a0c1c..56f0842 100644 --- a/arch/arm/boot/dts

Re: [PATCH 0/2] Free running cyclic transfer implementation for pl330

2017-04-17 Thread sugar
Hi Alexander, I have tested this series on rk3399 evb board and works well. Tested-by: Sugar Zhang 在 4/14/2017 22:35, Alexander Kochetkov 写道: Hello! This series contain free running cyclic transfer implementation for pl330. It affect ALL chips using pl330 (not only rockchip) and allow to

[PATCH v3] ASoC: rockchip: spdif: restore register during runtime_suspend/resume cycle

2016-09-06 Thread Sugar Zhang
when step into runtime_suspend, spdif pd will be disabled and loss state. so need to restore register when runtime_resume. Signed-off-by: Sugar Zhang --- Changes in v3: - remove unneeded initialization Changes in v2: - remove system suspend/resume and restore register in runtime_suspend

[PATCH v3] ASoC: rockchip: i2s: restore register during runtime_suspend/resume cycle

2016-09-06 Thread Sugar Zhang
when step into runtime_suspend, i2s pd will be disabled and loss state. so need to restore register when runtime_resume. Signed-off-by: Sugar Zhang --- Changes in v3: - remove unneeded initialization Changes in v2: - remove system suspend/resume and restore register in runtime_suspend

[PATCH v2] ASoC: rockchip: spdif: restore register during runtime_suspend/resume cycle

2016-09-05 Thread Sugar Zhang
when step into runtime_suspend, spdif pd will be disabled and loss state. so need to restore register when runtime_resume. Signed-off-by: Sugar Zhang --- Changes in v2: - remove system suspend/resume and restore register in runtime_suspend/resume per Doug Anderson's suggestion soun

[PATCH v2] ASoC: rockchip: i2s: restore register during runtime_suspend/resume cycle

2016-09-05 Thread Sugar Zhang
when step into runtime_suspend, i2s pd will be disabled and loss state. so need to restore register when runtime_resume. Signed-off-by: Sugar Zhang --- Changes in v2: - remove system suspend/resume and restore register in runtime_suspend/resume per Doug Anderson's suggestion soun

[PATCH] ASoC: rockchip: implement system suspend/resume for spdif

2016-07-04 Thread Sugar Zhang
restore hw registers after power loss during a suspend/resume cycle. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_spdif.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c

[PATCH] ASoC: rockchip: implement system suspend/resume for i2s

2016-07-04 Thread Sugar Zhang
restore hw registers after power loss during a suspend/resume cycle. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index

Re: [PATCH 1/2] ASoC: rockchip: i2s: separate capture and playback

2016-05-02 Thread sugar
Hi John, On 4/30/2016 15:00, John Keeping Wrote: Hi Enric, On Fri, Apr 29, 2016 at 04:59:27PM +0200, Enric Balletbo Serra wrote: 2015-12-09 11:32 GMT+01:00 John Keeping : If we only clear the tx/rx state when both are disabled it is not possible to start/stop one multiple times while the othe

[PATCH v2] ASoC: rockchip: i2s: configure the sdio pins' iomux mode

2016-04-11 Thread Sugar Zhang
There are 3 i2s sdio pins, which iomux mode is as follows: - sdi3_sdo1 - sdi2_sdo2 - sdi1_sdo3 we need to configure these pins' iomux mode via the GRF register when use multi channel playback/capture. Signed-off-by: Sugar Zhang --- Changes in v2: - fix a typo error. as suggested by

Re: [PATCH] ASoC: rockchip: i2s: configure the sdio pins' iomux mode

2016-04-10 Thread sugar
Hi Heiko, Got it, thanks for your advice, these will be done in next version. On 4/9/2016 01:14, Heiko Stuebner Wrote: Hi, Am Mittwoch, 6. April 2016, 16:38:22 schrieb Sugar Zhang: There are 3 i2s sdio pins, which iomux mode is as follows: - sdi3_sdo1 - sdi2_sdo2 - sdi1_sdo3 we need

Re: [PATCH] ASoC: rockchip: i2s: configure the sdio pins' iomux mode

2016-04-08 Thread sugar
Hi Rob, On 4/8/2016 01:58, Rob Herring Wrote: On Wed, Apr 06, 2016 at 04:38:22PM +0800, Sugar Zhang wrote: There are 3 i2s sdio pins, which iomux mode is as follows: s/i2s sdio/I2S\/SDIO muxed/ - sdi3_sdo1 - sdi2_sdo2 - sdi1_sdo3 we need to configure these pins' iomux mode vi

[PATCH] ASoC: rockchip: i2s: configure the sdio pins' iomux mode

2016-04-06 Thread Sugar Zhang
There are 3 i2s sdio pins, which iomux mode is as follows: - sdi3_sdo1 - sdi2_sdo2 - sdi1_sdo3 we need to configure these pins' iomux mode via the GRF register when use multi channel playback/capture. Signed-off-by: Sugar Zhang --- .../devicetree/bindings/sound/rockchip-i2s.txt

[PATCH] ASoC: rt5640: Correct the digital interface data select

2016-03-19 Thread Sugar Zhang
this patch corrects the interface adc/dac control register definition according to datasheet. Signed-off-by: Sugar Zhang --- sound/soc/codecs/rt5640.c | 2 +- sound/soc/codecs/rt5640.h | 36 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a

[PATCH] ASoC: rockchip: add bindings for spdif controller

2016-03-04 Thread Sugar Zhang
this patch add compatible for rk3366/rk3368/rk3399 spdif, these three spdifs share the same type. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip-spdif.txt | 8 ++-- sound/soc/rockchip/rockchip_spdif.c| 13 ++--- 2 files

[PATCH] ASoC: rt5640: add master clock handling for rt5640

2016-02-22 Thread Sugar Zhang
enable/disable master clock when codec is active or not. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rt5640.txt | 3 +++ sound/soc/codecs/rt5640.c | 31 ++ sound/soc/codecs/rt5640.h | 2 ++ 3

[PATCH] ASoC: rockchip: i2s: add default values for registers

2016-02-22 Thread Sugar Zhang
this patch add default values for registers according description from TRM. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 6561c4c

Re: [PATCH v1 0/2] patches to add support for rockchip rt5640 card

2016-02-22 Thread sugar
在 2/22/2016 19:04, Mark Brown 写道: On Mon, Feb 22, 2016 at 03:56:53PM +0800, Sugar Zhang wrote: Sugar Zhang (2): ASoC: rockchip: i2s: add default values for registers ASoC: rt5640: add master clock handling for rt5640 These appear to be commpletly unrelated patches so should each be

[PATCH v1 2/2] ASoC: rt5640: add master clock handling for rt5640

2016-02-22 Thread Sugar Zhang
enable/disable master clock when codec is active or not. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rt5640.txt | 3 +++ sound/soc/codecs/rt5640.c | 31 ++ sound/soc/codecs/rt5640.h | 2 ++ 3

[PATCH v1 1/2] ASoC: rockchip: i2s: add default values for registers

2016-02-22 Thread Sugar Zhang
this patch add default values for registers according description from TRM. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 6561c4c

[PATCH v1 0/2] patches to add support for rockchip rt5640 card

2016-02-22 Thread Sugar Zhang
add default values for i2s registers from TRM. rt5640: add master clock handing. Sugar Zhang (2): ASoC: rockchip: i2s: add default values for registers ASoC: rt5640: add master clock handling for rt5640 Documentation/devicetree/bindings/sound/rt5640.txt | 3 +++ sound/soc/codecs/rt5640.c

[PATCH 1/3] ASoC: rockchip: i2s: compatible with different chips

2015-11-09 Thread Sugar Zhang
with these various chips, we add playback and capture property to specify these values. there are default channels configuration in driver: 8 channels playback and 2 channels capture. if not add property, we use the default values. Signed-off-by: Sugar Zhang --- sound/soc/rockchip

[PATCH 3/3] ARM: dts: rockchip: add channels properties for i2s

2015-11-09 Thread Sugar Zhang
add playback and capture properties to compatible various chips. Signed-off-by: Sugar Zhang --- arch/arm/boot/dts/rk3066a.dtsi | 6 ++ arch/arm/boot/dts/rk3188.dtsi | 2 ++ arch/arm/boot/dts/rk3288.dtsi | 2 ++ 3 files changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/rk3066a.dtsi

[PATCH 0/3] ASoC: rockchip: i2s: compatible with different chips

2015-11-09 Thread Sugar Zhang
with these various chips, we add playback and capture property to specify these values. there are default channels configuration in driver: 8 channels playback and 2 channels capture. if not add property, we use the default values. Sugar Zhang (3): ASoC: rockchip: i2s: compatible with different

[PATCH 2/3] ASoC: rockchip: add playback property

2015-11-09 Thread Sugar Zhang
rockchip,playback-channels: max playback channels, 8 channels default. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip-i2s.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt b/Documentation

Re: [PATCH v3 1/3] ASoC: rockchip: i2s: add 8 channels capture support

2015-11-08 Thread sugar
On 11/6/2015 20:00, Mark Brown wrote: On Fri, Nov 06, 2015 at 09:38:09AM +0800, Sugar Zhang wrote: + /* refine capture channels */ + if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) { + if (val &g

[PATCH v3 2/3] Documentation: DT bindings: rockchip-i2s: add capture property

2015-11-05 Thread Sugar Zhang
rockchip,capture-channels: max capture channels, 2 channels default. Signed-off-by: Sugar Zhang --- Changes in v3: - move property into the Optional properties section Changes in v2: - remove unused lrck property Documentation/devicetree/bindings/sound/rockchip-i2s.txt | 5 + 1 file

[PATCH v3 0/3] ASoC: rockchip: i2s: add 8 channels capture support and share lrck

2015-11-05 Thread Sugar Zhang
support 8 channels capture support. share lrck tx/rx when symmetric_rates enabled. Sugar Zhang (3): ASoC: rockchip: i2s: add 8 channels capture support Documentation: DT bindings: rockchip-i2s: add capture property ASoC: rockchip: i2s: share tx/rx lrck when symmetric_rates enabled

[PATCH v3 1/3] ASoC: rockchip: i2s: add 8 channels capture support

2015-11-05 Thread Sugar Zhang
support max 8 channels capture, please add property 'rockchip,capture-channels' in dts to enable this, if not, support 2 channels capture default. Signed-off-by: Sugar Zhang --- Changes in v3: None Changes in v2: - remove lrck mode, and move it to new patch sound/soc/rockchip/rock

[PATCH v3 3/3] ASoC: rockchip: i2s: share tx/rx lrck when symmetric_rates enabled

2015-11-05 Thread Sugar Zhang
we share lrck_tx to lrck_rx only if when both i2s symmetric_rates and dai_link symmetric_rates enabled. if only lrck_tx is wired into external codec, we should enable this to provider lrck for rx logic inside i2s module. Signed-off-by: Sugar Zhang --- Changes in v3: - modify the judgment

[PATCH v2 0/3] ASoC: rockchip: i2s: add 8 channels capture support and share lrck

2015-10-08 Thread Sugar Zhang
support 8 channels capture support. share lrck tx/rx when symmetric_rates enabled. Sugar Zhang (3): ASoC: rockchip: i2s: add 8 channels capture support Documentation: DT bindings: rockchip-i2s: add capture property ASoC: rockchip: i2s: share tx/rx lrck when symmetric_rates enabled

[PATCH v2 1/3] ASoC: rockchip: i2s: add 8 channels capture support

2015-10-08 Thread Sugar Zhang
support max 8 channels capture, please add property 'rockchip,capture-channels' in dts to enable this, if not, support 2 channels capture default. Signed-off-by: Sugar Zhang --- Changes in v2: - remove lrck mode, and move it to new patch sound/soc/rockchip/rockchip_

[PATCH v2 3/3] ASoC: rockchip: i2s: share tx/rx lrck when symmetric_rates enabled

2015-10-08 Thread Sugar Zhang
share lrck_tx to lrck_rx when symmetric_rates enabled. Signed-off-by: Sugar Zhang --- Changes in v2: - new patch sound/soc/rockchip/rockchip_i2s.c | 8 sound/soc/rockchip/rockchip_i2s.h | 6 ++ 2 files changed, 14 insertions(+) diff --git a/sound/soc/rockchip/rockchip_i2s.c b

[PATCH v2 2/3] Documentation: DT bindings: rockchip-i2s: add capture property

2015-10-08 Thread Sugar Zhang
rockchip,capture-channels: max capture channels, 2 channels default. Signed-off-by: Sugar Zhang --- Changes in v2: - remove unused lrck property Documentation/devicetree/bindings/sound/rockchip-i2s.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings

Re: [alsa-devel] [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-10-07 Thread sugar
Only the new design support 8 channels capture now, the others support 2 channels capture. but all of them support 32bits/sample. On 10/8/2015 11:19, Caleb Crome wrote: That will work! Do all your cortex-a parts support that? Thanks, Caleb Sent from my iPhone -- To unsubscribe from this l

Re: [alsa-devel] [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-10-07 Thread sugar
Yes, we can support 8 channels with 32bits/sample, thanks. 在 10/8/2015 10:36, Caleb Crome 写道: We make microphone arrays with lots of microphones. Some as few as 2, many with 7 channels, and a few with 14 or more. Can you support 8 channels with 32 bits/sample? That would work, we can just s

Re: [alsa-devel] [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-10-07 Thread sugar
Hi Caleb, we haven't support 16 channels capture and playback yet, would you mind to detail the use case? if must, we may support this feature on next generation chip. 在 10/7/2015 21:04, Caleb Crome 写道: Hi sugar, Can the rockchip support more than 8 channels? Ideally, we would li

Re: [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-10-07 Thread sugar
在 10/7/2015 17:39, Mark Brown 写道: On Wed, Oct 07, 2015 at 10:27:14AM +0100, Mark Brown wrote: On Wed, Oct 07, 2015 at 04:01:38PM +0800, sugar wrote: if (dai->symmetric_rates) regmap_update_bits(i2s->regmap, I2S_CKR, I2S_CKR_TRC

Re: [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-10-07 Thread sugar
Sorry for late reply, we were in the National Day Holiday. 在 10/1/2015 02:46, Mark Brown 写道: On Mon, Sep 28, 2015 at 04:16:12PM +0800, sugar wrote: 在 9/24/2015 00:24, Mark Brown 写道: My initial thought here is that the machine driver should be responsible for setting this and then the DAI

Re: [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-09-28 Thread sugar
Hi Mark Brown, 在 9/24/2015 00:24, Mark Brown 写道: On Wed, Sep 23, 2015 at 11:41:22AM +0800, Sugar Zhang wrote: + /* configure tx/rx lrck use mode */ + if (!of_property_read_u32(node, "rockchip,lrck-mode", &val)) { + if (val >= LRCK_TXRX &&

[PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support

2015-09-22 Thread Sugar Zhang
th lrck_rx. - rx_share: lrck_rx is shared with lrck_tx. to enable this, please add property 'rockchip,lrck-mode' in dts, if not, use 'txrx' lrck mode default. Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_i2s.c | 48 +-- sound/so

[PATCH 2/2] Documentation: DT bindings: rockchip-i2s: add capture and lrck-mode

2015-09-22 Thread Sugar Zhang
rockchip,capture-channels: max capture channels, 2 channels default. rockchip,lrck-mode: 0: rxtx separate, 1: tx share, 2: rx share. default use 'rxtx separate' mode. Signed-off-by: Sugar Zhang --- Documentation/devicetree/bindings/sound/rockchip-i2s.txt | 5 + 1 file changed, 5

[PATCH 0/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode

2015-09-22 Thread Sugar Zhang
Support max 8 channels capture. support lrck clk mode configuration, there are 3 modes: - txrx: lrck_tx and lrck_rx are different. - tx_share: lrck_tx is shared with lrck_rx. - rx_share: lrck_rx is shared with lrck_tx. Sugar Zhang (2): ASoC: rockchip: i2s: add 8 channels capture and lrck