ASoC: rockchip: sai: Add support lanes parsed from DT

used to assign lanes from DT.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I2064b201a8325e0b5d1e7a448a14345443a173a4
This commit is contained in:
Sugar Zhang
2024-09-11 16:13:08 +08:00
committed by Tao Huang
parent 3fa1e010c7
commit f4e6d5530a

View File

@@ -765,8 +765,19 @@ static int rockchip_sai_path_prepare(struct rk_sai_dev *sai,
static int rockchip_sai_parse_paths(struct rk_sai_dev *sai,
struct device_node *np)
{
unsigned int val;
int ret;
if (!device_property_read_u32(sai->dev, "rockchip,tdm-tx-lanes", &val)) {
if ((val >= 1) && (val <= 4))
sai->tx_lanes = val;
}
if (!device_property_read_u32(sai->dev, "rockchip,tdm-rx-lanes", &val)) {
if ((val >= 1) && (val <= 4))
sai->rx_lanes = val;
}
ret = rockchip_sai_path_prepare(sai, np, 0);
if (ret < 0) {
dev_err(sai->dev, "Failed to prepare TX path: %d\n", ret);