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

Commit 9cb0ee85 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86

Pull x86 platform driver updates from Matthew Garrett:
 "A few small updates for 3.6 - a trivial regression fix and a couple of
  conformance updates for the gmux driver, plus some tiny fixes for
  asus-wmi, eeepc-laptop and thinkpad_acpi."

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
  thinkpad_acpi: buffer overflow in fan_get_status()
  eeepc-laptop: fix device reference count leakage in eeepc_rfkill_hotplug()
  platform/x86: fix asus_laptop.wled_type description
  asus-laptop: HRWS/HWRS typo
  drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEO
  apple-gmux: Fix port address calculation in gmux_pio_write32()
  apple-gmux: Fix index read functions
  apple-gmux: Obtain version info from indexed gmux
parents 5b799dde eceeb437
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2196,10 +2196,8 @@ static int __init acer_wmi_init(void)
		interface->capability &= ~ACER_CAP_BRIGHTNESS;
		pr_info("Brightness must be controlled by acpi video driver\n");
	} else {
#ifdef CONFIG_ACPI_VIDEO
		pr_info("Disabling ACPI video driver\n");
		acpi_video_unregister();
#endif
	}

	if (wmi_has_guid(WMID_GUID3)) {
+13 −11
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ static void gmux_pio_write32(struct apple_gmux_data *gmux_data, int port,

	for (i = 0; i < 4; i++) {
		tmpval = (val >> (i * 8)) & 0xff;
		outb(tmpval, port + i);
		outb(tmpval, gmux_data->iostart + port + i);
	}
}

@@ -142,8 +142,9 @@ static u8 gmux_index_read8(struct apple_gmux_data *gmux_data, int port)
	u8 val;

	mutex_lock(&gmux_data->index_lock);
	outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ);
	gmux_index_wait_ready(gmux_data);
	outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ);
	gmux_index_wait_complete(gmux_data);
	val = inb(gmux_data->iostart + GMUX_PORT_VALUE);
	mutex_unlock(&gmux_data->index_lock);

@@ -166,8 +167,9 @@ static u32 gmux_index_read32(struct apple_gmux_data *gmux_data, int port)
	u32 val;

	mutex_lock(&gmux_data->index_lock);
	outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ);
	gmux_index_wait_ready(gmux_data);
	outb((port & 0xff), gmux_data->iostart + GMUX_PORT_READ);
	gmux_index_wait_complete(gmux_data);
	val = inl(gmux_data->iostart + GMUX_PORT_VALUE);
	mutex_unlock(&gmux_data->index_lock);

@@ -461,18 +463,22 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
	ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE);
	if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) {
		if (gmux_is_indexed(gmux_data)) {
			u32 version;
			mutex_init(&gmux_data->index_lock);
			gmux_data->indexed = true;
			version = gmux_read32(gmux_data,
				GMUX_PORT_VERSION_MAJOR);
			ver_major = (version >> 24) & 0xff;
			ver_minor = (version >> 16) & 0xff;
			ver_release = (version >> 8) & 0xff;
		} else {
			pr_info("gmux device not present\n");
			ret = -ENODEV;
			goto err_release;
		}
		pr_info("Found indexed gmux\n");
	} else {
		pr_info("Found gmux version %d.%d.%d\n", ver_major, ver_minor,
			ver_release);
	}
	pr_info("Found gmux version %d.%d.%d [%s]\n", ver_major, ver_minor,
		ver_release, (gmux_data->indexed ? "indexed" : "classic"));

	memset(&props, 0, sizeof(props));
	props.type = BACKLIGHT_PLATFORM;
@@ -505,9 +511,7 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
	 * Disable the other backlight choices.
	 */
	acpi_video_dmi_promote_vendor();
#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
	acpi_video_unregister();
#endif
	apple_bl_unregister();

	gmux_data->power_state = VGA_SWITCHEROO_ON;
@@ -593,9 +597,7 @@ static void __devexit gmux_remove(struct pnp_dev *pnp)
	kfree(gmux_data);

	acpi_video_dmi_demote_vendor();
#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
	acpi_video_register();
#endif
	apple_bl_register();
}

+5 −5
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static char *wled_type = "unknown";
static char *bled_type = "unknown";

module_param(wled_type, charp, 0444);
MODULE_PARM_DESC(wlan_status, "Set the wled type on boot "
MODULE_PARM_DESC(wled_type, "Set the wled type on boot "
		 "(unknown, led or rfkill). "
		 "default is unknown");

@@ -863,9 +863,9 @@ static ssize_t show_infos(struct device *dev,
	 * The significance of others is yet to be found.
	 * If we don't find the method, we assume the device are present.
	 */
	rv = acpi_evaluate_integer(asus->handle, "HRWS", NULL, &temp);
	rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp);
	if (!ACPI_FAILURE(rv))
		len += sprintf(page + len, "HRWS value         : %#x\n",
		len += sprintf(page + len, "HWRS value         : %#x\n",
			       (uint) temp);
	/*
	 * Another value for userspace: the ASYM method returns 0x02 for
@@ -1751,9 +1751,9 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
	 * The significance of others is yet to be found.
	 */
	status =
	    acpi_evaluate_integer(asus->handle, "HRWS", NULL, &hwrs_result);
	    acpi_evaluate_integer(asus->handle, "HWRS", NULL, &hwrs_result);
	if (!ACPI_FAILURE(status))
		pr_notice("  HRWS returned %x", (int)hwrs_result);
		pr_notice("  HWRS returned %x", (int)hwrs_result);

	if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL))
		asus->have_rsts = true;
+0 −4
Original line number Diff line number Diff line
@@ -47,9 +47,7 @@
#include <linux/thermal.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#ifdef CONFIG_ACPI_VIDEO
#include <acpi/video.h>
#endif

#include "asus-wmi.h"

@@ -1704,10 +1702,8 @@ static int asus_wmi_add(struct platform_device *pdev)
	if (asus->driver->quirks->wmi_backlight_power)
		acpi_video_dmi_promote_vendor();
	if (!acpi_video_backlight_support()) {
#ifdef CONFIG_ACPI_VIDEO
		pr_info("Disabling ACPI video driver\n");
		acpi_video_unregister();
#endif
		err = asus_wmi_backlight_init(asus);
		if (err && err != -ENODEV)
			goto fail_backlight;
+6 −4
Original line number Diff line number Diff line
@@ -610,12 +610,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)

		if (!bus) {
			pr_warn("Unable to find PCI bus 1?\n");
			goto out_unlock;
			goto out_put_dev;
		}

		if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) {
			pr_err("Unable to read PCI config space?\n");
			goto out_unlock;
			goto out_put_dev;
		}

		absent = (l == 0xffffffff);
@@ -627,7 +627,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
				absent ? "absent" : "present");
			pr_warn("skipped wireless hotplug as probably "
				"inappropriate for this model\n");
			goto out_unlock;
			goto out_put_dev;
		}

		if (!blocked) {
@@ -635,7 +635,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
			if (dev) {
				/* Device already present */
				pci_dev_put(dev);
				goto out_unlock;
				goto out_put_dev;
			}
			dev = pci_scan_single_device(bus, 0);
			if (dev) {
@@ -650,6 +650,8 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
				pci_dev_put(dev);
			}
		}
out_put_dev:
		pci_dev_put(port);
	}

out_unlock:
Loading