From caf846fe5d583d9b508d15ff3a1f339b48d16660 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 f59bc3d16455..4e27cbd09360 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -1024,7 +1024,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) @@ -1059,6 +1059,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; + } dev_set_drvdata(&pdev->dev, i2s);