| 55 | |
| 56 | == Translation of Choices == |
| 57 | A choice can be treated as an Enumeration. The [https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt KConfig specification] defines a choice as follows: |
| 58 | >choices: [[br]] |
| 59 | > "choice" [symbol] [[br]] |
| 60 | > <choice options> [[br]] |
| 61 | > <choice block> [[br]] |
| 62 | > "endchoice" [[br]] |
| 63 | >This defines a choice group and accepts any of the above attributes as options. A choice can only be of type bool or tristate, while a boolean |
| 64 | >choice only allows a single config entry to be selected, a tristate choice also allows any number of config entries to be set to 'm'. This |
| 65 | >can be used if multiple drivers for a single hardware exists and only a single driver can be compiled/loaded into the kernel, but all drivers |
| 66 | >can be compiled as modules. [[br]] |
| 67 | >A choice accepts another option "optional", which allows to set the choice to 'n' and no entry needs to be selected. |
| 68 | >If no [symbol] is associated with a choice, then you can not have multiple definitions of that choice. If a [symbol] is associated to the choice, |
| 69 | >then you may define the same choice (ie. with the same entries) in another place. |
| 70 | === Translation of Boolean Choices === |
| 71 | If a boolean choice is selected, exactly one of the related !ChoiceItems has to be selected. For each !ChoiceItems the individual conditions has to be considered. |
| 72 | === Translation of Tristate Choices === |
| 73 | A Tristate Choice can be selected as permanently selected ('y') or as a module ('m'). |
| 74 | * If the Choice is permanently selected ('y'), exactly one of its !ChoiceItems must also be permanently selected ('y'). |
| 75 | * If the Choice is selected as a module ('m'), an arbitrary number (0 - n) of !ChoiceItems can also be selected as modules ('m'). |