aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2009-12-26 19:52:15 -0500
committerLen Brown <len.brown@intel.com>2009-12-26 22:37:35 -0500
commitff850c339a1a6a7724537160c73cdc09a483fc5d (patch)
tree219086f3b031107f9a52d88b4b447b193be58363 /drivers/platform
parent74c75c1848b618f6717c1be887ad539ffac2e96d (diff)
thinkpad-acpi: make volume subdriver optional
Allow the user to choose through Kconfig if the Console Audio Control interface (aka "volume subdriver") should be available or not. This not only saves some memory, but also allows the thinkpad-acpi driver to be built-in even if ALSA is modular when the console audio control interface is not wanted. This change fixes a build problem that is causing some annoyances, in a way that doesn't disable the entire driver on kernels without ALSA support. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Ingo Molnar <mingo@elte.hu> Cc: Amerigo Wang <amwang@redhat.com> Cc: Helight Xu <helight.xu@gmail.com> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/Kconfig23
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c26
2 files changed, 49 insertions, 0 deletions
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index ec4faffe6b05..2462dc30b39b 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -233,6 +233,29 @@ config THINKPAD_ACPI
233 233
234 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here. 234 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
235 235
236config THINKPAD_ACPI_ALSA_SUPPORT
237 bool "Console audio control ALSA interface"
238 depends on THINKPAD_ACPI
239 depends on SND
240 depends on SND = y || THINKPAD_ACPI = SND
241 default y
242 ---help---
243 Enables monitoring of the built-in console audio output control
244 (headphone and speakers), which is operated by the mute and (in
245 some ThinkPad models) volume hotkeys.
246
247 If this option is enabled, ThinkPad-ACPI will export an ALSA card
248 with a single read-only mixer control, which should be used for
249 on-screen-display feedback purposes by the Desktop Environment.
250
251 Optionally, the driver will also allow software control (the
252 ALSA mixer will be made read-write). Please refer to the driver
253 documentation for details.
254
255 All IBM models have both volume and mute control. Newer Lenovo
256 models only have mute control (the volume hotkeys are just normal
257 keys and volume control is done through the main HDA mixer).
258
236config THINKPAD_ACPI_DEBUGFACILITIES 259config THINKPAD_ACPI_DEBUGFACILITIES
237 bool "Maintainer debug facilities" 260 bool "Maintainer debug facilities"
238 depends on THINKPAD_ACPI 261 depends on THINKPAD_ACPI
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 9b7da9c96e76..e67e4feb35cb 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6384,6 +6384,8 @@ static struct ibm_struct brightness_driver_data = {
6384 * and we leave them unchanged. 6384 * and we leave them unchanged.
6385 */ 6385 */
6386 6386
6387#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
6388
6387#define TPACPI_ALSA_DRVNAME "ThinkPad EC" 6389#define TPACPI_ALSA_DRVNAME "ThinkPad EC"
6388#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control" 6390#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
6389#define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME 6391#define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME
@@ -7021,6 +7023,28 @@ static struct ibm_struct volume_driver_data = {
7021 .shutdown = volume_shutdown, 7023 .shutdown = volume_shutdown,
7022}; 7024};
7023 7025
7026#else /* !CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
7027
7028#define alsa_card NULL
7029
7030static void inline volume_alsa_notify_change(void)
7031{
7032}
7033
7034static int __init volume_init(struct ibm_init_struct *iibm)
7035{
7036 printk(TPACPI_INFO
7037 "volume: disabled as there is no ALSA support in this kernel\n");
7038
7039 return 1;
7040}
7041
7042static struct ibm_struct volume_driver_data = {
7043 .name = "volume",
7044};
7045
7046#endif /* CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
7047
7024/************************************************************************* 7048/*************************************************************************
7025 * Fan subdriver 7049 * Fan subdriver
7026 */ 7050 */
@@ -8743,6 +8767,7 @@ MODULE_PARM_DESC(hotkey_report_mode,
8743 "used for backwards compatibility with userspace, " 8767 "used for backwards compatibility with userspace, "
8744 "see documentation"); 8768 "see documentation");
8745 8769
8770#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
8746module_param_named(volume_mode, volume_mode, uint, 0444); 8771module_param_named(volume_mode, volume_mode, uint, 0444);
8747MODULE_PARM_DESC(volume_mode, 8772MODULE_PARM_DESC(volume_mode,
8748 "Selects volume control strategy: " 8773 "Selects volume control strategy: "
@@ -8765,6 +8790,7 @@ module_param_named(id, alsa_id, charp, 0444);
8765MODULE_PARM_DESC(id, "ALSA id for the ACPI EC Mixer"); 8790MODULE_PARM_DESC(id, "ALSA id for the ACPI EC Mixer");
8766module_param_named(enable, alsa_enable, bool, 0444); 8791module_param_named(enable, alsa_enable, bool, 0444);
8767MODULE_PARM_DESC(enable, "Enable the ALSA interface for the ACPI EC Mixer"); 8792MODULE_PARM_DESC(enable, "Enable the ALSA interface for the ACPI EC Mixer");
8793#endif /* CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
8768 8794
8769#define TPACPI_PARAM(feature) \ 8795#define TPACPI_PARAM(feature) \
8770 module_param_call(feature, set_ibm_param, NULL, NULL, 0); \ 8796 module_param_call(feature, set_ibm_param, NULL, NULL, 0); \