diff options
author | Len Brown <len.brown@intel.com> | 2008-12-01 00:09:47 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-12-19 04:42:32 -0500 |
commit | 41b16dce390510f550a4d2b12b98e0258bbed6e2 (patch) | |
tree | 03f668f70c47e7d6319a1b5fc21aa0634254cdb1 /drivers/misc | |
parent | 8c36790a21eec6c39c372e92c76e81865005a6ce (diff) |
create drivers/platform/x86/ from drivers/misc/
Move x86 platform specific drivers from drivers/misc/
to a new home under drivers/platform/x86/.
The community has been maintaining x86 vendor-specific
platform specific drivers under /drivers/misc/ for a few years.
The oldest ones started life under drivers/acpi.
They moved out of drivers/acpi/ because they don't actually
implement the ACPI specification, but either simply
use ACPI, or implement vendor-specific ACPI extensions.
In the future we anticipate...
drivers/misc/ will go away.
other architectures will create drivers/platform/<arch>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/Kconfig | 280 | ||||
-rw-r--r-- | drivers/misc/Makefile | 12 | ||||
-rw-r--r-- | drivers/misc/acer-wmi.c | 1345 | ||||
-rw-r--r-- | drivers/misc/asus-laptop.c | 1266 | ||||
-rw-r--r-- | drivers/misc/compal-laptop.c | 406 | ||||
-rw-r--r-- | drivers/misc/eeepc-laptop.c | 872 | ||||
-rw-r--r-- | drivers/misc/fujitsu-laptop.c | 1126 | ||||
-rw-r--r-- | drivers/misc/hp-wmi.c | 512 | ||||
-rw-r--r-- | drivers/misc/intel_menlow.c | 536 | ||||
-rw-r--r-- | drivers/misc/msi-laptop.c | 437 | ||||
-rw-r--r-- | drivers/misc/panasonic-laptop.c | 766 | ||||
-rw-r--r-- | drivers/misc/sony-laptop.c | 2781 | ||||
-rw-r--r-- | drivers/misc/tc1100-wmi.c | 290 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 6949 |
14 files changed, 0 insertions, 17578 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index dcf61690bd2..8574879fa63 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -136,97 +136,6 @@ config TIFM_7XX1 To compile this driver as a module, choose M here: the module will be called tifm_7xx1. -config ACER_WMI - tristate "Acer WMI Laptop Extras (EXPERIMENTAL)" - depends on X86 - depends on EXPERIMENTAL - depends on ACPI - depends on LEDS_CLASS - depends on NEW_LEDS - depends on BACKLIGHT_CLASS_DEVICE - depends on SERIO_I8042 - depends on RFKILL - select ACPI_WMI - ---help--- - This is a driver for newer Acer (and Wistron) laptops. It adds - wireless radio and bluetooth control, and on some laptops, - exposes the mail LED and LCD backlight. - - For more information about this driver see - <file:Documentation/laptops/acer-wmi.txt> - - If you have an ACPI-WMI compatible Acer/ Wistron laptop, say Y or M - here. - -config ASUS_LAPTOP - tristate "Asus Laptop Extras (EXPERIMENTAL)" - depends on X86 - depends on ACPI - depends on EXPERIMENTAL && !ACPI_ASUS - depends on LEDS_CLASS - depends on NEW_LEDS - depends on BACKLIGHT_CLASS_DEVICE - ---help--- - This is the new Linux driver for Asus laptops. It may also support some - MEDION, JVC or VICTOR laptops. It makes all the extra buttons generate - standard ACPI events that go through /proc/acpi/events. It also adds - support for video output switching, LCD backlight control, Bluetooth and - Wlan control, and most importantly, allows you to blink those fancy LEDs. - - For more information and a userspace daemon for handling the extra - buttons see <http://acpi4asus.sf.net/>. - - If you have an ACPI-compatible ASUS laptop, say Y or M here. - -config FUJITSU_LAPTOP - tristate "Fujitsu Laptop Extras" - depends on X86 - depends on ACPI - depends on INPUT - depends on BACKLIGHT_CLASS_DEVICE - ---help--- - This is a driver for laptops built by Fujitsu: - - * P2xxx/P5xxx/S6xxx/S7xxx series Lifebooks - * Possibly other Fujitsu laptop models - * Tested with S6410 and S7020 - - It adds support for LCD brightness control and some hotkeys. - - If you have a Fujitsu laptop, say Y or M here. - -config FUJITSU_LAPTOP_DEBUG - bool "Verbose debug mode for Fujitsu Laptop Extras" - depends on FUJITSU_LAPTOP - default n - ---help--- - Enables extra debug output from the fujitsu extras driver, at the - expense of a slight increase in driver size. - - If you are not sure, say N here. - -config TC1100_WMI - tristate "HP Compaq TC1100 Tablet WMI Extras (EXPERIMENTAL)" - depends on X86 && !X86_64 - depends on EXPERIMENTAL - depends on ACPI - select ACPI_WMI - ---help--- - This is a driver for the WMI extensions (wireless and bluetooth power - control) of the HP Compaq TC1100 tablet. - -config HP_WMI - tristate "HP WMI extras" - depends on ACPI_WMI - depends on INPUT - depends on RFKILL - help - Say Y here if you want to support WMI-based hotkeys on HP laptops and - to read data from WMI such as docking or ambient light sensor state. - - To compile this driver as a module, choose M here: the module will - be called hp-wmi. - config ICS932S401 tristate "Integrated Circuits ICS932S401" depends on I2C && EXPERIMENTAL @@ -237,170 +146,6 @@ config ICS932S401 This driver can also be built as a module. If so, the module will be called ics932s401. -config MSI_LAPTOP - tristate "MSI Laptop Extras" - depends on X86 - depends on ACPI - depends on BACKLIGHT_CLASS_DEVICE - ---help--- - This is a driver for laptops built by MSI (MICRO-STAR - INTERNATIONAL): - - MSI MegaBook S270 (MS-1013) - Cytron/TCM/Medion/Tchibo MD96100/SAM2000 - - It adds support for Bluetooth, WLAN and LCD brightness control. - - More information about this driver is available at - <http://0pointer.de/lennart/tchibo.html>. - - If you have an MSI S270 laptop, say Y or M here. - -config PANASONIC_LAPTOP - tristate "Panasonic Laptop Extras" - depends on X86 && INPUT && ACPI - depends on BACKLIGHT_CLASS_DEVICE - ---help--- - This driver adds support for access to backlight control and hotkeys - on Panasonic Let's Note laptops. - - If you have a Panasonic Let's note laptop (such as the R1(N variant), - R2, R3, R5, T2, W2 and Y2 series), say Y. - -config COMPAL_LAPTOP - tristate "Compal Laptop Extras" - depends on X86 - depends on ACPI - depends on BACKLIGHT_CLASS_DEVICE - ---help--- - This is a driver for laptops built by Compal: - - Compal FL90/IFL90 - Compal FL91/IFL91 - Compal FL92/JFL92 - Compal FT00/IFT00 - - It adds support for Bluetooth, WLAN and LCD brightness control. - - If you have an Compal FL9x/IFL9x/FT00 laptop, say Y or M here. - -config SONY_LAPTOP - tristate "Sony Laptop Extras" - depends on X86 && ACPI - select BACKLIGHT_CLASS_DEVICE - depends on INPUT - ---help--- - This mini-driver drives the SNC and SPIC devices present in the ACPI - BIOS of the Sony Vaio laptops. - - It gives access to some extra laptop functionalities like Bluetooth, - screen brightness control, Fn keys and allows powering on/off some - devices. - - Read <file:Documentation/laptops/sony-laptop.txt> for more information. - -config SONYPI_COMPAT - bool "Sonypi compatibility" - depends on SONY_LAPTOP - ---help--- - Build the sonypi driver compatibility code into the sony-laptop driver. - -config THINKPAD_ACPI - tristate "ThinkPad ACPI Laptop Extras" - depends on X86 && ACPI - select BACKLIGHT_LCD_SUPPORT - select BACKLIGHT_CLASS_DEVICE - select HWMON - select NVRAM - select INPUT - select NEW_LEDS - select LEDS_CLASS - select NET - select RFKILL - ---help--- - This is a driver for the IBM and Lenovo ThinkPad laptops. It adds - support for Fn-Fx key combinations, Bluetooth control, video - output switching, ThinkLight control, UltraBay eject and more. - For more information about this driver see - <file:Documentation/laptops/thinkpad-acpi.txt> and - <http://ibm-acpi.sf.net/> . - - This driver was formerly known as ibm-acpi. - - If you have an IBM or Lenovo ThinkPad laptop, say Y or M here. - -config THINKPAD_ACPI_DEBUG - bool "Verbose debug mode" - depends on THINKPAD_ACPI - default n - ---help--- - Enables extra debugging information, at the expense of a slightly - increase in driver size. - - If you are not sure, say N here. - -config THINKPAD_ACPI_DOCK - bool "Legacy Docking Station Support" - depends on THINKPAD_ACPI - depends on ACPI_DOCK=n - default n - ---help--- - Allows the thinkpad_acpi driver to handle docking station events. - This support was made obsolete by the generic ACPI docking station - support (CONFIG_ACPI_DOCK). It will allow locking and removing the - laptop from the docking station, but will not properly connect PCI - devices. - - If you are not sure, say N here. - -config THINKPAD_ACPI_BAY - bool "Legacy Removable Bay Support" - depends on THINKPAD_ACPI - default y - ---help--- - Allows the thinkpad_acpi driver to handle removable bays. It will - electrically disable the device in the bay, and also generate - notifications when the bay lever is ejected or inserted. - - If you are not sure, say Y here. - -config THINKPAD_ACPI_VIDEO - bool "Video output control support" - depends on THINKPAD_ACPI - default y - ---help--- - Allows the thinkpad_acpi driver to provide an interface to control - the various video output ports. - - This feature often won't work well, depending on ThinkPad model, - display state, video output devices in use, whether there is a X - server running, phase of the moon, and the current mood of - Schroedinger's cat. If you can use X.org's RandR to control - your ThinkPad's video output ports instead of this feature, - don't think twice: do it and say N here to save some memory. - - If you are not sure, say Y here. - -config THINKPAD_ACPI_HOTKEY_POLL - bool "Support NVRAM polling for hot keys" - depends on THINKPAD_ACPI - default y - ---help--- - Some thinkpad models benefit from NVRAM polling to detect a few of - the hot key press events. If you know your ThinkPad model does not - need to do NVRAM polling to support any of the hot keys you use, - unselecting this option will save about 1kB of memory. - - ThinkPads T40 and newer, R52 and newer, and X31 and newer are - unlikely to need NVRAM polling in their latest BIOS versions. - - NVRAM polling can detect at most the following keys: ThinkPad/Access - IBM, Zoom, Switch Display (fn+F7), ThinkLight, Volume up/down/mute, - Brightness up/down, Display Expand (fn+F8), Hibernate (fn+F12). - - If you are not sure, say Y here. The driver enables polling only if - it is strictly necessary to do so. - config ATMEL_SSC tristate "Device driver for Atmel SSC peripheral" depends on AVR32 || ARCH_AT91 @@ -413,31 +158,6 @@ config ATMEL_SSC If unsure, say N. -config INTEL_MENLOW - tristate "Thermal Management driver for Intel menlow platform" - depends on ACPI_THERMAL - select THERMAL - depends on X86 - ---help--- - ACPI thermal management enhancement driver on - Intel Menlow platform. - - If unsure, say N. - -config EEEPC_LAPTOP - tristate "Eee PC Hotkey Driver (EXPERIMENTAL)" - depends on X86 - depends on ACPI - depends on BACKLIGHT_CLASS_DEVICE - depends on HWMON - depends on EXPERIMENTAL - depends on RFKILL - ---help--- - This driver supports the Fn-Fx keys on Eee PC laptops. - It also adds the ability to switch camera/wlan on/off. - - If you have an Eee PC laptop, say Y or M here. - config ENCLOSURE_SERVICES tristate "Enclosure Services" default n diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 027e1eae7c8..d5749a7bc77 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -4,28 +4,16 @@ obj-$(CONFIG_IBM_ASM) += ibmasm/ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ -obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o -obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o -obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o -obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o -obj-$(CONFIG_ACER_WMI) += acer-wmi.o obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o -obj-$(CONFIG_HP_WMI) += hp-wmi.o obj-$(CONFIG_ICS932S401) += ics932s401.o -obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o obj-$(CONFIG_PHANTOM) += phantom.o obj-$(CONFIG_SGI_IOC4) += ioc4.o -obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o -obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o -obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o -obj-$(CONFIG_PANASONIC_LAPTOP) += panasonic-laptop.o obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o -obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o obj-$(CONFIG_KGDB_TESTS) += kgdbts.o obj-$(CONFIG_SGI_XP) += sgi-xp/ diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c deleted file mode 100644 index 94c9f911824..00000000000 --- a/drivers/misc/acer-wmi.c +++ /dev/null @@ -1,1345 +0,0 @@ -/* - * Acer WMI Laptop Extras - * - * Copyright (C) 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk> - * - * Based on acer_acpi: - * Copyright (C) 2005-2007 E.M. Smith - * Copyright (C) 2007-2008 Carlos Corbacho <cathectic@gmail.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/init.h> -#include <linux/types.h> -#include <linux/dmi.h> -#include <linux/fb.h> -#include <linux/backlight.h> -#include <linux/leds.h> -#include <linux/platform_device.h> -#include <linux/acpi.h> -#include <linux/i8042.h> -#include <linux/rfkill.h> -#include <linux/workqueue.h> -#include <linux/debugfs.h> - -#include <acpi/acpi_drivers.h> - -MODULE_AUTHOR("Carlos Corbacho"); -MODULE_DESCRIPTION("Acer Laptop WMI Extras Driver"); -MODULE_LICENSE("GPL"); - -#define ACER_LOGPREFIX "acer-wmi: " -#define ACER_ERR KERN_ERR ACER_LOGPREFIX -#define ACER_NOTICE KERN_NOTICE ACER_LOGPREFIX -#define ACER_INFO KERN_INFO ACER_LOGPREFIX - -/* - * The following defines quirks to get some specific functions to work - * which are known to not be supported over ACPI-WMI (such as the mail LED - * on WMID based Acer's) - */ -struct acer_quirks { - const char *vendor; - const char *model; - u16 quirks; -}; - -/* - * Magic Number - * Meaning is unknown - this number is required for writing to ACPI for AMW0 - * (it's also used in acerhk when directly accessing the BIOS) - */ -#define ACER_AMW0_WRITE 0x9610 - -/* - * Bit masks for the AMW0 interface - */ -#define ACER_AMW0_WIRELESS_MASK 0x35 -#define ACER_AMW0_BLUETOOTH_MASK 0x34 -#define ACER_AMW0_MAILLED_MASK 0x31 - -/* - * Method IDs for WMID interface - */ -#define ACER_WMID_GET_WIRELESS_METHODID 1 -#define ACER_WMID_GET_BLUETOOTH_METHODID 2 -#define ACER_WMID_GET_BRIGHTNESS_METHODID 3 -#define ACER_WMID_SET_WIRELESS_METHODID 4 -#define ACER_WMID_SET_BLUETOOTH_METHODID 5 -#define ACER_WMID_SET_BRIGHTNESS_METHODID 6 -#define ACER_WMID_GET_THREEG_METHODID 10 -#define ACER_WMID_SET_THREEG_METHODID 11 - -/* - * Acer ACPI method GUIDs - */ -#define AMW0_GUID1 "67C3371D-95A3-4C37-BB61-DD47B491DAAB" -#define AMW0_GUID2 "431F16ED-0C2B-444C-B267-27DEB140CF9C" -#define WMID_GUID1 "6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3" -#define WMID_GUID2 "95764E09-FB56-4e83-B31A-37761F60994A" - -MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB"); -MODULE_ALIAS("wmi:6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3"); - -/* Temporary workaround until the WMI sysfs interface goes in */ -MODULE_ALIAS("dmi:*:*Acer*:*:"); - -/* - * Interface capability flags - */ -#define ACER_CAP_MAILLED (1<<0) -#define ACER_CAP_WIRELESS (1<<1) -#define ACER_CAP_BLUETOOTH (1<<2) -#define ACER_CAP_BRIGHTNESS (1<<3) -#define ACER_CAP_THREEG (1<<4) -#define ACER_CAP_ANY (0xFFFFFFFF) - -/* - * Interface type flags - */ -enum interface_flags { - ACER_AMW0, - ACER_AMW0_V2, - ACER_WMID, -}; - -#define ACER_DEFAULT_WIRELESS 0 -#define ACER_DEFAULT_BLUETOOTH 0 -#define ACER_DEFAULT_MAILLED 0 -#define ACER_DEFAULT_THREEG 0 - -static int max_brightness = 0xF; - -static int mailled = -1; -static int brightness = -1; -static int threeg = -1; -static int force_series; - -module_param(mailled, int, 0444); -module_param(brightness, int, 0444); -module_param(threeg, int, 0444); -module_param(force_series, int, 0444); -MODULE_PARM_DESC(mailled, "Set initial state of Mail LED"); -MODULE_PARM_DESC(brightness, "Set initial LCD backlight brightness"); -MODULE_PARM_DESC(threeg, "Set initial state of 3G hardware"); -MODULE_PARM_DESC(force_series, "Force a different laptop series"); - -struct acer_data { - int mailled; - int threeg; - int brightness; -}; - -struct acer_debug { - struct dentry *root; - struct dentry *devices; - u32 wmid_devices; -}; - -static struct rfkill *wireless_rfkill; -static struct rfkill *bluetooth_rfkill; - -/* Each low-level interface must define at least some of the following */ -struct wmi_interface { - /* The WMI device type */ - u32 type; - - /* The capabilities this interface provides */ - u32 capability; - - /* Private data for the current interface */ - struct acer_data data; - - /* debugfs entries associated with this interface */ - struct acer_debug debug; -}; - -/* The static interface pointer, points to the currently detected interface */ -static struct wmi_interface *interface; - -/* - * Embedded Controller quirks - * Some laptops require us to directly access the EC to either enable or query - * features that are not available through WMI. - */ - -struct quirk_entry { - u8 wireless; - u8 mailled; - s8 brightness; - u8 bluetooth; -}; - -static struct quirk_entry *quirks; - -static void set_quirks(void) -{ - if (!interface) - return; - - if (quirks->mailled) - interface->capability |= ACER_CAP_MAILLED; - - if (quirks->brightness) - interface->capability |= ACER_CAP_BRIGHTNESS; -} - -static int dmi_matched(const struct dmi_system_id *dmi) -{ - quirks = dmi->driver_data; - return 0; -} - -static struct quirk_entry quirk_unknown = { -}; - -static struct quirk_entry quirk_acer_aspire_1520 = { - .brightness = -1, -}; - -static struct quirk_entry quirk_acer_travelmate_2490 = { - .mailled = 1, -}; - -/* This AMW0 laptop has no bluetooth */ -static struct quirk_entry quirk_medion_md_98300 = { - .wireless = 1, -}; - -static struct quirk_entry quirk_fujitsu_amilo_li_1718 = { - .wireless = 2, -}; - -static struct dmi_system_id acer_quirks[] = { - { - .callback = dmi_matched, - .ident = "Acer Aspire 1360", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"), - }, - .driver_data = &quirk_acer_aspire_1520, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 1520", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1520"), - }, - .driver_data = &quirk_acer_aspire_1520, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 3100", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3100"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 3610", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3610"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 5100", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 5610", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 5630", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 5650", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 5680", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 9110", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer TravelMate 2490", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Acer TravelMate 4200", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4200"), - }, - .driver_data = &quirk_acer_travelmate_2490, - }, - { - .callback = dmi_matched, - .ident = "Fujitsu Siemens Amilo Li 1718", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), - DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Li 1718"), - }, - .driver_data = &quirk_fujitsu_amilo_li_1718, - }, - { - .callback = dmi_matched, - .ident = "Medion MD 98300", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), - DMI_MATCH(DMI_PRODUCT_NAME, "WAM2030"), - }, - .driver_data = &quirk_medion_md_98300, - }, - {} -}; - -/* Find which quirks are needed for a particular vendor/ model pair */ -static void find_quirks(void) -{ - if (!force_series) { - dmi_check_system(acer_quirks); - } else if (force_series == 2490) { - quirks = &quirk_acer_travelmate_2490; - } - - if (quirks == NULL) - quirks = &quirk_unknown; - - set_quirks(); -} - -/* - * General interface convenience methods - */ - -static bool has_cap(u32 cap) -{ - if ((interface->capability & cap) != 0) - return 1; - - return 0; -} - -/* - * AMW0 (V1) interface - */ -struct wmab_args { - u32 eax; - u32 ebx; - u32 ecx; - u32 edx; -}; - -struct wmab_ret { - u32 eax; - u32 ebx; - u32 ecx; - u32 edx; - u32 eex; -}; - -static acpi_status wmab_execute(struct wmab_args *regbuf, -struct acpi_buffer *result) -{ - struct acpi_buffer input; - acpi_status status; - input.length = sizeof(struct wmab_args); - input.pointer = (u8 *)regbuf; - - status = wmi_evaluate_method(AMW0_GUID1, 1, 1, &input, result); - - return status; -} - -static acpi_status AMW0_get_u32(u32 *value, u32 cap, -struct wmi_interface *iface) -{ - int err; - u8 result; - - switch (cap) { - case ACER_CAP_MAILLED: - switch (quirks->mailled) { - default: - err = ec_read(0xA, &result); - if (err) - return AE_ERROR; - *value = (result >> 7) & 0x1; - return AE_OK; - } - break; - case ACER_CAP_WIRELESS: - switch (quirks->wireless) { - case 1: - err = ec_read(0x7B, &result); - if (err) - return AE_ERROR; - *value = result & 0x1; - return AE_OK; - case 2: - err = ec_read(0x71, &result); - if (err) - return AE_ERROR; - *value = result & 0x1; - return AE_OK; - default: - err = ec_read(0xA, &result); - if (err) - return AE_ERROR; - *value = (result >> 2) & 0x1; - return AE_OK; - } - break; - case ACER_CAP_BLUETOOTH: - switch (quirks->bluetooth) { - default: - err = ec_read(0xA, &result); - if (err) - return AE_ERROR; - *value = (result >> 4) & 0x1; - return AE_OK; - } - break; - case ACER_CAP_BRIGHTNESS: - switch (quirks->brightness) { - default: - err = ec_read(0x83, &result); - if (err) - return AE_ERROR; - *value = result; - return AE_OK; - } - break; - default: - return AE_ERROR; - } - return AE_OK; -} - -static acpi_status AMW0_set_u32(u32 value, u32 cap, struct wmi_interface *iface) -{ - struct wmab_args args; - - args.eax = ACER_AMW0_WRITE; - args.ebx = value ? (1<<8) : 0; - args.ecx = args.edx = 0; - - switch (cap) { - case ACER_CAP_MAILLED: - if (value > 1) - return AE_BAD_PARAMETER; - args.ebx |= ACER_AMW0_MAILLED_MASK; - break; - case ACER_CAP_WIRELESS: - if (value > 1) - return AE_BAD_PARAMETER; - args.ebx |= ACER_AMW0_WIRELESS_MASK; - break; - case ACER_CAP_BLUETOOTH: - if (value > 1) - return AE_BAD_PARAMETER; - args.ebx |= ACER_AMW0_BLUETOOTH_MASK; - break; - case ACER_CAP_BRIGHTNESS: - if (value > max_brightness) - return AE_BAD_PARAMETER; - switch (quirks->brightness) { - default: - return ec_write(0x83, value); - break; - } - default: - return AE_ERROR; - } - - /* Actually do the set */ - return wmab_execute(&args, NULL); -} - -static acpi_status AMW0_find_mailled(void) -{ - struct wmab_args args; - struct wmab_ret ret; - acpi_status status = AE_OK; - struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL }; - union acpi_object *obj; - - args.eax = 0x86; - args.ebx = args.ecx = args.edx = 0; - - status = wmab_execute(&args, &out); - if (ACPI_FAILURE(status)) - return status; - - obj = (union acpi_object *) out.pointer; - if (obj && obj->type == ACPI_TYPE_BUFFER && - obj->buffer.length == sizeof(struct wmab_ret)) { - ret = *((struct wmab_ret *) obj->buffer.pointer); - } else { - return AE_ERROR; - } - - if (ret.eex & 0x1) - interface->capability |= ACER_CAP_MAILLED; - - kfree(out.pointer); - - return AE_OK; -} - -static acpi_status AMW0_set_capabilities(void) -{ - struct wmab_args args; - struct wmab_ret ret; - acpi_status status = AE_OK; - struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL }; - union acpi_object *obj; - - /* - * On laptops with this strange GUID (non Acer), normal probing doesn't - * work. - */ - if (wmi_has_guid(AMW0_GUID2)) { - interface->capability |= ACER_CAP_WIRELESS; - return AE_OK; - } - - args.eax = ACER_AMW0_WRITE; - args.ecx = args.edx = 0; - - args.ebx = 0xa2 << 8; - args.ebx |= ACER_AMW0_WIRELESS_MASK; - - status = wmab_execute(&args, &out); - if (ACPI_FAILURE(status)) - return status; - - obj = (union acpi_object *) out.pointer; - if (obj && obj->type == ACPI_TYPE_BUFFER && - obj->buffer.length == sizeof(struct wmab_ret)) { - ret = *((struct wmab_ret *) obj->buffer.pointer); - } else { - return AE_ERROR; - } - - if (ret.eax & 0x1) - interface->capability |= ACER_CAP_WIRELESS; - - args.ebx = 2 << 8; - args.ebx |= ACER_AMW0_BLUETOOTH_MASK; - - status = wmab_execute(&args, &out); - if (ACPI_FAILURE(status)) - return status; - - obj = (union acpi_object *) out.pointer; - if (obj && obj->type == ACPI_TYPE_BUFFER - && obj->buffer.length == sizeof(struct wmab_ret)) { - ret = *((struct wmab_ret *) obj->buffer.pointer); - } else { - return AE_ERROR; - } - - if (ret.eax & 0x1) - interface->capability |= ACER_CAP_BLUETOOTH; - - kfree(out.pointer); - - /* - * This appears to be safe to enable, since all Wistron based laptops - * appear to use the same EC register for brightness, even if they - * differ for wireless, etc - */ - if (quirks->brightness >= 0) - interface->capability |= ACER_CAP_BRIGHTNESS; - - return AE_OK; -} - -static struct wmi_interface AMW0_interface = { - .type = ACER_AMW0, -}; - -static struct wmi_interface AMW0_V2_interface = { - .type = ACER_AMW0_V2, -}; - -/* - * New interface (The WMID interface) - */ -static acpi_status -WMI_execute_u32(u32 method_id, u32 in, u32 *out) -{ - struct acpi_buffer input = { (acpi_size) sizeof(u32), (void *)(&in) }; - struct acpi_buffer result = { ACPI_ALLOCATE_BUFFER, NULL }; - union acpi_object *obj; - u32 tmp; - acpi_status status; - - status = wmi_evaluate_method(WMID_GUID1, 1, method_id, &input, &result); - - if (ACPI_FAILURE(status)) - return status; - - obj = (union acpi_object *) result.pointer; - if (obj && obj->type == ACPI_TYPE_BUFFER && - obj->buffer.length == sizeof(u32)) { - tmp = *((u32 *) obj->buffer.pointer); - } else { - tmp = 0; - } - - if (out) - *out = tmp; - - kfree(result.pointer); - - return status; -} - -static acpi_status WMID_get_u32(u32 *value, u32 cap, -struct wmi_interface *iface) -{ - acpi_status status; - u8 tmp; - u32 result, method_id = 0; - - switch (cap) { - case ACER_CAP_WIRELESS: - method_id = ACER_WMID_GET_WIRELESS_METHODID; - break; - case ACER_CAP_BLUETOOTH: - method_id = ACER_WMID_GET_BLUETOOTH_METHODID; - break; - case ACER_CAP_BRIGHTNESS: - method_id = ACER_WMID_GET_BRIGHTNESS_METHODID; - break; - case ACER_CAP_THREEG: - method_id = ACER_WMID_GET_THREEG_METHODID; - break; - case ACER_CAP_MAILLED: - if (quirks->mailled == 1) { - ec_read(0x9f, &tmp); - *value = tmp & 0x1; - return 0; - } - default: - return AE_ERROR; - } - status = WMI_execute_u32(method_id, 0, &result); - - if (ACPI_SUCCESS(status)) - *value = (u8)result; - - return status; -} - -static acpi_status WMID_set_u32(u32 value, u32 cap, struct wmi_interface *iface) -{ - u32 method_id = 0; - char param; - - switch (cap) { - case ACER_CAP_BRIGHTNESS: - if (value > max_brightness) - return AE_BAD_PARAMETER; - method_id = ACER_WMID_SET_BRIGHTNESS_METHODID; - break; - case ACER_CAP_WIRELESS: - if (value > 1) - return AE_BAD_PARAMETER; - method_id = ACER_WMID_SET_WIRELESS_METHODID; - break; - case ACER_CAP_BLUETOOTH: - if (value > 1) - return AE_BAD_PARAMETER; - method_id = ACER_WMID_SET_BLUETOOTH_METHODID; - break; - case ACER_CAP_THREEG: - if (value > 1) - return AE_BAD_PARAMETER; - method_id = ACER_WMID_SET_THREEG_METHODID; - break; - case ACER_CAP_MAILLED: - if (value > 1) - return AE_BAD_PARAMETER; - if (quirks->mailled == 1) { |