These patches fixup or update for rockchip i2s.
Changes in v3:
- Drop property 'rockchip,playback-only', 'rockchip,capture-only'.
Implement it by 'dma-names' of DT instead.
Changes in v2:
- split property trcm into single 'trcm-sync-tx-only' and
'trcm-sync-rx-only' suggested by Nicolas.
- split property trcm into single 'trcm-sync-tx-only' and
'trcm-sync-rx-only' suggested by Nicolas.
- drop change-id
Sugar Zhang (12):
ASoC: rockchip: i2s: Add support for set bclk ratio
ASoC: rockchip: i2s: Fixup clk div error
ASoC: rockchip: i2s: Improve dma data transfer efficiency
ASoC: rockchip: i2s: Fix regmap_ops hang
ASoC: rockchip: i2s: Fix concurrency between tx/rx
ASoC: rockchip: i2s: Reset the controller if soft reset failed
ASoC: dt-bindings: rockchip: Document reset property for i2s
ASoC: rockchip: i2s: Make playback/capture optional
ASoC: rockchip: i2s: Add compatible for more SoCs
ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
ASoC: rockchip: i2s: Add support for frame inversion
ASoC: dt-bindings: rockchip: i2s: Document property TRCM
Xiaotan Luo (1):
ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B
Xing Zheng (1):
ASoC: rockchip: i2s: Add support for TRCM property
.../devicetree/bindings/sound/rockchip-i2s.yaml | 19 ++
sound/soc/rockchip/rockchip_i2s.c | 278 +++++++++++++++------
sound/soc/rockchip/rockchip_i2s.h | 10 +-
3 files changed, 224 insertions(+), 83 deletions(-)
--
2.7.4
MCLK maybe not precise as required because of PLL,
but which still can be used and no side effect. so,
using DIV_ROUND_CLOSEST instead div.
e.g.
set mclk to 11289600 Hz, but get 11289598 Hz.
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
This patch changes dma data burst from 4 to 8 to improve
data transfer efficiency.
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
This patch adds support for set bclk ratio from machine driver.
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
API 'set_fmt' maybe called when PD is off, in the situation,
any register access will hang the system. so, enable PD
before r/w register.
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
This patch brings i2s back to normal by resetting i2s m/h
when the soft reset failed.
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
@@ -132,7 +149,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)regmap_read(i2s->regmap,I2S_CLR,&val);retry--;if(!retry){-dev_warn(i2s->dev,"fail to clear\n");+rockchip_i2s_reset(i2s);break;}}
@@ -181,7 +198,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)regmap_read(i2s->regmap,I2S_CLR,&val);retry--;if(!retry){-dev_warn(i2s->dev,"fail to clear\n");+rockchip_i2s_reset(i2s);break;}}
@@ -629,6 +646,14 @@ static int rockchip_i2s_probe(struct platform_device *pdev)i2s->pins=of_id->data;}+i2s->reset_m=devm_reset_control_get_optional(&pdev->dev,"reset-m");+if(IS_ERR(i2s->reset_m))+returnPTR_ERR(i2s->reset_m);++i2s->reset_h=devm_reset_control_get_optional(&pdev->dev,"reset-h");+if(IS_ERR(i2s->reset_h))+returnPTR_ERR(i2s->reset_h);+/* try to prepare related clocks */i2s->hclk=devm_clk_get(&pdev->dev,"i2s_hclk");if(IS_ERR(i2s->hclk)){
There are some controllers which support playback only or
capture only. so, make it optional. and initial capability
by 'dma-names' of DT.
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3:
- Drop property 'rockchip,playback-only', 'rockchip,capture-only'.
Implement it by 'dma-names' of DT instead.
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 129 +++++++++++++++++++++++---------------
1 file changed, 79 insertions(+), 50 deletions(-)
From: Xiaotan Luo <redacted>
- DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC
- DSP_B: PCM no delay mode, L data MSB during FRM LRC
Signed-off-by: Xiaotan Luo <redacted>
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2: None
sound/soc/rockchip/rockchip_i2s.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
This patch documents property 'rockchip,trcm-sync-tx-only/rx-only'
which is used to specify the lrck.
Signed-off-by: Sugar Zhang <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Changes in v3: None
Changes in v2:
- split property trcm into single 'trcm-sync-tx-only' and
'trcm-sync-rx-only' suggested by Nicolas.
- drop change-id
Documentation/devicetree/bindings/sound/rockchip-i2s.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
@@ -91,6 +91,14 @@ properties:Required property for controllers which support multi channelplayback/capture.+rockchip,trcm-sync-tx-only:+type:boolean+description:Use TX LRCK for both TX and RX.++rockchip,trcm-sync-rx-only:+type:boolean+description:Use RX LRCK for both TX and RX.+"#sound-dai-cells":const:0
From: Xing Zheng <redacted>
If there is only one lrck (tx or rx) by hardware, we need to
use 'rockchip,trcm-sync-tx-only/rx-only' to specify which lrck
can be used.
Signed-off-by: Xing Zheng <redacted>
Signed-off-by: Sugar Zhang <redacted>
---
Changes in v3: None
Changes in v2:
- split property trcm into single 'trcm-sync-tx-only' and
'trcm-sync-rx-only' suggested by Nicolas.
sound/soc/rockchip/rockchip_i2s.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
From: Mark Brown <broonie@kernel.org> Date: 2021-08-26 14:16:21
On Thu, 26 Aug 2021 12:00:41 +0800, Sugar Zhang wrote:
These patches fixup or update for rockchip i2s.
Changes in v3:
- Drop property 'rockchip,playback-only', 'rockchip,capture-only'.
Implement it by 'dma-names' of DT instead.
Changes in v2:
- split property trcm into single 'trcm-sync-tx-only' and
'trcm-sync-rx-only' suggested by Nicolas.
- split property trcm into single 'trcm-sync-tx-only' and
'trcm-sync-rx-only' suggested by Nicolas.
- drop change-id
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[01/14] ASoC: rockchip: i2s: Add support for set bclk ratio
commit: ebfea67125767a779af63ae6de176709713c8826
[02/14] ASoC: rockchip: i2s: Fixup clk div error
commit: 6b76bcc004b046ea3c8eb66bbc6954f1d23cc2af
[03/14] ASoC: rockchip: i2s: Improve dma data transfer efficiency
commit: 7a2df53bc090a161713da057df7455b39f6cd00d
[04/14] ASoC: rockchip: i2s: Fix regmap_ops hang
commit: 53ca9b9777b95cdd689181d7c547e38dc79adad0
[06/14] ASoC: rockchip: i2s: Reset the controller if soft reset failed
(no commit info)
[07/14] ASoC: dt-bindings: rockchip: Document reset property for i2s
commit: 296713a3609deaf4ad2c460ffe196c09084792e0
[08/14] ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B
commit: 1bf56843e664eef2525bdbfae6a561e98910f676
[09/14] ASoC: rockchip: i2s: Make playback/capture optional
commit: 4455f26a551c86e31c7d27495903a11c3d660034
[10/14] ASoC: rockchip: i2s: Add compatible for more SoCs
commit: f005dc6db136a477166dd86e983351fec9129cce
[11/14] ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
commit: d5ceed036f7cde29bf17173e9a9c8bbde0a70389
[12/14] ASoC: rockchip: i2s: Add support for frame inversion
commit: 917f07719b133093680ed57dd7b5bc30b6a5b45d
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
Why is this a global and not part of the driver data? It's also not
clear to me why this is a spinlock and not a mutex.
Yes, this should be moved into driver data, will do in v4.
it's not allowed to sleep in this context, so use spinlock instead.
--
Best Regards!
张学广/Sugar
瑞芯微电子股份有限公司
Rockchip Electronics Co., Ltd.