Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08d869aa authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: introduce kernel parameter acpi_sleep=sci_force_enable
  ACPI: WMI: Survive BIOS with duplicate GUIDs
  dell-wmi - fix condition to abort driver loading
  wmi: check find_guid() return value to prevent oops
  dell-wmi, hp-wmi, msi-wmi: check wmi_get_event_data() return value
  ACPI: hp-wmi, msi-wmi: clarify that wmi_install_notify_handler() returns an acpi_status
  dell-wmi: sys_init_module: 'dell_wmi'->init suspiciously returned 21, it should
  ACPI video: correct error-handling code
  ACPI video: no warning message if "acpi_backlight=vendor" is used
  ACPI: fix ACPI=n allmodconfig build
  thinkpad-acpi: improve Kconfig help text
  thinkpad-acpi: update volume subdriver documentation
  thinkpad-acpi: make volume subdriver optional
  thinkpad-acpi: don't fail to load the entire module due to ALSA problems
  thinkpad-acpi: don't take the first ALSA slot by default
parents 05a62548 1201b2a9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ and is between 256 and 4096 characters. It is defined in the file

	acpi_sleep=	[HW,ACPI] Sleep options
			Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
				  old_ordering, s4_nonvs }
				  old_ordering, s4_nonvs, sci_force_enable }
			See Documentation/power/video.txt for information on
			s3_bios and s3_mode.
			s3_beep is for debugging; it makes the PC's speaker beep
@@ -253,6 +253,9 @@ and is between 256 and 4096 characters. It is defined in the file
			of _PTS is used by default).
			s4_nonvs prevents the kernel from saving/restoring the
			ACPI NVS memory during hibernation.
			sci_force_enable causes the kernel to set SCI_EN directly
			on resume from S1/S3 (which is against the ACPI spec,
			but some broken systems don't work without it).

	acpi_use_timer_override [HW,ACPI]
			Use timer override. For some broken Nvidia NF5 boards
+50 −8
Original line number Diff line number Diff line
@@ -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,
+2 −0
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@ static int __init acpi_sleep_setup(char *str)
#endif
		if (strncmp(str, "old_ordering", 12) == 0)
			acpi_old_suspend_ordering();
		if (strncmp(str, "sci_force_enable", 16) == 0)
			acpi_set_sci_en_on_resume();
		str = strchr(str, ',');
		if (str != NULL)
			str += strspn(str, ", \t");
+17 −12
Original line number Diff line number Diff line
@@ -80,6 +80,23 @@ static int acpi_sleep_prepare(u32 acpi_state)

#ifdef CONFIG_ACPI_SLEEP
static u32 acpi_target_sleep_state = ACPI_STATE_S0;
/*
 * According to the ACPI specification the BIOS should make sure that ACPI is
 * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states.  Still,
 * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
 * on such systems during resume.  Unfortunately that doesn't help in
 * particularly pathological cases in which SCI_EN has to be set directly on
 * resume, although the specification states very clearly that this flag is
 * owned by the hardware.  The set_sci_en_on_resume variable will be set in such
 * cases.
 */
static bool set_sci_en_on_resume;

void __init acpi_set_sci_en_on_resume(void)
{
	set_sci_en_on_resume = true;
}

/*
 * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
 * user to request that behavior by using the 'acpi_old_suspend_ordering'
@@ -170,18 +187,6 @@ static void acpi_pm_end(void)
#endif /* CONFIG_ACPI_SLEEP */

#ifdef CONFIG_SUSPEND
/*
 * According to the ACPI specification the BIOS should make sure that ACPI is
 * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states.  Still,
 * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
 * on such systems during resume.  Unfortunately that doesn't help in
 * particularly pathological cases in which SCI_EN has to be set directly on
 * resume, although the specification states very clearly that this flag is
 * owned by the hardware.  The set_sci_en_on_resume variable will be set in such
 * cases.
 */
static bool set_sci_en_on_resume;

extern void do_suspend_lowlevel(void);

static u32 acpi_suspend_states[] = {
+7 −1
Original line number Diff line number Diff line
@@ -999,8 +999,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
		sprintf(name, "acpi_video%d", count++);
		device->backlight = backlight_device_register(name,
			NULL, device, &acpi_backlight_ops);
		device->backlight->props.max_brightness = device->brightness->count-3;
		kfree(name);
		if (IS_ERR(device->backlight))
			return;
		device->backlight->props.max_brightness = device->brightness->count-3;

		result = sysfs_create_link(&device->backlight->dev.kobj,
					   &device->dev->dev.kobj, "device");
@@ -1979,6 +1981,10 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event)
	unsigned long long level_current, level_next;
	int result = -EINVAL;

	/* no warning message if acpi_backlight=vendor is used */
	if (!acpi_video_backlight_support())
		return 0;

	if (!device->brightness)
		goto out;

Loading