Skip to contentSkip to conversation

Make WMI be selected automatically when needed

PATCH In review Éric Piel 3 participants 6 messages Apr 17, 2010 – Apr 23, 2010

Subsystems (2)
lore
Share & tools
lore

Éric Piel

author
#0 lore raw

PATCH 1/2 Make WMI be selected automatically when needed

Many different modules depend on WMI. In Kconfig, some used to "depend" on it, while others "selected" it. As WMI by itself is useless and more like a library, it's easier for the user to have it automatically selected whenever needed. It's especially true for options in completely different places (like LEDS_DELL_NETBOOKS). So we consistently "select" it.

---
 drivers/leds/Kconfig         |    3 ++-
 drivers/platform/x86/Kconfig |    8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/leds/Kconfig +2 -1
index 505eb64..71e8a51 100644
@@ -280,7 +280,8 @@ config LEDS_ADP5520
 
 config LEDS_DELL_NETBOOKS
 	tristate "External LED on Dell Business Netbooks"
-	depends on X86 && ACPI_WMI
+	depends on X86
+	select ACPI_WMI
 	help
 	  This adds support for the Latitude 2100 and similar
 	  notebooks that have an external LED.
drivers/platform/x86/Kconfig +4 -4
index 7bec458..9808ef3 100644
@@ -89,8 +89,8 @@ config DELL_LAPTOP
 
 config DELL_WMI
 	tristate "Dell WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
+	select ACPI_WMI
 	---help---
 	  Say Y here if you want to support WMI-based hotkeys on Dell laptops.
 
@@ -136,9 +136,9 @@ config TC1100_WMI
 
 config HP_WMI
 	tristate "HP WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on RFKILL || RFKILL = n
+	select ACPI_WMI
 	help
 	 Say Y here if you want to support WMI-based hotkeys on HP laptops and
 	 to read data from WMI such as docking or ambient light sensor state.
@@ -387,9 +387,9 @@ config EEEPC_LAPTOP
 
 config EEEPC_WMI
 	tristate "Eee PC WMI Hotkey Driver (EXPERIMENTAL)"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on EXPERIMENTAL
+	select ACPI_WMI
 	---help---
 	  Say Y here if you want to support WMI-based hotkeys on Eee PC laptops.
 
@@ -419,9 +419,9 @@ config ACPI_WMI
 
 config MSI_WMI
 	tristate "MSI WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on BACKLIGHT_CLASS_DEVICE
+	select ACPI_WMI
 	select INPUT_SPARSEKMAP
 	help
 	 Say Y here if you want to support WMI-based hotkeys on MSI laptops.
Signature · 6 lines
1.7.0.5

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 8 lines · On Sat, 17 Apr 2010 02:23:57 +0200 Éric Piel wrote:

Many different modules depend on WMI. In Kconfig, some used to "depend" on it, while others "selected" it. As WMI by itself is useless and more like a library, it's easier for the user to have it automatically selected whenever needed. It's especially true for options in completely different places (like LEDS_DELL_NETBOOKS). So we consistently "select" it.

config ACPI_WMI
tristate "WMI"
depends on ACPI

so what happens when one of these configs selects ACPI_WMI but ACPI is not enabled? Hint: that will not enable ACPI.

Did you test that kconfig combination?

Quoted 57 lines
---
 drivers/leds/Kconfig         |    3 ++-
 drivers/platform/x86/Kconfig |    8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/leds/Kconfig +2 -1
index 505eb64..71e8a51 100644
@@ -280,7 +280,8 @@ config LEDS_ADP5520
 
 config LEDS_DELL_NETBOOKS
 	tristate "External LED on Dell Business Netbooks"
-	depends on X86 && ACPI_WMI
+	depends on X86
+	select ACPI_WMI
 	help
 	  This adds support for the Latitude 2100 and similar
 	  notebooks that have an external LED.
drivers/platform/x86/Kconfig +3 -3
index 7bec458..9808ef3 100644
@@ -89,8 +89,8 @@ config DELL_LAPTOP
 
 config DELL_WMI
 	tristate "Dell WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
+	select ACPI_WMI
 	---help---
 	  Say Y here if you want to support WMI-based hotkeys on Dell laptops.
 
@@ -136,9 +136,9 @@ config TC1100_WMI
 
 config HP_WMI
 	tristate "HP WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on RFKILL || RFKILL = n
+	select ACPI_WMI
 	help
 	 Say Y here if you want to support WMI-based hotkeys on HP laptops and
 	 to read data from WMI such as docking or ambient light sensor state.
@@ -387,9 +387,9 @@ config EEEPC_LAPTOP
 
 config EEEPC_WMI
 	tristate "Eee PC WMI Hotkey Driver (EXPERIMENTAL)"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on EXPERIMENTAL
+	select ACPI_WMI
 	---help---
 	  Say Y here if you want to support WMI-based hotkeys on Eee PC laptops.
 

drivers/platform/x86/Kconfig config ACPI_WMI · line 427

Quoted 10 lines
drivers/platform/x86/Kconfig +1 -1
@@ -419,9 +419,9 @@ config ACPI_WMI
 
 config MSI_WMI
 	tristate "MSI WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on BACKLIGHT_CLASS_DEVICE
+	select ACPI_WMI
 	select INPUT_SPARSEKMAP
 	help
 	 Say Y here if you want to support WMI-based hotkeys on MSI laptops.

---
~Randy
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw

Op 17-04-10 02:31, Randy Dunlap schreef:

Quoted 11 lines · On Sat, 17 Apr 2010 02:23:57 +0200 Éric Piel wrote:
Quoted 9 lines

Many different modules depend on WMI. In Kconfig, some used to "depend" on it, while others "selected" it. As WMI by itself is useless and more like a library, it's easier for the user to have it automatically selected whenever needed. It's especially true for options in completely different places (like LEDS_DELL_NETBOOKS). So we consistently "select" it.

Quoted 8 lines

config ACPI_WMI
tristate "WMI"
depends on ACPI

so what happens when one of these configs selects ACPI_WMI but ACPI is not enabled? Hint: that will not enable ACPI.

Did you test that kconfig combination?

Indeed, I hadn't really thought of no ACPI support at all... I guess the best is to just do like the other config which select ACPI_WMI, make them depend on ACPI. Sounds good to you? (new version appended)

Eric

8<------------------------------
Many different modules depend on WMI. In Kconfig, some used to "depend" on it, while others "selected" it. As WMI by itself is useless and more like a library, it's easier for the user to have it automatically selected whenever needed. It's especially true for options in completely different places (like LEDS_DELL_NETBOOKS). So we consistently "select" it.

v2: depend on ACPI to avoid selecting ACPI_WMI without ACPI.

---
 drivers/leds/Kconfig         |    4 +++-
 drivers/platform/x86/Kconfig |   12 ++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
drivers/leds/Kconfig +3 -1
index 505eb64..f937f88 100644
@@ -280,7 +280,9 @@ config LEDS_ADP5520
 
 config LEDS_DELL_NETBOOKS
 	tristate "External LED on Dell Business Netbooks"
-	depends on X86 && ACPI_WMI
+	depends on X86
+	depends on ACPI
+	select ACPI_WMI
 	help
 	  This adds support for the Latitude 2100 and similar
 	  notebooks that have an external LED.
drivers/platform/x86/Kconfig +8 -4
index 7bec458..28c33e8 100644
@@ -89,8 +89,9 @@ config DELL_LAPTOP
 
 config DELL_WMI
 	tristate "Dell WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
+	depends on ACPI
+	select ACPI_WMI
 	---help---
 	  Say Y here if you want to support WMI-based hotkeys on Dell laptops.
 
@@ -136,9 +137,10 @@ config TC1100_WMI
 
 config HP_WMI
 	tristate "HP WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on RFKILL || RFKILL = n
+	depends on ACPI
+	select ACPI_WMI
 	help
 	 Say Y here if you want to support WMI-based hotkeys on HP laptops and
 	 to read data from WMI such as docking or ambient light sensor state.
@@ -387,9 +389,10 @@ config EEEPC_LAPTOP
 
 config EEEPC_WMI
 	tristate "Eee PC WMI Hotkey Driver (EXPERIMENTAL)"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on EXPERIMENTAL
+	depends on ACPI
+	select ACPI_WMI
 	---help---
 	  Say Y here if you want to support WMI-based hotkeys on Eee PC laptops.
 
@@ -419,9 +422,10 @@ config ACPI_WMI
 
 config MSI_WMI
 	tristate "MSI WMI extras"
-	depends on ACPI_WMI
 	depends on INPUT
 	depends on BACKLIGHT_CLASS_DEVICE
+	depends on ACPI
+	select ACPI_WMI
 	select INPUT_SPARSEKMAP
 	help
 	 Say Y here if you want to support WMI-based hotkeys on MSI laptops.
Signature · 8 lines
1.7.0.5


 
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

drivers/leds/Kconfig config LEDS_ADP5520 · line 285

Quoted 6 lines · Éric Piel

config LEDS_DELL_NETBOOKS

drivers/leds/Kconfig +3 -1
 	tristate "External LED on Dell Business Netbooks"
-	depends on X86 && ACPI_WMI
+	depends on X86
+	depends on ACPI
+	select ACPI_WMI

I dislike this. The originally stated dependencies are correct and more accurately represent what the code requires, and changing that for the sake of making it easier for people to find the driver sounds like it's trying to cover up shortcomings in our configuration system more than anything else.

Signature · 5 lines
Matthew Garrett | [email protected]
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#4 lore raw

Op 23-04-10 21:20, Matthew Garrett schreef:

Quoted 15 lines · Éric Piel

drivers/leds/Kconfig config LEDS_ADP5520 · line 285

Quoted 7 lines

config LEDS_DELL_NETBOOKS

drivers/leds/Kconfig +3 -1
 	tristate "External LED on Dell Business Netbooks"
-	depends on X86 && ACPI_WMI
+	depends on X86
+	depends on ACPI
+	select ACPI_WMI

I dislike this. The originally stated dependencies are correct and more accurately represent what the code requires, and changing that for the sake of making it easier for people to find the driver sounds like it's trying to cover up shortcomings in our configuration system more than anything else.

Currently there are 2 modules which select ACPI_WMI and 4 which depend on it. There are 7 modules which select BACKLIGHT_CLASS_DEVICE and as many which depend on it. Making usage of the select functionality all the time would avoid these inconsistencies.

Eric
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 4 lines · Éric Piel

Currently there are 2 modules which select ACPI_WMI and 4 which depend on it. There are 7 modules which select BACKLIGHT_CLASS_DEVICE and as many which depend on it. Making usage of the select functionality all the time would avoid these inconsistencies.

Using select for ACPI_WMI is pretty clearly wrong since it fails in cases where ACPI isn't enabled. But I don't think the appropriate way to handle that is to encode the dependency between ACPI_WMI and ACPI multiple times - they should just be switched to depend on it instead.

Signature · 5 lines
Matthew Garrett | [email protected]
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html