Skip to contentSkip to conversation

Using select in boolean dependents of a tristate symbol

DISCUSSION Dmitry Torokhov 4 participants 9 messages Jul 13, 2006 – Jul 27, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

[Argh.. resending to correct LKML address]

Roman,

Question for you as Kconfig maintainer - I have a module (HID) that has a few sub-options. Now HID can be built as a module but sub-options are suimple booleans. Some of these sub-options will depend on a common code which is moved out of HID driver. Now I want to use "select" like this:

config THRUSTMASTER_FF
bool "ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)" depends on HID_FF && EXPERIMENTAL
+ select INPUT_FF_MEMLESS
help
Say Y here if you have a THRUSTMASTER FireStore Dual Power 2, and want to enable force feedback support for it.

Unfortunately this forces INPUT_FF_MEMLESS to always be built-in, although if HID is a module it could be a module as well. Do you have any suggestions as to how allow INPUT_FF_MEMLESS to be compiled as a module?

Thanks!

--
Dmitry

Signature · 1 line
Dmitry
#2 lore raw

Hi,

Quoted 8 lines · Dmitry Torokhov

config THRUSTMASTER_FF
bool "ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)" depends on HID_FF && EXPERIMENTAL
+ select INPUT_FF_MEMLESS
help
Say Y here if you have a THRUSTMASTER FireStore Dual Power 2, and want to enable force feedback support for it.

Quoted 4 lines

Unfortunately this forces INPUT_FF_MEMLESS to always be built-in, although if HID is a module it could be a module as well. Do you have any suggestions as to how allow INPUT_FF_MEMLESS to be compiled as a module?

You need to directly include HID into the dependencies, only the direct dependencies for config entry are used for the select.

bye, Roman

#3 lore raw
Quoted 12 lines · Roman Zippel

Hi,

Quoted 8 lines · Dmitry Torokhov

config THRUSTMASTER_FF
bool "ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)" depends on HID_FF && EXPERIMENTAL
+ select INPUT_FF_MEMLESS
help
Say Y here if you have a THRUSTMASTER FireStore Dual Power 2, and want to enable force feedback support for it.

Quoted 8 lines
Quoted 4 lines

Unfortunately this forces INPUT_FF_MEMLESS to always be built-in, although if HID is a module it could be a module as well. Do you have any suggestions as to how allow INPUT_FF_MEMLESS to be compiled as a module?

You need to directly include HID into the dependencies, only the direct dependencies for config entry are used for the select.

Oh, this indeed works, thanks a lot! And I was thinking I would need to implement something like "select <expr> as <expr>" in kconfig ;)

Signature · 1 line
Dmitry
#4 lore raw

Hi,

Quoted 18 lines · Dmitry Torokhov
Quoted 17 lines · Roman Zippel

Hi,

Quoted 12 lines · Dmitry Torokhov

config THRUSTMASTER_FF
bool "ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)" depends on HID_FF && EXPERIMENTAL
+ select INPUT_FF_MEMLESS
help
Say Y here if you have a THRUSTMASTER FireStore Dual Power 2, and want to enable force feedback support for it.

Unfortunately this forces INPUT_FF_MEMLESS to always be built-in, although if HID is a module it could be a module as well. Do you have any suggestions as to how allow INPUT_FF_MEMLESS to be compiled as a module?

Quoted 6 lines
Quoted 3 lines

You need to directly include HID into the dependencies, only the direct dependencies for config entry are used for the select.

Oh, this indeed works, thanks a lot! And I was thinking I would need to implement something like "select <expr> as <expr>" in kconfig ;)

What you could do is to use "select INPUT_FF_MEMLESS if HID" to make it visible that this dependency is actually for select.
This point is a little subtle and I'm not completely happy with it, maybe I'm going to split this into two select variations - one which includes all the dependencies and one which only uses the config symbol to select.

bye, Roman

#5 lore raw
Quoted 7 lines · Roman Zippel

What you could do is to use "select INPUT_FF_MEMLESS if HID" to make it visible that this dependency is actually for select.
This point is a little subtle and I'm not completely happy with it, maybe I'm going to split this into two select variations - one which includes all the dependencies and one which only uses the config symbol to select.

Roman,

Another question for you - what is the best way to describe dependancy of a sub-option on a subsystem so you won't end up with the subsystem as a module and user built in. Something like

config IBM_ASM
tristate "Device driver for IBM RSA service processor" depends on X86 && PCI && EXPERIMENTAL
...
config IBM_ASM_INPUT
bool "Support for remote keyboard/mouse" depends on IBM_ASM && (INPUT=y || INPUT=IMB_ASM)

But the above feels yucky. Could we have something like:

depends on matching(INPUT, IBM_ASM)

Thank you.

Signature · 1 line
Dmitry
#6 lore raw
Quoted 12 lines · Dmitry Torokhov

Another question for you - what is the best way to describe dependancy of a sub-option on a subsystem so you won't end up with the subsystem as a module and user built in. Something like

config IBM_ASM
tristate "Device driver for IBM RSA service processor" depends on X86 && PCI && EXPERIMENTAL
...
config IBM_ASM_INPUT
bool "Support for remote keyboard/mouse" depends on IBM_ASM && (INPUT=y || INPUT=IMB_ASM)

Quoted 3 lines

But the above feels yucky. Could we have something like:

depends on matching(INPUT, IBM_ASM)

What feels yucky is the dependency of a 'bool' on a tristate. Does the ASM_INPUT get used in places where the source file can only be a builtin, not a module?

#7 lore raw
Quoted 14 lines · On 7/19/06, [email protected] <[email protected]> wrote:
Quoted 12 lines · Dmitry Torokhov

Another question for you - what is the best way to describe dependancy of a sub-option on a subsystem so you won't end up with the subsystem as a module and user built in. Something like

config IBM_ASM
tristate "Device driver for IBM RSA service processor" depends on X86 && PCI && EXPERIMENTAL
...
config IBM_ASM_INPUT
bool "Support for remote keyboard/mouse" depends on IBM_ASM && (INPUT=y || INPUT=IMB_ASM)

Quoted 8 lines
Quoted 3 lines

But the above feels yucky. Could we have something like:

depends on matching(INPUT, IBM_ASM)

What feels yucky is the dependency of a 'bool' on a tristate. Does the ASM_INPUT get used in places where the source file can only be a builtin, not a module?

In this case ASM_INPUT enables an optional part of a bigger module (IBM_ASM). Sometimes it is done because optional part is too small to be split into a separately loadable module or because it is difficult to implement "attaching" of the optional part at the later time if it is compiled as a module.

Signature · 1 line
Dmitry
#8 lore raw
In reply to Dmitry Torokhov

Hi,

Quoted 12 lines · Dmitry Torokhov

Another question for you - what is the best way to describe dependancy of a sub-option on a subsystem so you won't end up with the subsystem as a module and user built in. Something like

config IBM_ASM
tristate "Device driver for IBM RSA service processor" depends on X86 && PCI && EXPERIMENTAL
...
config IBM_ASM_INPUT
bool "Support for remote keyboard/mouse" depends on IBM_ASM && (INPUT=y || INPUT=IMB_ASM)

Quoted 3 lines

But the above feels yucky. Could we have something like:

depends on matching(INPUT, IBM_ASM)

This is not really descriptive of what it does, is it? Linus suggested a syntax like (IBM_ASM && IMB_ASM<=INPUT) Another alternative which works now is to just disable the one invalid case explicitely:

	depends on IBM_ASM && INPUT
	depends on !(IBM_ASM=y && INPUT=m)

bye, Roman

#9 lore raw
Quoted 20 lines · Roman Zippel

Hi,

Quoted 12 lines · Dmitry Torokhov

Another question for you - what is the best way to describe dependancy of a sub-option on a subsystem so you won't end up with the subsystem as a module and user built in. Something like

config IBM_ASM
tristate "Device driver for IBM RSA service processor" depends on X86 && PCI && EXPERIMENTAL
...
config IBM_ASM_INPUT
bool "Support for remote keyboard/mouse" depends on IBM_ASM && (INPUT=y || INPUT=IMB_ASM)

Quoted 3 lines

But the above feels yucky. Could we have something like:

depends on matching(INPUT, IBM_ASM)

Quoted 8 lines

This is not really descriptive of what it does, is it? Linus suggested a syntax like (IBM_ASM && IMB_ASM<=INPUT) Another alternative which works now is to just disable the one invalid case explicitely:

	depends on IBM_ASM && INPUT
	depends on !(IBM_ASM=y && INPUT=m)

OK, then I'll be disabling invalid cases explicitly for now.

Thank you Roman.

Signature · 1 line
Dmitry