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 <sugar.zhang@rock-chips.com>
Change-Id: Id50833a8899782ac4aac34e146a424b9f6da590d
This commit is contained in:
Sugar Zhang
2023-09-23 09:02:12 +08:00
committed by Tao Huang
parent afb680be91
commit 8b9e0e2d95

View File

@@ -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");