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

Commit a72aea72 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpica', 'acpi-video' and 'acpi-fan'

* acpica:
  ACPICA: Update version to 20160108
  ACPICA: Silence a -Wbad-function-cast warning when acpi_uintptr_t is 'uintptr_t'
  ACPICA: Additional 2016 copyright changes
  ACPICA: Reduce regression fix divergence from upstream ACPICA

* acpi-video:
  ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830
  ACPI / video: Revert "thinkpad_acpi: Use acpi_video_handles_brightness_key_presses()"
  ACPI / video: Document acpi_video_handles_brightness_key_presses() a bit
  ACPI / video: Fix using an uninitialized mutex / list_head in acpi_video_handles_brightness_key_presses()
  ACPI / video: Revert "ACPI / video: driver must be registered before checking for keypresses"
  ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700

* acpi-fan:
  ACPI / fan: Improve acpi_device_update_power error message
Loading
Loading
Loading
Loading
+33 −19
Original line number Original line Diff line number Diff line
@@ -90,10 +90,10 @@ module_param(device_id_scheme, bool, 0444);
static bool only_lcd = false;
static bool only_lcd = false;
module_param(only_lcd, bool, 0444);
module_param(only_lcd, bool, 0444);


static DECLARE_COMPLETION(register_done);
static int register_count;
static DEFINE_MUTEX(register_done_mutex);
static DEFINE_MUTEX(register_count_mutex);
static struct mutex video_list_lock;
static DEFINE_MUTEX(video_list_lock);
static struct list_head video_bus_head;
static LIST_HEAD(video_bus_head);
static int acpi_video_bus_add(struct acpi_device *device);
static int acpi_video_bus_add(struct acpi_device *device);
static int acpi_video_bus_remove(struct acpi_device *device);
static int acpi_video_bus_remove(struct acpi_device *device);
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
@@ -478,6 +478,15 @@ static struct dmi_system_id video_dmi_table[] = {
	 * control on these systems, but do not register a backlight sysfs
	 * control on these systems, but do not register a backlight sysfs
	 * as brightness control does not work.
	 * as brightness control does not work.
	 */
	 */
	{
	 /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
	 .callback = video_disable_backlight_sysfs_if,
	 .ident = "Toshiba Portege R700",
	 .matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
		DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE R700"),
		},
	},
	{
	{
	 /* https://bugs.freedesktop.org/show_bug.cgi?id=82634 */
	 /* https://bugs.freedesktop.org/show_bug.cgi?id=82634 */
	 .callback = video_disable_backlight_sysfs_if,
	 .callback = video_disable_backlight_sysfs_if,
@@ -487,6 +496,15 @@ static struct dmi_system_id video_dmi_table[] = {
		DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE R830"),
		DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE R830"),
		},
		},
	},
	},
	{
	 /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
	 .callback = video_disable_backlight_sysfs_if,
	 .ident = "Toshiba Satellite R830",
	 .matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
		DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE R830"),
		},
	},
	/*
	/*
	 * Some machine's _DOD IDs don't have bit 31(Device ID Scheme) set
	 * Some machine's _DOD IDs don't have bit 31(Device ID Scheme) set
	 * but the IDs actually follow the Device ID Scheme.
	 * but the IDs actually follow the Device ID Scheme.
@@ -2049,8 +2067,8 @@ int acpi_video_register(void)
{
{
	int ret = 0;
	int ret = 0;


	mutex_lock(&register_done_mutex);
	mutex_lock(&register_count_mutex);
	if (completion_done(&register_done)) {
	if (register_count) {
		/*
		/*
		 * if the function of acpi_video_register is already called,
		 * if the function of acpi_video_register is already called,
		 * don't register the acpi_vide_bus again and return no error.
		 * don't register the acpi_vide_bus again and return no error.
@@ -2058,9 +2076,6 @@ int acpi_video_register(void)
		goto leave;
		goto leave;
	}
	}


	mutex_init(&video_list_lock);
	INIT_LIST_HEAD(&video_bus_head);

	dmi_check_system(video_dmi_table);
	dmi_check_system(video_dmi_table);


	ret = acpi_bus_register_driver(&acpi_video_bus);
	ret = acpi_bus_register_driver(&acpi_video_bus);
@@ -2071,22 +2086,22 @@ int acpi_video_register(void)
	 * When the acpi_video_bus is loaded successfully, increase
	 * When the acpi_video_bus is loaded successfully, increase
	 * the counter reference.
	 * the counter reference.
	 */
	 */
	complete(&register_done);
	register_count = 1;


leave:
leave:
	mutex_unlock(&register_done_mutex);
	mutex_unlock(&register_count_mutex);
	return ret;
	return ret;
}
}
EXPORT_SYMBOL(acpi_video_register);
EXPORT_SYMBOL(acpi_video_register);


void acpi_video_unregister(void)
void acpi_video_unregister(void)
{
{
	mutex_lock(&register_done_mutex);
	mutex_lock(&register_count_mutex);
	if (completion_done(&register_done)) {
	if (register_count) {
		acpi_bus_unregister_driver(&acpi_video_bus);
		acpi_bus_unregister_driver(&acpi_video_bus);
		reinit_completion(&register_done);
		register_count = 0;
	}
	}
	mutex_unlock(&register_done_mutex);
	mutex_unlock(&register_count_mutex);
}
}
EXPORT_SYMBOL(acpi_video_unregister);
EXPORT_SYMBOL(acpi_video_unregister);


@@ -2094,21 +2109,20 @@ void acpi_video_unregister_backlight(void)
{
{
	struct acpi_video_bus *video;
	struct acpi_video_bus *video;


	mutex_lock(&register_done_mutex);
	mutex_lock(&register_count_mutex);
	if (completion_done(&register_done)) {
	if (register_count) {
		mutex_lock(&video_list_lock);
		mutex_lock(&video_list_lock);
		list_for_each_entry(video, &video_bus_head, entry)
		list_for_each_entry(video, &video_bus_head, entry)
			acpi_video_bus_unregister_backlight(video);
			acpi_video_bus_unregister_backlight(video);
		mutex_unlock(&video_list_lock);
		mutex_unlock(&video_list_lock);
	}
	}
	mutex_unlock(&register_done_mutex);
	mutex_unlock(&register_count_mutex);
}
}


bool acpi_video_handles_brightness_key_presses(void)
bool acpi_video_handles_brightness_key_presses(void)
{
{
	bool have_video_busses;
	bool have_video_busses;


	wait_for_completion(&register_done);
	mutex_lock(&video_list_lock);
	mutex_lock(&video_list_lock);
	have_video_busses = !list_empty(&video_bus_head);
	have_video_busses = !list_empty(&video_bus_head);
	mutex_unlock(&video_list_lock);
	mutex_unlock(&video_list_lock);
+2 −2
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
 *****************************************************************************/
 *****************************************************************************/


/*
/*
 * Copyright (C) 2000 - 2015, Intel Corp.
 * Copyright (C) 2000 - 2016, Intel Corp.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
/* Common info for tool signons */
/* Common info for tool signons */


#define ACPICA_NAME                 "Intel ACPI Component Architecture"
#define ACPICA_NAME                 "Intel ACPI Component Architecture"
#define ACPICA_COPYRIGHT            "Copyright (c) 2000 - 2015 Intel Corporation"
#define ACPICA_COPYRIGHT            "Copyright (c) 2000 - 2016 Intel Corporation"


#if ACPI_MACHINE_WIDTH == 64
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH          "-64"
#define ACPI_WIDTH          "-64"
+1 −1
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
 *****************************************************************************/
 *****************************************************************************/


/*
/*
 * Copyright (C) 2000 - 2015, Intel Corp.
 * Copyright (C) 2000 - 2016, Intel Corp.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
+1 −1
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
 *****************************************************************************/
 *****************************************************************************/


/*
/*
 * Copyright (C) 2000 - 2015, Intel Corp.
 * Copyright (C) 2000 - 2016, Intel Corp.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
+1 −1
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
 *****************************************************************************/
 *****************************************************************************/


/*
/*
 * Copyright (C) 2000 - 2015, Intel Corp.
 * Copyright (C) 2000 - 2016, Intel Corp.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
Loading