Skip to contentSkip to conversation

clk: rockchip: add clock output/input switch driver

PATCH In review ZhuXiangyu 2 participants 2 messages Nov 21 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

ZhuXiangyu

author
#1 lore raw

PATCH 2/2 clk: rockchip: add clock output/input switch driver

Add a small driver for the Rockchip GRF-controlled clock output/input switch. It exposes a single gate bit as a clock, allowing the SAI MCLK pin direction to be controlled through the clock framework.

Tested on an RK3506B board with the ES8388 codec: this clock drives the I2S MCLK and audio playback works.

---
 drivers/clk/rockchip/Kconfig   |  8 ++++
 drivers/clk/rockchip/Makefile  |  1 +
 drivers/clk/rockchip/clk-out.c | 70 ++++++++++++++++++++++++++++++++++
 3 files changed, 79 insertions(+)
 create mode 100644 drivers/clk/rockchip/clk-out.c
drivers/clk/rockchip/Kconfig +8 -0
index 4b55f48d..dfbdb231 100644
@@ -156,4 +156,12 @@ config CLK_RK3588
 	help
 	  Build the driver for RK3588 Clock Driver.
 
+config ROCKCHIP_CLK_OUT
+	tristate "Rockchip clock output/input switch"
+	help
+	  Say Y or M here to enable the Rockchip clock output/input switch
+	  driver. It exposes a GRF-controlled clock gate used for the SAI
+	  MCLK output pins. The pin direction is controlled through the
+	  common clock framework.
+
 endif
drivers/clk/rockchip/Makefile +1 -0
index 554b7eb8..eed5fb59 100644
@@ -4,6 +4,7 @@
 #
 
 obj-$(CONFIG_COMMON_CLK_ROCKCHIP) += clk-rockchip.o
+obj-$(CONFIG_ROCKCHIP_CLK_OUT) += clk-out.o
 
 clk-rockchip-y += clk.o
 clk-rockchip-y += clk-pll.o
drivers/clk/rockchip/clk-out.c new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
2.47.3
#2 lore raw
Quoted 8 lines · ZhuXiangyu

Add a small driver for the Rockchip GRF-controlled clock output/input switch. It exposes a single gate bit as a clock, allowing the SAI MCLK pin direction to be controlled through the clock framework.

Tested on an RK3506B board with the ES8388 codec: this clock drives the I2S MCLK and audio playback works.

No, this makes no sense. Please do not invent own stuff, like author-testing-tags. Look how other people did it.

Quoted 2 lines

---

Best regards,
Krzysztof