Commit 5323186
ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback
In commit
9e2ab4b ("ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates"),
the set_sysclk callback was removed as considered unused as the mclk rate
can be set in the hw_params callback.
The difference between hw_params and set_sysclk is that the former is
called with the audio sampling rate set in the params (e.g.: 48000 Hz)
while the latter is called with a clock rate already computed with
sampling_rate * mclk-fs (e.g.: 48000 * 256)
For HDMI audio using the Rockchip I2S TDM driver, the mclk-fs value must
be set to 128 instead of the default 256, and that value is set in the
device tree at the machine driver level (like a simple-audio-card
compatible node).
Therefore, the i2s_tdm driver has no idea that another mclk-fs value can
be configured and simply computes the mclk rate in the hw_params callback
with DEFAULT_MCLK_FS * params_rate(params), which is wrong for HDMI
audio.
Re-add the set_sysclk callback so that the mclk rate is computed by the
machine driver which has the correct mclk-fs value set in its device tree
node.
Fixes: 9e2ab4b ("ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates")
Signed-off-by: Detlev Casanova <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>1 parent d1e7dce commit 5323186
1 file changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
620 | 642 | | |
621 | 643 | | |
622 | 644 | | |
| |||
631 | 653 | | |
632 | 654 | | |
633 | 655 | | |
| 656 | + | |
634 | 657 | | |
635 | 658 | | |
| 659 | + | |
636 | 660 | | |
637 | 661 | | |
| 662 | + | |
638 | 663 | | |
639 | 664 | | |
| 665 | + | |
640 | 666 | | |
641 | 667 | | |
642 | | - | |
| 668 | + | |
643 | 669 | | |
644 | 670 | | |
645 | 671 | | |
| |||
799 | 825 | | |
800 | 826 | | |
801 | 827 | | |
| 828 | + | |
802 | 829 | | |
803 | 830 | | |
804 | 831 | | |
| |||
0 commit comments