From 8b9e0e2d95fcaa47634b1bd6df52ffbb1574cd43 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Sat, 23 Sep 2023 09:02:12 +0800 Subject: [PATCH] ASoC: rockchip: i2s: Add property 'bclk-fs' This patch bring back property 'rockchip,bclk-fs' to allow user to set it from DT, though we can set it from machine driver or by 'BCLK_Ratio' control. Signed-off-by: Sugar Zhang Change-Id: Id50833a8899782ac4aac34e146a424b9f6da590d --- sound/soc/rockchip/rockchip_i2s.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 9331158551d0..a24279f68a35 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -1089,7 +1089,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) struct snd_soc_dai_driver *dai; struct resource *res; void __iomem *regs; - int ret, i; + int ret, i, val; i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); if (!i2s) @@ -1124,6 +1124,10 @@ static int rockchip_i2s_probe(struct platform_device *pdev) } i2s->bclk_ratio = 64; + if (!device_property_read_u32(&pdev->dev, "rockchip,bclk-fs", &val)) { + if ((val >= 32) && (val % 2 == 0)) + i2s->bclk_ratio = val; + } i2s->pinctrl = devm_pinctrl_get(&pdev->dev); if (!IS_ERR(i2s->pinctrl)) { i2s->bclk_on = pinctrl_lookup_state(i2s->pinctrl, "bclk_on");