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

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

Merge branch 'acpi-video'

* acpi-video:
  ACPI: blacklist win8 OSI for buggy laptops
  ACPI: blacklist win8 OSI for ASUS Zenbook Prime UX31A
  ACPI / video: drop unused fields from struct acpi_video_brightness_flags
  ACPI / video: remove unnecessary type casting
  ACPI / video: trivial style cleanups
  ACPI / video: trivial costmetic cleanups

Conflicts:
	drivers/acpi/video.c
parents 551f5c74 94fb9823
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -192,6 +192,12 @@ static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
	acpi_osi_setup("!Windows 2009");
	return 0;
}
static int __init dmi_disable_osi_win8(const struct dmi_system_id *d)
{
	printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
	acpi_osi_setup("!Windows 2012");
	return 0;
}

static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
	{
@@ -267,6 +273,30 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
		     DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
		},
	},
	{
	.callback = dmi_disable_osi_win8,
	.ident = "ASUS Zenbook Prime UX31A",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
		     DMI_MATCH(DMI_PRODUCT_NAME, "UX31A"),
		},
	},
	{
	.callback = dmi_disable_osi_win8,
	.ident = "Dell Inspiron 15R SE",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
		     DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7520"),
		},
	},
	{
	.callback = dmi_disable_osi_win8,
	.ident = "Lenovo ThinkPad Edge E530",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		     DMI_MATCH(DMI_PRODUCT_VERSION, "3259A2G"),
		},
	},

	/*
	 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
+87 −93
Original line number Diff line number Diff line
/*
 *  video.c - ACPI Video Driver ($Revision:$)
 *  video.c - ACPI Video Driver
 *
 *  Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
 *  Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org>
@@ -88,7 +88,7 @@ module_param(allow_duplicates, bool, 0644);
static bool use_bios_initial_backlight = 1;
module_param(use_bios_initial_backlight, bool, 0644);

static int register_count = 0;
static int register_count;
static int acpi_video_bus_add(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);
@@ -185,8 +185,6 @@ struct acpi_video_device_cap {
struct acpi_video_brightness_flags {
	u8 _BCL_no_ac_battery_levels:1;	/* no AC/Battery levels in _BCL */
	u8 _BCL_reversed:1;		/* _BCL package is in a reversed order */
	u8 _BCL_use_index:1;		/* levels in _BCL are index values */
	u8 _BCM_use_index:1;		/* input of _BCM is an index value */
	u8 _BQC_use_index:1;		/* _BQC returns an index value */
};

@@ -236,15 +234,16 @@ static int acpi_video_get_brightness(struct backlight_device *bd)
{
	unsigned long long cur_level;
	int i;
	struct acpi_video_device *vd =
		(struct acpi_video_device *)bl_get_data(bd);
	struct acpi_video_device *vd = bl_get_data(bd);

	if (acpi_video_device_lcd_get_level_current(vd, &cur_level, false))
		return -EINVAL;
	for (i = 2; i < vd->brightness->count; i++) {
		if (vd->brightness->levels[i] == cur_level)
			/* The first two entries are special - see page 575
			   of the ACPI spec 3.0 */
			/*
			 * The first two entries are special - see page 575
			 * of the ACPI spec 3.0
			 */
			return i - 2;
	}
	return 0;
@@ -253,8 +252,7 @@ static int acpi_video_get_brightness(struct backlight_device *bd)
static int acpi_video_set_brightness(struct backlight_device *bd)
{
	int request_level = bd->props.brightness + 2;
	struct acpi_video_device *vd =
		(struct acpi_video_device *)bl_get_data(bd);
	struct acpi_video_device *vd = bl_get_data(bd);

	return acpi_video_device_lcd_set_level(vd,
				vd->brightness->levels[request_level]);
@@ -316,9 +314,11 @@ static const struct thermal_cooling_device_ops video_cooling_ops = {
	.set_cur_state = video_set_cur_state,
};

/* --------------------------------------------------------------------------
                               Video Management
   -------------------------------------------------------------------------- */
/*
 * --------------------------------------------------------------------------
 *                             Video Management
 * --------------------------------------------------------------------------
 */

static int
acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
@@ -552,7 +552,8 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
				      buf));
			device->cap._BQC = device->cap._BCQ = 0;
		} else {
			/* Fixme:
			/*
			 * Fixme:
			 * should we return an error or ignore this failure?
			 * dev->brightness->curr is a cached value which stores
			 * the correct current backlight level in most cases.
@@ -799,16 +800,6 @@ acpi_video_init_brightness(struct acpi_video_device *device)
	br->count = count;
	device->brightness = br;

	/* Check the input/output of _BQC/_BCL/_BCM */
	if ((max_level < 100) && (max_level <= (count - 2)))
		br->flags._BCL_use_index = 1;

	/*
	 * _BCM is always consistent with _BCL,
	 * at least for all the laptops we have ever seen.
	 */
	br->flags._BCM_use_index = br->flags._BCL_use_index;

	/* _BQC uses INDEX while _BCL uses VALUE in some laptops */
	br->curr = level = max_level;

@@ -900,7 +891,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
		acpi_handle acpi_parent;
		struct device *parent = NULL;
		int result;
		static int count = 0;
		static int count;
		char *name;

		result = acpi_video_init_brightness(device);
@@ -1012,7 +1003,8 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
		return -ENODEV;
	pci_dev_put(dev);

	/* Since there is no HID, CID and so on for VGA driver, we have
	/*
	 * Since there is no HID, CID and so on for VGA driver, we have
	 * to check well known required nodes.
	 */

@@ -1042,9 +1034,11 @@ static int acpi_video_bus_check(struct acpi_video_bus *video)
	return status;
}

/* --------------------------------------------------------------------------
                                 Driver Interface
   -------------------------------------------------------------------------- */
/*
 * --------------------------------------------------------------------------
 *                               Driver Interface
 * --------------------------------------------------------------------------
 */

/* device interface */
static struct acpi_video_device_attrib *
@@ -1107,7 +1101,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,

	attribute = acpi_video_get_device_attr(video, device_id);

	if((attribute != NULL) && attribute->device_id_scheme) {
	if (attribute && attribute->device_id_scheme) {
		switch (attribute->display_type) {
		case ACPI_VIDEO_DISPLAY_CRT:
			data->flags.crt = 1;