Commit 4b09ddbc authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'acpi-5.3-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more ACPI updates from Rafael Wysocki:
 "These get rid of two clang warnings, add a new quirk mechanism to the
  ACPI backlight driver (and apply it to one machine) and update the
  table load object initialization in ACPICA (this is a replacement for
  a previously reverted ACPICA commit).

  Specifics:

   - Make ACPI table loading work more consistently regardless of the
     exact mechanism used for loading a table (Erik Schmauss).

   - Get rid of two clang warnings (Arnd Bergmann).

   - Add new quirk mechanism to the ACPI backlight driver and use it to
     add a quirk for PB Easynote MZ35 (Hans de Goede)"

* tag 'acpi-5.3-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: video: Add new hw_changes_brightness quirk, set it on PB Easynote MZ35
  ACPI: fix false-positive -Wuninitialized warning
  ACPI: blacklist: fix clang warning for unused DMI table
  ACPICA: Update table load object initialization
parents 47d6a760 2c66a5b5
......@@ -60,6 +60,12 @@ module_param(report_key_events, int, 0644);
MODULE_PARM_DESC(report_key_events,
"0: none, 1: output changes, 2: brightness changes, 3: all");
static int hw_changes_brightness = -1;
module_param(hw_changes_brightness, int, 0644);
MODULE_PARM_DESC(hw_changes_brightness,
"Set this to 1 on buggy hw which changes the brightness itself when "
"a hotkey is pressed: -1: auto, 0: normal 1: hw-changes-brightness");
/*
* Whether the struct acpi_video_device_attrib::device_id_scheme bit should be
* assumed even if not actually set.
......@@ -405,6 +411,14 @@ static int video_set_report_key_events(const struct dmi_system_id *id)
return 0;
}
static int video_hw_changes_brightness(
const struct dmi_system_id *d)
{
if (hw_changes_brightness == -1)
hw_changes_brightness = 1;
return 0;
}
static const struct dmi_system_id video_dmi_table[] = {
/*
* Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
......@@ -529,6 +543,21 @@ static const struct dmi_system_id video_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"),
},
},
/*
* Some machines change the brightness themselves when a brightness
* hotkey gets pressed, despite us telling them not to. In this case
* acpi_video_device_notify() should only call backlight_force_update(
* BACKLIGHT_UPDATE_HOTKEY) and not do anything else.
*/
{
/* https://bugzilla.kernel.org/show_bug.cgi?id=204077 */
.callback = video_hw_changes_brightness,
.ident = "Packard Bell EasyNote MZ35",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"),
DMI_MATCH(DMI_PRODUCT_NAME, "EasyNote MZ35"),
},
},
{}
};
......@@ -1612,6 +1641,14 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
bus = video_device->video;
input = bus->input;
if (hw_changes_brightness > 0) {
if (video_device->backlight)
backlight_force_update(video_device->backlight,
BACKLIGHT_UPDATE_HOTKEY);
acpi_notifier_call_chain(device, event, 0);
return;
}
switch (event) {
case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */
brightness_switch_event(video_device, event);
......
......@@ -174,12 +174,11 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
return_ACPI_STATUS(status);
}
/* Complete the initialization/resolution of package objects */
/* Complete the initialization/resolution of new objects */
status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0,
acpi_ns_init_one_package, NULL, NULL,
NULL);
acpi_ex_exit_interpreter();
acpi_ns_initialize_objects();
acpi_ex_enter_interpreter();
/* Parameter Data (optional) */
......@@ -437,12 +436,11 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(status);
}
/* Complete the initialization/resolution of package objects */
/* Complete the initialization/resolution of new objects */
status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0,
acpi_ns_init_one_package, NULL, NULL,
NULL);
acpi_ex_exit_interpreter();
acpi_ns_initialize_objects();
acpi_ex_enter_interpreter();
/* Store the ddb_handle into the Target operand */
......
......@@ -297,15 +297,11 @@ acpi_status acpi_load_table(struct acpi_table_header *table)
status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL,
FALSE, &table_index);
if (ACPI_SUCCESS(status)) {
/* Complete the initialization/resolution of package objects */
status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE,
ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0,
acpi_ns_init_one_package,
NULL, NULL, NULL);
/* Complete the initialization/resolution of new objects */
acpi_ns_initialize_objects();
}
return_ACPI_STATUS(status);
......
......@@ -17,7 +17,9 @@
#include "internal.h"
#ifdef CONFIG_DMI
static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
#endif
/*
* POLICY: If *anything* doesn't work, put it on the blacklist.
......@@ -61,7 +63,9 @@ int __init acpi_blacklisted(void)
}
(void)early_acpi_osi_init();
#ifdef CONFIG_DMI
dmi_check_system(acpi_rev_dmi_table);
#endif
return blacklisted;
}
......
......@@ -324,7 +324,10 @@ struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags,
#ifdef CONFIG_X86_IO_APIC
extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
#else
#define acpi_get_override_irq(gsi, trigger, polarity) (-1)
static inline int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity)
{
return -1;
}
#endif
/*
* This function undoes the effect of one call to acpi_register_gsi().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment