Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi-ng: f1c100s: Add IR mod clock

For some reason the mod clock for the Allwinner F1C100s CIR (infrared
receiver) peripheral was not modeled in the CCU driver.

Add the clock description to the list, and wire it up in the clock list.
By assigning a new clock ID at the end, it extends the number of clocks.

This allows to use the CIR peripheral on any F1C100s series board.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20221107005433.11079-5-andre.przywara@arm.com
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

authored by

Andre Przywara and committed by
Jernej Skrabec
f64603c9 d550f6b0

+13 -2
+10 -1
drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
··· 239 239 static SUNXI_CCU_MUX_WITH_GATE(spdif_clk, "spdif", i2s_spdif_parents, 240 240 0x0b4, 16, 2, BIT(31), 0); 241 241 242 - /* The BSP header file has a CIR_CFG, but no mod clock uses this definition */ 242 + static const char * const ir_parents[] = { "osc32k", "osc24M" }; 243 + static SUNXI_CCU_MP_WITH_MUX_GATE(ir_clk, "ir", 244 + ir_parents, 0x0b8, 245 + 0, 4, /* M */ 246 + 16, 2, /* P */ 247 + 24, 2, /* mux */ 248 + BIT(31), /* gate */ 249 + 0); 243 250 244 251 static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", 245 252 0x0cc, BIT(1), 0); ··· 362 355 &mmc1_output_clk.common, 363 356 &i2s_clk.common, 364 357 &spdif_clk.common, 358 + &ir_clk.common, 365 359 &usb_phy0_clk.common, 366 360 &dram_ve_clk.common, 367 361 &dram_csi_clk.common, ··· 454 446 [CLK_MMC1_OUTPUT] = &mmc1_output_clk.common.hw, 455 447 [CLK_I2S] = &i2s_clk.common.hw, 456 448 [CLK_SPDIF] = &spdif_clk.common.hw, 449 + [CLK_IR] = &ir_clk.common.hw, 457 450 [CLK_USB_PHY0] = &usb_phy0_clk.common.hw, 458 451 [CLK_DRAM_VE] = &dram_ve_clk.common.hw, 459 452 [CLK_DRAM_CSI] = &dram_csi_clk.common.hw,
+1 -1
drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
··· 29 29 30 30 /* All bus gates, DRAM gates and mod clocks are exported */ 31 31 32 - #define CLK_NUMBER (CLK_AVS + 1) 32 + #define CLK_NUMBER (CLK_IR + 1) 33 33 34 34 #endif /* _CCU_SUNIV_F1C100S_H_ */
+2
include/dt-bindings/clock/suniv-ccu-f1c100s.h
··· 67 67 #define CLK_CODEC 65 68 68 #define CLK_AVS 66 69 69 70 + #define CLK_IR 67 71 + 70 72 #endif