# SPDX-License-Identifier: GPL-2.0-only
# Embedded Codec and Affiliated

# SUNXI Platform DMA
config SND_SUNXI_SOC
	depends on ARCH_SUNXI
	tristate

# Dummy CPU DAI module
config SND_SUNXI_SOC_CPUDAI
	depends on ARCH_SUNXI
	tristate

# SUNXI Codec Embedded
config SND_SUN50IW10_CODEC
	tristate

config SND_SUN50IW12_CODEC
	tristate

config SND_SUN8IW20_CODEC
	tristate

config SND_SUN20IW1_CODEC
	tristate

menu "Allwinner SoC Audio support"
	depends on ARCH_SUNXI || COMPILE_TEST

config SND_SUN4I_CODEC
	tristate "Allwinner A10 Codec Support"
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	help
	  Select Y or M to add support for the Codec embedded in the Allwinner
	  A10 and affiliated SoCs.

config SND_SUN8I_CODEC
	tristate "Allwinner SUN8I audio codec"
	depends on OF
	depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
	select REGMAP_MMIO
	help
	  This option enables the digital part of the internal audio codec for
	  Allwinner sun8i SoC (and particularly A33).

	  Say Y or M if you want to add sun8i digital audio codec support.

config SND_SUN8I_CODEC_ANALOG
	tristate "Allwinner sun8i Codec Analog Controls Support"
	depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
	select SND_SUN8I_ADDA_PR_REGMAP
	help
	  Say Y or M if you want to add support for the analog controls for
	  the codec embedded in newer Allwinner SoCs.

config SND_SUN50I_CODEC_ANALOG
	tristate "Allwinner sun50i Codec Analog Controls Support"
	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
	select SND_SUN8I_ADDA_PR_REGMAP
	help
	  Say Y or M if you want to add support for the analog controls for
	  the codec embedded in Allwinner A64 SoC.

config SND_SUN4I_I2S
	tristate "Allwinner A10 I2S Support"
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	help
	  Say Y or M if you want to add support for codecs attached to
	  the Allwinner A10 I2S. You will also need to select the
	  individual machine drivers to support below.

config SND_SUN4I_SPDIF
	tristate "Allwinner A10 SPDIF Support"
	depends on OF
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	help
	  Say Y or M to add support for the S/PDIF audio block in the Allwinner
	  A10 and affiliated SoCs.

config SND_SUN8I_ADDA_PR_REGMAP
	tristate
	select REGMAP

# SUNXI CODEC Machine Select
config SND_SUNXI_SOC_SUN50IW10_CODEC
	tristate "Allwinner Sun50iw10 Codec Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	select SND_SUN50IW10_CODEC
	select SND_SUNXI_SOC_CPUDAI
	depends on ARCH_SUN50IW10
   help
	Select Y or M to add support for the Codec embedded in the Allwinner
	SUN50IW10 and affiliated SoCs.

config SND_SUNXI_SOC_SUN50IW12_CODEC
	tristate "Allwinner Sun50iw12 Codec Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	select SND_SUN50IW12_CODEC
	select SND_SUNXI_SOC_CPUDAI
	depends on ARCH_SUN50IW12
   help
	Select Y or M to add support for the Codec embedded in the Allwinner
	SUN50IW12 and affiliated SoCs.

config SND_SUNXI_SOC_SUN8IW20_CODEC
	tristate "Allwinner Sun8iw20 Codec Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	select SND_SUN8IW20_CODEC
	select SND_SUNXI_SOC_CPUDAI
	depends on ARCH_SUN8IW20
   help
	Select Y or M to add support for the Codec embedded in the Allwinner
	SUN8IW20 and affiliated SoCs.

config SND_SUNXI_SOC_SUN20IW1_CODEC
	tristate "Allwinner Sun20iw1 Codec Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	select SND_SUN20IW1_CODEC
	select SND_SUNXI_SOC_CPUDAI
	depends on ARCH_SUN20IW1
   help
	Select Y or M to add support for the Codec embedded in the Allwinner
	SUN20IW1 and affiliated SoCs.

#SUNXI MACHINE Select
config SND_SUNXI_SOC_SIMPLE_CARD
	tristate "Allwinner Audio Simple Card"
	depends on OF
	select SND_SIMPLE_CARD_UTILS
	help
	  Select Y to enable debug information of allwinner audio driver
	  If you not sure, Just not select it.

# SUNXI DAUDIO Select
config SND_SUNXI_SOC_DAUDIO
	tristate "Allwinner Digital Audio Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	depends on OF
	depends on SND_SUNXI_SOC_SIMPLE_CARD
   help
	Select Y or M to add support for I2S/PCM/TDM Module in the
	Allwinner SoCs.

# SUNXI DAUDIO ASRC Select
config SND_SUNXI_SOC_DAUDIO_ASRC
	tristate "Allwinner Digital Audio ASRC Support"
	depends on SND_SUNXI_SOC_DAUDIO
   help
	Select Y or M to add support for the ASRC Func of the
	I2S/PCM/TDM Module in the Allwinner SoCs.

# SUNXI HDMIAUDIO Select
config SND_SUNXI_SOC_SUNXI_HDMIAUDIO
	tristate "Allwinner HDMI Audio Support"
	depends on SND_SUNXI_SOC_DAUDIO
    help
	Select Y or M to add support for the HDMI Audio Module in the Allwinner
	SoCs.

# SUNXI SPDIF Select
config SND_SUNXI_SOC_SPDIF
	tristate "Allwinner SPDIF Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	depends on OF
	depends on SND_SUNXI_SOC_SIMPLE_CARD
    help
	Select Y or M to add support SPDIF Module in Allwinner
	SoCs.

# SUNXI SPDIF RX Select
config SND_SUNXI_SOC_SPDIF_RX_IEC61937
	tristate "Allwinner SPDIF RX IEC61937 Support"
	depends on SND_SUNXI_SOC_SPDIF
    help
	Select Y or M to add support SPDIF RX IEC-61937 in Allwinner
	SoCs.

# SUNXI DMIC Select
config SND_SUNXI_SOC_DMIC
	tristate "Allwinner DMIC Support"
	select SND_SUNXI_SOC
	select SND_SOC_GENERIC_DMAENGINE_PCM
	select REGMAP_MMIO
	select SND_SOC_DMIC
	depends on OF
	depends on SND_SUNXI_SOC_SIMPLE_CARD
    help
	Select Y or M to add support DMIC Module in Allwinner
	SoCs.

config SUNXI_AUDIO_DEBUG
	bool "Allwinner Audio Debug Support"
	depends on SND_SUNXI_SOC
	help
	  Select Y to enable debug information of allwinner audio driver
	  If you not sure, Just not select it.

config SUNXI_RX_SYNC
	bool "Allwinner RX SYNC Support"
	help
	  Select Y to enable rx_sync function of allwinner audio driver
	  If you not sure, Just not select it.

endmenu

menuconfig SND_SUNXI_RPAF
	tristate "Allwinner SUNXI HiFi DSP Audio Framework"
	select RPMSG
	select RPMSG_SUNXI_AMP
	default n
    help
	Select Y or M to enable the sunxi remote process audio framework.

if SND_SUNXI_RPAF

source "sound/soc/sunxi/sunxi-rpaf/component/Kconfig"
source "sound/soc/sunxi/sunxi-rpaf/sunxi-hifi/Kconfig"

endif
