[PW_SID:992795] clk: spacemit: fix i2s clock - #798
Conversation
Previously, the K1 clock driver did not include the parent clocks of the I2S sysclk. Introduce pre-clock to fix I2S clock. Otherwise, the I2S clock may not work as expected. This patch adds their definitions to allow proper registration in the driver and usage in the device tree. Fixes: 1b72c59 ("clk: spacemit: Add clock support for SpacemiT K1 SoC") Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The original DDN operations applied an implicit divide-by-2, which should not be a default behavior. This patch removes that assumption, letting each clock define its actual behavior explicitly. Reviewed-by: Haylen Chu <heylenay@4d2.org> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Defining i2s_bclk and i2s_sysclk as fixed-rate clocks is insufficient for real I2S use cases. Moreover, the current I2S clock configuration does not work as expected due to missing parent clocks. This patch adds the missing parent clocks, defines i2s_sysclk as a DDN clock, and i2s_bclk as a DIV clock. A special note for i2s_bclk: From the register definition, the i2s_bclk divider always implies an additional 1/2 factor. The following table shows the correspondence between index and frequency division coefficients: | index | div | |-------|-------| | 0 | 2 | | 1 | 4 | | 2 | 6 | | 3 | 8 | From a software perspective, introducing i2s_bclk_factor as the parent of i2s_bclk is sufficient to address the issue. The I2S-related clock registers can be found here [1]. Link: https://developer.spacemit.com/documentation?token=LCrKwWDasiJuROkVNusc2pWTnEb [1] Fixes: 1b72c59 ("clk: spacemit: Add clock support for SpacemiT K1 SoC") Co-developer: Jinmei Wei <weijinmei@linux.spacemit.com> Suggested-by: Haylen Chu <heylenay@4d2.org> Signed-off-by: Jinmei Wei <weijinmei@linux.spacemit.com> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 1: "[v4,1/3] dt-bindings: clock: spacemit: introduce i2s pre-clock to fix i2s clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 2: "[v4,2/3] clk: spacemit: introduce pre-div for ddn clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
|
Patch 3: "[v4,3/3] clk: spacemit: fix i2s clock" |
PR for series 992795 applied to workflow__riscv__fixes
Name: clk: spacemit: fix i2s clock
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=992795
Version: 4