* [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2
@ 2009-12-27 0:52 Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 1/5] thinkpad-acpi: don't take the first ALSA slot by default Henrique de Moraes Holschuh
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 0:52 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel
Len,
This patchset fixes a few problems that have been reported,
including the annoying build problem reported by Ingo.
It mostly updates the new ALSA functionality to be better
behaved, and makes it optional for people who could care
less for on-screen-display of volume hotkeys and would
rather have a kernel that is a few kiB smaller.
Please apply.
Thanks.
Shortlog:
Henrique de Moraes Holschuh (5):
thinkpad-acpi: don't take the first ALSA slot by default
thinkpad-acpi: don't fail to load the entire module due to ALSA problems
thinkpad-acpi: make volume subdriver optional
thinkpad-acpi: update volume documentation
thinkpad-acpi: improve Kconfig help text
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/5] thinkpad-acpi: don't take the first ALSA slot by default
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
@ 2009-12-27 0:52 ` Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 2/5] thinkpad-acpi: don't fail to load the entire module due to ALSA problems Henrique de Moraes Holschuh
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 0:52 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh
We don't want to be the first soundcard. We don't want to shift other
soundcards out of the way either, even if they load much later.
Ask ALSA to (by default) load us in one of the last three slots. This
can be overriden at will using the "index" parameter.
Reported-by: Whoopie <whoopie79@gmx.net>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
drivers/platform/x86/thinkpad_acpi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 448c8ae..3311b00 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6388,7 +6388,7 @@ static struct ibm_struct brightness_driver_data = {
#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
#define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME
-static int alsa_index = SNDRV_DEFAULT_IDX1;
+static int alsa_index = ~((1 << (SNDRV_CARDS - 3)) - 1); /* last three slots */
static char *alsa_id = "ThinkPadEC";
static int alsa_enable = SNDRV_DEFAULT_ENABLE1;
--
1.6.5.7
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/5] thinkpad-acpi: don't fail to load the entire module due to ALSA problems
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 1/5] thinkpad-acpi: don't take the first ALSA slot by default Henrique de Moraes Holschuh
@ 2009-12-27 0:52 ` Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 3/5] thinkpad-acpi: make volume subdriver optional Henrique de Moraes Holschuh
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 0:52 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh
If we cannot create the ALSA mixer, it is a good reason to fail to
load the volume subdriver, and not to fail to load the entire module.
While at it, add more debugging messages, as the error paths are being
used a lot more than I'd expect, and it is failing to set up the ALSA
mixer on a number of ThinkPads.
Reported-by: Peter Jordan <usernetwork@gmx.info>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
drivers/platform/x86/thinkpad_acpi.c | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 3311b00..9b7da9c 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6705,10 +6705,11 @@ static int __init volume_create_alsa_mixer(void)
rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE,
sizeof(struct tpacpi_alsa_data), &card);
- if (rc < 0)
- return rc;
- if (!card)
- return -ENOMEM;
+ if (rc < 0 || !card) {
+ printk(TPACPI_ERR
+ "Failed to create ALSA card structures: %d\n", rc);
+ return 1;
+ }
BUG_ON(!card->private_data);
data = card->private_data;
@@ -6741,8 +6742,9 @@ static int __init volume_create_alsa_mixer(void)
rc = snd_ctl_add(card, ctl_vol);
if (rc < 0) {
printk(TPACPI_ERR
- "Failed to create ALSA volume control\n");
- goto err_out;
+ "Failed to create ALSA volume control: %d\n",
+ rc);
+ goto err_exit;
}
data->ctl_vol_id = &ctl_vol->id;
}
@@ -6750,22 +6752,25 @@ static int __init volume_create_alsa_mixer(void)
ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL);
rc = snd_ctl_add(card, ctl_mute);
if (rc < 0) {
- printk(TPACPI_ERR "Failed to create ALSA mute control\n");
- goto err_out;
+ printk(TPACPI_ERR "Failed to create ALSA mute control: %d\n",
+ rc);
+ goto err_exit;
}
data->ctl_mute_id = &ctl_mute->id;
snd_card_set_dev(card, &tpacpi_pdev->dev);
rc = snd_card_register(card);
-
-err_out:
if (rc < 0) {
- snd_card_free(card);
- card = NULL;
+ printk(TPACPI_ERR "Failed to register ALSA card: %d\n", rc);
+ goto err_exit;
}
alsa_card = card;
- return rc;
+ return 0;
+
+err_exit:
+ snd_card_free(card);
+ return 1;
}
#define TPACPI_VOL_Q_MUTEONLY 0x0001 /* Mute-only control available */
--
1.6.5.7
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/5] thinkpad-acpi: make volume subdriver optional
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 1/5] thinkpad-acpi: don't take the first ALSA slot by default Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 2/5] thinkpad-acpi: don't fail to load the entire module due to ALSA problems Henrique de Moraes Holschuh
@ 2009-12-27 0:52 ` Henrique de Moraes Holschuh
2009-12-27 9:38 ` Takashi Iwai
2009-12-27 0:52 ` [PATCH 4/5] thinkpad-acpi: update volume documentation Henrique de Moraes Holschuh
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 0:52 UTC (permalink / raw)
To: Len Brown
Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh,
Ingo Molnar, Amerigo Wang, Helight Xu, Takashi Iwai
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>
---
drivers/platform/x86/Kconfig | 23 +++++++++++++++++++++++
drivers/platform/x86/thinkpad_acpi.c | 26 ++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index ec4faff..2462dc3 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -233,6 +233,29 @@ config THINKPAD_ACPI
If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
+config THINKPAD_ACPI_ALSA_SUPPORT
+ bool "Console audio control ALSA interface"
+ depends on THINKPAD_ACPI
+ depends on SND
+ depends on SND = y || THINKPAD_ACPI = SND
+ default y
+ ---help---
+ Enables monitoring of the built-in console audio output control
+ (headphone and speakers), which is operated by the mute and (in
+ some ThinkPad models) volume hotkeys.
+
+ If this option is enabled, ThinkPad-ACPI will export an ALSA card
+ with a single read-only mixer control, which should be used for
+ on-screen-display feedback purposes by the Desktop Environment.
+
+ Optionally, the driver will also allow software control (the
+ ALSA mixer will be made read-write). Please refer to the driver
+ documentation for details.
+
+ All IBM models have both volume and mute control. Newer Lenovo
+ models only have mute control (the volume hotkeys are just normal
+ keys and volume control is done through the main HDA mixer).
+
config THINKPAD_ACPI_DEBUGFACILITIES
bool "Maintainer debug facilities"
depends on THINKPAD_ACPI
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 9b7da9c..e67e4fe 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 = {
* and we leave them unchanged.
*/
+#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
+
#define TPACPI_ALSA_DRVNAME "ThinkPad EC"
#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
#define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME
@@ -7021,6 +7023,28 @@ static struct ibm_struct volume_driver_data = {
.shutdown = volume_shutdown,
};
+#else /* !CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
+
+#define alsa_card NULL
+
+static void inline volume_alsa_notify_change(void)
+{
+}
+
+static int __init volume_init(struct ibm_init_struct *iibm)
+{
+ printk(TPACPI_INFO
+ "volume: disabled as there is no ALSA support in this kernel\n");
+
+ return 1;
+}
+
+static struct ibm_struct volume_driver_data = {
+ .name = "volume",
+};
+
+#endif /* CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
+
/*************************************************************************
* Fan subdriver
*/
@@ -8743,6 +8767,7 @@ MODULE_PARM_DESC(hotkey_report_mode,
"used for backwards compatibility with userspace, "
"see documentation");
+#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
module_param_named(volume_mode, volume_mode, uint, 0444);
MODULE_PARM_DESC(volume_mode,
"Selects volume control strategy: "
@@ -8765,6 +8790,7 @@ module_param_named(id, alsa_id, charp, 0444);
MODULE_PARM_DESC(id, "ALSA id for the ACPI EC Mixer");
module_param_named(enable, alsa_enable, bool, 0444);
MODULE_PARM_DESC(enable, "Enable the ALSA interface for the ACPI EC Mixer");
+#endif /* CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
#define TPACPI_PARAM(feature) \
module_param_call(feature, set_ibm_param, NULL, NULL, 0); \
--
1.6.5.7
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/5] thinkpad-acpi: update volume documentation
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
` (2 preceding siblings ...)
2009-12-27 0:52 ` [PATCH 3/5] thinkpad-acpi: make volume subdriver optional Henrique de Moraes Holschuh
@ 2009-12-27 0:52 ` Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 5/5] thinkpad-acpi: improve Kconfig help text Henrique de Moraes Holschuh
2009-12-27 3:41 ` [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Len Brown
5 siblings, 0 replies; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 0:52 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh
Update the volume subdriver documentation.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
Documentation/laptops/thinkpad-acpi.txt | 58 ++++++++++++++++++++++++++----
1 files changed, 50 insertions(+), 8 deletions(-)
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 169091f..75afa12 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -1092,8 +1092,8 @@ WARNING:
its level up and down at every change.
-Volume control
---------------
+Volume control (Console Audio control)
+--------------------------------------
procfs: /proc/acpi/ibm/volume
ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC"
@@ -1110,9 +1110,53 @@ the desktop environment to just provide on-screen-display feedback.
Software volume control should be done only in the main AC97/HDA
mixer.
-This feature allows volume control on ThinkPad models with a digital
-volume knob (when available, not all models have it), as well as
-mute/unmute control. The available commands are:
+
+About the ThinkPad Console Audio control:
+
+ThinkPads have a built-in amplifier and muting circuit that drives the
+console headphone and speakers. This circuit is after the main AC97
+or HDA mixer in the audio path, and under exclusive control of the
+firmware.
+
+ThinkPads have three special hotkeys to interact with the console
+audio control: volume up, volume down and mute.
+
+It is worth noting that the normal way the mute function works (on
+ThinkPads that do not have a "mute LED") is:
+
+1. Press mute to mute. It will *always* mute, you can press it as
+ many times as you want, and the sound will remain mute.
+
+2. Press either volume key to unmute the ThinkPad (it will _not_
+ change the volume, it will just unmute).
+
+This is a very superior design when compared to the cheap software-only
+mute-toggle solution found on normal consumer laptops: you can be
+absolutely sure the ThinkPad will not make noise if you press the mute
+button, no matter the previous state.
+
+The IBM ThinkPads, and the earlier Lenovo ThinkPads have variable-gain
+amplifiers driving the speakers and headphone output, and the firmware
+also handles volume control for the headphone and speakers on these
+ThinkPads without any help from the operating system (this volume
+control stage exists after the main AC97 or HDA mixer in the audio
+path).
+
+The newer Lenovo models only have firmware mute control, and depend on
+the main HDA mixer to do volume control (which is done by the operating
+system). In this case, the volume keys are filtered out for unmute
+key press (there are some firmware bugs in this area) and delivered as
+normal key presses to the operating system (thinkpad-acpi is not
+involved).
+
+
+The ThinkPad-ACPI volume control:
+
+The preferred way to interact with the Console Audio control is the
+ALSA interface.
+
+The legacy procfs interface allows one to read the current state,
+and if volume control is enabled, accepts the following commands:
echo up >/proc/acpi/ibm/volume
echo down >/proc/acpi/ibm/volume
@@ -1121,12 +1165,10 @@ mute/unmute control. The available commands are:
echo 'level <level>' >/proc/acpi/ibm/volume
The <level> number range is 0 to 14 although not all of them may be
-distinct. The unmute the volume after the mute command, use either the
+distinct. To unmute the volume after the mute command, use either the
up or down command (the level command will not unmute the volume), or
the unmute command.
-The current volume level and mute state is shown in the file.
-
You can use the volume_capabilities parameter to tell the driver
whether your thinkpad has volume control or mute-only control:
volume_capabilities=1 for mixers with mute and volume control,
--
1.6.5.7
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/5] thinkpad-acpi: improve Kconfig help text
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
` (3 preceding siblings ...)
2009-12-27 0:52 ` [PATCH 4/5] thinkpad-acpi: update volume documentation Henrique de Moraes Holschuh
@ 2009-12-27 0:52 ` Henrique de Moraes Holschuh
2009-12-28 13:30 ` tytso
2009-12-27 3:41 ` [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Len Brown
5 siblings, 1 reply; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 0:52 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh
Document that rfkill and ALSA functionality exists, but requires the
subsystems to be available, and not modular if thinkpad-acpi is not
modular.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
drivers/platform/x86/Kconfig | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 2462dc3..db32c25 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -231,6 +231,11 @@ config THINKPAD_ACPI
This driver was formerly known as ibm-acpi.
+ Extra functionality will be available if the rfkill (CONFIG_RFKILL)
+ and/or ALSA (CONFIG_SND) subsystems are available in the kernel.
+ Note that if you want ThinkPad-ACPI to be built-in instead of
+ modular, ALSA and rfkill will also have to be built-in.
+
If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
config THINKPAD_ACPI_ALSA_SUPPORT
--
1.6.5.7
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
` (4 preceding siblings ...)
2009-12-27 0:52 ` [PATCH 5/5] thinkpad-acpi: improve Kconfig help text Henrique de Moraes Holschuh
@ 2009-12-27 3:41 ` Len Brown
5 siblings, 0 replies; 15+ messages in thread
From: Len Brown @ 2009-12-27 3:41 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: linux-acpi, ibm-acpi-devel
applied to acpi-test
thanks,
Len Brown, Intel Open Source Technology Center
On Sat, 26 Dec 2009, Henrique de Moraes Holschuh wrote:
> Len,
>
> This patchset fixes a few problems that have been reported,
> including the annoying build problem reported by Ingo.
>
> It mostly updates the new ALSA functionality to be better
> behaved, and makes it optional for people who could care
> less for on-screen-display of volume hotkeys and would
> rather have a kernel that is a few kiB smaller.
>
> Please apply.
>
> Thanks.
>
> Shortlog:
> Henrique de Moraes Holschuh (5):
> thinkpad-acpi: don't take the first ALSA slot by default
> thinkpad-acpi: don't fail to load the entire module due to ALSA problems
> thinkpad-acpi: make volume subdriver optional
> thinkpad-acpi: update volume documentation
> thinkpad-acpi: improve Kconfig help text
>
> --
> "One disk to rule them all, One disk to find them. One disk to bring
> them all and in the darkness grind them. In the Land of Redmond
> where the shadows lie." -- The Silicon Valley Tarot
> Henrique Holschuh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] thinkpad-acpi: make volume subdriver optional
2009-12-27 0:52 ` [PATCH 3/5] thinkpad-acpi: make volume subdriver optional Henrique de Moraes Holschuh
@ 2009-12-27 9:38 ` Takashi Iwai
[not found] ` <s5hr5qgvjsa.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
0 siblings, 1 reply; 15+ messages in thread
From: Takashi Iwai @ 2009-12-27 9:38 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Len Brown, linux-acpi, ibm-acpi-devel, Ingo Molnar, Amerigo Wang,
Helight Xu
At Sat, 26 Dec 2009 22:52:15 -0200,
Henrique de Moraes Holschuh wrote:
>
> 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>
> ---
> drivers/platform/x86/Kconfig | 23 +++++++++++++++++++++++
> drivers/platform/x86/thinkpad_acpi.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 49 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index ec4faff..2462dc3 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -233,6 +233,29 @@ config THINKPAD_ACPI
>
> If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
>
> +config THINKPAD_ACPI_ALSA_SUPPORT
> + bool "Console audio control ALSA interface"
> + depends on THINKPAD_ACPI
> + depends on SND
> + depends on SND = y || THINKPAD_ACPI = SND
I think the first "depends on SND" is superfluous.
But it's no any important issue.
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
> + default y
> + ---help---
> + Enables monitoring of the built-in console audio output control
> + (headphone and speakers), which is operated by the mute and (in
> + some ThinkPad models) volume hotkeys.
> +
> + If this option is enabled, ThinkPad-ACPI will export an ALSA card
> + with a single read-only mixer control, which should be used for
> + on-screen-display feedback purposes by the Desktop Environment.
> +
> + Optionally, the driver will also allow software control (the
> + ALSA mixer will be made read-write). Please refer to the driver
> + documentation for details.
> +
> + All IBM models have both volume and mute control. Newer Lenovo
> + models only have mute control (the volume hotkeys are just normal
> + keys and volume control is done through the main HDA mixer).
> +
> config THINKPAD_ACPI_DEBUGFACILITIES
> bool "Maintainer debug facilities"
> depends on THINKPAD_ACPI
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 9b7da9c..e67e4fe 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 = {
> * and we leave them unchanged.
> */
>
> +#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
> +
> #define TPACPI_ALSA_DRVNAME "ThinkPad EC"
> #define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
> #define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME
> @@ -7021,6 +7023,28 @@ static struct ibm_struct volume_driver_data = {
> .shutdown = volume_shutdown,
> };
>
> +#else /* !CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
> +
> +#define alsa_card NULL
> +
> +static void inline volume_alsa_notify_change(void)
> +{
> +}
> +
> +static int __init volume_init(struct ibm_init_struct *iibm)
> +{
> + printk(TPACPI_INFO
> + "volume: disabled as there is no ALSA support in this kernel\n");
> +
> + return 1;
> +}
> +
> +static struct ibm_struct volume_driver_data = {
> + .name = "volume",
> +};
> +
> +#endif /* CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
> +
> /*************************************************************************
> * Fan subdriver
> */
> @@ -8743,6 +8767,7 @@ MODULE_PARM_DESC(hotkey_report_mode,
> "used for backwards compatibility with userspace, "
> "see documentation");
>
> +#ifdef CONFIG_THINKPAD_ACPI_ALSA_SUPPORT
> module_param_named(volume_mode, volume_mode, uint, 0444);
> MODULE_PARM_DESC(volume_mode,
> "Selects volume control strategy: "
> @@ -8765,6 +8790,7 @@ module_param_named(id, alsa_id, charp, 0444);
> MODULE_PARM_DESC(id, "ALSA id for the ACPI EC Mixer");
> module_param_named(enable, alsa_enable, bool, 0444);
> MODULE_PARM_DESC(enable, "Enable the ALSA interface for the ACPI EC Mixer");
> +#endif /* CONFIG_THINKPAD_ACPI_ALSA_SUPPORT */
>
> #define TPACPI_PARAM(feature) \
> module_param_call(feature, set_ibm_param, NULL, NULL, 0); \
> --
> 1.6.5.7
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] thinkpad-acpi: make volume subdriver optional
[not found] ` <s5hr5qgvjsa.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2009-12-27 18:32 ` Henrique de Moraes Holschuh
2009-12-27 22:37 ` Ian Molton
0 siblings, 1 reply; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-27 18:32 UTC (permalink / raw)
To: Takashi Iwai
Cc: Amerigo Wang, ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-acpi-u79uwXL29TY76Z2rM5mHXA, Helight Xu, Ingo Molnar,
Len Brown
On Sun, 27 Dec 2009, Takashi Iwai wrote:
> > +config THINKPAD_ACPI_ALSA_SUPPORT
> > + bool "Console audio control ALSA interface"
> > + depends on THINKPAD_ACPI
> > + depends on SND
> > + depends on SND = y || THINKPAD_ACPI = SND
>
> I think the first "depends on SND" is superfluous.
Yes, but I felt that it wouldn't get the idea across as nicely (to humans,
Kconfig obviously could care less).
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] thinkpad-acpi: make volume subdriver optional
2009-12-27 18:32 ` Henrique de Moraes Holschuh
@ 2009-12-27 22:37 ` Ian Molton
2009-12-28 13:17 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 15+ messages in thread
From: Ian Molton @ 2009-12-27 22:37 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Takashi Iwai, Len Brown, linux-acpi, ibm-acpi-devel, Ingo Molnar,
Amerigo Wang, Helight Xu
Not directly related to your patch but I thought I'd mention...
I've noticed issues with my X200 re: routing audio before / after docking.
I'll investigate if I can provoke it and will let you know.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] thinkpad-acpi: make volume subdriver optional
2009-12-27 22:37 ` Ian Molton
@ 2009-12-28 13:17 ` Henrique de Moraes Holschuh
[not found] ` <20091228131744.GC19362-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
0 siblings, 1 reply; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-28 13:17 UTC (permalink / raw)
To: Ian Molton
Cc: Takashi Iwai, Len Brown, linux-acpi, ibm-acpi-devel, Ingo Molnar,
Amerigo Wang, Helight Xu
On Sun, 27 Dec 2009, Ian Molton wrote:
> Not directly related to your patch but I thought I'd mention...
>
> I've noticed issues with my X200 re: routing audio before / after docking.
ThinkPads used to route line-out to the dock, with a fixed 1.1dB amplifier
(0.1dB increase) in the audio path, and had the volume control for
headphones and speakers done in a different audio path, extracted before the
line-out amplifier. The PeeCee beeper channel was routed to the headphones
and speakers, only.
If Lenovo tried to reproduce that with the HDA mixer but without the "Laptop
Apudio Controller" the IBM thinkpads had, I wouldn't be surprised if it
causes massive ALSA disruption should the firmware screw with the HDA mixer
registers behind ALSA's back. Try asking the kernel to enable OSI(Linux) in
ACPI... I always forget the kernel command line parameter to do that, but
it is documented in the usual place.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] thinkpad-acpi: improve Kconfig help text
2009-12-27 0:52 ` [PATCH 5/5] thinkpad-acpi: improve Kconfig help text Henrique de Moraes Holschuh
@ 2009-12-28 13:30 ` tytso
2009-12-28 13:35 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 15+ messages in thread
From: tytso @ 2009-12-28 13:30 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: Len Brown, linux-acpi, ibm-acpi-devel
On Sat, Dec 26, 2009 at 10:52:17PM -0200, Henrique de Moraes Holschuh wrote:
> + Extra functionality will be available if the rfkill (CONFIG_RFKILL)
> + and/or ALSA (CONFIG_SND) subsystems are available in the kernel.
> + Note that if you want ThinkPad-ACPI to be built-in instead of
> + modular, ALSA and rfkill will also have to be built-in.
By the way, just as a point of information, Ubuntu Karmic seems to
have some kind of bug with their sound system (I suspect their
Pulseaudio integration) which cases sound to be completely
non-functional if ALSA is built in. I had to build ALSA as modules in
order for Ubuntu to work correctly.
- Ted
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] thinkpad-acpi: improve Kconfig help text
2009-12-28 13:30 ` tytso
@ 2009-12-28 13:35 ` Henrique de Moraes Holschuh
2009-12-29 14:21 ` tytso
0 siblings, 1 reply; 15+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-28 13:35 UTC (permalink / raw)
To: tytso; +Cc: Len Brown, linux-acpi, ibm-acpi-devel
On Mon, 28 Dec 2009, tytso@mit.edu wrote:
> By the way, just as a point of information, Ubuntu Karmic seems to
> have some kind of bug with their sound system (I suspect their
> Pulseaudio integration) which cases sound to be completely
> non-functional if ALSA is built in. I had to build ALSA as modules in
> order for Ubuntu to work correctly.
Maybe they are depending on module parameters for it to work, and adding
those automagically behind your back in the modprobe.d config stuff but
ignoring the kernel command line?
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] thinkpad-acpi: make volume subdriver optional
[not found] ` <20091228131744.GC19362-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
@ 2009-12-28 21:30 ` Jerone Young
0 siblings, 0 replies; 15+ messages in thread
From: Jerone Young @ 2009-12-28 21:30 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Amerigo Wang, linux-acpi-u79uwXL29TY76Z2rM5mHXA, Takashi Iwai,
Ian Molton, ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Helight Xu, Ingo Molnar, Len Brown
On Mon, 2009-12-28 at 11:17 -0200, Henrique de Moraes Holschuh wrote:
> On Sun, 27 Dec 2009, Ian Molton wrote:
> > Not directly related to your patch but I thought I'd mention...
> >
> > I've noticed issues with my X200 re: routing audio before / after docking.
>
> ThinkPads used to route line-out to the dock, with a fixed 1.1dB amplifier
> (0.1dB increase) in the audio path, and had the volume control for
> headphones and speakers done in a different audio path, extracted before the
> line-out amplifier. The PeeCee beeper channel was routed to the headphones
> and speakers, only.
>
> If Lenovo tried to reproduce that with the HDA mixer but without the "Laptop
> Apudio Controller" the IBM thinkpads had, I wouldn't be surprised if it
> causes massive ALSA disruption should the firmware screw with the HDA mixer
> registers behind ALSA's back. Try asking the kernel to enable OSI(Linux) in
> ACPI... I always forget the kernel command line parameter to do that, but
> it is documented in the usual place.
"acpi_osi=Linux" is the kernel command line param your looking for.
>
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] thinkpad-acpi: improve Kconfig help text
2009-12-28 13:35 ` Henrique de Moraes Holschuh
@ 2009-12-29 14:21 ` tytso
0 siblings, 0 replies; 15+ messages in thread
From: tytso @ 2009-12-29 14:21 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: Len Brown, linux-acpi, ibm-acpi-devel
On Mon, Dec 28, 2009 at 11:35:22AM -0200, Henrique de Moraes Holschuh wrote:
> On Mon, 28 Dec 2009, tytso@mit.edu wrote:
> > By the way, just as a point of information, Ubuntu Karmic seems to
> > have some kind of bug with their sound system (I suspect their
> > Pulseaudio integration) which cases sound to be completely
> > non-functional if ALSA is built in. I had to build ALSA as modules in
> > order for Ubuntu to work correctly.
>
> Maybe they are depending on module parameters for it to work, and adding
> those automagically behind your back in the modprobe.d config stuff but
> ignoring the kernel command line?
For a T400? I don't think so. #1, the only thing in /etc/modprobe.d
is:
options snd-hda-intel power_save=10 power_save_controller=N
#2, building sound into the kernel worked fine with Ubuntu Jaunty; the
exact same kernel broke when I upgraded the userspace to Ubuntu
Karmic.
- Ted
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2009-12-29 14:21 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-27 0:52 [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 1/5] thinkpad-acpi: don't take the first ALSA slot by default Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 2/5] thinkpad-acpi: don't fail to load the entire module due to ALSA problems Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 3/5] thinkpad-acpi: make volume subdriver optional Henrique de Moraes Holschuh
2009-12-27 9:38 ` Takashi Iwai
[not found] ` <s5hr5qgvjsa.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2009-12-27 18:32 ` Henrique de Moraes Holschuh
2009-12-27 22:37 ` Ian Molton
2009-12-28 13:17 ` Henrique de Moraes Holschuh
[not found] ` <20091228131744.GC19362-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2009-12-28 21:30 ` Jerone Young
2009-12-27 0:52 ` [PATCH 4/5] thinkpad-acpi: update volume documentation Henrique de Moraes Holschuh
2009-12-27 0:52 ` [PATCH 5/5] thinkpad-acpi: improve Kconfig help text Henrique de Moraes Holschuh
2009-12-28 13:30 ` tytso
2009-12-28 13:35 ` Henrique de Moraes Holschuh
2009-12-29 14:21 ` tytso
2009-12-27 3:41 ` [GIT PATCH] thinkpad-acpi fixes for 2.6.32-rc2 Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox