diff options
Diffstat (limited to 'drivers')
29 files changed, 245 insertions, 290 deletions
diff --git a/drivers/Makefile b/drivers/Makefile index 2503f7b99b2..fceb71a741c 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -56,6 +56,7 @@ obj-$(CONFIG_MAC) += macintosh/ obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_TC) += tc/ +obj-$(CONFIG_UWB) += uwb/ obj-$(CONFIG_USB) += usb/ obj-$(CONFIG_USB_MUSB_HDRC) += usb/musb/ obj-$(CONFIG_PCI) += usb/ @@ -101,4 +102,3 @@ obj-$(CONFIG_SSB) += ssb/ obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_REGULATOR) += regulator/ obj-$(CONFIG_STAGING) += staging/ -obj-$(CONFIG_UWB) += uwb/ diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 9d568d417ea..cb046c3fc3f 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -262,6 +262,7 @@ static int acpi_lid_send_state(struct acpi_button *button) return -ENODEV; /* input layer checks if event is redundant */ input_report_switch(button->input, SW_LID, !state); + input_sync(button->input); return 0; } @@ -285,8 +286,8 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data) input_report_key(input, keycode, 1); input_sync(input); input_report_key(input, keycode, 0); + input_sync(input); } - input_sync(input); acpi_bus_generate_proc_event(button->device, event, ++button->pushed); diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index dc98f7a6f2c..dbcf260ea93 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -38,7 +38,10 @@ #include <asm/uaccess.h> #endif + +#ifdef CONFIG_X86 #include <asm/cpufeature.h> +#endif #include <acpi/acpi_bus.h> #include <acpi/processor.h> @@ -360,11 +363,13 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr) * the BIOS is older than the CPU and does not know its frequencies */ update_bios: +#ifdef CONFIG_X86 if (ACPI_SUCCESS(acpi_get_handle(pr->handle, "_PPC", &handle))){ if(boot_cpu_has(X86_FEATURE_EST)) printk(KERN_WARNING FW_BUG "BIOS needs update for CPU " "frequency support\n"); } +#endif return result; } diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 26571bafb15..80c0868d048 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -163,6 +163,8 @@ static void acpi_pm_end(void) acpi_target_sleep_state = ACPI_STATE_S0; acpi_sleep_tts_switch(acpi_target_sleep_state); } +#else /* !CONFIG_ACPI_SLEEP */ +#define acpi_target_sleep_state ACPI_STATE_S0 #endif /* CONFIG_ACPI_SLEEP */ #ifdef CONFIG_SUSPEND diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 2a632f8b7a0..66aac06f2ac 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -371,6 +371,7 @@ static void bt_poll_rfkill(struct input_polled_dev *poll_dev) RFKILL_STATE_HARD_BLOCKED); input_report_switch(poll_dev->input, SW_RFKILL_ALL, new_rfk_state); + input_sync(poll_dev->input); } } @@ -842,6 +843,7 @@ static int __init toshiba_acpi_init(void) set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit); set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit); input_report_switch(toshiba_acpi.poll_dev->input, SW_RFKILL_ALL, TRUE); + input_sync(toshiba_acpi.poll_dev->input); ret = input_register_polled_device(toshiba_acpi.poll_dev); if (ret) { diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 98821f97583..b97aebd7aeb 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -2071,12 +2071,13 @@ module_init(rs_init) module_exit(rs_exit) +#if defined(CONFIG_SERIAL_CONSOLE) && !defined(MODULE) + /* * ------------------------------------------------------------ * Serial console driver * ------------------------------------------------------------ */ -#ifdef CONFIG_SERIAL_CONSOLE static void amiga_serial_putc(char c) { @@ -2130,6 +2131,7 @@ static int __init amiserial_console_init(void) return 0; } console_initcall(amiserial_console_init); -#endif + +#endif /* CONFIG_SERIAL_CONSOLE && !MODULE */ MODULE_LICENSE("GPL"); diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 43b8cefad2c..b0438c4f0c3 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c @@ -33,6 +33,7 @@ #include <linux/delay.h> #include <linux/dma-mapping.h> #include <linux/workqueue.h> +#include <linux/i7300_idle.h> #include "ioatdma.h" #include "ioatdma_registers.h" #include "ioatdma_hw.h" @@ -171,8 +172,10 @@ static int ioat_dma_enumerate_channels(struct ioatdma_device *device) xfercap_scale = readb(device->reg_base + IOAT_XFERCAP_OFFSET); xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale)); -#if CONFIG_I7300_IDLE_IOAT_CHANNEL - device->common.chancnt--; +#ifdef CONFIG_I7300_IDLE_IOAT_CHANNEL + if (i7300_idle_platform_probe(NULL, NULL) == 0) { + device->common.chancnt--; + } #endif for (i = 0; i < device->common.chancnt; i++) { ioat_chan = kzalloc(sizeof(*ioat_chan), GFP_KERNEL); diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index f5999a91614..b4fd8ca701a 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -247,7 +247,6 @@ config HID_SUNPLUS config THRUSTMASTER_FF tristate "ThrustMaster devices support" - default m depends on USB_HID select INPUT_FF_MEMLESS help @@ -256,7 +255,6 @@ config THRUSTMASTER_FF config ZEROPLUS_FF tristate "Zeroplus based game controller support" - default m depends on USB_HID select INPUT_FF_MEMLESS help diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index fd7f896b34f..c6ab4ba60c5 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -312,13 +312,6 @@ static int apple_probe(struct hid_device *hdev, unsigned int connect_mask = HID_CONNECT_DEFAULT; int ret; - /* return something else or move to hid layer? device will reside - allocated */ - if (id->bus == BUS_USB && (quirks & APPLE_IGNORE_MOUSE) && - to_usb_interface(hdev->dev.parent)->cur_altsetting-> - desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) - return -ENODEV; - asc = kzalloc(sizeof(*asc), GFP_KERNEL); if (asc == NULL) { dev_err(&hdev->dev, "can't alloc apple descriptor\n"); @@ -367,38 +360,32 @@ static const struct hid_device_id apple_devices[] = { .driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE | APPLE_ISO_KEYBOARD }, + APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE | APPLE_ISO_KEYBOARD }, + APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, + APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE | APPLE_ISO_KEYBOARD }, + APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS}, + APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO), @@ -406,14 +393,12 @@ static const struct hid_device_id apple_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, + APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO), @@ -422,25 +407,21 @@ static const struct hid_device_id apple_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), - .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO), - .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS), - .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI), - .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), - .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), - .driver_data = APPLE_HAS_FN | APPLE_IGNORE_MOUSE | APPLE_RDESC_JIS }, + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), - .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | - APPLE_IGNORE_MOUSE }, + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, /* Apple wireless Mighty Mouse */ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c), diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 721a36d9758..743e6f8cb20 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1264,6 +1264,7 @@ static const struct hid_device_id hid_blacklist[] = { { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_SK8115) }, { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, @@ -1275,8 +1276,6 @@ static const struct hid_device_id hid_blacklist[] = { { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_LX3) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_V150) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) }, @@ -1295,6 +1294,7 @@ static const struct hid_device_id hid_blacklist[] = { { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) }, @@ -1406,6 +1406,7 @@ static const struct hid_device_id hid_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1) }, { HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232) }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM)}, + { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM2)}, { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, @@ -1541,6 +1542,40 @@ static const struct hid_device_id hid_ignore_list[] = { { } }; +/** + * hid_mouse_ignore_list - mouse devices which should not be handled by the hid layer + * + * There are composite devices for which we want to ignore only a certain + * interface. This is a list of devices for which only the mouse interface will + * be ignored. This allows a dedicated driver to take care of the interface. + */ +static const struct hid_device_id hid_mouse_ignore_list[] = { + /* appletouch driver */ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, + { } +}; + static bool hid_ignore(struct hid_device *hdev) { switch (hdev->vendor) { @@ -1557,6 +1592,10 @@ static bool hid_ignore(struct hid_device *hdev) break; } + if (hdev->type == HID_TYPE_USBMOUSE && + hid_match_id(hdev, hid_mouse_ignore_list)) + return true; + return !!hid_match_id(hdev, hid_ignore_list); } diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c index ac5120f542c..04a0afec52a 100644 --- a/drivers/hid/hid-gyration.c +++ b/drivers/hid/hid-gyration.c @@ -4,9 +4,9 @@ * Copyright (c) 1999 Andreas Gal * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc - * Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2007 Paul Walmsley * Copyright (c) 2008 Jiri Slaby + * Copyright (c) 2006-2008 Jiri Kosina */ /* @@ -40,6 +40,7 @@ static int gyration_input_mapping(struct hid_device *hdev, struct hid_input *hi, case 0x025: gy_map_key_clear(KEY_PVR); break; case 0x046: gy_map_key_clear(KEY_MEDIA); break; case 0x047: gy_map_key_clear(KEY_MP3); break; + case 0x048: gy_map_key_clear(KEY_MEDIA); break; case 0x049: gy_map_key_clear(KEY_CAMERA); break; case 0x04a: gy_map_key_clear(KEY_VIDEO); break; @@ -68,6 +69,7 @@ static int gyration_event(struct hid_device *hdev, struct hid_field *field, static const struct hid_device_id gyration_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, { } }; MODULE_DEVICE_TABLE(hid, gyration_devices); diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index d9a1ba920c2..a0d6a6cb184 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -89,6 +89,7 @@ #define USB_VENDOR_ID_ASUS 0x0b05 #define USB_DEVICE_ID_ASUS_LCM 0x1726 +#define USB_DEVICE_ID_ASUS_LCM2 0x175b #define USB_VENDOR_ID_ATEN 0x0557 #define USB_DEVICE_ID_ATEN_UC100KM 0x2004 @@ -236,6 +237,7 @@ #define USB_VENDOR_ID_GYRATION 0x0c16 #define USB_DEVICE_ID_GYRATION_REMOTE 0x0002 +#define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003 #define USB_VENDOR_ID_HAPP 0x078b #define USB_DEVICE_ID_UGCI_DRIVING 0x0010 @@ -268,8 +270,6 @@ #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 #define USB_VENDOR_ID_LOGITECH 0x046d -#define USB_DEVICE_ID_LOGITECH_LX3 0xc044 -#define USB_DEVICE_ID_LOGITECH_V150 0xc047 #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101 #define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110 #define USB_DEVICE_ID_LOGITECH_HARMONY_LAST 0xc14f @@ -350,6 +350,7 @@ #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 #define USB_VENDOR_ID_SONY 0x054c +#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b #define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268 #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2 diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 406d8c82abf..2bae340eafe 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -287,11 +287,6 @@ static const struct hid_device_id lg_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500), .driver_data = LG_IGNORE_DOUBLED_WHEEL | LG_EXPANDED_KEYMAP }, - { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_LX3), - .driver_data = LG_INVERT_HWHEEL }, - { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_V150), - .driver_data = LG_INVERT_HWHEEL }, - { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D), .driver_data = LG_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL), diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 3af8095a7de..86e563b8d64 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -4,9 +4,9 @@ * Copyright (c) 1999 Andreas Gal * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc - * Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2007 Paul Walmsley * Copyright (c) 2008 Jiri Slaby + * Copyright (c) 2006-2008 Jiri Kosina */ /* @@ -23,6 +23,26 @@ #include "hid-ids.h" +#define VAIO_RDESC_CONSTANT 0x0001 + +struct sony_sc { + unsigned long quirks; +}; + +/* Sony Vaio VGX has wrongly mouse pointer declared as constant */ +static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, + unsigned int rsize) +{ + struct sony_sc *sc = hid_get_drvdata(hdev); + + if ((sc->quirks & VAIO_RDESC_CONSTANT) && + rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) { + dev_info(&hdev->dev, "Fixing up Sony Vaio VGX report " + "descriptor\n"); + rdesc[55] = 0x06; + } +} + /* * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller * to "operational". Without this, the ps3 controller will not report any @@ -56,6 +76,17 @@ static int sony_set_operational(struct hid_device *hdev) static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) { int ret; + unsigned long quirks = id->driver_data; + struct sony_sc *sc; + + sc = kzalloc(sizeof(*sc), GFP_KERNEL); + if (sc == NULL) { + dev_err(&hdev->dev, "can't alloc apple descriptor\n"); + return -ENOMEM; + } + + sc->quirks = quirks; + hid_set_drvdata(hdev, sc); ret = hid_parse(hdev); if (ret) { @@ -78,11 +109,20 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) err_stop: hid_hw_stop(hdev); err_free: + kfree(sc); return ret; } +static void sony_remove(struct hid_device *hdev) +{ + hid_hw_stop(hdev); + kfree(hid_get_drvdata(hdev)); +} + static const struct hid_device_id sony_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE), + .driver_data = VAIO_RDESC_CONSTANT }, { } }; MODULE_DEVICE_TABLE(hid, sony_devices); @@ -91,6 +131,8 @@ static struct hid_driver sony_driver = { .name = "sony", .id_table = sony_devices, .probe = sony_probe, + .remove = sony_remove, + .report_fixup = sony_report_fixup, }; static int sony_init(void) diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index af3edb98df4..894d52e05bf 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -264,6 +264,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, default: ret = -ENOTTY; } + unlock_kernel(); return ret; } @@ -403,7 +404,7 @@ out: return result; } -void __exit hidraw_exit(void) +void hidraw_exit(void) { dev_t dev_id = MKDEV(hidraw_major, 0); diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 705a43cdeea..42bdd83444c 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -972,6 +972,9 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) hid->vendor = le16_to_cpu(dev->descriptor.idVendor); hid->product = le16_to_cpu(dev->descriptor.idProduct); hid->name[0] = 0; + if (intf->cur_altsetting->desc.bInterfaceProtocol == + USB_INTERFACE_PROTOCOL_MOUSE) + hid->type = HID_TYPE_USBMOUSE; if (dev->manufacturer) strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index babd65dd46a..3ac320785fc 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -436,8 +436,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, if (copy_to_user(user_arg, uref, sizeof(*uref))) goto fault; - kfree(uref_multi); - return 0; + goto goodreturn; default: if (cmd != HIDIOCGUSAGE && diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index d9e7a49d6cb..70bb854086d 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c @@ -178,7 +178,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM", 26, 1, 1, 1, 0 }, { "CPU Fan", 32, 2, 60, 1, 0 }, { "NB Fan", 33, 2, 60, 1, 0 }, @@ -200,7 +200,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM1", 26, 1, 1, 1, 0 }, { "PWM2", 27, 1, 1, 1, 0 }, { "PWM3", 28, 1, 1, 1, 0 }, @@ -229,7 +229,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM", 26, 1, 1, 1, 0 }, { "CPU Fan", 32, 2, 60, 1, 0 }, { "NB Fan", 33, 2, 60, 1, 0 }, @@ -250,7 +250,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM", 26, 1, 1, 1, 0 }, { "CPU Fan", 32, 2, 60, 1, 0 }, { "NB Fan", 33, 2, 60, 1, 0 }, @@ -342,7 +342,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM1", 26, 1, 1, 1, 0 }, { "PWM2", 27, 1, 1, 1, 0 }, { "PWM3", 28, 1, 1, 1, 0 }, @@ -371,7 +371,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM", 26, 1, 1, 1, 0 }, { "CPU Fan", 32, 2, 60, 1, 0 }, { "NB Fan", 33, 2, 60, 1, 0 }, @@ -402,7 +402,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX3 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0016, NULL /* AW9D-MAX, need DMI string */, { + { 0x0016, "AW9D-MAX (Intel i975-ICH7)", { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -416,7 +416,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM1", 26, 1, 1, 1, 0 }, { "PWM2", 27, 1, 1, 1, 0 }, { "PWM3", 28, 1, 1, 1, 0 }, @@ -446,7 +446,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "ATX +3.3V", 10, 0, 20, 1, 0 }, { "ATX 5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 26, 1, 1, 1, 0 }, + { "System", 26, 1, 1, 1, 0 }, { "PWM", 27, 1, 1, 1, 0 }, { "CPU FAN", 32, 2, 60, 1, 0 }, { "SYS FAN", 34, 2, 60, 1, 0 }, @@ -469,7 +469,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM Phase1", 26, 1, 1, 1, 0 }, { "PWM Phase2", 27, 1, 1, 1, 0 }, { "PWM Phase3", 28, 1, 1, 1, 0 }, @@ -487,7 +487,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "DDR2", 13, 0, 20, 1, 0 }, { "DDR2 VTT", 14, 0, 10, 1, 0 }, { "CPU VTT", 3, 0, 20, 1, 0 }, - { "NB 1.2V ", 4, 0, 10, 1, 0 }, + { "NB 1.2V", 4, 0, 10, 1, 0 }, { "SB 1.5V", 6, 0, 10, 1, 0 }, { "HyperTransport", 5, 0, 10, 1, 0 }, { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, @@ -496,7 +496,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "ATX +3.3V", 10, 0, 20, 1, 0 }, { "ATX 5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, { "PWM Phase1", 26, 1, 1, 1, 0 }, { "PWM Phase2", 27, 1, 1, 1, 0 }, { "PWM Phase3", 28, 1, 1, 1, 0 }, @@ -523,8 +523,8 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "+3.3V", 10, 0, 20, 1, 0 }, { "5VSB", 11, 0, 30, 1, 0 }, { "CPU", 24, 1, 1, 1, 0 }, - { "System ", 25, 1, 1, 1, 0 }, - { "PWM ", 26, 1, 1, 1, 0 }, + { "System", 25, 1, 1, 1, 0 }, + { "PWM", 26, 1, 1, 1, 0 }, { "PWM Phase2", 27, 1, 1, 1, 0 }, { "PWM Phase3", 28, 1, 1, 1, 0 }, { "PWM Phase4", 29, 1, 1, 1, 0 }, @@ -947,7 +947,7 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) if (!abituguru3_motherboards[i].dmi_name) { printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " "not detected using DMI. Please send the output of " - "\"dmidecode\" to the abituguru3 maintainer" + "\"dmidecode\" to the abituguru3 maintainer " "(see MAINTAINERS)\n"); } #endif diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index 3a0b6313647..b9a8ea30c99 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c @@ -319,35 +319,24 @@ out: } /* - * On this chip, voltages are given as a count of steps between a minimum - * and maximum voltage, not a direct voltage. + * Conversions */ -static const int volt_convert_table[][2] = { - {2997, 3}, - {4395, 4}, + +/* IN are scaled acording to built-in resistors */ +static const int adt7473_scaling[] = { /* .001 Volts */ + 2250, 3300 }; +#define SCALE(val, from, to) (((val) * (to) + ((from) / 2)) / (from)) static int decode_volt(int volt_index, u8 raw) { - int cmax = volt_convert_table[volt_index][0]; - int cmin = volt_convert_table[volt_index][1]; - return ((raw * (cmax - cmin)) / 255) + cmin; + return SCALE(raw, 192, adt7473_scaling[volt_index]); } static u8 encode_volt(int volt_index, int cooked) { - int cmax = volt_convert_table[volt_index][0]; - int cmin = volt_convert_table[volt_index][1]; - u8 x; - - if (cooked > cmax) - cooked = cmax; - else if (cooked < cmin) - cooked = cmin; - - x = ((cooked - cmin) * 255) / (cmax - cmin); - - return x; + int raw = SCALE(cooked, adt7473_scaling[volt_index], 192); + return SENSORS_LIMIT(raw, 0, 255); } static ssize_t show_volt_min(struct device *dev, diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index c54eff92be4..bfc296145bb 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c @@ -180,6 +180,7 @@ static struct vrm_model vrm_models[] = { {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ + {X86_VENDOR_AMD, 0x10, ANY, ANY, 25}, /* NPT family 10h */ {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 3edeebc0b83..96a70186672 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -12,9 +12,9 @@ * made by National Semiconductor. Both have an increased remote * temperature measurement accuracy (1 degree), and the LM99 * additionally shifts remote temperatures (measured and limits) by 16 - * degrees, which allows for higher temperatures measurement. The - * driver doesn't handle it since it can be done easily in user-space. + * degrees, which allows for higher temperatures measurement. * Note that there is no way to differentiate between both chips. + * When device is auto-detected, the driver will assume an LM99. * * This driver also supports the LM86, another sensor chip made by * National Semiconductor. It is exactly similar to the LM90 except it @@ -169,8 +169,8 @@ static const struct i2c_device_id lm90_id[] = { { "adt7461", adt7461 }, { "lm90", lm90 }, { "lm86", lm86 }, - { "lm89", lm99 }, - { "lm99", lm99 }, /* Missing temperature offset */ + { "lm89", lm86 }, + { "lm99", lm99 }, { "max6646", max6646 }, { "max6647", max6646 }, { "max6649", max6646 }, @@ -366,6 +366,10 @@ static ssize_t show_temp8(struct device *dev, struct device_attribute *devattr, else temp = temp_from_s8(data->temp8[attr->index]); + /* +16 degrees offset for temp2 for the LM99 */ + if (data->kind == lm99 && attr->index == 3) + temp += 16000; + return sprintf(buf, "%d\n", temp); } @@ -385,6 +389,10 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr, long val = simple_strtol(buf, NULL, 10); int nr = attr->index; + /* +16 degrees offset for temp2 for the LM99 */ + if (data->kind == lm99 && attr->index == 3) + val -= 16000; + mutex_lock(&data->update_lock); if (data->kind == adt7461) data->temp8[nr] = temp_to_u8_adt7461(data, val); @@ -411,6 +419,10 @@ static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr, else temp = temp_from_s16(data->temp11[attr->index]); + /* +16 degrees offset for temp2 for the LM99 */ + if (data->kind == lm99 && attr->index <= 2) + temp += 16000; + return sprintf(buf, "%d\n", temp); } @@ -432,6 +444,10 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr, long val = simple_strtol(buf, NULL, 10); int nr = attr->index; + /* +16 degrees offset for temp2 for the LM99 */ + if (data->kind == lm99 && attr->index <= 2) + val -= 16000; + mutex_lock(&data->update_lock); if (data->kind == adt7461) data->temp11[nr] = temp_to_u16_adt7461(data, val); @@ -461,9 +477,15 @@ static ssize_t show_temphyst(struct device *dev, struct device_attribute *devatt if (data->kind == adt7461) temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); + else if (data->kind == max6646) + temp = temp_from_u8(data->temp8[attr->index]); else temp = temp_from_s8(data->temp8[attr->index]); + /* +16 degrees offset for temp2 for the LM99 */ + if (data->kind == lm99 && attr->index == 3) + temp += 16000; + return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); } @@ -473,12 +495,19 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy, struct i2c_client *client = to_i2c_client(dev); struct lm90_data *data = i2c_get_clientdata(client); long val = simple_strtol(buf, NULL, 10); - long hyst; + int temp; mutex_lock(&data->update_lock); - hyst = temp_from_s8(data->temp8[2]) - val; + if (data->kind == adt7461) + temp = temp_from_u8_adt7461(data, data->temp8[2]); + else if (data->kind == max6646) + temp = temp_from_u8(data->temp8[2]); + else + temp = temp_from_s8(data->temp8[2]); + + data->temp_hyst = hyst_to_reg(temp - val); i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, - hyst_to_reg(hyst)); + data->temp_hyst); mutex_unlock(&data->update_lock); return count; } @@ -682,6 +711,15 @@ static int lm90_detect(struct i2c_client *new_client, int kind, } else if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ kind = lm99; + dev_info(&adapter->dev, + "Assuming LM99 chip at " + "0x%02x\n", address); + dev_info(&adapter->dev, + "If it is an LM89, pass " + "force_lm86=%d,0x%02x when " + "loading the lm90 driver\n", + i2c_adapter_id(adapter), + address); } else if (address == 0x4C && (chip_id & 0xF0) == 0x10) { /* LM86 */ diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index d4d1b859d4f..fc12bd412e3 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c @@ -1968,7 +1968,7 @@ exit: return res; } -static void __exit +static void w83781d_isa_unregister(void) { if (pdev) { @@ -2017,7 +2017,7 @@ w83781d_isa_register(void) return 0; } -static void __exit +static void w83781d_isa_unregister(void) { } diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c index 76bdc9a27f6..2d848010499 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c @@ -690,9 +690,9 @@ static int __init icside_init(void) return ecard_register_driver(&icside_driver); } -static void __exit icside_exit(void); +static void __exit icside_exit(void) { - ecard_unregister_driver(&icside_driver); + ecard_remove_driver(&icside_driver); } MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); diff --git a/drivers/ide/rapide.c b/drivers/ide/rapide.c index 78d27d9ae43..d5003ca6980 100644 --- a/drivers/ide/rapide.c +++ b/drivers/ide/rapide.c @@ -11,7 +11,7 @@ #include <asm/ecard.h> -static struct const ide_port_info rapide_port_info = { +static const struct ide_port_info rapide_port_info = { .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, }; @@ -97,7 +97,7 @@ static int __init rapide_init(void) static void __exit rapide_exit(void) { - ecard_unregister_driver(&rapide_driver); + ecard_remove_driver(&rapide_driver); } MODULE_LICENSE("GPL"); diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index f5b26dd579e..108264de0ac 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -5,12 +5,13 @@ config I7300_IDLE_IOAT_CHANNEL bool config I7300_IDLE - tristate "Intel chipset idle power saving driver" + tristate "Intel chipset idle memory power saving driver" select I7300_IDLE_IOAT_CHANNEL - depends on X86_64 + depends on X86_64 && EXPERIMENTAL help - Enable idle power savings with certain Intel server chipsets. - The chipset must have I/O AT support, such as the Intel 7300. - The power savings depends on the type and quantity of DRAM devices. + Enable memory power savings when idle with certain Intel server + chipsets. The chipset must have I/O AT support, such as the + Intel 7300. The power savings depends on the type and quantity of + DRAM devices. endmenu diff --git a/drivers/idle/i7300_idle.c b/drivers/idle/i7300_idle.c index 59d1bbc3cd3..fb176f6ef9f 100644 --- a/drivers/idle/i7300_idle.c +++ b/drivers/idle/i7300_idle.c @@ -25,6 +25,7 @@ #include <linux/delay.h> #include <linux/debugfs.h> #include <linux/stop_machine.h> +#include <linux/i7300_idle.h> #include <asm/idle.h> @@ -34,6 +35,8 @@ #define I7300_IDLE_DRIVER_VERSION "1.55" #define I7300_PRINT "i7300_idle:" +#define MAX_STOP_RETRIES 10 + static int debug; module_param_named(debug, debug, uint, 0644); MODULE_PARM_DESC(debug, "Enable debug printks in this driver"); @@ -46,12 +49,12 @@ MODULE_PARM_DESC(debug, "Enable debug printks in this driver"); * 0 = No throttling * 1 = Throttle when > 4 activations per eval window (Maximum throttling) * 2 = Throttle when > 8 activations - * 168 = Throttle when > 168 activations (Minimum throttling) + * 168 = Throttle when > 672 activations (Minimum throttling) */ -#define MAX_THRTLWLIMIT 168 -static uint i7300_idle_thrtlowlm = 1; -module_param_named(thrtlwlimit, i7300_idle_thrtlowlm, uint, 0644); -MODULE_PARM_DESC(thrtlwlimit, +#define MAX_THROTTLE_LOW_LIMIT 168 +static uint throttle_low_limit = 1; +module_param_named(throttle_low_limit, throttle_low_limit, uint, 0644); +MODULE_PARM_DESC(throttle_low_limit, "Value for THRTLOWLM activation field " "(0 = disable throttle, 1 = Max throttle, 168 = Min throttle)"); @@ -110,9 +113,9 @@ static int i7300_idle_ioat_start(void) static void i7300_idle_ioat_stop(void) { int i; - u8 sts; + u64 sts; - for (i = 0; i < 5; i++) { + for (i = 0; i < MAX_STOP_RETRIES; i++) { writeb(IOAT_CHANCMD_RESET, ioat_chanbase + IOAT1_CHANCMD_OFFSET); @@ -126,9 +129,10 @@ static void i7300_idle_ioat_stop(void) } - if (i == 5) - dprintk("failed to suspend+reset I/O AT after 5 retries\n"); - + if (i == MAX_STOP_RETRIES) { + dprintk("failed to stop I/O AT after %d retries\n", + MAX_STOP_RETRIES); + } } /* Test I/O AT by copying 1024 byte from 2k to 1k */ @@ -275,7 +279,7 @@ static void __exit i7300_idle_ioat_exit(void) i7300_idle_ioat_stop(); /* Wait for a while for the channel to halt before releasing */ - for (i = 0; i < 10; i++) { + for (i = 0; i < MAX_STOP_RETRIES; i++) { writeb(IOAT_CHANCMD_RESET, ioat_chanbase + IOAT1_CHANCMD_OFFSET); @@ -389,9 +393,9 @@ static void i7300_idle_start(void) new_ctl = i7300_idle_thrtctl_saved & ~DIMM_THRTCTL_THRMHUNT; pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl); - limit = i7300_idle_thrtlowlm; - if (unlikely(limit > MAX_THRTLWLIMIT)) - limit = MAX_THRTLWLIMIT; + limit = throttle_low_limit; + if (unlikely(limit > MAX_THROTTLE_LOW_LIMIT)) + limit = MAX_THROTTLE_LOW_LIMIT; pci_write_config_byte(fbd_dev, DIMM_THRTLOW, limit); @@ -440,7 +444,7 @@ static int i7300_idle_notifier(struct notifier_block *nb, unsigned long val, static ktime_t idle_begin_time; static int time_init = 1; - if (!i7300_idle_thrtlowlm) + if (!throttle_low_limit) return 0; if (unlikely(time_init)) { @@ -505,77 +509,8 @@ static struct notifier_block i7300_idle_nb = { .notifier_call = i7300_idle_notifier, }; -/* - * I/O AT controls (PCI bus 0 device 8 function 0) - * DIMM controls (PCI bus 0 device 16 function 1) - */ -#define IOAT_BUS 0 -#define IOAT_DEVFN PCI_DEVFN(8, 0) -#define MEMCTL_BUS 0 -#define MEMCTL_DEVFN PCI_DEVFN(16, 1) - -struct fbd_ioat { - unsigned int vendor; - unsigned int ioat_dev; -}; - -/* - * The i5000 chip-set has the same hooks as the i7300 - * but support is disabled by default because this driver - * has not been validated on that platform. - */ -#define SUPPORT_I5000 0 - -static const struct fbd_ioat fbd_ioat_list[] = { - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB}, -#if SUPPORT_I5000 - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT}, -#endif - {0, 0} -}; - -/* table of devices that work with this driver */ -static const struct pci_device_id pci_tbl[] = { - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) }, -#if SUPPORT_I5000 - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) }, -#endif - { } /* Terminating entry */ -}; - MODULE_DEVICE_TABLE(pci, pci_tbl); -/* Check for known platforms with I/O-AT */ -static int __init i7300_idle_platform_probe(void) -{ - int i; - - fbd_dev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN); - if (!fbd_dev) - return -ENODEV; - - for (i = 0; pci_tbl[i].vendor != 0; i++) { - if (fbd_dev->vendor == pci_tbl[i].vendor && - fbd_dev->device == pci_tbl[i].device) { - break; - } - } - if (pci_tbl[i].vendor == 0) - return -ENODEV; - - ioat_dev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN); - if (!ioat_dev) - return -ENODEV; - - for (i = 0; fbd_ioat_list[i].vendor != 0; i++) { - if (ioat_dev->vendor == fbd_ioat_list[i].vendor && - ioat_dev->device == fbd_ioat_list[i].ioat_dev) { - return 0; - } - } - return -ENODEV; -} - int stats_open_generic(struct inode *inode, struct file *fp) { fp->private_data = inode->i_private; @@ -617,7 +552,7 @@ static int __init i7300_idle_init(void) cpus_clear(idle_cpumask); total_us = 0; - if (i7300_idle_platform_probe()) + if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev)) return -ENODEV; if (i7300_idle_thrt_save()) diff --git a/drivers/leds/leds-hp-disk.c b/drivers/leds/leds-hp-disk.c index 53a25b1c2da..74645ab1566 100644 --- a/drivers/leds/leds-hp-disk.c +++ b/drivers/leds/leds-hp-disk.c @@ -49,7 +49,7 @@ static struct acpi_hpled adev; static acpi_status hpled_acpi_write(acpi_handle handle, int reg) { - unsigned long ret; /* Not used when writing */ + unsigned long long ret; /* Not used when writing */ union acpi_object in_obj[1]; struct acpi_object_list args = { 1, in_obj }; diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 2b4e975770f..4b7cb389dc4 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -1915,92 +1915,6 @@ static void rtl_disable_msi(struct pci_dev *pdev, struct rtl8169_private *tp) } } -static int rtl_eeprom_read(struct pci_dev *pdev, int cap, int addr, __le32 *val) -{ - int ret, count = 100; - u16 status = 0; - u32 value; - - ret = pci_write_config_word(pdev, cap + PCI_VPD_ADDR, addr); - if (ret < 0) - return ret; - - do { - udelay(10); - ret = pci_read_config_word(pdev, cap + PCI_VPD_ADDR, &status); - if (ret < 0) - return ret; - } while (!(status & PCI_VPD_ADDR_F) && --count); - - if (!(status & PCI_VPD_ADDR_F)) - return -ETIMEDOUT; - - ret = pci_read_config_dword(pdev, cap + PCI_VPD_DATA, &value); - if (ret < 0) - return ret; - - *val = cpu_to_le32(value); - - return 0; -} - -static void rtl_init_mac_address(struct rtl8169_private *tp, - void __iomem *ioaddr) -{ - struct pci_dev *pdev = tp->pci_dev; - int vpd_cap; - __le32 sig; - u8 mac[8]; - u8 cfg1; - - cfg1 = RTL_R8(Config1); - if (!(cfg1 & VPD)) { - if (netif_msg_probe(tp)) - dev_info(&pdev->dev, "VPD access disabled, enabling\n"); - RTL_W8(Cfg9346, Cfg9346_Unlock); - RTL_W8(Config1, cfg1 | VPD); - RTL_W8(Cfg9346, Cfg9346_Lock); - } - - vpd_cap = pci_find_capability(pdev, PCI_CAP_ID_VPD); - if (!vpd_cap) - return; - - if (rtl_eeprom_read(pdev, vpd_cap, RTL_EEPROM_SIG_ADDR, &sig) < 0) - return; - - if ((sig & RTL_EEPROM_SIG_MASK) != RTL_EEPROM_SIG) { - dev_info(&pdev->dev, "Missing EEPROM signature: %08x\n", sig); - return; - } - - /* - * MAC address is stored in EEPROM at offset 0x0e - * Realtek says: "The VPD address does not have to be a DWORD-aligned - * address as defined in the PCI 2.2 Specifications, but the VPD data - * is always consecutive 4-byte data starting from the VPD address - * specified." - */ - if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 || - rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) { - if (netif_msg_probe(tp)) { - dev_warn(&pdev->dev, - "reading MAC address from EEPROM failed\n"); - } - return; - } - - if (netif_msg_probe(tp)) { - DECLARE_MAC_BUF(buf); - - dev_info(&pdev->dev, "MAC address found in EEPROM: %s\n", - print_mac(buf, mac)); - } - - if (is_valid_ether_addr(mac)) - rtl_rar_set(tp, mac); -} - static int __devinit rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -2178,8 +2092,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) tp->mmio_addr = ioaddr; - rtl_init_mac_address(tp, ioaddr); - /* Get MAC address */ for (i = 0; i < MAC_ADDR_LEN; i++) dev->dev_addr[i] = RTL_R8(MAC0 + i); diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index dfe7c8e1b18..b3a63edb690 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -83,6 +83,9 @@ static acpi_status acpi_run_osc(acpi_handle handle, if (ACPI_FAILURE(status)) return status; + if (!output.length) + return AE_NULL_OBJECT; + out_obj = output.pointer; if (out_obj->type != ACPI_TYPE_BUFFER) { printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); |