Re: Optional drivers and board configuration

Carles Cufi

HI Michael,


I’d say he cleanest way is to do it at the SoC level, like this:


That way every single board that enables CONFIG_PWM in its defconfig (or any application that enables CONFIG_PWM) will be enabling CONFIG_PWM_SAM. But boards or applications that do not enable CONFIG_PWM will have CONFIG_PWM_SAM disabled.




From: <devel@...> on behalf of "Michael Hope via" <>
Reply-To: "michaelh@..." <michaelh@...>
Date: Sunday, 7 June 2020 at 19:32
To: devel <devel@...>
Subject: [Zephyr-devel] Optional drivers and board configuration


Hi there.  I'm adding a new SAM0 based board.  What's the best way to enable optional peripherals?  For example, not all users need the PWM driver.  Should I:

- Put CONFIG_PWM=y and CONFIG_PWM_SAM0=y in defconfig and live with the unneeded code?
- Put CONFIG_PWM_SAM0=y in defconfig and ignore the warning?
- or add a

config PWM_SAM0
    default y

    depends on PWM


section to Kconfig.board?




-- Michael

Join to automatically receive all group messages.