mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
ASoC: rockchip: sai: add sai wait time init
Change-Id: Ia10d66b67968d092c5d2903334b29078f65c8664 Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
This commit is contained in:
@@ -1524,6 +1524,22 @@ static const struct snd_dlp_config dconfig = {
|
||||
.get_fifo_count = rockchip_sai_get_fifo_count,
|
||||
};
|
||||
|
||||
static int rockchip_sai_wait_time_init(struct rk_sai_dev *sai)
|
||||
{
|
||||
unsigned int wait_time;
|
||||
|
||||
if (!device_property_read_u32(sai->dev, "rockchip,sai-tx-wait-time-ms", &wait_time)) {
|
||||
dev_info(sai->dev, "Init TX wait-time-ms: %d\n", wait_time);
|
||||
sai->wait_time[SNDRV_PCM_STREAM_PLAYBACK] = wait_time;
|
||||
}
|
||||
|
||||
if (!device_property_read_u32(sai->dev, "rockchip,sai-rx-wait-time-ms", &wait_time)) {
|
||||
dev_info(sai->dev, "Init RX wait-time-ms: %d\n", wait_time);
|
||||
sai->wait_time[SNDRV_PCM_STREAM_CAPTURE] = wait_time;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rockchip_sai_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *node = pdev->dev.of_node;
|
||||
@@ -1543,6 +1559,8 @@ static int rockchip_sai_probe(struct platform_device *pdev)
|
||||
sai->is_master_mode = true;
|
||||
dev_set_drvdata(&pdev->dev, sai);
|
||||
|
||||
rockchip_sai_wait_time_init(sai);
|
||||
|
||||
sai->rst_h = devm_reset_control_get_optional_exclusive(&pdev->dev, "h");
|
||||
if (IS_ERR(sai->rst_h))
|
||||
return PTR_ERR(sai->rst_h);
|
||||
|
||||
Reference in New Issue
Block a user