• Arnd Bergmann's avatar
    ASoC: SOF: sort out Kconfig, again · f9dfa8f2
    Arnd Bergmann authored
    The imx8 config keeps causing issues:
    
    WARNING: unmet direct dependencies detected for SND_SOC_SOF_IMX8M
      Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_IMX_TOPLEVEL [=y] && IMX_DSP [=n]
      Selected by [m]:
      - SND_SOC_SOF_IMX_OF [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_IMX_TOPLEVEL [=y] && SND_SOC_SOF_IMX8M_SUPPORT [=y]
    
    This is complicated by two drivers having dependencies on both
    platform specific drivers and the SND_SOC_SOF_OF framework code,
    and using an somewhat obscure method to build them the same way
    as the SOC_SOF_OF symbol (built-in or modular).
    
    My solution now ensures that the two drivers can only be enabled
    when the dependencies are met:
    
    - When the platform specific drivers are built-in, everything is
      fine, as SOC_SOF_OF is either =y or =m
    
    - When both are loadable modules, it also works, both for Kconfig
      and at runtime
    
    - When the hardware drivers are loadable modules or disabled, and
      SOC_SOF_OF=y, prevent the IMX_SOF_OF drivers from being turned on,
      as this would be broken.
    
    It seems that this is just an elaborate way to describe two tristate
    symbols that have straight dependencies, but maybe I'm missing some
    subtle point. It seems to always build for me now.
    
    Fixes: fe57a92c ("ASoC: SOF: Add missing dependency on IMX_SCU")
    Fixes: afb93d71 ("ASoC: SOF: imx: Add i.MX8M HW support")
    Fixes: cb0312f6 ("ASoC: SOF: imx: fix undefined reference issue")
    Fixes: afb93d71 ("ASoC: SOF: imx: Add i.MX8M HW support")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Acked-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
    Link: https://lore.kernel.org/r/20200428212752.2901778-1-arnd@arndb.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    f9dfa8f2
Kconfig 1.49 KB