I have a multiple choice menu defined like this:
menu "Audio"
choice
prompt "Select Audio Output"
default I2S
help
This option selects the audio output.
config AUDIO_OUTPUT_MODE_I2S
bool "Generic I2S"
config AUDIO_OUTPUT_MODE_I2S_MERUS
bool "Merus Audio I2S"
config AUDIO_OUTPUT_MODE_DAC_BUILT_IN
bool "Built-In DAC"
endchoice
config AUDIO_OUTPUT_MODE
string
default I2S
default I2S if AUDIO_OUTPUT_MODE_I2S
default I2S_MERUS if AUDIO_OUTPUT_MODE_I2S_MERUS
default DAC_BUILT_IN if AUDIO_OUTPUT_MODE_DAC_BUILT_IN
config DAC_BUG_WORKAROUND
bool "Activate workaround when using Built-In DAC"
endmenu
I want to map the choice to an enum, but Kconfig only has tristate and string types, so I can't do this, because the value of AUDIO_OUTPUT_MODE is a string and not a literal:
my_enum = AUDIO_OUTPUT_MODE;
Using int directly would work, but is there a cleaner solution?