# SPDX-License-Identifier: GPL-2.0-only
config SUNXI_CCU
	tristate "Clock support for Allwinner SoCs"
	depends on ARCH_SUNXI || COMPILE_TEST
	select RESET_CONTROLLER
	select SUNXI_RTC_CCU
	default ARCH_SUNXI

if SUNXI_CCU

config SUN8IW20_CCU
	tristate "Support for the Allwinner SUN8IW20 CCU"
	default ARM && ARCH_SUN8IW20
	depends on (ARM && ARCH_SUN8IW20) || (RISCV && ARCH_SUN20IW1) || COMPILE_TEST

config SUN8IW20_R_CCU
	tristate "Support for the Allwinner SUN8IW20 PRCM CCU"
	default ARM && ARCH_SUN8IW20
	depends on (ARM && ARCH_SUN8IW20) || (RISCV && ARCH_SUN20IW1) || COMPILE_TEST

config SUN50IW12_CCU
	tristate "Support for the Allwinner SUN50IW12 CCU"
	default ARM64 && ARCH_SUN50IW12
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50IW12_R_CCU
	tristate "Support for the Allwinner SUN50IW12 PRCM CCU"
	default ARM64 && ARCH_SUN50IW12
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50IW10_CCU
	tristate "Support for the Allwinner SUN50IW10 CCU"
	default ARM64 && ARCH_SUN50IW10
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50IW10_R_CCU
	tristate "Support for the Allwinner SUN50IW10 PRCM CCU"
	default ARM64 && ARCH_SUN50IW10
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50IW9_CCU
	tristate "Support for the Allwinner SUN50IW9 CCU"
	default ARM64 && ARCH_SUN50IW9
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50IW9_R_CCU
	tristate "Support for the Allwinner SUN50IW9 PRCM CCU"
	default ARM64 && ARCH_SUN50IW9
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUNIV_F1C100S_CCU
	bool "Support for the Allwinner newer F1C100s CCU"
	default MACH_SUNIV
	depends on MACH_SUNIV || COMPILE_TEST

config SUN50I_A64_CCU
	bool "Support for the Allwinner A64 CCU"
	default ARM64 && ARCH_SUNXI
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50I_H6_CCU
	bool "Support for the Allwinner H6 CCU"
	default ARM64 && ARCH_SUNXI
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN50I_H6_R_CCU
	bool "Support for the Allwinner H6 PRCM CCU"
	default ARM64 && ARCH_SUNXI
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN4I_A10_CCU
	bool "Support for the Allwinner A10/A20 CCU"
	default MACH_SUN4I
	default MACH_SUN7I
	depends on MACH_SUN4I || MACH_SUN7I || COMPILE_TEST

config SUN5I_CCU
	bool "Support for the Allwinner sun5i family CCM"
	default MACH_SUN5I
	depends on MACH_SUN5I || COMPILE_TEST

config SUN55IW3_CCU
	tristate "Support for the Allwinner SUN55IW3 CCU"
	default ARM64 && ARCH_SUN55IW3
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN55IW3_R_CCU
	tristate "Support for the Allwinner SUN55IW3 PRCM CCU"
	default ARM64 && ARCH_SUN55IW3
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN55IW3_DSP_CCU
	tristate "Support for the Allwinner SUN55IW3 DSP PRCM CCU"
	default ARM64 && ARCH_SUN55IW3
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN6I_A31_CCU
	bool "Support for the Allwinner A31/A31s CCU"
	default MACH_SUN6I
	depends on MACH_SUN6I || COMPILE_TEST

config SUN8I_A23_CCU
	bool "Support for the Allwinner A23 CCU"
	default MACH_SUN8I
	depends on MACH_SUN8I || COMPILE_TEST

config SUN8I_A33_CCU
	bool "Support for the Allwinner A33 CCU"
	default MACH_SUN8I
	depends on MACH_SUN8I || COMPILE_TEST

config SUN8I_A83T_CCU
	bool "Support for the Allwinner A83T CCU"
	default MACH_SUN8I

config SUN8I_H3_CCU
	bool "Support for the Allwinner H3 CCU"
	default MACH_SUN8I || (ARM64 && ARCH_SUNXI)
	depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST

config SUN8I_V3S_CCU
	bool "Support for the Allwinner V3s CCU"
	default MACH_SUN8I
	depends on MACH_SUN8I || COMPILE_TEST

config SUN8I_DE2_CCU
	bool "Support for the Allwinner SoCs DE2 CCU"
	default MACH_SUN8I || (ARM64 && ARCH_SUNXI)

config SUN8I_R40_CCU
	bool "Support for the Allwinner R40 CCU"
	default MACH_SUN8I
	depends on MACH_SUN8I || COMPILE_TEST

config SUN9I_A80_CCU
	bool "Support for the Allwinner A80 CCU"
	default MACH_SUN9I
	depends on MACH_SUN9I || COMPILE_TEST

config SUN8I_R_CCU
	bool "Support for Allwinner SoCs' PRCM CCUs"
	default MACH_SUN8I || (ARCH_SUNXI && ARM64)

endif

config SUNXI_RTC_CCU
	tristate "Clock support in RTC domain for Allwinner SoCs"
	depends on ARCH_SUNXI
	default y
	help
	  sunxi clock provider in RTC domain, which provides clocks such as
          dcxo24M-out, iosc, osc32k, osc32k-out and rtc-1k. This module is
	  mandatory for sunxi SoCs. Say 'Y' here.
