Kconfig with choice for integers
Michael Alleblas
I am trying to add some changes to the NXP iMX RT1060 SOC so that
different video PLLs can be configured. I have created the options for
selection in menuconfig and they work good in that environment but
when trying to set them by prj.conf I get an error.. An example of the
configurations I have is embodied by this:
**********
choice
prompt "Video PLL loop divider"
depends on INIT_VIDEO_PLL
default MCUX_VIDEO_PLL_LOOP_DIVIDER_31
config MCUX_VIDEO_PLL_LOOP_DIVIDER_27
bool "27"
...
config MCUX_VIDEO_PLL_LOOP_DIVIDER_54
bool "54"
endchoice
config MCUX_VIDEO_PLL_LOOP_DIVIDER
int
default 31
default 27 if MCUX_VIDEO_PLL_LOOP_DIVIDER_27
...
default 54 if MCUX_VIDEO_PLL_LOOP_DIVIDER_54
**********
When trying to set CONFIG_MCUX_LCDIF_PRE_DIV=1 in prj.config for
instance, I get the error
**********
error: MCUX_VIDEO_PLL_LOOP_DIVIDER (defined at
soc/arm/nxp_imx/rt/Kconfig.soc:425) is assigned in a configuration
file, but is not directly user-configurable (has no prompt). It gets
its value indirectly from other symbols.
**********
I understand why I get this error, I just can't wrap my head around
the best way to structure my Kconfig menu items to get the desired end
result in both menuconfig and in the prj.conf file.
Two of my changes which work perfectly fine are as follows:
**********
config MCUX_VIDEO_PLL_NUMERATOR
int "Video PLL numerator"
range 0 1073741823
default 0
config MCUX_VIDEO_PLL_DENOMINATOR
int "Video PLL denominator"
range 0 1073741823
default 0
**********
Any guidance would be appreciated.
Regards,
Michael A
different video PLLs can be configured. I have created the options for
selection in menuconfig and they work good in that environment but
when trying to set them by prj.conf I get an error.. An example of the
configurations I have is embodied by this:
**********
choice
prompt "Video PLL loop divider"
depends on INIT_VIDEO_PLL
default MCUX_VIDEO_PLL_LOOP_DIVIDER_31
config MCUX_VIDEO_PLL_LOOP_DIVIDER_27
bool "27"
...
config MCUX_VIDEO_PLL_LOOP_DIVIDER_54
bool "54"
endchoice
config MCUX_VIDEO_PLL_LOOP_DIVIDER
int
default 31
default 27 if MCUX_VIDEO_PLL_LOOP_DIVIDER_27
...
default 54 if MCUX_VIDEO_PLL_LOOP_DIVIDER_54
**********
When trying to set CONFIG_MCUX_LCDIF_PRE_DIV=1 in prj.config for
instance, I get the error
**********
error: MCUX_VIDEO_PLL_LOOP_DIVIDER (defined at
soc/arm/nxp_imx/rt/Kconfig.soc:425) is assigned in a configuration
file, but is not directly user-configurable (has no prompt). It gets
its value indirectly from other symbols.
**********
I understand why I get this error, I just can't wrap my head around
the best way to structure my Kconfig menu items to get the desired end
result in both menuconfig and in the prj.conf file.
Two of my changes which work perfectly fine are as follows:
**********
config MCUX_VIDEO_PLL_NUMERATOR
int "Video PLL numerator"
range 0 1073741823
default 0
config MCUX_VIDEO_PLL_DENOMINATOR
int "Video PLL denominator"
range 0 1073741823
default 0
**********
Any guidance would be appreciated.
Regards,
Michael A