diff --git a/.gitignore b/.gitignore index c2fd41347..8043b138c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ +kernel-3.*/ diff --git a/Makefile b/Makefile index 705670ff1..7bc3839f8 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,6 @@ debug: @perl -pi -e 's/# CONFIG_KDB_KEYBOARD is not set/CONFIG_KDB_KEYBOARD=y/' config-nodebug @perl -pi -e 's/# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set/CONFIG_CPU_NOTIFIER_ERROR_INJECT=m/' config-nodebug @perl -pi -e 's/# CONFIG_DEBUG_PER_CPU_MAPS is not set/CONFIG_DEBUG_PER_CPU_MAPS=y/' config-nodebug - @perl -pi -e 's/CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y/# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set/' config-nodebug #@perl -pi -e 's/# CONFIG_PCI_DEFAULT_USE_CRS is not set/CONFIG_PCI_DEFAULT_USE_CRS=y/' config-nodebug @perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set/CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y/' config-nodebug @perl -pi -e 's/# CONFIG_TEST_LIST_SORT is not set/CONFIG_TEST_LIST_SORT=y/' config-nodebug @@ -168,7 +167,6 @@ release: #@perl -pi -e 's/CONFIG_KGDB_KDB=y/# CONFIG_KGDB_KDB is not set/' config-nodebug #@perl -pi -e 's/CONFIG_KDB_KEYBOARD=y/# CONFIG_KDB_KEYBOARD is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_PER_CPU_MAPS=y/# CONFIG_DEBUG_PER_CPU_MAPS is not set/' config-nodebug - @perl -pi -e 's/# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set/CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y/' config-nodebug #@perl -pi -e 's/CONFIG_PCI_DEFAULT_USE_CRS=y/# CONFIG_PCI_DEFAULT_USE_CRS is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y/# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set/' config-nodebug @perl -pi -e 's/CONFIG_TEST_LIST_SORT=y/# CONFIG_TEST_LIST_SORT is not set/' config-nodebug diff --git a/TODO b/TODO deleted file mode 100644 index abaefae05..000000000 --- a/TODO +++ /dev/null @@ -1,61 +0,0 @@ -# Put stuff likely to go upstream (in decreasing likelyhood) at the top. -# - -* linux-2.6-firewire-git-update.patch - perpetual updates from git trees. - -* linux-2.6-compile-fixes.patch -* linux-2.6-hotfixes.patch - Empty - -* linux-2.6-build-nonintconfig.patch -* linux-2.6-debug-nmi-timeout.patch -* linux-2.6-debug-spinlock-taint.patch -* linux-2.6-debug-taint-vm.patch -* linux-2.6-debug-vm-would-have-oomkilled.patch - TODO: Push upstream - -* linux-2.6-acpi-video-dos.patch -* linux-2.6-defaults-acpi-video.patch - Fedora policy decisions - Turn into CONFIG_ options and upstream ? - -* linux-2.6-crash-driver.patch - Unlikely to go upstream. - https://bugzilla.redhat.com/show_bug.cgi?id=492803 - -* linux-2.6-debug-always-inline-kzalloc.patch - Sent upstream Sep 25 2008 - -* linux-2.6-debug-sizeof-structs.patch - Fedora local debug stuff. - -* linux-2.6-utrace.patch - utrace - -* linux-2.6-defaults-pci_no_msi.patch - Fedora local choices uninteresting to upstream - -* linux-2.6-input-kill-stupid-messages.patch -* linux-2.6-silence-acpi-blacklist.patch -* linux-2.6-silence-fbcon-logo.patch -* linux-2.6-silence-noise.patch - Fedora local 'hush' patches. (Some will go upstream next time) - -* linux-2.6-execshield.patch - Not interesting to upstream. - -* lirc-2.6.33.patch -* hdpvr-ir-enable.patch - jarod working on upstreaming - -* linux-2.6-selinux-mprotect-checks.patch -* linux-2.6-sparc-selinux-mprotect-checks.patch - Newer version might go upstream at some point. - -* linux-2.6-serial-460800.patch - Probably not upstreamable. - http://marc.theaimsgroup.com/?l=linux-kernel&m=112687270832687&w=2 - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=126403 - http://lkml.org/lkml/2006/8/2/208 - diff --git a/acpi_reboot.patch b/acpi_reboot.patch deleted file mode 100644 index a980b31f7..000000000 --- a/acpi_reboot.patch +++ /dev/null @@ -1,102 +0,0 @@ -Improve our reboot handling for compatibility with Windows. Upstream in .38? - -diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c -index c495aa8..c770e66 100644 ---- a/arch/x86/kernel/reboot.c -+++ b/arch/x86/kernel/reboot.c -@@ -34,7 +34,7 @@ EXPORT_SYMBOL(pm_power_off); - - static const struct desc_ptr no_idt = {}; - static int reboot_mode; --enum reboot_type reboot_type = BOOT_KBD; -+enum reboot_type reboot_type = BOOT_ACPI; - int reboot_force; - - #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) -@@ -538,9 +538,23 @@ void __attribute__((weak)) mach_reboot_fixups(void) - { - } - -+/* -+ * Windows does the following on reboot: -+ * 1) If the FADT has the ACPI reboot register flag set, try it -+ * 2) If still alive, write to the keyboard controller -+ * 3) If still alive, write to the ACPI reboot register again -+ * 4) Ig still alive, write to the keyboard controller again -+ * -+ * If the machine is still alive at this stage, it gives up. We default to -+ * following the same pattern, except that if we're still alive after (4) we'll -+ * try to force a triple fault and then cycle between hitting the keyboard -+ * controller and doing that -+ */ - static void native_machine_emergency_restart(void) - { - int i; -+ int attempt = 0; -+ int orig_reboot_type = reboot_type; - - if (reboot_emergency) - emergency_vmx_disable_all(); -@@ -562,6 +576,13 @@ static void native_machine_emergency_restart(void) - outb(0xfe, 0x64); /* pulse reset low */ - udelay(50); - } -+ if (attempt == 0 && orig_reboot_type == BOOT_ACPI) { -+ attempt = 1; -+ reboot_type = BOOT_ACPI; -+ } else { -+ reboot_type = BOOT_TRIPLE; -+ } -+ break; - - case BOOT_TRIPLE: - load_idt(&no_idt); -diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c -index 50cc3be..c6a4e63 100644 ---- a/drivers/acpi/acpica/hwxface.c -+++ b/drivers/acpi/acpica/hwxface.c -@@ -82,12 +82,11 @@ acpi_status acpi_reset(void) - /* - * For I/O space, write directly to the OSL. This bypasses the port - * validation mechanism, which may block a valid write to the reset -- * register. -+ * register. Spec section 4.7.3.6 requires register width to be 8. - */ - status = - acpi_os_write_port((acpi_io_address) reset_reg->address, -- acpi_gbl_FADT.reset_value, -- reset_reg->bit_width); -+ acpi_gbl_FADT.reset_value, 8); - } else { - /* Write the reset value to the reset register */ - -diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c -index 93f9114..a6c77e8b 100644 ---- a/drivers/acpi/reboot.c -+++ b/drivers/acpi/reboot.c -@@ -15,9 +15,15 @@ void acpi_reboot(void) - - rr = &acpi_gbl_FADT.reset_register; - -- /* Is the reset register supported? */ -- if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) || -- rr->bit_width != 8 || rr->bit_offset != 0) -+ /* ACPI reset register was only introduced with v2 of the FADT */ -+ -+ if (acpi_gbl_FADT.header.revision < 2) -+ return; -+ -+ /* Is the reset register supported? The spec says we should be -+ * checking the bit width and bit offset, but Windows ignores -+ * these fields */ -+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER)) - return; - - reset_value = acpi_gbl_FADT.reset_value; -@@ -45,6 +51,4 @@ void acpi_reboot(void) - acpi_reset(); - break; - } -- /* Wait ten seconds */ -- acpi_os_stall(10000000); - } diff --git a/add-appleir-usb-driver.patch b/add-appleir-usb-driver.patch index 61edb8061..af4f968f6 100644 --- a/add-appleir-usb-driver.patch +++ b/add-appleir-usb-driver.patch @@ -99,9 +99,9 @@ index baa25ad..abc5bd7 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1244,8 +1244,6 @@ static const struct hid_device_id hid_blacklist[] = { - #if defined(CONFIG_HID_ACRUX_FF) || defined(CONFIG_HID_ACRUX_FF_MODULE) + { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) }, + { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) }, { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) }, - #endif - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) }, diff --git a/apple_backlight.patch b/apple_backlight.patch deleted file mode 100644 index c7d5a8191..000000000 --- a/apple_backlight.patch +++ /dev/null @@ -1,688 +0,0 @@ -Various fixes to the Apple backlight driver. Upstream in .38? - -diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig -index e54a337..fb5df46 100644 ---- a/drivers/video/backlight/Kconfig -+++ b/drivers/video/backlight/Kconfig -@@ -236,12 +236,12 @@ config BACKLIGHT_MAX8925 - If you have a LCD backlight connected to the WLED output of MAX8925 - WLED output, say Y here to enable this driver. - --config BACKLIGHT_MBP_NVIDIA -- tristate "MacBook Pro Nvidia Backlight Driver" -+config BACKLIGHT_APPLE -+ tristate "Apple Backlight Driver" - depends on X86 - help -- If you have an Apple Macbook Pro with Nvidia graphics hardware say Y -- to enable a driver for its backlight -+ If you have an Intel-based Apple say Y to enable a driver for its -+ backlight - - config BACKLIGHT_TOSA - tristate "Sharp SL-6000 Backlight Driver" -diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile -index 44c0f81..ebaecc0 100644 ---- a/drivers/video/backlight/Makefile -+++ b/drivers/video/backlight/Makefile -@@ -26,7 +26,7 @@ obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o - obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o - obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o - obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o --obj-$(CONFIG_BACKLIGHT_MBP_NVIDIA) += mbp_nvidia_bl.o -+obj-$(CONFIG_BACKLIGHT_APPLE) += apple_bl.o - obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o - obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o - obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o -diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c -new file mode 100644 -index 0000000..8f808c7 ---- /dev/null -+++ b/drivers/video/backlight/apple_bl.c -@@ -0,0 +1,240 @@ -+/* -+ * Backlight Driver for Intel-based Apples -+ * -+ * Copyright (c) Red Hat -+ * Based on code from Pommed: -+ * Copyright (C) 2006 Nicolas Boichat -+ * Copyright (C) 2006 Felipe Alfaro Solana -+ * Copyright (C) 2007 Julien BLACHE -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * This driver triggers SMIs which cause the firmware to change the -+ * backlight brightness. This is icky in many ways, but it's impractical to -+ * get at the firmware code in order to figure out what it's actually doing. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct backlight_device *apple_backlight_device; -+ -+struct hw_data { -+ /* I/O resource to allocate. */ -+ unsigned long iostart; -+ unsigned long iolen; -+ /* Backlight operations structure. */ -+ const struct backlight_ops backlight_ops; -+ void (*set_brightness)(int); -+}; -+ -+static const struct hw_data *hw_data; -+ -+#define DRIVER "apple_backlight: " -+ -+/* Module parameters. */ -+static int debug; -+module_param_named(debug, debug, int, 0644); -+MODULE_PARM_DESC(debug, "Set to one to enable debugging messages."); -+ -+/* -+ * Implementation for machines with Intel chipset. -+ */ -+static void intel_chipset_set_brightness(int intensity) -+{ -+ outb(0x04 | (intensity << 4), 0xb3); -+ outb(0xbf, 0xb2); -+} -+ -+static int intel_chipset_send_intensity(struct backlight_device *bd) -+{ -+ int intensity = bd->props.brightness; -+ -+ if (debug) -+ printk(KERN_DEBUG DRIVER "setting brightness to %d\n", -+ intensity); -+ -+ intel_chipset_set_brightness(intensity); -+ return 0; -+} -+ -+static int intel_chipset_get_intensity(struct backlight_device *bd) -+{ -+ int intensity; -+ -+ outb(0x03, 0xb3); -+ outb(0xbf, 0xb2); -+ intensity = inb(0xb3) >> 4; -+ -+ if (debug) -+ printk(KERN_DEBUG DRIVER "read brightness of %d\n", -+ intensity); -+ -+ return intensity; -+} -+ -+static const struct hw_data intel_chipset_data = { -+ .iostart = 0xb2, -+ .iolen = 2, -+ .backlight_ops = { -+ .options = BL_CORE_SUSPENDRESUME, -+ .get_brightness = intel_chipset_get_intensity, -+ .update_status = intel_chipset_send_intensity, -+ }, -+ .set_brightness = intel_chipset_set_brightness, -+}; -+ -+/* -+ * Implementation for machines with Nvidia chipset. -+ */ -+static void nvidia_chipset_set_brightness(int intensity) -+{ -+ outb(0x04 | (intensity << 4), 0x52f); -+ outb(0xbf, 0x52e); -+} -+ -+static int nvidia_chipset_send_intensity(struct backlight_device *bd) -+{ -+ int intensity = bd->props.brightness; -+ -+ if (debug) -+ printk(KERN_DEBUG DRIVER "setting brightness to %d\n", -+ intensity); -+ -+ nvidia_chipset_set_brightness(intensity); -+ return 0; -+} -+ -+static int nvidia_chipset_get_intensity(struct backlight_device *bd) -+{ -+ int intensity; -+ -+ outb(0x03, 0x52f); -+ outb(0xbf, 0x52e); -+ intensity = inb(0x52f) >> 4; -+ -+ if (debug) -+ printk(KERN_DEBUG DRIVER "read brightness of %d\n", -+ intensity); -+ -+ return intensity; -+} -+ -+static const struct hw_data nvidia_chipset_data = { -+ .iostart = 0x52e, -+ .iolen = 2, -+ .backlight_ops = { -+ .options = BL_CORE_SUSPENDRESUME, -+ .get_brightness = nvidia_chipset_get_intensity, -+ .update_status = nvidia_chipset_send_intensity -+ }, -+ .set_brightness = nvidia_chipset_set_brightness, -+}; -+ -+static int __devinit apple_bl_add(struct acpi_device *dev) -+{ -+ struct backlight_properties props; -+ struct pci_dev *host; -+ int intensity; -+ -+ host = pci_get_bus_and_slot(0, 0); -+ -+ if (!host) { -+ printk(KERN_ERR DRIVER "unable to find PCI host\n"); -+ return -ENODEV; -+ } -+ -+ if (host->vendor == PCI_VENDOR_ID_INTEL) -+ hw_data = &intel_chipset_data; -+ else if (host->vendor == PCI_VENDOR_ID_NVIDIA) -+ hw_data = &nvidia_chipset_data; -+ -+ pci_dev_put(host); -+ -+ if (!hw_data) { -+ printk(KERN_ERR DRIVER "unknown hardware\n"); -+ return -ENODEV; -+ } -+ -+ /* Check that the hardware responds - this may not work under EFI */ -+ -+ intensity = hw_data->backlight_ops.get_brightness(NULL); -+ -+ if (!intensity) { -+ hw_data->set_brightness(1); -+ if (!hw_data->backlight_ops.get_brightness(NULL)) -+ return -ENODEV; -+ -+ hw_data->set_brightness(0); -+ } -+ -+ if (!request_region(hw_data->iostart, hw_data->iolen, -+ "Apple backlight")) -+ return -ENXIO; -+ -+ memset(&props, 0, sizeof(struct backlight_properties)); -+ props.max_brightness = 15; -+ apple_backlight_device = backlight_device_register("apple_backlight", -+ NULL, NULL, &hw_data->backlight_ops, &props); -+ -+ if (IS_ERR(apple_backlight_device)) { -+ release_region(hw_data->iostart, hw_data->iolen); -+ return PTR_ERR(apple_backlight_device); -+ } -+ -+ apple_backlight_device->props.brightness = -+ hw_data->backlight_ops.get_brightness(apple_backlight_device); -+ backlight_update_status(apple_backlight_device); -+ -+ return 0; -+} -+ -+static int __devexit apple_bl_remove(struct acpi_device *dev, int type) -+{ -+ backlight_device_unregister(apple_backlight_device); -+ -+ release_region(hw_data->iostart, hw_data->iolen); -+ hw_data = NULL; -+ return 0; -+} -+ -+static const struct acpi_device_id apple_bl_ids[] = { -+ {"APP0002", 0}, -+ {"", 0}, -+}; -+ -+static struct acpi_driver apple_bl_driver = { -+ .name = "Apple backlight", -+ .ids = apple_bl_ids, -+ .ops = { -+ .add = apple_bl_add, -+ .remove = apple_bl_remove, -+ }, -+}; -+ -+static int __init apple_bl_init(void) -+{ -+ return acpi_bus_register_driver(&apple_bl_driver); -+} -+ -+static void __exit apple_bl_exit(void) -+{ -+ acpi_bus_unregister_driver(&apple_bl_driver); -+} -+ -+module_init(apple_bl_init); -+module_exit(apple_bl_exit); -+ -+MODULE_AUTHOR("Matthew Garrett "); -+MODULE_DESCRIPTION("Apple Backlight Driver"); -+MODULE_LICENSE("GPL"); -+MODULE_DEVICE_TABLE(acpi, apple_bl_ids); -+MODULE_ALIAS("mbp_nvidia_bl"); -diff --git a/drivers/video/backlight/mbp_nvidia_bl.c b/drivers/video/backlight/mbp_nvidia_bl.c -deleted file mode 100644 -index 1485f73..0000000 ---- a/drivers/video/backlight/mbp_nvidia_bl.c -+++ /dev/null -@@ -1,400 +0,0 @@ --/* -- * Backlight Driver for Nvidia 8600 in Macbook Pro -- * -- * Copyright (c) Red Hat -- * Based on code from Pommed: -- * Copyright (C) 2006 Nicolas Boichat -- * Copyright (C) 2006 Felipe Alfaro Solana -- * Copyright (C) 2007 Julien BLACHE -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 2 as -- * published by the Free Software Foundation. -- * -- * This driver triggers SMIs which cause the firmware to change the -- * backlight brightness. This is icky in many ways, but it's impractical to -- * get at the firmware code in order to figure out what it's actually doing. -- */ -- --#include --#include --#include --#include --#include --#include --#include --#include -- --static struct backlight_device *mbp_backlight_device; -- --/* Structure to be passed to the DMI_MATCH function. */ --struct dmi_match_data { -- /* I/O resource to allocate. */ -- unsigned long iostart; -- unsigned long iolen; -- /* Backlight operations structure. */ -- const struct backlight_ops backlight_ops; --}; -- --/* Module parameters. */ --static int debug; --module_param_named(debug, debug, int, 0644); --MODULE_PARM_DESC(debug, "Set to one to enable debugging messages."); -- --/* -- * Implementation for MacBooks with Intel chipset. -- */ --static int intel_chipset_send_intensity(struct backlight_device *bd) --{ -- int intensity = bd->props.brightness; -- -- if (debug) -- printk(KERN_DEBUG "mbp_nvidia_bl: setting brightness to %d\n", -- intensity); -- -- outb(0x04 | (intensity << 4), 0xb3); -- outb(0xbf, 0xb2); -- return 0; --} -- --static int intel_chipset_get_intensity(struct backlight_device *bd) --{ -- int intensity; -- -- outb(0x03, 0xb3); -- outb(0xbf, 0xb2); -- intensity = inb(0xb3) >> 4; -- -- if (debug) -- printk(KERN_DEBUG "mbp_nvidia_bl: read brightness of %d\n", -- intensity); -- -- return intensity; --} -- --static const struct dmi_match_data intel_chipset_data = { -- .iostart = 0xb2, -- .iolen = 2, -- .backlight_ops = { -- .options = BL_CORE_SUSPENDRESUME, -- .get_brightness = intel_chipset_get_intensity, -- .update_status = intel_chipset_send_intensity, -- } --}; -- --/* -- * Implementation for MacBooks with Nvidia chipset. -- */ --static int nvidia_chipset_send_intensity(struct backlight_device *bd) --{ -- int intensity = bd->props.brightness; -- -- if (debug) -- printk(KERN_DEBUG "mbp_nvidia_bl: setting brightness to %d\n", -- intensity); -- -- outb(0x04 | (intensity << 4), 0x52f); -- outb(0xbf, 0x52e); -- return 0; --} -- --static int nvidia_chipset_get_intensity(struct backlight_device *bd) --{ -- int intensity; -- -- outb(0x03, 0x52f); -- outb(0xbf, 0x52e); -- intensity = inb(0x52f) >> 4; -- -- if (debug) -- printk(KERN_DEBUG "mbp_nvidia_bl: read brightness of %d\n", -- intensity); -- -- return intensity; --} -- --static const struct dmi_match_data nvidia_chipset_data = { -- .iostart = 0x52e, -- .iolen = 2, -- .backlight_ops = { -- .options = BL_CORE_SUSPENDRESUME, -- .get_brightness = nvidia_chipset_get_intensity, -- .update_status = nvidia_chipset_send_intensity -- } --}; -- --/* -- * DMI matching. -- */ --static /* const */ struct dmi_match_data *driver_data; -- --static int mbp_dmi_match(const struct dmi_system_id *id) --{ -- driver_data = id->driver_data; -- -- printk(KERN_INFO "mbp_nvidia_bl: %s detected\n", id->ident); -- return 1; --} -- --static const struct dmi_system_id __initdata mbp_device_table[] = { -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 1,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 2,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 3,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook3,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 4,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 4,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,2"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 1,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro1,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 1,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro1,2"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 2,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 2,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 3,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 3,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3,2"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 4,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro4,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookAir 1,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir1,1"), -- }, -- .driver_data = (void *)&intel_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 5,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,1"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 5,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBook 6,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook6,1"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookAir 2,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir2,1"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 5,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,1"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 5,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,2"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 5,3", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,3"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 5,4", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,4"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookPro 5,5", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,5"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookAir 3,1", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir3,1"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { -- .callback = mbp_dmi_match, -- .ident = "MacBookAir 3,2", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), -- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir3,2"), -- }, -- .driver_data = (void *)&nvidia_chipset_data, -- }, -- { } --}; -- --static int __init mbp_init(void) --{ -- struct backlight_properties props; -- if (!dmi_check_system(mbp_device_table)) -- return -ENODEV; -- -- if (!request_region(driver_data->iostart, driver_data->iolen, -- "Macbook Pro backlight")) -- return -ENXIO; -- -- memset(&props, 0, sizeof(struct backlight_properties)); -- props.max_brightness = 15; -- mbp_backlight_device = backlight_device_register("mbp_backlight", NULL, -- NULL, -- &driver_data->backlight_ops, -- &props); -- if (IS_ERR(mbp_backlight_device)) { -- release_region(driver_data->iostart, driver_data->iolen); -- return PTR_ERR(mbp_backlight_device); -- } -- -- mbp_backlight_device->props.brightness = -- driver_data->backlight_ops.get_brightness(mbp_backlight_device); -- backlight_update_status(mbp_backlight_device); -- -- return 0; --} -- --static void __exit mbp_exit(void) --{ -- backlight_device_unregister(mbp_backlight_device); -- -- release_region(driver_data->iostart, driver_data->iolen); --} -- --module_init(mbp_init); --module_exit(mbp_exit); -- --MODULE_AUTHOR("Matthew Garrett "); --MODULE_DESCRIPTION("Nvidia-based Macbook Pro Backlight Driver"); --MODULE_LICENSE("GPL"); --MODULE_DEVICE_TABLE(dmi, mbp_device_table); diff --git a/bluetooth-device-ids-for-ath3k-on-pegatron-lucid-tablets.patch b/bluetooth-device-ids-for-ath3k-on-pegatron-lucid-tablets.patch new file mode 100644 index 000000000..767105587 --- /dev/null +++ b/bluetooth-device-ids-for-ath3k-on-pegatron-lucid-tablets.patch @@ -0,0 +1,37 @@ +From: Andy Ross +Date: Mon, 9 May 2011 23:11:16 +0000 (-0700) +Subject: Bluetooth: Device ids for ath3k on Pegatron Lucid tablets +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpadovan%2Fbluetooth-next-2.6.git;a=commitdiff_plain;h=2a7bccccdb9604a717c2128a931f022267d35629 + +Bluetooth: Device ids for ath3k on Pegatron Lucid tablets + +New ath3k device IDs used on the Pegatron Lucid (ExoPC and WeTab) units. + +Signed-off-by: Andy Ross +Signed-off-by: Gustavo F. Padovan +--- + +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c +index 695d441..6bacef3 100644 +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -62,6 +62,7 @@ static struct usb_device_id ath3k_table[] = { + + /* Atheros AR3011 with sflash firmware*/ + { USB_DEVICE(0x0CF3, 0x3002) }, ++ { USB_DEVICE(0x13d3, 0x3304) }, + + /* Atheros AR9285 Malbec with sflash firmware */ + { USB_DEVICE(0x03F0, 0x311D) }, +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 762a510..c2de895 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -104,6 +104,7 @@ static struct usb_device_id blacklist_table[] = { + + /* Atheros 3011 with sflash firmware */ + { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, ++ { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, + + /* Atheros AR9285 Malbec with sflash firmware */ + { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, diff --git a/config-arm b/config-arm index e2d8af390..dd6f90ad6 100644 --- a/config-arm +++ b/config-arm @@ -83,7 +83,7 @@ CONFIG_FB_ARMCLCD=m CONFIG_SND_ARM=y CONFIG_SND_ARMAACI=m -CONFIG_USB_MUSB_HDRC=m +CONFIG_USB_MUSB_HDRC=y # CONFIG_MUSB_PIO_ONLY is not set CONFIG_USB_TUSB6010=y # CONFIG_USB_MUSB_DEBUG is not set @@ -135,3 +135,15 @@ CONFIG_STRICT_DEVMEM=y # CONFIG_HVC_DCC is not set CONFIG_SPARSE_IRQ=y + +# CONFIG_ARM_PATCH_PHYS_VIRT is not set + +CONFIG_FTMAC100=m + +CONFIG_HWSPINLOCK_OMAP=m + +CONFIG_USE_OF=y +CONFIG_PROC_DEVICETREE=y +CONFIG_MTD_PHYSMAP_OF=m +CONFIG_SERIAL_OF_PLATFORM=m +CONFIG_MMC_SDHCI_OF=m diff --git a/config-debug b/config-debug index 86aa2cc04..7bbaa0b59 100644 --- a/config-debug +++ b/config-debug @@ -41,6 +41,7 @@ CONFIG_DEBUG_OBJECTS=y # CONFIG_DEBUG_OBJECTS_SELFTEST is not set CONFIG_DEBUG_OBJECTS_FREE=y CONFIG_DEBUG_OBJECTS_TIMERS=y +CONFIG_DEBUG_OBJECTS_RCU_HEAD=y CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 CONFIG_X86_PTDUMP=y @@ -88,8 +89,6 @@ CONFIG_PM_ADVANCED_DEBUG=y CONFIG_CEPH_LIB_PRETTYDEBUG=y CONFIG_QUOTA_DEBUG=y -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set - CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y diff --git a/config-generic b/config-generic index c07e5b85a..83a056bfa 100644 --- a/config-generic +++ b/config-generic @@ -6,6 +6,7 @@ CONFIG_SMP=y CONFIG_HOTPLUG_CPU=y CONFIG_LOCALVERSION="" CONFIG_CROSS_COMPILE="" +CONFIG_DEFAULT_HOSTNAME="(none)" # # Code maturity level options @@ -32,6 +33,7 @@ CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_FHANDLE=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y @@ -138,6 +140,7 @@ CONFIG_MMC_SDHCI_PLTFM=m CONFIG_MMC_CB710=m CONFIG_MMC_RICOH_MMC=y CONFIG_MMC_USHC=m +CONFIG_MMC_VUB300=m CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set @@ -191,6 +194,7 @@ CONFIG_EXTRA_FIRMWARE="" # CONFIG_MTD=m # CONFIG_MTD_DEBUG is not set +CONFIG_MTD_SWAP=m CONFIG_MTD_PARTITIONS=y CONFIG_MTD_AR7_PARTS=m CONFIG_MTD_CONCAT=m @@ -240,6 +244,7 @@ CONFIG_MTD_ABSENT=m # CONFIG_MTD_COMPLEX_MAPPINGS=y # CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_LATCH_ADDR is not set CONFIG_MTD_SC520CDP=m CONFIG_MTD_NETSC520=m # CONFIG_MTD_SBC_GXX is not set @@ -282,6 +287,7 @@ CONFIG_MTD_NAND=m # CONFIG_MTD_NAND_MUSEUM_IDS is not set # CONFIG_MTD_NAND_PLATFORM is not set # CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_BCH is not set # CONFIG_MTD_NAND_CAFE is not set CONFIG_MTD_NAND_IDS=m CONFIG_MTD_NAND_NANDSIM=m @@ -569,6 +575,7 @@ CONFIG_SATA_ACARD_AHCI=m CONFIG_PATA_ACPI=m CONFIG_PATA_ALI=m CONFIG_PATA_AMD=m +CONFIG_PATA_ARASAN_CF=m CONFIG_PATA_ARTOP=m CONFIG_PATA_ATIIXP=m CONFIG_PATA_CMD640_PCI=m @@ -689,6 +696,7 @@ CONFIG_DM_LOG_USERSPACE=m CONFIG_DM_MULTIPATH_QL=m CONFIG_DM_MULTIPATH_ST=m CONFIG_DM_RAID=m +CONFIG_DM_FLAKEY=m # # Fusion MPT device support @@ -759,6 +767,7 @@ CONFIG_INET_TUNNEL=m CONFIG_INET_DIAG=m CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_FIB_TRIE_STATS=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y @@ -806,7 +815,7 @@ CONFIG_IP_VS_NQ=m CONFIG_IP_VS_FTP=m CONFIG_IP_VS_PE_SIP=m -CONFIG_IPV6=m +CONFIG_IPV6=y CONFIG_IPV6_PRIVACY=y CONFIG_IPV6_ROUTER_PREF=y CONFIG_IPV6_ROUTE_INFO=y @@ -842,11 +851,12 @@ CONFIG_BRIDGE_IGMP_SNOOPING=y # CONFIG_NETWORK_PHY_TIMESTAMPING is not set CONFIG_NETFILTER=y CONFIG_NETFILTER_ADVANCED=y -CONFIG_NF_CONNTRACK=y +CONFIG_NF_CONNTRACK=m CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m CONFIG_NETFILTER_XTABLES=y +CONFIG_NETFILTER_XT_SET=m CONFIG_NETFILTER_XT_MARK=m CONFIG_NETFILTER_XT_CONNMARK=m CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m @@ -902,6 +912,9 @@ CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m CONFIG_NETFILTER_XT_MATCH_CPU=m CONFIG_NETFILTER_XT_MATCH_IPVS=m +CONFIG_NETFILTER_XT_TARGET_AUDIT=m +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y @@ -927,6 +940,8 @@ CONFIG_NF_CONNTRACK_SIP=m CONFIG_NF_CONNTRACK_TFTP=m CONFIG_NF_CONNTRACK_IPV4=y CONFIG_NF_CONNTRACK_IPV6=y +CONFIG_NF_CONNTRACK_TIMESTAMP=y +CONFIG_NF_CONNTRACK_SNMP=m CONFIG_NF_NAT=m CONFIG_NF_NAT_SNMP_BASIC=m CONFIG_NF_CT_PROTO_DCCP=m @@ -1016,6 +1031,19 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=m CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m CONFIG_INET6_XFRM_MODE_BEET=m +CONFIG_IP_SET=m +CONFIG_IP_SET_MAX=256 +CONFIG_IP_SET_BITMAP_IP=m +CONFIG_IP_SET_BITMAP_IPMAC=m +CONFIG_IP_SET_BITMAP_PORT=m +CONFIG_IP_SET_HASH_IP=m +CONFIG_IP_SET_HASH_IPPORT=m +CONFIG_IP_SET_HASH_IPPORTIP=m +CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_NET=m +CONFIG_IP_SET_HASH_NETPORT=m +CONFIG_IP_SET_LIST_SET=m + # # SCTP Configuration (EXPERIMENTAL) # @@ -1077,6 +1105,10 @@ CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_SFB=m +CONFIG_NET_SCH_MQPRIO=m +CONFIG_NET_SCH_CHOKE=m +CONFIG_NET_SCH_QFQ=m CONFIG_NET_CLS=y CONFIG_NET_CLS_ACT=y CONFIG_NET_CLS_BASIC=m @@ -1421,7 +1453,10 @@ CONFIG_ADM8211=m CONFIG_ATH_COMMON=m CONFIG_ATH5K=m CONFIG_ATH5K_DEBUG=y +# CONFIG_ATH5K_TRACER is not set CONFIG_ATH9K=m +CONFIG_ATH9K_PCI=y +CONFIG_ATH9K_AHB=y # CONFIG_ATH9K_DEBUG is not set CONFIG_ATH9K_DEBUGFS=y CONFIG_ATH9K_HTC=m @@ -1479,7 +1514,13 @@ CONFIG_IWLWIFI=m CONFIG_IWLWIFI_DEBUG=y CONFIG_IWLWIFI_DEBUGFS=y CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y +CONFIG_IWLWIFI_DEVICE_SVTOOL=y +# CONFIG_IWL_P2P is not set CONFIG_IWLAGN=m +CONFIG_IWLWIFI_LEGACY=m +CONFIG_IWLWIFI_LEGACY_DEBUG=y +CONFIG_IWLWIFI_LEGACY_DEBUGFS=y +# CONFIG_IWLWIFI_LEGACY_DEVICE_TRACING is not set CONFIG_IWL4965=y CONFIG_IWL5000=y CONFIG_IWL3945=m @@ -1508,16 +1549,19 @@ CONFIG_RT2500USB=m CONFIG_RT2800USB=m CONFIG_RT2800USB_RT33XX=y CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT53XX=y CONFIG_RT2800USB_UNKNOWN=y CONFIG_RT2800PCI=m CONFIG_RT2800PCI_RT33XX=y CONFIG_RT2800PCI_RT35XX=y +CONFIG_RT2800PCI_RT53XX=y CONFIG_RT73USB=m CONFIG_RTL8180=m CONFIG_RTL8187=m CONFIG_TMD_HERMES=m CONFIG_USB_ZD1201=m CONFIG_USB_NET_RNDIS_WLAN=m +CONFIG_USB_NET_KALMIA=m CONFIG_USB_NET_SMSC75XX=m CONFIG_ZD1211RW=m # CONFIG_ZD1211RW_DEBUG is not set @@ -1538,6 +1582,11 @@ CONFIG_WL1271_SDIO=m CONFIG_WL1271_SPI=m CONFIG_RTL8192CE=m +CONFIG_RTL8192SE=m +CONFIG_RTL8192CU=m + +CONFIG_MWIFIEX=m +CONFIG_MWIFIEX_SDIO=m # # Token Ring devices @@ -1597,6 +1646,8 @@ CONFIG_CAN_TSCAN1=m CONFIG_CAN_SLCAN=m CONFIG_CAN_SOFTING=m CONFIG_CAN_SOFTING_CS=m +CONFIG_CAN_C_CAN=m +CONFIG_CAN_C_CAN_PLATFORM=m # CONFIG_PCH_CAN is not set CONFIG_NETROM=m CONFIG_ROSE=m @@ -1655,9 +1706,9 @@ CONFIG_WINBOND_FIR=m # Bluetooth support # CONFIG_BT=m -CONFIG_BT_L2CAP=m +CONFIG_BT_L2CAP=y CONFIG_BT_L2CAP_EXT_FEATURES=y -CONFIG_BT_SCO=m +CONFIG_BT_SCO=y CONFIG_BT_CMTP=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y @@ -1689,6 +1740,7 @@ CONFIG_BT_HCIUART_LL=y CONFIG_BT_MRVL=m CONFIG_BT_MRVL_SDIO=m CONFIG_BT_ATH3K=m +CONFIG_BT_WILINK=m # # ISDN subsystem @@ -1880,12 +1932,14 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_LM8323 is not set -# FIXME: Do we really need these keyboards enabled ? -CONFIG_KEYBOARD_ADP5588=m -CONFIG_KEYBOARD_MAX7359=m +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_QT1070 is not set # CONFIG_KEYBOARD_MCS is not set -CONFIG_KEYBOARD_OPENCORES=m -CONFIG_KEYBOARD_QT2160=m +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_QT2160 is not set # CONFIG_KEYBOARD_TCA6416 is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y @@ -1959,6 +2013,8 @@ CONFIG_TOUCHSCREEN_USB_COMPOSITE=m CONFIG_TOUCHSCREEN_W90X900=m # CONFIG_TOUCHSCREEN_BU21013 is not set CONFIG_TOUCHSCREEN_ST1232=m +CONFIG_TOUCHSCREEN_ATMEL_MXT=m +# CONFIG_TOUCHSCREEN_MAX11801 is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m @@ -1993,6 +2049,7 @@ CONFIG_SYNCLINKMP=m CONFIG_SYNCLINK_GT=m CONFIG_N_HDLC=m CONFIG_N_GSM=m +# CONFIG_TRACE_SINK is not set # CONFIG_STALDRV is not set # CONFIG_IBM_ASM is not set CONFIG_TIFM_CORE=m @@ -2041,6 +2098,7 @@ CONFIG_SERIAL_JSM=m # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_XILINX_PS_UART is not set # CONFIG_SERIAL_TIMBERDALE is not set CONFIG_UNIX98_PTYS=y CONFIG_DEVPTS_MULTIPLE_INSTANCES=y @@ -2113,6 +2171,8 @@ CONFIG_I2C_TINY_USB=m # CONFIG_I2C_DESIGNWARE is not set # CONFIG_I2C_XILINX is not set +CONFIG_I2C_DIOLAN_U2C=m + # # I2C Hardware Sensors Chip support # @@ -2219,6 +2279,23 @@ CONFIG_SENSORS_W83795=m # CONFIG_SENSORS_W83795_FANCTRL is not set CONFIG_SENSORS_DS620=m CONFIG_SENSORS_SHT21=m +CONFIG_SENSORS_LINEAGE=m +CONFIG_SENSORS_LTC4151=m +CONFIG_SENSORS_MAX6639=m +CONFIG_SENSORS_SCH5627=m +CONFIG_SENSORS_ADS1015=m +CONFIG_SENSORS_MAX16065=m +CONFIG_SENSORS_MAX6642=m +CONFIG_SENSORS_ADM1275=m +CONFIG_SENSORS_UCD9000=m +CONFIG_SENSORS_UCD9200=m +CONFIG_SENSORS_EMC6W201=m + +CONFIG_PMBUS=m +CONFIG_SENSORS_PMBUS=m +CONFIG_SENSORS_MAX16064=m +CONFIG_SENSORS_MAX34440=m +CONFIG_SENSORS_MAX8688=m # CONFIG_HMC6352 is not set # CONFIG_BMP085 is not set @@ -2241,6 +2318,9 @@ CONFIG_W1_SLAVE_DS2433=m CONFIG_W1_SLAVE_DS2433_CRC=y CONFIG_W1_SLAVE_DS2760=m CONFIG_W1_SLAVE_DS2423=m +CONFIG_W1_SLAVE_DS2408=m +CONFIG_W1_SLAVE_DS2780=m +CONFIG_W1_SLAVE_BQ27000=m # # Mice @@ -2342,6 +2422,8 @@ CONFIG_RTC_DRV_WM831X=m CONFIG_RTC_DRV_BQ32K=m CONFIG_RTC_DRV_MSM6242=m CONFIG_RTC_DRV_RP5C01=m +CONFIG_RTC_DRV_EM3027=m +CONFIG_RTC_DRV_RV3029C2=m CONFIG_DTLK=m CONFIG_R3964=m @@ -2402,12 +2484,14 @@ CONFIG_HANGCHECK_TIMER=m # Multimedia devices # CONFIG_MEDIA_SUPPORT=m +CONFIG_MEDIA_CONTROLLER=y CONFIG_VIDEO_DEV=m # CONFIG_VIDEO_ADV_DEBUG is not set CONFIG_VIDEO_HELPER_CHIPS_AUTO=y CONFIG_VIDEO_ALLOW_V4L1=y CONFIG_VIDEO_V4L1_COMPAT=y CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y # CONFIG_VIDEO_VIVI is not set # @@ -2424,11 +2508,13 @@ CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BT848_DVB=y CONFIG_VIDEO_BWQCAM=m CONFIG_VIDEO_SR030PC30=m +CONFIG_VIDEO_NOON010PC30=m CONFIG_VIDEO_CAFE_CCIC=m # CONFIG_VIDEO_CPIA is not set CONFIG_VIDEO_CPIA2=m CONFIG_VIDEO_CQCAM=m CONFIG_VIDEO_CX23885=m +# CONFIG_MEDIA_ALTERA_CI is not set CONFIG_VIDEO_CX18=m CONFIG_VIDEO_CX18_ALSA=m CONFIG_VIDEO_CX88=m @@ -2473,6 +2559,7 @@ CONFIG_VIDEO_FB_IVTV=m CONFIG_VIDEO_SAA7164=m CONFIG_VIDEO_TLG2300=m # CONFIG_VIDEO_TIMBERDALE is not set +# CONFIG_VIDEO_M5MOLS is not set CONFIG_USB_VIDEO_CLASS=m CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y @@ -2484,6 +2571,7 @@ CONFIG_RADIO_GEMTEK_PCI=m CONFIG_RADIO_MAXIRADIO=m CONFIG_RADIO_MAESTRO=m CONFIG_RADIO_WL1273=m +CONFIG_RADIO_WL128X=m CONFIG_MEDIA_ATTACH=y CONFIG_MEDIA_TUNER_CUSTOMISE=y @@ -2503,6 +2591,7 @@ CONFIG_MEDIA_TUNER_MXL5007T=m CONFIG_MEDIA_TUNER_MC44S803=m CONFIG_MEDIA_TUNER_MAX2165=m CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_TDA18212=m # # Digital Video Broadcasting Devices @@ -2574,6 +2663,8 @@ CONFIG_DVB_ATBM8830=m CONFIG_DVB_TDA665x=m CONFIG_DVB_STV0299=m CONFIG_DVB_MB86A16=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_CXD2820R=m # # Supported Frontend Modules @@ -2601,6 +2692,9 @@ CONFIG_DVB_DUMMY_FE=m CONFIG_DVB_FIREDTV=m CONFIG_DVB_NGENE=m CONFIG_DVB_MB86A20S=m +CONFIG_DVB_USB_TECHNISAT_USB2=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_STV0367=m # # Supported SAA7146 based PCI Adapters @@ -2677,7 +2771,10 @@ CONFIG_IR_RC5_SZ_DECODER=m CONFIG_IR_LIRC_CODEC=m CONFIG_IR_IMON=m CONFIG_IR_MCEUSB=m +CONFIG_IR_ITE_CIR=m CONFIG_IR_NUVOTON=m +CONFIG_IR_FINTEK=m +CONFIG_IR_REDRAT3=m CONFIG_V4L_MEM2MEM_DRIVERS=y # CONFIG_VIDEO_MEM2MEM_TESTDEV is not set @@ -2743,6 +2840,7 @@ CONFIG_FB_RIVA=m # CONFIG_FB_RIVA_I2C is not set # CONFIG_FB_S1D13XXX is not set CONFIG_FB_S3=m +CONFIG_FB_S3_DDC=y CONFIG_FB_SAVAGE=m CONFIG_FB_SAVAGE_I2C=y CONFIG_FB_SAVAGE_ACCEL=y @@ -2760,11 +2858,13 @@ CONFIG_FB_VOODOO1=m # CONFIG_FB_VT8623 is not set CONFIG_FB_EFI=y CONFIG_FB_VIA=m +CONFIG_FB_VIA_X_COMPATIBILITY=y # CONFIG_FB_VIA_DIRECT_PROCFS is not set CONFIG_FB_METRONOME=m CONFIG_FB_MB862XX=m CONFIG_FB_MB862XX_PCI_GDC=y CONFIG_FB_MB862XX_LIME=y +CONFIG_FB_MB862XX_I2C=y # CONFIG_FB_PRE_INIT_FB is not set # CONFIG_FB_TMIO is not set # CONFIG_FB_BROADSHEET is not set @@ -2875,6 +2975,7 @@ CONFIG_SND_ENS1371=m CONFIG_SND_ES1938=m CONFIG_SND_ES1968=m CONFIG_SND_ES1968_INPUT=y +CONFIG_SND_ES1968_RADIO=y CONFIG_SND_FM801=m CONFIG_SND_FM801_TEA575X_BOOL=y CONFIG_SND_CTXFI=m @@ -2932,6 +3033,7 @@ CONFIG_SND_VIRTUOSO=m CONFIG_SND_VX222=m CONFIG_SND_YMFPCI=m CONFIG_SND_ASIHPI=m +CONFIG_SND_LOLA=m # # ALSA USB devices @@ -2943,6 +3045,7 @@ CONFIG_SND_USB_CAIAQ_INPUT=y CONFIG_SND_USB_USX2Y=m CONFIG_SND_USB_US122L=m CONFIG_SND_USB_UA101=m +CONFIG_SND_USB_6FIRE=m # # PCMCIA devices @@ -2951,6 +3054,10 @@ CONFIG_SND_PCMCIA=y CONFIG_SND_VXPOCKET=m CONFIG_SND_PDAUDIOCF=m +CONFIG_SND_FIREWIRE=y +CONFIG_SND_FIREWIRE_SPEAKERS=m +CONFIG_SND_ISIGHT=m + # # Open Sound System # @@ -2983,6 +3090,8 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_HCD_SSB is not set CONFIG_USB_UHCI_HCD=y +CONFIG_USB_SL811_HCD=m +CONFIG_USB_SL811_HCD_ISO=y # CONFIG_USB_SL811_CS is not set # CONFIG_USB_R8A66597_HCD is not set CONFIG_USB_XHCI_HCD=m @@ -3003,17 +3112,19 @@ CONFIG_USB_TMC=m # CONFIG_BLK_DEV_UB is not set CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set -CONFIG_USB_STORAGE_CYPRESS_ATACB=y -CONFIG_USB_STORAGE_DATAFAB=y -CONFIG_USB_STORAGE_FREECOM=y -CONFIG_USB_STORAGE_ISD200=y -CONFIG_USB_STORAGE_SDDR09=y -CONFIG_USB_STORAGE_SDDR55=y -CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_CYPRESS_ATACB=m +CONFIG_USB_STORAGE_DATAFAB=m +CONFIG_USB_STORAGE_FREECOM=m +CONFIG_USB_STORAGE_ISD200=m +CONFIG_USB_STORAGE_SDDR09=m +CONFIG_USB_STORAGE_SDDR55=m +CONFIG_USB_STORAGE_JUMPSHOT=m CONFIG_USB_STORAGE_USBAT=y -CONFIG_USB_STORAGE_ONETOUCH=y -CONFIG_USB_STORAGE_ALAUDA=y -CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_STORAGE_ONETOUCH=m +CONFIG_USB_STORAGE_ALAUDA=m +CONFIG_USB_STORAGE_KARMA=m +CONFIG_USB_STORAGE_REALTEK=m +CONFIG_USB_STORAGE_ENE_UB6250=m # CONFIG_USB_LIBUSUAL is not set CONFIG_USB_UAS=m @@ -3078,6 +3189,11 @@ CONFIG_HID_UCLOGIC=m CONFIG_HID_WALTOP=m CONFIG_HID_ROCCAT_PYRA=m CONFIG_HID_ROCCAT_KONEPLUS=m +CONFIG_HID_ACRUX=m +CONFIG_HID_KEYTOUCH=m +CONFIG_HID_LCPOWER=m +CONFIG_HID_ROCCAT_ARVO=m +CONFIG_HID_ROCCAT_KOVAPLUS=m # # USB Imaging devices @@ -3136,6 +3252,9 @@ CONFIG_USB_GSPCA_KONICA=m CONFIG_USB_GSPCA_XIRLINK_CIT=m CONFIG_USB_GSPCA_SPCA1528=m CONFIG_USB_GSPCA_SQ930X=m +CONFIG_USB_GSPCA_NW80X=m +CONFIG_USB_GSPCA_VICAM=m +CONFIG_USB_GSPCA_KINECT=m CONFIG_USB_IBMCAM=m CONFIG_USB_KONICAWC=m @@ -3161,6 +3280,7 @@ CONFIG_SOC_CAMERA_OV9640=m CONFIG_SOC_CAMERA_OV6650=m CONFIG_SOC_CAMERA_IMX074=m CONFIG_SOC_CAMERA_OV2640=m +CONFIG_SOC_CAMERA_OV9740=m # # USB Network adaptors @@ -3189,6 +3309,7 @@ CONFIG_USB_NET_INT51X1=m CONFIG_USB_CDC_PHONET=m CONFIG_USB_IPHETH=m CONFIG_USB_SIERRA_NET=m +CONFIG_USB_VL600=m # # USB Host-to-Host Cables @@ -3213,7 +3334,7 @@ CONFIG_USB_USS720=m # # USB Serial Converter support # -CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_AIRCABLE=m CONFIG_USB_SERIAL_ARK3116=m @@ -3279,6 +3400,8 @@ CONFIG_USB_SERIAL_DEBUG=m CONFIG_USB_SERIAL_SSU100=m CONFIG_USB_SERIAL_SAMBA=m +CONFIG_USB_SERIAL_CONSOLE=y + CONFIG_USB_EZUSB=y CONFIG_USB_EMI62=m CONFIG_USB_LED=m @@ -3322,7 +3445,6 @@ CONFIG_USB_PWC_INPUT_EVDEV=y # CONFIG_USB_PWC_DEBUG is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_QUICKCAM_MESSENGER is not set -CONFIG_USB_SL811_HCD=m CONFIG_USB_SISUSBVGA=m CONFIG_USB_SISUSBVGA_CON=y CONFIG_RADIO_SI470X=y @@ -3362,7 +3484,6 @@ CONFIG_PCF50633_GPIO=m # CONFIG_AB3100_CORE is not set CONFIG_INPUT_PCF50633_PMU=m CONFIG_INPUT_GPIO_ROTARY_ENCODER=m -CONFIG_CHARGER_PCF50633=m CONFIG_RTC_DRV_PCF50633=m CONFIG_RTC_DRV_DS3232=m CONFIG_RTC_DRV_ISL12022=m @@ -3488,6 +3609,7 @@ CONFIG_PROC_KCORE=y CONFIG_PROC_VMCORE=y CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TMPFS_XATTR=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_DEBUG_FS=y @@ -3550,9 +3672,10 @@ CONFIG_NFS_FSCACHE=y # CONFIG_NFS_USE_LEGACY_DNS is not set # CONFIG_NFS_USE_NEW_IDMAPPER is not set # CONFIG_NFSD_DEPRECATED is not set +CONFIG_PNFS_OBJLAYOUT=m CONFIG_LOCKD=m CONFIG_LOCKD_V4=y -CONFIG_EXPORTFS=m +CONFIG_EXPORTFS=y CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_SUNRPC_XPRT_RDMA=m @@ -3572,6 +3695,7 @@ CONFIG_CIFS_ACL=y CONFIG_CIFS_WEAK_PW_HASH=y # CONFIG_CIFS_DEBUG2 is not set CONFIG_CIFS_DFS_UPCALL=y +CONFIG_CIFS_NFSD_EXPORT=y CONFIG_NCP_FS=m CONFIG_NCPFS_PACKET_SIGNING=y CONFIG_NCPFS_IOCTL_LOCKING=y @@ -3734,10 +3858,11 @@ CONFIG_CRYPTO=y CONFIG_CRYPTO_FIPS=y CONFIG_CRYPTO_USER_API_HASH=y CONFIG_CRYPTO_USER_API_SKCIPHER=y -CONFIG_CRYPTO_MANAGER_TESTS=y +CONFIG_CRYPTO_MANAGER=y +# Note, CONFIG_CRYPTO_MANAGER_DISABLE_TESTS needs to be unset, or FIPS will be disabled. +# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_MANAGER=m # CONFIG_CRYPTO_CRYPTD is not set CONFIG_CRYPTO_AES=y CONFIG_CRYPTO_ARC4=m @@ -3825,6 +3950,7 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=m # CONFIG_BACKLIGHT_GENERIC is not set CONFIG_BACKLIGHT_PROGEAR=m # CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set CONFIG_FB_NVIDIA_BACKLIGHT=y CONFIG_FB_RIVA_BACKLIGHT=y CONFIG_FB_RADEON_BACKLIGHT=y @@ -3857,6 +3983,7 @@ CONFIG_CGROUP_SCHED=y CONFIG_CGROUP_MEM_RES_CTLR=y CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y # XXX disabled by default, pass 'swapaccount' # CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set +CONFIG_CGROUP_PERF=y CONFIG_BLK_CGROUP=y # CONFIG_DEBUG_BLK_CGROUP is not set @@ -4068,9 +4195,11 @@ CONFIG_LEDS_TRIGGER_GPIO=m CONFIG_LEDS_INTEL_SS4200=m CONFIG_LEDS_LP5521=m CONFIG_LEDS_LP5523=m +CONFIG_LEDS_LM3530=m CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y +CONFIG_DW_DMAC=m # CONFIG_TIMB_DMA is not set CONFIG_NET_DMA=y # CONFIG_DMATEST is not set @@ -4122,13 +4251,15 @@ CONFIG_APM_POWER=m # CONFIG_BATTERY_DS2760 is not set # CONFIG_BATTERY_DS2782 is not set # CONFIG_BATTERY_BQ20Z75 is not set +# CONFIG_BATTERY_DS2780 is not set # CONFIG_CHARGER_ISP1704 is not set -CONFIG_BATTERY_PMU=m +# CONFIG_CHARGER_MAX8903 is not set # CONFIG_BATTERY_BQ27x00 is not set # CONFIG_BATTERY_MAX17040 is not set # CONFIG_PDA_POWER is not set # CONFIG_CHARGER_GPIO is not set # CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_PCF50633 is not set CONFIG_AUXDISPLAY=y @@ -4172,6 +4303,8 @@ CONFIG_PM_TRACE_RTC=y CONFIG_R6040=m CONFIG_BNX2X=m +CONFIG_SCSI_BNX2X_FCOE=m + CONFIG_NOZOMI=m # CONFIG_TPS65010 is not set # CONFIG_DEBUG_SECTION_MISMATCH is not set @@ -4199,6 +4332,7 @@ CONFIG_MEMSTICK=m CONFIG_MSPRO_BLOCK=m CONFIG_MEMSTICK_TIFM_MS=m CONFIG_MEMSTICK_JMICRON_38X=m +CONFIG_MEMSTICK_R592=m CONFIG_ACCESSIBILITY=y CONFIG_A11Y_BRAILLE_CONSOLE=y @@ -4238,7 +4372,6 @@ CONFIG_PHONET=m CONFIG_ICS932S401=m # CONFIG_C2PORT is not set -CONFIG_W1_SLAVE_BQ27000=m CONFIG_IT87_WDT=m @@ -4327,6 +4460,15 @@ CONFIG_USB_ATMEL=m # CONFIG_DX_SEP is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set # CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set +# CONFIG_RTS_PSTOR is not set +# CONFIG_DRM_PSB is not set +# CONFIG_ALTERA_STAPL is not set +# CONFIG_DVB_CXD2099 is not set +# CONFIG_USBIP_CORE is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_BRCMFMAC is not set +# CONFIG_INTEL_MEI is not set +# CONFIG_ZCACHE is not set # # Android @@ -4370,6 +4512,7 @@ CONFIG_STRIP_ASM_SYMS=y # CONFIG_RCU_FANOUT_EXACT is not set CONFIG_RCU_FAST_NO_HZ=y CONFIG_SRCU_SYNCHRONIZE_DELAY=10 +CONFIG_RCU_CPU_STALL_TIMEOUT=60 CONFIG_KSM=y CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 @@ -4392,9 +4535,11 @@ CONFIG_PPS_CLIENT_PARPORT=m CONFIG_PPS_GENERATOR_PARPORT=m CONFIG_NTP_PPS=y +CONFIG_PTP_1588_CLOCK=m + # CONFIG_USB_SERIAL_QUATECH2 is not set # CONFIG_VT6655 is not set -# CONFIG_FB_UDL is not set +CONFIG_FB_UDL=m # DEBUG options that don't get enabled/disabled with 'make debug/release' # @@ -4422,12 +4567,14 @@ CONFIG_DETECT_SOFTLOCKUP=y CONFIG_LOCKUP_DETECTOR=y # CONFIG_DEBUG_INFO_REDUCED is not set # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set # CONFIG_DETECT_HUNG_TASK is not set # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set CONFIG_ATOMIC64_SELFTEST=y CONFIG_MEMORY_FAILURE=y CONFIG_HWPOISON_INJECT=m +CONFIG_CLEANCACHE=y CONFIG_BLK_DEV_DRBD=m @@ -4448,6 +4595,7 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_IT8761E is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_UCB1400_CORE is not set +# CONFIG_TPS6105X is not set # CONFIG_RADIO_MIROPCM20 is not set # CONFIG_USB_GPIO_VBUS is not set # CONFIG_GPIO_SCH is not set @@ -4489,6 +4637,28 @@ CONFIG_NFC_DEVICES=y CONFIG_PN544_NFC=m CONFIG_TARGET_CORE=m +CONFIG_LOOPBACK_TARGET=m +# CONFIG_LOOPBACK_TARGET_CDB_DEBUG is not set CONFIG_TCM_IBLOCK=m CONFIG_TCM_FILEIO=m CONFIG_TCM_PSCSI=m +CONFIG_TCM_FC=m + +CONFIG_HWSPINLOCK=m + +CONFIG_PSTORE=y + +# CONFIG_AVERAGE is not set + +# CONFIG_SIGMA is not set + +CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 + +CONFIG_TEST_KSTRTOX=m + +CONFIG_BCMA=m +CONFIG_BCMA_HOST_PCI=y +# CONFIG_BCMA_DEBUG is not set + +# CONFIG_GOOGLE_FIRMWARE is not set +CONFIG_INTEL_MID_PTI=m diff --git a/config-ia64-generic b/config-ia64-generic index 5c864b3d0..704c704aa 100644 --- a/config-ia64-generic +++ b/config-ia64-generic @@ -140,6 +140,8 @@ CONFIG_ACPI_VIDEO=m CONFIG_ACPI_HED=m CONFIG_ACPI_EC_DEBUGFS=m CONFIG_ACPI_IPMI=m +CONFIG_ACPI_CUSTOM_METHOD=m +CONFIG_SENSORS_ACPI_POWER=m CONFIG_PM=y CONFIG_HOTPLUG_PCI=y @@ -183,6 +185,7 @@ CONFIG_PROC_VMCORE=y # CONFIG_IA64_MC_ERR_INJECT is not set CONFIG_DMIID=y +CONFIG_DMI_SYSFS=y CONFIG_SENSORS_I5K_AMB=m @@ -206,3 +209,5 @@ CONFIG_RCU_FANOUT=64 CONFIG_ACPI_POWER_METER=m CONFIG_I2C_SCMI=m + +# CONFIG_HP_ACCEL is not set diff --git a/config-nodebug b/config-nodebug index c81b03b85..62650aa3a 100644 --- a/config-nodebug +++ b/config-nodebug @@ -41,6 +41,7 @@ CONFIG_CPUMASK_OFFSTACK=y # CONFIG_DEBUG_OBJECTS_SELFTEST is not set # CONFIG_DEBUG_OBJECTS_FREE is not set # CONFIG_DEBUG_OBJECTS_TIMERS is not set +# CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 # CONFIG_X86_PTDUMP is not set @@ -88,8 +89,6 @@ CONFIG_PM_ADVANCED_DEBUG=y # CONFIG_CEPH_LIB_PRETTYDEBUG is not set # CONFIG_QUOTA_DEBUG is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y - CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y diff --git a/config-powerpc-generic b/config-powerpc-generic index 9cd30a459..e47c31588 100644 --- a/config-powerpc-generic +++ b/config-powerpc-generic @@ -325,6 +325,9 @@ CONFIG_PATA_MACIO=m CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m # CONFIG_PMIC_ADP5520 is not set # CONFIG_MFD_88PM8607 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_TPS65910 is not set +# CONFIG_MFD_WL1273_CORE is not set # CONFIG_XPS_USB_HCD_XILINX is not set # CONFIG_MMC_SDHCI_OF_ESDHC is not set # CONFIG_MMC_SDHCI_OF_HLWD is not set @@ -338,3 +341,17 @@ CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m CONFIG_MPC512X_DMA=m CONFIG_KVM_GUEST=y + +CONFIG_I2C_MPC=m + +# CONFIG_IMA is not set +# CONFIG_TCG_TPM is not set + +CONFIG_RFKILL_GPIO=m + +CONFIG_CRYPTO_DEV_FSL_CAAM=m +CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 +CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=y +CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD=255 +CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD=2048 +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=m diff --git a/config-powerpc32-generic b/config-powerpc32-generic index d2304955f..31c399e65 100644 --- a/config-powerpc32-generic +++ b/config-powerpc32-generic @@ -137,7 +137,6 @@ CONFIG_VIRTUALIZATION=y # CONFIG_MEMSTICK is not set # CONFIG_IPMI_HANDLER is not set -# CONFIG_TCG_TPM is not set # PPC gets sad with debug alloc (bz 448598) # CONFIG_DEBUG_PAGEALLOC is not set @@ -182,3 +181,7 @@ CONFIG_PERF_EVENTS=y CONFIG_EVENT_PROFILE=y CONFIG_KVM_BOOK3S_32=m + +# CONFIG_SCSI_QLA_ISCSI is not set + +CONFIG_BATTERY_PMU=m diff --git a/config-powerpc64 b/config-powerpc64 index 74f33d1aa..8866a5320 100644 --- a/config-powerpc64 +++ b/config-powerpc64 @@ -126,7 +126,7 @@ CONFIG_SCSI_IBMVSCSIS=m CONFIG_SECCOMP=y -CONFIG_TUNE_CELL=y +# CONFIG_TUNE_CELL is not set CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y # CONFIG_BLK_DEV_PLATFORM is not set @@ -184,3 +184,7 @@ CONFIG_CMM=y # CONFIG_SPARSEMEM_VMEMMAP is not set CONFIG_PSERIES_ENERGY=m + +CONFIG_PPC_ICSWX=y +CONFIG_IO_EVENT_IRQ=y +CONFIG_HW_RANDOM_AMD=m diff --git a/config-s390x b/config-s390x index 780fc9146..da9db13c1 100644 --- a/config-s390x +++ b/config-s390x @@ -233,3 +233,8 @@ CONFIG_SCHED_MC=y CONFIG_SCHED_BOOK=y CONFIG_STRICT_DEVMEM=y + +# CONFIG_WARN_DYNAMIC_STACK is not set + +CONFIG_JUMP_LABEL=y +CONFIG_CRYPTO_GHASH_S390=m diff --git a/config-x86-generic b/config-x86-generic index d6feae847..79a63a880 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -152,9 +152,11 @@ CONFIG_ACPI_POWER_METER=m CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_HED=m CONFIG_ACPI_APEI=y +CONFIG_ACPI_APEI_PCIEAER=y CONFIG_ACPI_APEI_GHES=m # CONFIG_ACPI_APEI_EINJ is not set CONFIG_ACPI_IPMI=m +CONFIG_ACPI_CUSTOM_METHOD=m # # CPUFreq processor drivers @@ -198,7 +200,6 @@ CONFIG_X86_TRAMPOLINE=y # CONFIG_NVRAM=y CONFIG_IBM_ASM=m -CONFIG_CRYPTO_AES_586=m CONFIG_CRYPTO_TWOFISH_586=m CONFIG_CRYPTO_DEV_PADLOCK=m CONFIG_CRYPTO_DEV_PADLOCK_AES=m @@ -324,6 +325,11 @@ CONFIG_TC1100_WMI=m CONFIG_HP_WMI=m # CONFIG_INTEL_SCU_IPC is not set CONFIG_DELL_WMI=m +CONFIG_DELL_WMI_AIO=m +CONFIG_ASUS_WMI=m +CONFIG_ASUS_NB_WMI=m +CONFIG_XO15_EBOOK=m +CONFIG_INTEL_OAKTRAIL=m # CONFIG_TOUCHSCREEN_INTEL_MID is not set @@ -362,6 +368,7 @@ CONFIG_LGUEST_GUEST=y CONFIG_VMI=y CONFIG_XEN=y +# CONFIG_XEN_DEBUG is not set CONFIG_XEN_MAX_DOMAIN_MEMORY=8 CONFIG_XEN_BALLOON=y CONFIG_XEN_SCRUB_PAGES=y @@ -371,13 +378,18 @@ CONFIG_XEN_FBDEV_FRONTEND=y CONFIG_XEN_KBDDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=m CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XEN_NETDEV_BACKEND=m +CONFIG_XEN_WDT=m +CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_XEN_PCIDEV_FRONTEND=m CONFIG_XENFS=m CONFIG_XEN_COMPAT_XENFS=y CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=m CONFIG_XEN_DEBUG_FS=y CONFIG_XEN_PLATFORM_PCI=m CONFIG_XEN_GNTDEV=m +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m CONFIG_MTD_ESB2ROM=m CONFIG_MTD_CK804XROM=m @@ -400,6 +412,8 @@ CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y CONFIG_MACINTOSH_DRIVERS=y CONFIG_DMIID=y +CONFIG_DMI_SYSFS=y + CONFIG_ISCSI_IBFT_FIND=y CONFIG_ISCSI_IBFT=m @@ -407,6 +421,8 @@ CONFIG_DMADEVICES=y CONFIG_INTEL_IOATDMA=m CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_FAM15H_POWER=m +CONFIG_SENSORS_ACPI_POWER=m # CONFIG_CPA_DEBUG is not set # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set @@ -420,6 +436,9 @@ CONFIG_OLPC_OPENFIRMWARE=y CONFIG_BATTERY_OLPC=y CONFIG_MOUSE_PS2_OLPC=y +# staging +# CONFIG_FB_OLPC_DCON is not set + CONFIG_STRICT_DEVMEM=y # CONFIG_NO_BOOTMEM is not set @@ -478,6 +497,7 @@ CONFIG_SFI=y CONFIG_INPUT_WINBOND_CIR=m CONFIG_I2C_SCMI=m +CONFIG_I2C_PXA=m CONFIG_SBC_FITPC2_WATCHDOG=m CONFIG_EDAC_I3200=m CONFIG_EDAC_DECODE_MCE=m @@ -536,7 +556,8 @@ CONFIG_X86_32_IRIS=m CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_CRYPTO_AES_NI_INTEL=m +CONFIG_CRYPTO_AES_NI_INTEL=y +CONFIG_CRYPTO_AES_586=y CONFIG_MTD_OF_PARTS=m CONFIG_MTD_PHYSMAP_OF=m @@ -544,3 +565,7 @@ CONFIG_PROC_DEVICETREE=y CONFIG_SERIAL_OF_PLATFORM=m CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m # CONFIG_MMC_SDHCI_OF is not set + +CONFIG_HP_ACCEL=m + +# CONFIG_RAPIDIO is not set diff --git a/config-x86_64-generic b/config-x86_64-generic index 0154cf1b0..d4a9a5f4e 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -98,9 +98,11 @@ CONFIG_ACPI_POWER_METER=m CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_HED=m CONFIG_ACPI_APEI=y +CONFIG_ACPI_APEI_PCIEAER=y CONFIG_ACPI_APEI_GHES=m # CONFIG_ACPI_APEI_EINJ is not set CONFIG_ACPI_IPMI=m +CONFIG_ACPI_CUSTOM_METHOD=m CONFIG_X86_PLATFORM_DEVICES=y CONFIG_ASUS_LAPTOP=m @@ -118,6 +120,12 @@ CONFIG_ACER_WMI=m CONFIG_ACERHDF=m CONFIG_HP_WMI=m CONFIG_DELL_WMI=m +CONFIG_DELL_WMI_AIO=m +CONFIG_ASUS_WMI=m +CONFIG_ASUS_NB_WMI=m +# CONFIG_XO15_EBOOK is not set +CONFIG_INTEL_OAKTRAIL=m + # CONFIG_INTEL_SCU_IPC is not set # CONFIG_TOUCHSCREEN_INTEL_MID is not set @@ -160,6 +168,7 @@ CONFIG_CRYPTO_DEV_PADLOCK_SHA=m CONFIG_CRYPTO_AES_X86_64=y CONFIG_CRYPTO_AES_NI_INTEL=y + CONFIG_CRYPTO_TWOFISH_X86_64=m CONFIG_CRYPTO_SALSA20_X86_64=m @@ -269,6 +278,8 @@ CONFIG_PROC_VMCORE=y CONFIG_CRASH=m CONFIG_DMIID=y +CONFIG_DMI_SYSFS=y + CONFIG_ISCSI_IBFT_FIND=y CONFIG_ISCSI_IBFT=m @@ -294,6 +305,7 @@ CONFIG_KVM_GUEST=y CONFIG_KVM_MMU_AUDIT=y CONFIG_XEN=y +# CONFIG_XEN_DEBUG is not set CONFIG_XEN_MAX_DOMAIN_MEMORY=32 CONFIG_XEN_BALLOON=y CONFIG_XEN_SCRUB_PAGES=y @@ -303,20 +315,27 @@ CONFIG_XEN_FBDEV_FRONTEND=y CONFIG_XEN_KBDDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=m CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XEN_NETDEV_BACKEND=m +CONFIG_XEN_WDT=m +CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_XEN_PCIDEV_FRONTEND=m CONFIG_XENFS=m CONFIG_XEN_COMPAT_XENFS=y CONFIG_XEN_DEV_EVTCHN=m CONFIG_XEN_SYS_HYPERVISOR=y CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=m CONFIG_XEN_GNTDEV=m CONFIG_XEN_DEBUG_FS=y CONFIG_XEN_PLATFORM_PCI=m +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m CONFIG_DMADEVICES=y CONFIG_INTEL_IOATDMA=m CONFIG_SENSORS_I5K_AMB=m +CONFIG_SENSORS_FAM15H_POWER=m +CONFIG_SENSORS_ACPI_POWER=m # CONFIG_COMPAT_VDSO is not set CONFIG_PROVIDE_OHCI1394_DMA_INIT=y @@ -449,3 +468,9 @@ CONFIG_JUMP_LABEL=y CONFIG_HP_ILO=m CONFIG_TRANSPARENT_HUGEPAGE=y + +CONFIG_HP_ACCEL=m + +# CONFIG_RAPIDIO is not set + +CONFIG_BPF_JIT=y diff --git a/crypto-aesni_intel-merge-with-fpu_ko.patch b/crypto-aesni_intel-merge-with-fpu_ko.patch new file mode 100644 index 000000000..afb4bec8b --- /dev/null +++ b/crypto-aesni_intel-merge-with-fpu_ko.patch @@ -0,0 +1,134 @@ +From: Andy Lutomirski +Date: Mon, 16 May 2011 05:12:47 +0000 (+1000) +Subject: crypto: aesni-intel - Merge with fpu.ko +X-Git-Tag: v3.0-rc1~371^2~5 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=b23b64516500df6b70fcafb820970f18538252cf + +crypto: aesni-intel - Merge with fpu.ko + +Loading fpu without aesni-intel does nothing. Loading aesni-intel +without fpu causes modes like xts to fail. (Unloading +aesni-intel will restore those modes.) + +One solution would be to make aesni-intel depend on fpu, but it +seems cleaner to just combine the modules. + +This is probably responsible for bugs like: +https://bugzilla.redhat.com/show_bug.cgi?id=589390 + +Signed-off-by: Andy Lutomirski +Signed-off-by: Herbert Xu +[also 9bed4aca for the bugfix. --kyle] + +--- +diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile +index 1a58ad8..c04f1b7 100644 +--- a/arch/x86/crypto/Makefile ++++ b/arch/x86/crypto/Makefile +@@ -2,8 +2,6 @@ + # Arch-specific CryptoAPI modules. + # + +-obj-$(CONFIG_CRYPTO_FPU) += fpu.o +- + obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o + obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o + obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o +@@ -24,6 +22,6 @@ aes-x86_64-y := aes-x86_64-asm_64.o aes_glue.o + twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o + salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o + +-aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o ++aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o + + ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o +diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c +index b375b2a..ede3fa7 100644 +--- a/arch/x86/crypto/aesni-intel_glue.c ++++ b/arch/x86/crypto/aesni-intel_glue.c +@@ -94,6 +94,10 @@ asmlinkage void aesni_cbc_enc(struct crypto_aes_ctx *ctx, u8 *out, + const u8 *in, unsigned int len, u8 *iv); + asmlinkage void aesni_cbc_dec(struct crypto_aes_ctx *ctx, u8 *out, + const u8 *in, unsigned int len, u8 *iv); ++ ++int crypto_fpu_init(void); ++void crypto_fpu_exit(void); ++ + #ifdef CONFIG_X86_64 + asmlinkage void aesni_ctr_enc(struct crypto_aes_ctx *ctx, u8 *out, + const u8 *in, unsigned int len, u8 *iv); +@@ -1259,6 +1263,8 @@ static int __init aesni_init(void) + return -ENODEV; + } + ++ if ((err = crypto_fpu_init())) ++ goto fpu_err; + if ((err = crypto_register_alg(&aesni_alg))) + goto aes_err; + if ((err = crypto_register_alg(&__aesni_alg))) +@@ -1336,6 +1342,7 @@ blk_ecb_err: + __aes_err: + crypto_unregister_alg(&aesni_alg); + aes_err: ++fpu_err: + return err; + } + +@@ -1365,6 +1372,8 @@ static void __exit aesni_exit(void) + crypto_unregister_alg(&blk_ecb_alg); + crypto_unregister_alg(&__aesni_alg); + crypto_unregister_alg(&aesni_alg); ++ ++ crypto_fpu_exit(); + } + + module_init(aesni_init); +diff --git a/arch/x86/crypto/fpu.c b/arch/x86/crypto/fpu.c +index 1a8f864..98d7a18 100644 +--- a/arch/x86/crypto/fpu.c ++++ b/arch/x86/crypto/fpu.c +@@ -150,18 +150,12 @@ static struct crypto_template crypto_fpu_tmpl = { + .module = THIS_MODULE, + }; + +-static int __init crypto_fpu_module_init(void) ++int __init crypto_fpu_init(void) + { + return crypto_register_template(&crypto_fpu_tmpl); + } + +-static void __exit crypto_fpu_module_exit(void) ++void __exit crypto_fpu_exit(void) + { + crypto_unregister_template(&crypto_fpu_tmpl); + } +- +-module_init(crypto_fpu_module_init); +-module_exit(crypto_fpu_module_exit); +- +-MODULE_LICENSE("GPL"); +-MODULE_DESCRIPTION("FPU block cipher wrapper"); +diff --git a/crypto/Kconfig b/crypto/Kconfig +index 4b7cb0e..87b22ca 100644 +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -264,11 +264,6 @@ config CRYPTO_XTS + key size 256, 384 or 512 bits. This implementation currently + can't handle a sectorsize which is not a multiple of 16 bytes. + +-config CRYPTO_FPU +- tristate +- select CRYPTO_BLKCIPHER +- select CRYPTO_MANAGER +- + comment "Hash modes" + + config CRYPTO_HMAC +@@ -543,7 +538,6 @@ config CRYPTO_AES_NI_INTEL + select CRYPTO_AES_586 if !64BIT + select CRYPTO_CRYPTD + select CRYPTO_ALGAPI +- select CRYPTO_FPU + help + Use Intel AES-NI instructions for AES algorithm. + diff --git a/drm-i915-gen4-has-non-power-of-two-strides.patch b/drm-i915-gen4-has-non-power-of-two-strides.patch deleted file mode 100644 index f111614bc..000000000 --- a/drm-i915-gen4-has-non-power-of-two-strides.patch +++ /dev/null @@ -1,69 +0,0 @@ -From bea96046b4245e9abd65ed7acfed9adfd5f6c639 Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Thu, 3 Mar 2011 23:43:02 +0000 -Subject: [PATCH] drm/i915: Gen4+ has non-power-of-two strides - -In c2e0eb16707, we started checking that the buffer was the correct size -for tiled access by ensuring that the size was a multiple of tiles. -However, gen4+ complicates the issue by allowing any multiple of 4096 -bytes for the stride and so the simple check based on a power-of-two -stride was failing for valid bo. - -Reported-by: Dan Williams -Reported-by: Robert Hooker -Cc: Daniel Vetter -Signed-off-by: Chris Wilson ---- - drivers/gpu/drm/i915/i915_gem_tiling.c | 29 ++++++++++++++--------------- - 1 files changed, 14 insertions(+), 15 deletions(-) - -diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c -index 79a04fd..654f350 100644 ---- a/drivers/gpu/drm/i915/i915_gem_tiling.c -+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c -@@ -215,6 +215,19 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) - } - } - -+ if (INTEL_INFO(dev)->gen >= 4) { -+ /* 965+ just needs multiples of tile width */ -+ if (stride & (tile_width - 1)) -+ return false; -+ } else { -+ /* Pre-965 needs power of two tile widths */ -+ if (stride < tile_width) -+ return false; -+ -+ if (stride & (stride - 1)) -+ return false; -+ } -+ - if (IS_GEN2(dev) || - (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) - tile_height = 32; -@@ -226,21 +239,7 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) - tile_height *= 2; - - /* Size needs to be aligned to a full tile row */ -- if (size & (tile_height * stride - 1)) -- return false; -- -- /* 965+ just needs multiples of tile width */ -- if (INTEL_INFO(dev)->gen >= 4) { -- if (stride & (tile_width - 1)) -- return false; -- return true; -- } -- -- /* Pre-965 needs power of two tile widths */ -- if (stride < tile_width) -- return false; -- -- if (stride & (stride - 1)) -+ if (size % (tile_height * stride)) - return false; - - return true; --- -1.7.4.1 - diff --git a/drm-intel-edp-fixes.patch b/drm-intel-edp-fixes.patch index c77ef116c..9e8c829c4 100644 --- a/drm-intel-edp-fixes.patch +++ b/drm-intel-edp-fixes.patch @@ -25,20 +25,12 @@ index 300f64b..2e3db37 100644 if (I915_READ(PCH_PP_STATUS) & PP_ON) return true; -@@ -816,7 +817,7 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) - */ - msleep(300); +@@ -851,7 +851,7 @@ static bool ironlake_edp_panel_on (struc + I915_WRITE(PCH_PP_CONTROL, pp); + POSTING_READ(PCH_PP_CONTROL); - if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on_mask, + if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on, 5000)) DRM_ERROR("panel on wait timed out: 0x%08x\n", I915_READ(PCH_PP_STATUS)); -@@ -922,6 +923,7 @@ static void intel_dp_prepare(struct drm_encoder *encoder) - - if (is_edp(intel_dp)) { - ironlake_edp_backlight_off(dev); -+ ironlake_edp_panel_off(dev); - ironlake_edp_panel_on(intel_dp); - if (!is_pch_edp(intel_dp)) - ironlake_edp_pll_on(encoder); diff --git a/drm-nouveau-fixes.patch b/drm-nouveau-fixes.patch new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/drm-nouveau-fixes.patch @@ -0,0 +1 @@ + diff --git a/drm-nouveau-updates.patch b/drm-nouveau-updates.patch index 3bd652fa6..e69de29bb 100644 --- a/drm-nouveau-updates.patch +++ b/drm-nouveau-updates.patch @@ -1,1875 +0,0 @@ - drivers/gpu/drm/nouveau/nouveau_bios.c | 25 +-- - drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +- - drivers/gpu/drm/nouveau/nouveau_channel.c | 2 +- - drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- - drivers/gpu/drm/nouveau/nouveau_dp.c | 2 - - drivers/gpu/drm/nouveau/nouveau_drv.h | 15 +- - drivers/gpu/drm/nouveau/nouveau_fence.c | 190 ++++++++++------ - drivers/gpu/drm/nouveau/nouveau_mem.c | 50 +++- - drivers/gpu/drm/nouveau/nouveau_object.c | 22 ++- - drivers/gpu/drm/nouveau/nouveau_sgdma.c | 341 +++++++++++++++++++++++++---- - drivers/gpu/drm/nouveau/nouveau_state.c | 10 +- - drivers/gpu/drm/nouveau/nouveau_temp.c | 4 +- - drivers/gpu/drm/nouveau/nouveau_util.c | 23 ++- - drivers/gpu/drm/nouveau/nouveau_util.h | 4 + - drivers/gpu/drm/nouveau/nouveau_vm.c | 13 +- - drivers/gpu/drm/nouveau/nv04_fifo.c | 19 ++- - drivers/gpu/drm/nouveau/nv40_fb.c | 59 +++++- - drivers/gpu/drm/nouveau/nv50_display.c | 7 +- - drivers/gpu/drm/nouveau/nv50_fb.c | 150 ++++++++++++- - drivers/gpu/drm/nouveau/nv50_fifo.c | 3 +- - drivers/gpu/drm/nouveau/nv50_gpio.c | 13 +- - drivers/gpu/drm/nouveau/nv50_graph.c | 142 +++++++----- - drivers/gpu/drm/nouveau/nv50_vm.c | 1 - - drivers/gpu/drm/nouveau/nv84_crypt.c | 2 +- - drivers/gpu/drm/nouveau/nvc0_fifo.c | 15 +- - drivers/gpu/drm/nouveau/nvc0_graph.c | 2 - - 26 files changed, 841 insertions(+), 281 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c -index 6bdab89..b8ff1e7 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_bios.c -+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c -@@ -5950,6 +5950,11 @@ apply_dcb_connector_quirks(struct nvbios *bios, int idx) - } - } - -+static const u8 hpd_gpio[16] = { -+ 0xff, 0x07, 0x08, 0xff, 0xff, 0x51, 0x52, 0xff, -+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x5e, 0x5f, 0x60, -+}; -+ - static void - parse_dcb_connector_table(struct nvbios *bios) - { -@@ -5986,23 +5991,9 @@ parse_dcb_connector_table(struct nvbios *bios) - - cte->type = (cte->entry & 0x000000ff) >> 0; - cte->index2 = (cte->entry & 0x00000f00) >> 8; -- switch (cte->entry & 0x00033000) { -- case 0x00001000: -- cte->gpio_tag = 0x07; -- break; -- case 0x00002000: -- cte->gpio_tag = 0x08; -- break; -- case 0x00010000: -- cte->gpio_tag = 0x51; -- break; -- case 0x00020000: -- cte->gpio_tag = 0x52; -- break; -- default: -- cte->gpio_tag = 0xff; -- break; -- } -+ -+ cte->gpio_tag = ffs((cte->entry & 0x07033000) >> 12); -+ cte->gpio_tag = hpd_gpio[cte->gpio_tag]; - - if (cte->type == 0xff) - continue; -diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c -index a521840..53a8000 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_bo.c -+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c -@@ -385,7 +385,8 @@ nouveau_bo_create_ttm_backend_entry(struct ttm_bo_device *bdev) - case NOUVEAU_GART_AGP: - return ttm_agp_backend_init(bdev, dev->agp->bridge); - #endif -- case NOUVEAU_GART_SGDMA: -+ case NOUVEAU_GART_PDMA: -+ case NOUVEAU_GART_HW: - return nouveau_sgdma_init_ttm(dev); - default: - NV_ERROR(dev, "Unknown GART type %d\n", -@@ -439,7 +440,8 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, - TTM_PL_FLAG_WC; - man->default_caching = TTM_PL_FLAG_WC; - break; -- case NOUVEAU_GART_SGDMA: -+ case NOUVEAU_GART_PDMA: -+ case NOUVEAU_GART_HW: - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE | - TTM_MEMTYPE_FLAG_CMA; - man->available_caching = TTM_PL_MASK_CACHING; -diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c -index 3960d66..3d7b316 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_channel.c -+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c -@@ -35,7 +35,7 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan) - struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_bo *pb = chan->pushbuf_bo; - struct nouveau_gpuobj *pushbuf = NULL; -- int ret; -+ int ret = 0; - - if (dev_priv->card_type >= NV_50) { - if (dev_priv->card_type < NV_C0) { -diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c -index 505c6bf..566466b 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_display.c -+++ b/drivers/gpu/drm/nouveau/nouveau_display.c -@@ -244,7 +244,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, - - /* Initialize a page flip struct */ - *s = (struct nouveau_page_flip_state) -- { { }, s->event, nouveau_crtc(crtc)->index, -+ { { }, event, nouveau_crtc(crtc)->index, - fb->bits_per_pixel, fb->pitch, crtc->x, crtc->y, - new_bo->bo.offset }; - -diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c -index 38d5995..7beb82a 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_dp.c -+++ b/drivers/gpu/drm/nouveau/nouveau_dp.c -@@ -175,7 +175,6 @@ nouveau_dp_link_train_adjust(struct drm_encoder *encoder, uint8_t *config) - { - struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - struct drm_device *dev = encoder->dev; -- struct bit_displayport_encoder_table_entry *dpse; - struct bit_displayport_encoder_table *dpe; - int ret, i, dpe_headerlen, vs = 0, pre = 0; - uint8_t request[2]; -@@ -183,7 +182,6 @@ nouveau_dp_link_train_adjust(struct drm_encoder *encoder, uint8_t *config) - dpe = nouveau_bios_dp_table(dev, nv_encoder->dcb, &dpe_headerlen); - if (!dpe) - return false; -- dpse = (void *)((char *)dpe + dpe_headerlen); - - ret = auxch_rd(encoder, DP_ADJUST_REQUEST_LANE0_1, request, 2); - if (ret) -diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h -index 982d70b..2cae8e7 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_drv.h -+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h -@@ -652,7 +652,6 @@ struct drm_nouveau_private { - /* interrupt handling */ - void (*irq_handler[32])(struct drm_device *); - bool msi_enabled; -- struct workqueue_struct *wq; - struct work_struct irq_work; - - struct list_head vbl_waiting; -@@ -691,13 +690,21 @@ struct drm_nouveau_private { - struct { - enum { - NOUVEAU_GART_NONE = 0, -- NOUVEAU_GART_AGP, -- NOUVEAU_GART_SGDMA -+ NOUVEAU_GART_AGP, /* AGP */ -+ NOUVEAU_GART_PDMA, /* paged dma object */ -+ NOUVEAU_GART_HW /* on-chip gart/vm */ - } type; - uint64_t aper_base; - uint64_t aper_size; - uint64_t aper_free; - -+ struct ttm_backend_func *func; -+ -+ struct { -+ struct page *page; -+ dma_addr_t addr; -+ } dummy; -+ - struct nouveau_gpuobj *sg_ctxdma; - struct nouveau_vma vma; - } gart_info; -@@ -1076,7 +1083,7 @@ extern void nv40_fb_set_tile_region(struct drm_device *dev, int i); - /* nv50_fb.c */ - extern int nv50_fb_init(struct drm_device *); - extern void nv50_fb_takedown(struct drm_device *); --extern void nv50_fb_vm_trap(struct drm_device *, int display, const char *); -+extern void nv50_fb_vm_trap(struct drm_device *, int display); - - /* nvc0_fb.c */ - extern int nvc0_fb_init(struct drm_device *); -diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c -index 221b846..8b46392 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_fence.c -+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c -@@ -32,8 +32,7 @@ - #include "nouveau_dma.h" - - #define USE_REFCNT(dev) (nouveau_private(dev)->chipset >= 0x10) --#define USE_SEMA(dev) (nouveau_private(dev)->chipset >= 0x17 && \ -- nouveau_private(dev)->card_type < NV_C0) -+#define USE_SEMA(dev) (nouveau_private(dev)->chipset >= 0x17) - - struct nouveau_fence { - struct nouveau_channel *channel; -@@ -259,11 +258,12 @@ __nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr) - } - - static struct nouveau_semaphore * --alloc_semaphore(struct drm_device *dev) -+semaphore_alloc(struct drm_device *dev) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_semaphore *sema; -- int ret; -+ int size = (dev_priv->chipset < 0x84) ? 4 : 16; -+ int ret, i; - - if (!USE_SEMA(dev)) - return NULL; -@@ -277,9 +277,9 @@ alloc_semaphore(struct drm_device *dev) - goto fail; - - spin_lock(&dev_priv->fence.lock); -- sema->mem = drm_mm_search_free(&dev_priv->fence.heap, 4, 0, 0); -+ sema->mem = drm_mm_search_free(&dev_priv->fence.heap, size, 0, 0); - if (sema->mem) -- sema->mem = drm_mm_get_block_atomic(sema->mem, 4, 0); -+ sema->mem = drm_mm_get_block_atomic(sema->mem, size, 0); - spin_unlock(&dev_priv->fence.lock); - - if (!sema->mem) -@@ -287,7 +287,8 @@ alloc_semaphore(struct drm_device *dev) - - kref_init(&sema->ref); - sema->dev = dev; -- nouveau_bo_wr32(dev_priv->fence.bo, sema->mem->start / 4, 0); -+ for (i = sema->mem->start; i < sema->mem->start + size; i += 4) -+ nouveau_bo_wr32(dev_priv->fence.bo, i / 4, 0); - - return sema; - fail: -@@ -296,7 +297,7 @@ fail: - } - - static void --free_semaphore(struct kref *ref) -+semaphore_free(struct kref *ref) - { - struct nouveau_semaphore *sema = - container_of(ref, struct nouveau_semaphore, ref); -@@ -318,61 +319,107 @@ semaphore_work(void *priv, bool signalled) - if (unlikely(!signalled)) - nouveau_bo_wr32(dev_priv->fence.bo, sema->mem->start / 4, 1); - -- kref_put(&sema->ref, free_semaphore); -+ kref_put(&sema->ref, semaphore_free); - } - - static int --emit_semaphore(struct nouveau_channel *chan, int method, -- struct nouveau_semaphore *sema) -+semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema) - { -- struct drm_nouveau_private *dev_priv = sema->dev->dev_private; -- struct nouveau_fence *fence; -- bool smart = (dev_priv->card_type >= NV_50); -+ struct drm_nouveau_private *dev_priv = chan->dev->dev_private; -+ struct nouveau_fence *fence = NULL; - int ret; - -- ret = RING_SPACE(chan, smart ? 8 : 4); -+ if (dev_priv->chipset < 0x84) { -+ ret = RING_SPACE(chan, 3); -+ if (ret) -+ return ret; -+ -+ BEGIN_RING(chan, NvSubSw, NV_SW_SEMAPHORE_OFFSET, 2); -+ OUT_RING (chan, sema->mem->start); -+ OUT_RING (chan, 1); -+ } else -+ if (dev_priv->chipset < 0xc0) { -+ struct nouveau_vma *vma = &dev_priv->fence.bo->vma; -+ u64 offset = vma->offset + sema->mem->start; -+ -+ ret = RING_SPACE(chan, 5); -+ if (ret) -+ return ret; -+ -+ BEGIN_RING(chan, NvSubSw, 0x0010, 4); -+ OUT_RING (chan, upper_32_bits(offset)); -+ OUT_RING (chan, lower_32_bits(offset)); -+ OUT_RING (chan, 1); -+ OUT_RING (chan, 1); /* ACQUIRE_EQ */ -+ } else { -+ struct nouveau_vma *vma = &dev_priv->fence.bo->vma; -+ u64 offset = vma->offset + sema->mem->start; -+ -+ ret = RING_SPACE(chan, 5); -+ if (ret) -+ return ret; -+ -+ BEGIN_NVC0(chan, 2, NvSubM2MF, 0x0010, 4); -+ OUT_RING (chan, upper_32_bits(offset)); -+ OUT_RING (chan, lower_32_bits(offset)); -+ OUT_RING (chan, 1); -+ OUT_RING (chan, 0x1001); /* ACQUIRE_EQ */ -+ } -+ -+ /* Delay semaphore destruction until its work is done */ -+ ret = nouveau_fence_new(chan, &fence, true); - if (ret) - return ret; - -- if (smart) { -- BEGIN_RING(chan, NvSubSw, NV_SW_DMA_SEMAPHORE, 1); -- OUT_RING(chan, NvSema); -- } -- BEGIN_RING(chan, NvSubSw, NV_SW_SEMAPHORE_OFFSET, 1); -- OUT_RING(chan, sema->mem->start); -- -- if (smart && method == NV_SW_SEMAPHORE_ACQUIRE) { -- /* -- * NV50 tries to be too smart and context-switch -- * between semaphores instead of doing a "first come, -- * first served" strategy like previous cards -- * do. -- * -- * That's bad because the ACQUIRE latency can get as -- * large as the PFIFO context time slice in the -- * typical DRI2 case where you have several -- * outstanding semaphores at the same moment. -- * -- * If we're going to ACQUIRE, force the card to -- * context switch before, just in case the matching -- * RELEASE is already scheduled to be executed in -- * another channel. -- */ -- BEGIN_RING(chan, NvSubSw, NV_SW_YIELD, 1); -- OUT_RING(chan, 0); -- } -+ kref_get(&sema->ref); -+ nouveau_fence_work(fence, semaphore_work, sema); -+ nouveau_fence_unref(&fence); -+ return 0; -+} -+ -+static int -+semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema) -+{ -+ struct drm_nouveau_private *dev_priv = chan->dev->dev_private; -+ struct nouveau_fence *fence = NULL; -+ int ret; -+ -+ if (dev_priv->chipset < 0x84) { -+ ret = RING_SPACE(chan, 4); -+ if (ret) -+ return ret; -+ -+ BEGIN_RING(chan, NvSubSw, NV_SW_SEMAPHORE_OFFSET, 1); -+ OUT_RING (chan, sema->mem->start); -+ BEGIN_RING(chan, NvSubSw, NV_SW_SEMAPHORE_RELEASE, 1); -+ OUT_RING (chan, 1); -+ } else -+ if (dev_priv->chipset < 0xc0) { -+ struct nouveau_vma *vma = &dev_priv->fence.bo->vma; -+ u64 offset = vma->offset + sema->mem->start; - -- BEGIN_RING(chan, NvSubSw, method, 1); -- OUT_RING(chan, 1); -- -- if (smart && method == NV_SW_SEMAPHORE_RELEASE) { -- /* -- * Force the card to context switch, there may be -- * another channel waiting for the semaphore we just -- * released. -- */ -- BEGIN_RING(chan, NvSubSw, NV_SW_YIELD, 1); -- OUT_RING(chan, 0); -+ ret = RING_SPACE(chan, 5); -+ if (ret) -+ return ret; -+ -+ BEGIN_RING(chan, NvSubSw, 0x0010, 4); -+ OUT_RING (chan, upper_32_bits(offset)); -+ OUT_RING (chan, lower_32_bits(offset)); -+ OUT_RING (chan, 1); -+ OUT_RING (chan, 2); /* RELEASE */ -+ } else { -+ struct nouveau_vma *vma = &dev_priv->fence.bo->vma; -+ u64 offset = vma->offset + sema->mem->start; -+ -+ ret = RING_SPACE(chan, 5); -+ if (ret) -+ return ret; -+ -+ BEGIN_NVC0(chan, 2, NvSubM2MF, 0x0010, 4); -+ OUT_RING (chan, upper_32_bits(offset)); -+ OUT_RING (chan, lower_32_bits(offset)); -+ OUT_RING (chan, 1); -+ OUT_RING (chan, 0x1002); /* RELEASE */ - } - - /* Delay semaphore destruction until its work is done */ -@@ -383,7 +430,6 @@ emit_semaphore(struct nouveau_channel *chan, int method, - kref_get(&sema->ref); - nouveau_fence_work(fence, semaphore_work, sema); - nouveau_fence_unref(&fence); -- - return 0; - } - -@@ -400,7 +446,7 @@ nouveau_fence_sync(struct nouveau_fence *fence, - nouveau_fence_signalled(fence))) - goto out; - -- sema = alloc_semaphore(dev); -+ sema = semaphore_alloc(dev); - if (!sema) { - /* Early card or broken userspace, fall back to - * software sync. */ -@@ -418,17 +464,17 @@ nouveau_fence_sync(struct nouveau_fence *fence, - } - - /* Make wchan wait until it gets signalled */ -- ret = emit_semaphore(wchan, NV_SW_SEMAPHORE_ACQUIRE, sema); -+ ret = semaphore_acquire(wchan, sema); - if (ret) - goto out_unlock; - - /* Signal the semaphore from chan */ -- ret = emit_semaphore(chan, NV_SW_SEMAPHORE_RELEASE, sema); -+ ret = semaphore_release(chan, sema); - - out_unlock: - mutex_unlock(&chan->mutex); - out_unref: -- kref_put(&sema->ref, free_semaphore); -+ kref_put(&sema->ref, semaphore_free); - out: - if (chan) - nouveau_channel_put_unlocked(&chan); -@@ -449,22 +495,23 @@ nouveau_fence_channel_init(struct nouveau_channel *chan) - struct nouveau_gpuobj *obj = NULL; - int ret; - -+ if (dev_priv->card_type >= NV_C0) -+ goto out_initialised; -+ - /* Create an NV_SW object for various sync purposes */ - ret = nouveau_gpuobj_gr_new(chan, NvSw, NV_SW); - if (ret) - return ret; - - /* we leave subchannel empty for nvc0 */ -- if (dev_priv->card_type < NV_C0) { -- ret = RING_SPACE(chan, 2); -- if (ret) -- return ret; -- BEGIN_RING(chan, NvSubSw, 0, 1); -- OUT_RING(chan, NvSw); -- } -+ ret = RING_SPACE(chan, 2); -+ if (ret) -+ return ret; -+ BEGIN_RING(chan, NvSubSw, 0, 1); -+ OUT_RING(chan, NvSw); - - /* Create a DMA object for the shared cross-channel sync area. */ -- if (USE_SEMA(dev)) { -+ if (USE_SEMA(dev) && dev_priv->chipset < 0x84) { - struct ttm_mem_reg *mem = &dev_priv->fence.bo->bo.mem; - - ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY, -@@ -484,14 +531,20 @@ nouveau_fence_channel_init(struct nouveau_channel *chan) - return ret; - BEGIN_RING(chan, NvSubSw, NV_SW_DMA_SEMAPHORE, 1); - OUT_RING(chan, NvSema); -+ } else { -+ ret = RING_SPACE(chan, 2); -+ if (ret) -+ return ret; -+ BEGIN_RING(chan, NvSubSw, NV_SW_DMA_SEMAPHORE, 1); -+ OUT_RING (chan, chan->vram_handle); /* whole VM */ - } - - FIRE_RING(chan); - -+out_initialised: - INIT_LIST_HEAD(&chan->fence.pending); - spin_lock_init(&chan->fence.lock); - atomic_set(&chan->fence.last_sequence_irq, 0); -- - return 0; - } - -@@ -519,11 +572,12 @@ int - nouveau_fence_init(struct drm_device *dev) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; -+ int size = (dev_priv->chipset < 0x84) ? 4096 : 16384; - int ret; - - /* Create a shared VRAM heap for cross-channel sync. */ - if (USE_SEMA(dev)) { -- ret = nouveau_bo_new(dev, NULL, 4096, 0, TTM_PL_FLAG_VRAM, -+ ret = nouveau_bo_new(dev, NULL, size, 0, TTM_PL_FLAG_VRAM, - 0, 0, false, true, &dev_priv->fence.bo); - if (ret) - return ret; -diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c -index b0fb9bd..5b769eb 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_mem.c -+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c -@@ -393,11 +393,17 @@ nouveau_mem_vram_init(struct drm_device *dev) - struct ttm_bo_device *bdev = &dev_priv->ttm.bdev; - int ret, dma_bits; - -- if (dev_priv->card_type >= NV_50 && -- pci_dma_supported(dev->pdev, DMA_BIT_MASK(40))) -- dma_bits = 40; -- else -- dma_bits = 32; -+ dma_bits = 32; -+ if (dev_priv->card_type >= NV_50) { -+ if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40))) -+ dma_bits = 40; -+ } else -+ if (drm_device_is_pcie(dev) && -+ dev_priv->chipset != 0x40 && -+ dev_priv->chipset != 0x45) { -+ if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39))) -+ dma_bits = 39; -+ } - - ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(dma_bits)); - if (ret) -@@ -419,14 +425,32 @@ nouveau_mem_vram_init(struct drm_device *dev) - } - - /* reserve space at end of VRAM for PRAMIN */ -- if (dev_priv->chipset == 0x40 || dev_priv->chipset == 0x47 || -- dev_priv->chipset == 0x49 || dev_priv->chipset == 0x4b) -- dev_priv->ramin_rsvd_vram = (2 * 1024 * 1024); -- else -- if (dev_priv->card_type >= NV_40) -- dev_priv->ramin_rsvd_vram = (1 * 1024 * 1024); -- else -- dev_priv->ramin_rsvd_vram = (512 * 1024); -+ if (dev_priv->card_type >= NV_50) { -+ dev_priv->ramin_rsvd_vram = 1 * 1024 * 1024; -+ } else -+ if (dev_priv->card_type >= NV_40) { -+ u32 vs = hweight8((nv_rd32(dev, 0x001540) & 0x0000ff00) >> 8); -+ u32 rsvd; -+ -+ /* estimate grctx size, the magics come from nv40_grctx.c */ -+ if (dev_priv->chipset == 0x40) rsvd = 0x6aa0 * vs; -+ else if (dev_priv->chipset < 0x43) rsvd = 0x4f00 * vs; -+ else if (nv44_graph_class(dev)) rsvd = 0x4980 * vs; -+ else rsvd = 0x4a40 * vs; -+ rsvd += 16 * 1024; -+ rsvd *= dev_priv->engine.fifo.channels; -+ -+ /* pciegart table */ -+ if (drm_device_is_pcie(dev)) -+ rsvd += 512 * 1024; -+ -+ /* object storage */ -+ rsvd += 512 * 1024; -+ -+ dev_priv->ramin_rsvd_vram = round_up(rsvd, 4096); -+ } else { -+ dev_priv->ramin_rsvd_vram = 512 * 1024; -+ } - - ret = dev_priv->engine.vram.init(dev); - if (ret) -diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c -index 30b6544..3c12461 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_object.c -+++ b/drivers/gpu/drm/nouveau/nouveau_object.c -@@ -490,16 +490,22 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, u64 base, - } - - if (target == NV_MEM_TARGET_GART) { -- if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) { -- target = NV_MEM_TARGET_PCI_NOSNOOP; -- base += dev_priv->gart_info.aper_base; -- } else -- if (base != 0) { -- base = nouveau_sgdma_get_physical(dev, base); -+ struct nouveau_gpuobj *gart = dev_priv->gart_info.sg_ctxdma; -+ -+ if (dev_priv->gart_info.type == NOUVEAU_GART_PDMA) { -+ if (base == 0) { -+ nouveau_gpuobj_ref(gart, pobj); -+ return 0; -+ } -+ -+ base = nouveau_sgdma_get_physical(dev, base); - target = NV_MEM_TARGET_PCI; - } else { -- nouveau_gpuobj_ref(dev_priv->gart_info.sg_ctxdma, pobj); -- return 0; -+ base += dev_priv->gart_info.aper_base; -+ if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) -+ target = NV_MEM_TARGET_PCI_NOSNOOP; -+ else -+ target = NV_MEM_TARGET_PCI; - } - } - -diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c -index 9a250eb..a26383b 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c -+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c -@@ -74,8 +74,24 @@ nouveau_sgdma_clear(struct ttm_backend *be) - } - } - -+static void -+nouveau_sgdma_destroy(struct ttm_backend *be) -+{ -+ struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; -+ -+ if (be) { -+ NV_DEBUG(nvbe->dev, "\n"); -+ -+ if (nvbe) { -+ if (nvbe->pages) -+ be->func->clear(be); -+ kfree(nvbe); -+ } -+ } -+} -+ - static int --nouveau_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) -+nv04_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) - { - struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; - struct drm_device *dev = nvbe->dev; -@@ -102,7 +118,7 @@ nouveau_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) - } - - static int --nouveau_sgdma_unbind(struct ttm_backend *be) -+nv04_sgdma_unbind(struct ttm_backend *be) - { - struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; - struct drm_device *dev = nvbe->dev; -@@ -125,23 +141,222 @@ nouveau_sgdma_unbind(struct ttm_backend *be) - return 0; - } - -+static struct ttm_backend_func nv04_sgdma_backend = { -+ .populate = nouveau_sgdma_populate, -+ .clear = nouveau_sgdma_clear, -+ .bind = nv04_sgdma_bind, -+ .unbind = nv04_sgdma_unbind, -+ .destroy = nouveau_sgdma_destroy -+}; -+ - static void --nouveau_sgdma_destroy(struct ttm_backend *be) -+nv41_sgdma_flush(struct nouveau_sgdma_be *nvbe) -+{ -+ struct drm_device *dev = nvbe->dev; -+ -+ nv_wr32(dev, 0x100810, 0x00000022); -+ if (!nv_wait(dev, 0x100810, 0x00000100, 0x00000100)) -+ NV_ERROR(dev, "vm flush timeout: 0x%08x\n", -+ nv_rd32(dev, 0x100810)); -+ nv_wr32(dev, 0x100810, 0x00000000); -+} -+ -+static int -+nv41_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) - { - struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; -+ struct drm_nouveau_private *dev_priv = nvbe->dev->dev_private; -+ struct nouveau_gpuobj *pgt = dev_priv->gart_info.sg_ctxdma; -+ dma_addr_t *list = nvbe->pages; -+ u32 pte = mem->start << 2; -+ u32 cnt = nvbe->nr_pages; - -- if (be) { -- NV_DEBUG(nvbe->dev, "\n"); -+ nvbe->offset = mem->start << PAGE_SHIFT; - -- if (nvbe) { -- if (nvbe->pages) -- be->func->clear(be); -- kfree(nvbe); -+ while (cnt--) { -+ nv_wo32(pgt, pte, (*list++ >> 7) | 1); -+ pte += 4; -+ } -+ -+ nv41_sgdma_flush(nvbe); -+ nvbe->bound = true; -+ return 0; -+} -+ -+static int -+nv41_sgdma_unbind(struct ttm_backend *be) -+{ -+ struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; -+ struct drm_nouveau_private *dev_priv = nvbe->dev->dev_private; -+ struct nouveau_gpuobj *pgt = dev_priv->gart_info.sg_ctxdma; -+ u32 pte = (nvbe->offset >> 12) << 2; -+ u32 cnt = nvbe->nr_pages; -+ -+ while (cnt--) { -+ nv_wo32(pgt, pte, 0x00000000); -+ pte += 4; -+ } -+ -+ nv41_sgdma_flush(nvbe); -+ nvbe->bound = false; -+ return 0; -+} -+ -+static struct ttm_backend_func nv41_sgdma_backend = { -+ .populate = nouveau_sgdma_populate, -+ .clear = nouveau_sgdma_clear, -+ .bind = nv41_sgdma_bind, -+ .unbind = nv41_sgdma_unbind, -+ .destroy = nouveau_sgdma_destroy -+}; -+ -+static void -+nv44_sgdma_flush(struct nouveau_sgdma_be *nvbe) -+{ -+ struct drm_device *dev = nvbe->dev; -+ -+ nv_wr32(dev, 0x100814, (nvbe->nr_pages - 1) << 12); -+ nv_wr32(dev, 0x100808, nvbe->offset | 0x20); -+ if (!nv_wait(dev, 0x100808, 0x00000001, 0x00000001)) -+ NV_ERROR(dev, "gart flush timeout: 0x%08x\n", -+ nv_rd32(dev, 0x100808)); -+ nv_wr32(dev, 0x100808, 0x00000000); -+} -+ -+static void -+nv44_sgdma_fill(struct nouveau_gpuobj *pgt, dma_addr_t *list, u32 base, u32 cnt) -+{ -+ struct drm_nouveau_private *dev_priv = pgt->dev->dev_private; -+ dma_addr_t dummy = dev_priv->gart_info.dummy.addr; -+ u32 pte, tmp[4]; -+ -+ pte = base >> 2; -+ base &= ~0x0000000f; -+ -+ tmp[0] = nv_ro32(pgt, base + 0x0); -+ tmp[1] = nv_ro32(pgt, base + 0x4); -+ tmp[2] = nv_ro32(pgt, base + 0x8); -+ tmp[3] = nv_ro32(pgt, base + 0xc); -+ while (cnt--) { -+ u32 addr = list ? (*list++ >> 12) : (dummy >> 12); -+ switch (pte++ & 0x3) { -+ case 0: -+ tmp[0] &= ~0x07ffffff; -+ tmp[0] |= addr; -+ break; -+ case 1: -+ tmp[0] &= ~0xf8000000; -+ tmp[0] |= addr << 27; -+ tmp[1] &= ~0x003fffff; -+ tmp[1] |= addr >> 5; -+ break; -+ case 2: -+ tmp[1] &= ~0xffc00000; -+ tmp[1] |= addr << 22; -+ tmp[2] &= ~0x0001ffff; -+ tmp[2] |= addr >> 10; -+ break; -+ case 3: -+ tmp[2] &= ~0xfffe0000; -+ tmp[2] |= addr << 17; -+ tmp[3] &= ~0x00000fff; -+ tmp[3] |= addr >> 15; -+ break; - } - } -+ -+ tmp[3] |= 0x40000000; -+ -+ nv_wo32(pgt, base + 0x0, tmp[0]); -+ nv_wo32(pgt, base + 0x4, tmp[1]); -+ nv_wo32(pgt, base + 0x8, tmp[2]); -+ nv_wo32(pgt, base + 0xc, tmp[3]); - } - - static int -+nv44_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) -+{ -+ struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; -+ struct drm_nouveau_private *dev_priv = nvbe->dev->dev_private; -+ struct nouveau_gpuobj *pgt = dev_priv->gart_info.sg_ctxdma; -+ dma_addr_t *list = nvbe->pages; -+ u32 pte = mem->start << 2, tmp[4]; -+ u32 cnt = nvbe->nr_pages; -+ int i; -+ -+ nvbe->offset = mem->start << PAGE_SHIFT; -+ -+ if (pte & 0x0000000c) { -+ u32 max = 4 - ((pte >> 2) & 0x3); -+ u32 part = (cnt > max) ? max : cnt; -+ nv44_sgdma_fill(pgt, list, pte, part); -+ pte += (part << 2); -+ list += part; -+ cnt -= part; -+ } -+ -+ while (cnt >= 4) { -+ for (i = 0; i < 4; i++) -+ tmp[i] = *list++ >> 12; -+ nv_wo32(pgt, pte + 0x0, tmp[0] >> 0 | tmp[1] << 27); -+ nv_wo32(pgt, pte + 0x4, tmp[1] >> 5 | tmp[2] << 22); -+ nv_wo32(pgt, pte + 0x8, tmp[2] >> 10 | tmp[3] << 17); -+ nv_wo32(pgt, pte + 0xc, tmp[3] >> 15 | 0x40000000); -+ pte += 0x10; -+ cnt -= 4; -+ } -+ -+ if (cnt) -+ nv44_sgdma_fill(pgt, list, pte, cnt); -+ -+ nv44_sgdma_flush(nvbe); -+ nvbe->bound = true; -+ return 0; -+} -+ -+static int -+nv44_sgdma_unbind(struct ttm_backend *be) -+{ -+ struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; -+ struct drm_nouveau_private *dev_priv = nvbe->dev->dev_private; -+ struct nouveau_gpuobj *pgt = dev_priv->gart_info.sg_ctxdma; -+ u32 pte = (nvbe->offset >> 12) << 2; -+ u32 cnt = nvbe->nr_pages; -+ -+ if (pte & 0x0000000c) { -+ u32 max = 4 - ((pte >> 2) & 0x3); -+ u32 part = (cnt > max) ? max : cnt; -+ nv44_sgdma_fill(pgt, NULL, pte, part); -+ pte += (part << 2); -+ cnt -= part; -+ } -+ -+ while (cnt >= 4) { -+ nv_wo32(pgt, pte + 0x0, 0x00000000); -+ nv_wo32(pgt, pte + 0x4, 0x00000000); -+ nv_wo32(pgt, pte + 0x8, 0x00000000); -+ nv_wo32(pgt, pte + 0xc, 0x00000000); -+ pte += 0x10; -+ cnt -= 4; -+ } -+ -+ if (cnt) -+ nv44_sgdma_fill(pgt, NULL, pte, cnt); -+ -+ nv44_sgdma_flush(nvbe); -+ nvbe->bound = false; -+ return 0; -+} -+ -+static struct ttm_backend_func nv44_sgdma_backend = { -+ .populate = nouveau_sgdma_populate, -+ .clear = nouveau_sgdma_clear, -+ .bind = nv44_sgdma_bind, -+ .unbind = nv44_sgdma_unbind, -+ .destroy = nouveau_sgdma_destroy -+}; -+ -+static int - nv50_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) - { - struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be; -@@ -170,14 +385,6 @@ nv50_sgdma_unbind(struct ttm_backend *be) - return 0; - } - --static struct ttm_backend_func nouveau_sgdma_backend = { -- .populate = nouveau_sgdma_populate, -- .clear = nouveau_sgdma_clear, -- .bind = nouveau_sgdma_bind, -- .unbind = nouveau_sgdma_unbind, -- .destroy = nouveau_sgdma_destroy --}; -- - static struct ttm_backend_func nv50_sgdma_backend = { - .populate = nouveau_sgdma_populate, - .clear = nouveau_sgdma_clear, -@@ -198,10 +405,7 @@ nouveau_sgdma_init_ttm(struct drm_device *dev) - - nvbe->dev = dev; - -- if (dev_priv->card_type < NV_50) -- nvbe->backend.func = &nouveau_sgdma_backend; -- else -- nvbe->backend.func = &nv50_sgdma_backend; -+ nvbe->backend.func = dev_priv->gart_info.func; - return &nvbe->backend; - } - -@@ -210,21 +414,70 @@ nouveau_sgdma_init(struct drm_device *dev) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_gpuobj *gpuobj = NULL; -- uint32_t aper_size, obj_size; -- int i, ret; -+ u32 aper_size, align; -+ int ret; -+ -+ if (dev_priv->card_type >= NV_50 || drm_device_is_pcie(dev)) -+ aper_size = 512 * 1024 * 1024; -+ else -+ aper_size = 64 * 1024 * 1024; -+ -+ /* Dear NVIDIA, NV44+ would like proper present bits in PTEs for -+ * christmas. The cards before it have them, the cards after -+ * it have them, why is NV44 so unloved? -+ */ -+ dev_priv->gart_info.dummy.page = alloc_page(GFP_DMA32 | GFP_KERNEL); -+ if (!dev_priv->gart_info.dummy.page) -+ return -ENOMEM; -+ -+ dev_priv->gart_info.dummy.addr = -+ pci_map_page(dev->pdev, dev_priv->gart_info.dummy.page, -+ 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); -+ if (pci_dma_mapping_error(dev->pdev, dev_priv->gart_info.dummy.addr)) { -+ NV_ERROR(dev, "error mapping dummy page\n"); -+ __free_page(dev_priv->gart_info.dummy.page); -+ dev_priv->gart_info.dummy.page = NULL; -+ return -ENOMEM; -+ } - -- if (dev_priv->card_type < NV_50) { -- if(dev_priv->ramin_rsvd_vram < 2 * 1024 * 1024) -- aper_size = 64 * 1024 * 1024; -- else -- aper_size = 512 * 1024 * 1024; -+ if (dev_priv->card_type >= NV_50) { -+ ret = nouveau_vm_get(dev_priv->chan_vm, aper_size, -+ 12, NV_MEM_ACCESS_RW, -+ &dev_priv->gart_info.vma); -+ if (ret) -+ return ret; -+ -+ dev_priv->gart_info.aper_base = dev_priv->gart_info.vma.offset; -+ dev_priv->gart_info.aper_size = aper_size; -+ dev_priv->gart_info.type = NOUVEAU_GART_HW; -+ dev_priv->gart_info.func = &nv50_sgdma_backend; -+ } else -+ if (0 && drm_device_is_pcie(dev) && -+ dev_priv->chipset != 0x40 && dev_priv->chipset != 0x45) { -+ if (nv44_graph_class(dev)) { -+ dev_priv->gart_info.func = &nv44_sgdma_backend; -+ align = 512 * 1024; -+ } else { -+ dev_priv->gart_info.func = &nv41_sgdma_backend; -+ align = 16; -+ } - -- obj_size = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 4; -- obj_size += 8; /* ctxdma header */ -+ ret = nouveau_gpuobj_new(dev, NULL, aper_size / 1024, align, -+ NVOBJ_FLAG_ZERO_ALLOC | -+ NVOBJ_FLAG_ZERO_FREE, &gpuobj); -+ if (ret) { -+ NV_ERROR(dev, "Error creating sgdma object: %d\n", ret); -+ return ret; -+ } - -- ret = nouveau_gpuobj_new(dev, NULL, obj_size, 16, -- NVOBJ_FLAG_ZERO_ALLOC | -- NVOBJ_FLAG_ZERO_FREE, &gpuobj); -+ dev_priv->gart_info.sg_ctxdma = gpuobj; -+ dev_priv->gart_info.aper_base = 0; -+ dev_priv->gart_info.aper_size = aper_size; -+ dev_priv->gart_info.type = NOUVEAU_GART_HW; -+ } else { -+ ret = nouveau_gpuobj_new(dev, NULL, (aper_size / 1024) + 8, 16, -+ NVOBJ_FLAG_ZERO_ALLOC | -+ NVOBJ_FLAG_ZERO_FREE, &gpuobj); - if (ret) { - NV_ERROR(dev, "Error creating sgdma object: %d\n", ret); - return ret; -@@ -236,25 +489,14 @@ nouveau_sgdma_init(struct drm_device *dev) - (0 << 14) /* RW */ | - (2 << 16) /* PCI */); - nv_wo32(gpuobj, 4, aper_size - 1); -- for (i = 2; i < 2 + (aper_size >> 12); i++) -- nv_wo32(gpuobj, i * 4, 0x00000000); - - dev_priv->gart_info.sg_ctxdma = gpuobj; - dev_priv->gart_info.aper_base = 0; - dev_priv->gart_info.aper_size = aper_size; -- } else -- if (dev_priv->chan_vm) { -- ret = nouveau_vm_get(dev_priv->chan_vm, 512 * 1024 * 1024, -- 12, NV_MEM_ACCESS_RW, -- &dev_priv->gart_info.vma); -- if (ret) -- return ret; -- -- dev_priv->gart_info.aper_base = dev_priv->gart_info.vma.offset; -- dev_priv->gart_info.aper_size = 512 * 1024 * 1024; -+ dev_priv->gart_info.type = NOUVEAU_GART_PDMA; -+ dev_priv->gart_info.func = &nv04_sgdma_backend; - } - -- dev_priv->gart_info.type = NOUVEAU_GART_SGDMA; - return 0; - } - -@@ -265,6 +507,13 @@ nouveau_sgdma_takedown(struct drm_device *dev) - - nouveau_gpuobj_ref(NULL, &dev_priv->gart_info.sg_ctxdma); - nouveau_vm_put(&dev_priv->gart_info.vma); -+ -+ if (dev_priv->gart_info.dummy.page) { -+ pci_unmap_page(dev->pdev, dev_priv->gart_info.dummy.addr, -+ PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); -+ __free_page(dev_priv->gart_info.dummy.page); -+ dev_priv->gart_info.dummy.page = NULL; -+ } - } - - uint32_t -diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c -index a54fc43..916505d 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_state.c -+++ b/drivers/gpu/drm/nouveau/nouveau_state.c -@@ -929,12 +929,6 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) - NV_DEBUG(dev, "vendor: 0x%X device: 0x%X class: 0x%X\n", - dev->pci_vendor, dev->pci_device, dev->pdev->class); - -- dev_priv->wq = create_workqueue("nouveau"); -- if (!dev_priv->wq) { -- ret = -EINVAL; -- goto err_priv; -- } -- - /* resource 0 is mmio regs */ - /* resource 1 is linear FB */ - /* resource 2 is RAMIN (mmio regs + 0x1000000) */ -@@ -947,7 +941,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) - NV_ERROR(dev, "Unable to initialize the mmio mapping. " - "Please report your setup to " DRIVER_EMAIL "\n"); - ret = -EINVAL; -- goto err_wq; -+ goto err_priv; - } - NV_DEBUG(dev, "regs mapped ok at 0x%llx\n", - (unsigned long long)mmio_start_offs); -@@ -1054,8 +1048,6 @@ err_ramin: - iounmap(dev_priv->ramin); - err_mmio: - iounmap(dev_priv->mmio); --err_wq: -- destroy_workqueue(dev_priv->wq); - err_priv: - kfree(dev_priv); - dev->dev_private = NULL; -diff --git a/drivers/gpu/drm/nouveau/nouveau_temp.c b/drivers/gpu/drm/nouveau/nouveau_temp.c -index 8d9968e..649b041 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_temp.c -+++ b/drivers/gpu/drm/nouveau/nouveau_temp.c -@@ -239,11 +239,9 @@ static bool - probe_monitoring_device(struct nouveau_i2c_chan *i2c, - struct i2c_board_info *info) - { -- char modalias[16] = "i2c:"; - struct i2c_client *client; - -- strlcat(modalias, info->type, sizeof(modalias)); -- request_module(modalias); -+ request_module("%s%s", I2C_MODULE_PREFIX, info->type); - - client = i2c_new_device(&i2c->adapter, info); - if (!client) -diff --git a/drivers/gpu/drm/nouveau/nouveau_util.c b/drivers/gpu/drm/nouveau/nouveau_util.c -index fbe0fb1..e51b515 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_util.c -+++ b/drivers/gpu/drm/nouveau/nouveau_util.c -@@ -47,18 +47,27 @@ nouveau_bitfield_print(const struct nouveau_bitfield *bf, u32 value) - printk(" (unknown bits 0x%08x)", value); - } - --void --nouveau_enum_print(const struct nouveau_enum *en, u32 value) -+const struct nouveau_enum * -+nouveau_enum_find(const struct nouveau_enum *en, u32 value) - { - while (en->name) { -- if (value == en->value) { -- printk("%s", en->name); -- return; -- } -- -+ if (en->value == value) -+ return en; - en++; - } - -+ return NULL; -+} -+ -+void -+nouveau_enum_print(const struct nouveau_enum *en, u32 value) -+{ -+ en = nouveau_enum_find(en, value); -+ if (en) { -+ printk("%s", en->name); -+ return; -+ } -+ - printk("(unknown enum 0x%08x)", value); - } - -diff --git a/drivers/gpu/drm/nouveau/nouveau_util.h b/drivers/gpu/drm/nouveau/nouveau_util.h -index d9ceaea..b97719f 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_util.h -+++ b/drivers/gpu/drm/nouveau/nouveau_util.h -@@ -36,10 +36,14 @@ struct nouveau_bitfield { - struct nouveau_enum { - u32 value; - const char *name; -+ void *data; - }; - - void nouveau_bitfield_print(const struct nouveau_bitfield *, u32 value); - void nouveau_enum_print(const struct nouveau_enum *, u32 value); -+const struct nouveau_enum * -+nouveau_enum_find(const struct nouveau_enum *, u32 value); -+ - int nouveau_ratelimit(void); - - #endif -diff --git a/drivers/gpu/drm/nouveau/nouveau_vm.c b/drivers/gpu/drm/nouveau/nouveau_vm.c -index 97d82ae..b4658f7 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_vm.c -+++ b/drivers/gpu/drm/nouveau/nouveau_vm.c -@@ -311,18 +311,7 @@ nouveau_vm_new(struct drm_device *dev, u64 offset, u64 length, u64 mm_offset, - vm->spg_shift = 12; - vm->lpg_shift = 17; - pgt_bits = 27; -- -- /* Should be 4096 everywhere, this is a hack that's -- * currently necessary to avoid an elusive bug that -- * causes corruption when mixing small/large pages -- */ -- if (length < (1ULL << 40)) -- block = 4096; -- else { -- block = (1 << pgt_bits); -- if (length < block) -- block = length; -- } -+ block = 4096; - } else { - kfree(vm); - return -ENOSYS; -diff --git a/drivers/gpu/drm/nouveau/nv04_fifo.c b/drivers/gpu/drm/nouveau/nv04_fifo.c -index f89d104..db465a3 100644 ---- a/drivers/gpu/drm/nouveau/nv04_fifo.c -+++ b/drivers/gpu/drm/nouveau/nv04_fifo.c -@@ -379,6 +379,15 @@ out: - return handled; - } - -+static const char *nv_dma_state_err(u32 state) -+{ -+ static const char * const desc[] = { -+ "NONE", "CALL_SUBR_ACTIVE", "INVALID_MTHD", "RET_SUBR_INACTIVE", -+ "INVALID_CMD", "IB_EMPTY"/* NV50+ */, "MEM_FAULT", "UNK" -+ }; -+ return desc[(state >> 29) & 0x7]; -+} -+ - void - nv04_fifo_isr(struct drm_device *dev) - { -@@ -460,9 +469,10 @@ nv04_fifo_isr(struct drm_device *dev) - if (nouveau_ratelimit()) - NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%02x%08x " - "Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x " -- "State 0x%08x Push 0x%08x\n", -+ "State 0x%08x (err: %s) Push 0x%08x\n", - chid, ho_get, dma_get, ho_put, - dma_put, ib_get, ib_put, state, -+ nv_dma_state_err(state), - push); - - /* METHOD_COUNT, in DMA_STATE on earlier chipsets */ -@@ -476,8 +486,9 @@ nv04_fifo_isr(struct drm_device *dev) - } - } else { - NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%08x " -- "Put 0x%08x State 0x%08x Push 0x%08x\n", -- chid, dma_get, dma_put, state, push); -+ "Put 0x%08x State 0x%08x (err: %s) Push 0x%08x\n", -+ chid, dma_get, dma_put, state, -+ nv_dma_state_err(state), push); - - if (dma_get != dma_put) - nv_wr32(dev, 0x003244, dma_put); -@@ -505,7 +516,7 @@ nv04_fifo_isr(struct drm_device *dev) - - if (dev_priv->card_type == NV_50) { - if (status & 0x00000010) { -- nv50_fb_vm_trap(dev, 1, "PFIFO_BAR_FAULT"); -+ nv50_fb_vm_trap(dev, nouveau_ratelimit()); - status &= ~0x00000010; - nv_wr32(dev, 0x002100, 0x00000010); - } -diff --git a/drivers/gpu/drm/nouveau/nv40_fb.c b/drivers/gpu/drm/nouveau/nv40_fb.c -index f3d9c05..f0ac2a7 100644 ---- a/drivers/gpu/drm/nouveau/nv40_fb.c -+++ b/drivers/gpu/drm/nouveau/nv40_fb.c -@@ -24,6 +24,53 @@ nv40_fb_set_tile_region(struct drm_device *dev, int i) - } - } - -+static void -+nv40_fb_init_gart(struct drm_device *dev) -+{ -+ struct drm_nouveau_private *dev_priv = dev->dev_private; -+ struct nouveau_gpuobj *gart = dev_priv->gart_info.sg_ctxdma; -+ -+ if (dev_priv->gart_info.type != NOUVEAU_GART_HW) { -+ nv_wr32(dev, 0x100800, 0x00000001); -+ return; -+ } -+ -+ nv_wr32(dev, 0x100800, gart->pinst | 0x00000002); -+ nv_mask(dev, 0x10008c, 0x00000100, 0x00000100); -+ nv_wr32(dev, 0x100820, 0x00000000); -+} -+ -+static void -+nv44_fb_init_gart(struct drm_device *dev) -+{ -+ struct drm_nouveau_private *dev_priv = dev->dev_private; -+ struct nouveau_gpuobj *gart = dev_priv->gart_info.sg_ctxdma; -+ u32 vinst; -+ -+ if (dev_priv->gart_info.type != NOUVEAU_GART_HW) { -+ nv_wr32(dev, 0x100850, 0x80000000); -+ nv_wr32(dev, 0x100800, 0x00000001); -+ return; -+ } -+ -+ /* calculate vram address of this PRAMIN block, object -+ * must be allocated on 512KiB alignment, and not exceed -+ * a total size of 512KiB for this to work correctly -+ */ -+ vinst = nv_rd32(dev, 0x10020c); -+ vinst -= ((gart->pinst >> 19) + 1) << 19; -+ -+ nv_wr32(dev, 0x100850, 0x80000000); -+ nv_wr32(dev, 0x100818, dev_priv->gart_info.dummy.addr); -+ -+ nv_wr32(dev, 0x100804, dev_priv->gart_info.aper_size); -+ nv_wr32(dev, 0x100850, 0x00008000); -+ nv_mask(dev, 0x10008c, 0x00000200, 0x00000200); -+ nv_wr32(dev, 0x100820, 0x00000000); -+ nv_wr32(dev, 0x10082c, 0x00000001); -+ nv_wr32(dev, 0x100800, vinst | 0x00000010); -+} -+ - int - nv40_fb_init(struct drm_device *dev) - { -@@ -32,12 +79,12 @@ nv40_fb_init(struct drm_device *dev) - uint32_t tmp; - int i; - -- /* This is strictly a NV4x register (don't know about NV5x). */ -- /* The blob sets these to all kinds of values, and they mess up our setup. */ -- /* I got value 0x52802 instead. For some cards the blob even sets it back to 0x1. */ -- /* Note: the blob doesn't read this value, so i'm pretty sure this is safe for all cards. */ -- /* Any idea what this is? */ -- nv_wr32(dev, NV40_PFB_UNK_800, 0x1); -+ if (dev_priv->chipset != 0x40 && dev_priv->chipset != 0x45) { -+ if (nv44_graph_class(dev)) -+ nv44_fb_init_gart(dev); -+ else -+ nv40_fb_init_gart(dev); -+ } - - switch (dev_priv->chipset) { - case 0x40: -diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c -index 7cc94ed..a804a35 100644 ---- a/drivers/gpu/drm/nouveau/nv50_display.c -+++ b/drivers/gpu/drm/nouveau/nv50_display.c -@@ -345,12 +345,15 @@ int nv50_display_create(struct drm_device *dev) - void - nv50_display_destroy(struct drm_device *dev) - { -+ struct drm_nouveau_private *dev_priv = dev->dev_private; -+ - NV_DEBUG_KMS(dev, "\n"); - - drm_mode_config_cleanup(dev); - - nv50_display_disable(dev); - nouveau_irq_unregister(dev, 26); -+ flush_work_sync(&dev_priv->irq_work); - } - - static u16 -@@ -587,7 +590,7 @@ static void - nv50_display_unk20_handler(struct drm_device *dev) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; -- u32 unk30 = nv_rd32(dev, 0x610030), tmp, pclk, script, mc; -+ u32 unk30 = nv_rd32(dev, 0x610030), tmp, pclk, script, mc = 0; - struct dcb_entry *dcb; - int i, crtc, or, type = OUTPUT_ANY; - -@@ -836,7 +839,7 @@ nv50_display_isr(struct drm_device *dev) - if (clock) { - nv_wr32(dev, NV03_PMC_INTR_EN_0, 0); - if (!work_pending(&dev_priv->irq_work)) -- queue_work(dev_priv->wq, &dev_priv->irq_work); -+ schedule_work(&dev_priv->irq_work); - delayed |= clock; - intr1 &= ~clock; - } -diff --git a/drivers/gpu/drm/nouveau/nv50_fb.c b/drivers/gpu/drm/nouveau/nv50_fb.c -index 50290de..efc8cd4 100644 ---- a/drivers/gpu/drm/nouveau/nv50_fb.c -+++ b/drivers/gpu/drm/nouveau/nv50_fb.c -@@ -95,12 +95,109 @@ nv50_fb_takedown(struct drm_device *dev) - kfree(priv); - } - -+static struct nouveau_enum vm_dispatch_subclients[] = { -+ { 0x00000000, "GRCTX", NULL }, -+ { 0x00000001, "NOTIFY", NULL }, -+ { 0x00000002, "QUERY", NULL }, -+ { 0x00000003, "COND", NULL }, -+ { 0x00000004, "M2M_IN", NULL }, -+ { 0x00000005, "M2M_OUT", NULL }, -+ { 0x00000006, "M2M_NOTIFY", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_ccache_subclients[] = { -+ { 0x00000000, "CB", NULL }, -+ { 0x00000001, "TIC", NULL }, -+ { 0x00000002, "TSC", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_prop_subclients[] = { -+ { 0x00000000, "RT0", NULL }, -+ { 0x00000001, "RT1", NULL }, -+ { 0x00000002, "RT2", NULL }, -+ { 0x00000003, "RT3", NULL }, -+ { 0x00000004, "RT4", NULL }, -+ { 0x00000005, "RT5", NULL }, -+ { 0x00000006, "RT6", NULL }, -+ { 0x00000007, "RT7", NULL }, -+ { 0x00000008, "ZETA", NULL }, -+ { 0x00000009, "LOCAL", NULL }, -+ { 0x0000000a, "GLOBAL", NULL }, -+ { 0x0000000b, "STACK", NULL }, -+ { 0x0000000c, "DST2D", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_pfifo_subclients[] = { -+ { 0x00000000, "PUSHBUF", NULL }, -+ { 0x00000001, "SEMAPHORE", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_bar_subclients[] = { -+ { 0x00000000, "FB", NULL }, -+ { 0x00000001, "IN", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_client[] = { -+ { 0x00000000, "STRMOUT", NULL }, -+ { 0x00000003, "DISPATCH", vm_dispatch_subclients }, -+ { 0x00000004, "PFIFO_WRITE", NULL }, -+ { 0x00000005, "CCACHE", vm_ccache_subclients }, -+ { 0x00000006, "PPPP", NULL }, -+ { 0x00000007, "CLIPID", NULL }, -+ { 0x00000008, "PFIFO_READ", NULL }, -+ { 0x00000009, "VFETCH", NULL }, -+ { 0x0000000a, "TEXTURE", NULL }, -+ { 0x0000000b, "PROP", vm_prop_subclients }, -+ { 0x0000000c, "PVP", NULL }, -+ { 0x0000000d, "PBSP", NULL }, -+ { 0x0000000e, "PCRYPT", NULL }, -+ { 0x0000000f, "PCOUNTER", NULL }, -+ { 0x00000011, "PDAEMON", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_engine[] = { -+ { 0x00000000, "PGRAPH", NULL }, -+ { 0x00000001, "PVP", NULL }, -+ { 0x00000004, "PEEPHOLE", NULL }, -+ { 0x00000005, "PFIFO", vm_pfifo_subclients }, -+ { 0x00000006, "BAR", vm_bar_subclients }, -+ { 0x00000008, "PPPP", NULL }, -+ { 0x00000009, "PBSP", NULL }, -+ { 0x0000000a, "PCRYPT", NULL }, -+ { 0x0000000b, "PCOUNTER", NULL }, -+ { 0x0000000c, "SEMAPHORE_BG", NULL }, -+ { 0x0000000d, "PCOPY", NULL }, -+ { 0x0000000e, "PDAEMON", NULL }, -+ {} -+}; -+ -+static struct nouveau_enum vm_fault[] = { -+ { 0x00000000, "PT_NOT_PRESENT", NULL }, -+ { 0x00000001, "PT_TOO_SHORT", NULL }, -+ { 0x00000002, "PAGE_NOT_PRESENT", NULL }, -+ { 0x00000003, "PAGE_SYSTEM_ONLY", NULL }, -+ { 0x00000004, "PAGE_READ_ONLY", NULL }, -+ { 0x00000006, "NULL_DMAOBJ", NULL }, -+ { 0x00000007, "WRONG_MEMTYPE", NULL }, -+ { 0x0000000b, "VRAM_LIMIT", NULL }, -+ { 0x0000000f, "DMAOBJ_LIMIT", NULL }, -+ {} -+}; -+ - void --nv50_fb_vm_trap(struct drm_device *dev, int display, const char *name) -+nv50_fb_vm_trap(struct drm_device *dev, int display) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; -+ const struct nouveau_enum *en, *cl; - unsigned long flags; - u32 trap[6], idx, chinst; -+ u8 st0, st1, st2, st3; - int i, ch; - - idx = nv_rd32(dev, 0x100c90); -@@ -117,8 +214,8 @@ nv50_fb_vm_trap(struct drm_device *dev, int display, const char *name) - if (!display) - return; - -+ /* lookup channel id */ - chinst = (trap[2] << 16) | trap[1]; -- - spin_lock_irqsave(&dev_priv->channels.lock, flags); - for (ch = 0; ch < dev_priv->engine.fifo.channels; ch++) { - struct nouveau_channel *chan = dev_priv->channels.ptr[ch]; -@@ -131,9 +228,48 @@ nv50_fb_vm_trap(struct drm_device *dev, int display, const char *name) - } - spin_unlock_irqrestore(&dev_priv->channels.lock, flags); - -- NV_INFO(dev, "%s - VM: Trapped %s at %02x%04x%04x status %08x " -- "channel %d (0x%08x)\n", -- name, (trap[5] & 0x100 ? "read" : "write"), -- trap[5] & 0xff, trap[4] & 0xffff, trap[3] & 0xffff, -- trap[0], ch, chinst); -+ /* decode status bits into something more useful */ -+ if (dev_priv->chipset < 0xa3 || -+ dev_priv->chipset == 0xaa || dev_priv->chipset == 0xac) { -+ st0 = (trap[0] & 0x0000000f) >> 0; -+ st1 = (trap[0] & 0x000000f0) >> 4; -+ st2 = (trap[0] & 0x00000f00) >> 8; -+ st3 = (trap[0] & 0x0000f000) >> 12; -+ } else { -+ st0 = (trap[0] & 0x000000ff) >> 0; -+ st1 = (trap[0] & 0x0000ff00) >> 8; -+ st2 = (trap[0] & 0x00ff0000) >> 16; -+ st3 = (trap[0] & 0xff000000) >> 24; -+ } -+ -+ NV_INFO(dev, "VM: trapped %s at 0x%02x%04x%04x on ch %d [0x%08x] ", -+ (trap[5] & 0x00000100) ? "read" : "write", -+ trap[5] & 0xff, trap[4] & 0xffff, trap[3] & 0xffff, ch, chinst); -+ -+ en = nouveau_enum_find(vm_engine, st0); -+ if (en) -+ printk("%s/", en->name); -+ else -+ printk("%02x/", st0); -+ -+ cl = nouveau_enum_find(vm_client, st2); -+ if (cl) -+ printk("%s/", cl->name); -+ else -+ printk("%02x/", st2); -+ -+ if (cl && cl->data) cl = nouveau_enum_find(cl->data, st3); -+ else if (en && en->data) cl = nouveau_enum_find(en->data, st3); -+ else cl = NULL; -+ if (cl) -+ printk("%s", cl->name); -+ else -+ printk("%02x", st3); -+ -+ printk(" reason: "); -+ en = nouveau_enum_find(vm_fault, st1); -+ if (en) -+ printk("%s\n", en->name); -+ else -+ printk("0x%08x\n", st1); - } -diff --git a/drivers/gpu/drm/nouveau/nv50_fifo.c b/drivers/gpu/drm/nouveau/nv50_fifo.c -index 8dd04c5..c34a074 100644 ---- a/drivers/gpu/drm/nouveau/nv50_fifo.c -+++ b/drivers/gpu/drm/nouveau/nv50_fifo.c -@@ -149,6 +149,7 @@ nv50_fifo_init_regs(struct drm_device *dev) - nv_wr32(dev, 0x3204, 0); - nv_wr32(dev, 0x3210, 0); - nv_wr32(dev, 0x3270, 0); -+ nv_wr32(dev, 0x2044, 0x01003fff); - - /* Enable dummy channels setup by nv50_instmem.c */ - nv50_fifo_channel_enable(dev, 0); -@@ -273,7 +274,7 @@ nv50_fifo_create_context(struct nouveau_channel *chan) - nv_wo32(ramfc, 0x80, ((chan->ramht->bits - 9) << 27) | - (4 << 24) /* SEARCH_FULL */ | - (chan->ramht->gpuobj->cinst >> 4)); -- nv_wo32(ramfc, 0x44, 0x2101ffff); -+ nv_wo32(ramfc, 0x44, 0x01003fff); - nv_wo32(ramfc, 0x60, 0x7fffffff); - nv_wo32(ramfc, 0x40, 0x00000000); - nv_wo32(ramfc, 0x7c, 0x30000001); -diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c -index 6b149c0..d4f4206 100644 ---- a/drivers/gpu/drm/nouveau/nv50_gpio.c -+++ b/drivers/gpu/drm/nouveau/nv50_gpio.c -@@ -137,6 +137,7 @@ nv50_gpio_irq_unregister(struct drm_device *dev, enum dcb_gpio_tag tag, - struct nv50_gpio_priv *priv = pgpio->priv; - struct nv50_gpio_handler *gpioh, *tmp; - struct dcb_gpio_entry *gpio; -+ LIST_HEAD(tofree); - unsigned long flags; - - gpio = nouveau_bios_gpio_entry(dev, tag); -@@ -149,10 +150,14 @@ nv50_gpio_irq_unregister(struct drm_device *dev, enum dcb_gpio_tag tag, - gpioh->handler != handler || - gpioh->data != data) - continue; -- list_del(&gpioh->head); -- kfree(gpioh); -+ list_move(&gpioh->head, &tofree); - } - spin_unlock_irqrestore(&priv->lock, flags); -+ -+ list_for_each_entry_safe(gpioh, tmp, &tofree, head) { -+ flush_work_sync(&gpioh->work); -+ kfree(gpioh); -+ } - } - - bool -@@ -205,7 +210,6 @@ nv50_gpio_init(struct drm_device *dev) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_gpio_engine *pgpio = &dev_priv->engine.gpio; -- struct nv50_gpio_priv *priv; - int ret; - - if (!pgpio->priv) { -@@ -213,7 +217,6 @@ nv50_gpio_init(struct drm_device *dev) - if (ret) - return ret; - } -- priv = pgpio->priv; - - /* disable, and ack any pending gpio interrupts */ - nv_wr32(dev, 0xe050, 0x00000000); -@@ -293,7 +296,7 @@ nv50_gpio_isr(struct drm_device *dev) - continue; - gpioh->inhibit = true; - -- queue_work(dev_priv->wq, &gpioh->work); -+ schedule_work(&gpioh->work); - } - spin_unlock(&priv->lock); - } -diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c -index 37e21d2..a32b301 100644 ---- a/drivers/gpu/drm/nouveau/nv50_graph.c -+++ b/drivers/gpu/drm/nouveau/nv50_graph.c -@@ -95,13 +95,41 @@ nv50_graph_init_regs__nv(struct drm_device *dev) - } - - static void --nv50_graph_init_regs(struct drm_device *dev) -+nv50_graph_init_zcull(struct drm_device *dev) - { -+ struct drm_nouveau_private *dev_priv = dev->dev_private; -+ int i; -+ - NV_DEBUG(dev, "\n"); - -- nv_wr32(dev, NV04_PGRAPH_DEBUG_3, -- (1 << 2) /* HW_CONTEXT_SWITCH_ENABLED */); -- nv_wr32(dev, 0x402ca8, 0x800); -+ switch (dev_priv->chipset & 0xf0) { -+ case 0x50: -+ case 0x80: -+ case 0x90: -+ nv_wr32(dev, 0x402ca8, 0x00000800); -+ break; -+ case 0xa0: -+ default: -+ nv_wr32(dev, 0x402cc0, 0x00000000); -+ if (dev_priv->chipset == 0xa0 || -+ dev_priv->chipset == 0xaa || -+ dev_priv->chipset == 0xac) { -+ nv_wr32(dev, 0x402ca8, 0x00000802); -+ } else { -+ nv_wr32(dev, 0x402cc0, 0x00000000); -+ nv_wr32(dev, 0x402ca8, 0x00000002); -+ } -+ -+ break; -+ } -+ -+ /* zero out zcull regions */ -+ for (i = 0; i < 8; i++) { -+ nv_wr32(dev, 0x402c20 + (i * 8), 0x00000000); -+ nv_wr32(dev, 0x402c24 + (i * 8), 0x00000000); -+ nv_wr32(dev, 0x402c28 + (i * 8), 0x00000000); -+ nv_wr32(dev, 0x402c2c + (i * 8), 0x00000000); -+ } - } - - static int -@@ -136,6 +164,7 @@ nv50_graph_init_ctxctl(struct drm_device *dev) - } - kfree(cp); - -+ nv_wr32(dev, 0x40008c, 0x00000004); /* HW_CTX_SWITCH_ENABLED */ - nv_wr32(dev, 0x400320, 4); - nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0); - nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, 0); -@@ -151,7 +180,7 @@ nv50_graph_init(struct drm_device *dev) - - nv50_graph_init_reset(dev); - nv50_graph_init_regs__nv(dev); -- nv50_graph_init_regs(dev); -+ nv50_graph_init_zcull(dev); - - ret = nv50_graph_init_ctxctl(dev); - if (ret) -@@ -526,11 +555,11 @@ nv86_graph_tlb_flush(struct drm_device *dev) - - static struct nouveau_enum nv50_mp_exec_error_names[] = - { -- { 3, "STACK_UNDERFLOW" }, -- { 4, "QUADON_ACTIVE" }, -- { 8, "TIMEOUT" }, -- { 0x10, "INVALID_OPCODE" }, -- { 0x40, "BREAKPOINT" }, -+ { 3, "STACK_UNDERFLOW", NULL }, -+ { 4, "QUADON_ACTIVE", NULL }, -+ { 8, "TIMEOUT", NULL }, -+ { 0x10, "INVALID_OPCODE", NULL }, -+ { 0x40, "BREAKPOINT", NULL }, - {} - }; - -@@ -558,47 +587,47 @@ static struct nouveau_bitfield nv50_graph_trap_ccache[] = { - - /* There must be a *lot* of these. Will take some time to gather them up. */ - struct nouveau_enum nv50_data_error_names[] = { -- { 0x00000003, "INVALID_QUERY_OR_TEXTURE" }, -- { 0x00000004, "INVALID_VALUE" }, -- { 0x00000005, "INVALID_ENUM" }, -- { 0x00000008, "INVALID_OBJECT" }, -- { 0x00000009, "READ_ONLY_OBJECT" }, -- { 0x0000000a, "SUPERVISOR_OBJECT" }, -- { 0x0000000b, "INVALID_ADDRESS_ALIGNMENT" }, -- { 0x0000000c, "INVALID_BITFIELD" }, -- { 0x0000000d, "BEGIN_END_ACTIVE" }, -- { 0x0000000e, "SEMANTIC_COLOR_BACK_OVER_LIMIT" }, -- { 0x0000000f, "VIEWPORT_ID_NEEDS_GP" }, -- { 0x00000010, "RT_DOUBLE_BIND" }, -- { 0x00000011, "RT_TYPES_MISMATCH" }, -- { 0x00000012, "RT_LINEAR_WITH_ZETA" }, -- { 0x00000015, "FP_TOO_FEW_REGS" }, -- { 0x00000016, "ZETA_FORMAT_CSAA_MISMATCH" }, -- { 0x00000017, "RT_LINEAR_WITH_MSAA" }, -- { 0x00000018, "FP_INTERPOLANT_START_OVER_LIMIT" }, -- { 0x00000019, "SEMANTIC_LAYER_OVER_LIMIT" }, -- { 0x0000001a, "RT_INVALID_ALIGNMENT" }, -- { 0x0000001b, "SAMPLER_OVER_LIMIT" }, -- { 0x0000001c, "TEXTURE_OVER_LIMIT" }, -- { 0x0000001e, "GP_TOO_MANY_OUTPUTS" }, -- { 0x0000001f, "RT_BPP128_WITH_MS8" }, -- { 0x00000021, "Z_OUT_OF_BOUNDS" }, -- { 0x00000023, "XY_OUT_OF_BOUNDS" }, -- { 0x00000027, "CP_MORE_PARAMS_THAN_SHARED" }, -- { 0x00000028, "CP_NO_REG_SPACE_STRIPED" }, -- { 0x00000029, "CP_NO_REG_SPACE_PACKED" }, -- { 0x0000002a, "CP_NOT_ENOUGH_WARPS" }, -- { 0x0000002b, "CP_BLOCK_SIZE_MISMATCH" }, -- { 0x0000002c, "CP_NOT_ENOUGH_LOCAL_WARPS" }, -- { 0x0000002d, "CP_NOT_ENOUGH_STACK_WARPS" }, -- { 0x0000002e, "CP_NO_BLOCKDIM_LATCH" }, -- { 0x00000031, "ENG2D_FORMAT_MISMATCH" }, -- { 0x0000003f, "PRIMITIVE_ID_NEEDS_GP" }, -- { 0x00000044, "SEMANTIC_VIEWPORT_OVER_LIMIT" }, -- { 0x00000045, "SEMANTIC_COLOR_FRONT_OVER_LIMIT" }, -- { 0x00000046, "LAYER_ID_NEEDS_GP" }, -- { 0x00000047, "SEMANTIC_CLIP_OVER_LIMIT" }, -- { 0x00000048, "SEMANTIC_PTSZ_OVER_LIMIT" }, -+ { 0x00000003, "INVALID_QUERY_OR_TEXTURE", NULL }, -+ { 0x00000004, "INVALID_VALUE", NULL }, -+ { 0x00000005, "INVALID_ENUM", NULL }, -+ { 0x00000008, "INVALID_OBJECT", NULL }, -+ { 0x00000009, "READ_ONLY_OBJECT", NULL }, -+ { 0x0000000a, "SUPERVISOR_OBJECT", NULL }, -+ { 0x0000000b, "INVALID_ADDRESS_ALIGNMENT", NULL }, -+ { 0x0000000c, "INVALID_BITFIELD", NULL }, -+ { 0x0000000d, "BEGIN_END_ACTIVE", NULL }, -+ { 0x0000000e, "SEMANTIC_COLOR_BACK_OVER_LIMIT", NULL }, -+ { 0x0000000f, "VIEWPORT_ID_NEEDS_GP", NULL }, -+ { 0x00000010, "RT_DOUBLE_BIND", NULL }, -+ { 0x00000011, "RT_TYPES_MISMATCH", NULL }, -+ { 0x00000012, "RT_LINEAR_WITH_ZETA", NULL }, -+ { 0x00000015, "FP_TOO_FEW_REGS", NULL }, -+ { 0x00000016, "ZETA_FORMAT_CSAA_MISMATCH", NULL }, -+ { 0x00000017, "RT_LINEAR_WITH_MSAA", NULL }, -+ { 0x00000018, "FP_INTERPOLANT_START_OVER_LIMIT", NULL }, -+ { 0x00000019, "SEMANTIC_LAYER_OVER_LIMIT", NULL }, -+ { 0x0000001a, "RT_INVALID_ALIGNMENT", NULL }, -+ { 0x0000001b, "SAMPLER_OVER_LIMIT", NULL }, -+ { 0x0000001c, "TEXTURE_OVER_LIMIT", NULL }, -+ { 0x0000001e, "GP_TOO_MANY_OUTPUTS", NULL }, -+ { 0x0000001f, "RT_BPP128_WITH_MS8", NULL }, -+ { 0x00000021, "Z_OUT_OF_BOUNDS", NULL }, -+ { 0x00000023, "XY_OUT_OF_BOUNDS", NULL }, -+ { 0x00000027, "CP_MORE_PARAMS_THAN_SHARED", NULL }, -+ { 0x00000028, "CP_NO_REG_SPACE_STRIPED", NULL }, -+ { 0x00000029, "CP_NO_REG_SPACE_PACKED", NULL }, -+ { 0x0000002a, "CP_NOT_ENOUGH_WARPS", NULL }, -+ { 0x0000002b, "CP_BLOCK_SIZE_MISMATCH", NULL }, -+ { 0x0000002c, "CP_NOT_ENOUGH_LOCAL_WARPS", NULL }, -+ { 0x0000002d, "CP_NOT_ENOUGH_STACK_WARPS", NULL }, -+ { 0x0000002e, "CP_NO_BLOCKDIM_LATCH", NULL }, -+ { 0x00000031, "ENG2D_FORMAT_MISMATCH", NULL }, -+ { 0x0000003f, "PRIMITIVE_ID_NEEDS_GP", NULL }, -+ { 0x00000044, "SEMANTIC_VIEWPORT_OVER_LIMIT", NULL }, -+ { 0x00000045, "SEMANTIC_COLOR_FRONT_OVER_LIMIT", NULL }, -+ { 0x00000046, "LAYER_ID_NEEDS_GP", NULL }, -+ { 0x00000047, "SEMANTIC_CLIP_OVER_LIMIT", NULL }, -+ { 0x00000048, "SEMANTIC_PTSZ_OVER_LIMIT", NULL }, - {} - }; - -@@ -678,7 +707,6 @@ nv50_pgraph_tp_trap(struct drm_device *dev, int type, uint32_t ustatus_old, - tps++; - switch (type) { - case 6: /* texture error... unknown for now */ -- nv50_fb_vm_trap(dev, display, name); - if (display) { - NV_ERROR(dev, "magic set %d:\n", i); - for (r = ustatus_addr + 4; r <= ustatus_addr + 0x10; r += 4) -@@ -701,7 +729,6 @@ nv50_pgraph_tp_trap(struct drm_device *dev, int type, uint32_t ustatus_old, - uint32_t e1c = nv_rd32(dev, ustatus_addr + 0x14); - uint32_t e20 = nv_rd32(dev, ustatus_addr + 0x18); - uint32_t e24 = nv_rd32(dev, ustatus_addr + 0x1c); -- nv50_fb_vm_trap(dev, display, name); - /* 2d engine destination */ - if (ustatus & 0x00000010) { - if (display) { -@@ -912,10 +939,10 @@ nv50_pgraph_trap_handler(struct drm_device *dev, u32 display, u64 inst, u32 chid - printk("\n"); - NV_INFO(dev, "PGRAPH - TRAP_CCACHE %08x %08x %08x %08x" - " %08x %08x %08x\n", -- nv_rd32(dev, 0x405800), nv_rd32(dev, 0x405804), -- nv_rd32(dev, 0x405808), nv_rd32(dev, 0x40580c), -- nv_rd32(dev, 0x405810), nv_rd32(dev, 0x405814), -- nv_rd32(dev, 0x40581c)); -+ nv_rd32(dev, 0x405000), nv_rd32(dev, 0x405004), -+ nv_rd32(dev, 0x405008), nv_rd32(dev, 0x40500c), -+ nv_rd32(dev, 0x405010), nv_rd32(dev, 0x405014), -+ nv_rd32(dev, 0x40501c)); - - } - -@@ -1044,6 +1071,7 @@ nv50_graph_isr(struct drm_device *dev) - NV_INFO(dev, "PGRAPH - ch %d (0x%010llx) subc %d " - "class 0x%04x mthd 0x%04x data 0x%08x\n", - chid, inst, subc, class, mthd, data); -+ nv50_fb_vm_trap(dev, 1); - } - } - -diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c -index 6144156..1f47c75 100644 ---- a/drivers/gpu/drm/nouveau/nv50_vm.c -+++ b/drivers/gpu/drm/nouveau/nv50_vm.c -@@ -31,7 +31,6 @@ void - nv50_vm_map_pgt(struct nouveau_gpuobj *pgd, u32 pde, - struct nouveau_gpuobj *pgt[2]) - { -- struct drm_nouveau_private *dev_priv = pgd->dev->dev_private; - u64 phys = 0xdeadcafe00000000ULL; - u32 coverage = 0; - -diff --git a/drivers/gpu/drm/nouveau/nv84_crypt.c b/drivers/gpu/drm/nouveau/nv84_crypt.c -index ec18ae1..fabc7fd 100644 ---- a/drivers/gpu/drm/nouveau/nv84_crypt.c -+++ b/drivers/gpu/drm/nouveau/nv84_crypt.c -@@ -136,5 +136,5 @@ nv84_crypt_isr(struct drm_device *dev) - nv_wr32(dev, 0x102130, stat); - nv_wr32(dev, 0x10200c, 0x10); - -- nv50_fb_vm_trap(dev, show, "PCRYPT"); -+ nv50_fb_vm_trap(dev, show); - } -diff --git a/drivers/gpu/drm/nouveau/nvc0_fifo.c b/drivers/gpu/drm/nouveau/nvc0_fifo.c -index e6f92c5..e9f8643 100644 ---- a/drivers/gpu/drm/nouveau/nvc0_fifo.c -+++ b/drivers/gpu/drm/nouveau/nvc0_fifo.c -@@ -418,6 +418,12 @@ nvc0_fifo_isr(struct drm_device *dev) - { - u32 stat = nv_rd32(dev, 0x002100); - -+ if (stat & 0x00000100) { -+ NV_INFO(dev, "PFIFO: unknown status 0x00000100\n"); -+ nv_wr32(dev, 0x002100, 0x00000100); -+ stat &= ~0x00000100; -+ } -+ - if (stat & 0x10000000) { - u32 units = nv_rd32(dev, 0x00259c); - u32 u = units; -@@ -446,10 +452,15 @@ nvc0_fifo_isr(struct drm_device *dev) - stat &= ~0x20000000; - } - -+ if (stat & 0x40000000) { -+ NV_INFO(dev, "PFIFO: unknown status 0x40000000\n"); -+ nv_mask(dev, 0x002a00, 0x00000000, 0x00000000); -+ stat &= ~0x40000000; -+ } -+ - if (stat) { - NV_INFO(dev, "PFIFO: unhandled status 0x%08x\n", stat); - nv_wr32(dev, 0x002100, stat); -+ nv_wr32(dev, 0x002140, 0); - } -- -- nv_wr32(dev, 0x2140, 0); - } -diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c b/drivers/gpu/drm/nouveau/nvc0_graph.c -index eb18a7e..afa7afe 100644 ---- a/drivers/gpu/drm/nouveau/nvc0_graph.c -+++ b/drivers/gpu/drm/nouveau/nvc0_graph.c -@@ -640,7 +640,6 @@ nvc0_graph_init(struct drm_device *dev) - { - struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; -- struct nvc0_graph_priv *priv; - int ret; - - dev_priv->engine.graph.accel_blocked = true; -@@ -665,7 +664,6 @@ nvc0_graph_init(struct drm_device *dev) - if (ret) - return ret; - } -- priv = pgraph->priv; - - nvc0_graph_init_obj418880(dev); - nvc0_graph_init_regs(dev); diff --git a/drm-radeon-fix-regression-on-atom-cards-with-hardcoded-EDID-record.patch b/drm-radeon-fix-regression-on-atom-cards-with-hardcoded-EDID-record.patch new file mode 100644 index 000000000..217e29d76 --- /dev/null +++ b/drm-radeon-fix-regression-on-atom-cards-with-hardcoded-EDID-record.patch @@ -0,0 +1,56 @@ +From linux-kernel-owner@vger.kernel.org Thu May 5 20:17:19 2011 +Date: Thu, 05 May 2011 17:10:51 -0700 +From: Greg KH +To: linux-kernel@vger.kernel.org, stable@kernel.org +Cc: stable-review@kernel.org, torvalds@linux-foundation.org, + akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, + Dave Airlie +Subject: [patch 19/38] drm/radeon: fix regression on atom cards with hardcoded EDID record. +In-Reply-To: <20110506001225.GA10547@kroah.com> +X-Mailing-List: linux-kernel@vger.kernel.org + +2.6.38-stable review patch. If anyone has any objections, please let us know. + +------------------ + +From: Dave Airlie + +commit eaa4f5e1d0b816291a59a47917e569c0384f2b6f upstream. + +Since fafcf94e2b5732d1e13b440291c53115d2b172e9 introduced an edid size, it seems to have broken this path. + +This manifest as oops on T500 Lenovo laptops with dual graphics primarily. + +Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33812 + +Reviewed-by: Alex Deucher +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_atombios.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_atombios.c ++++ b/drivers/gpu/drm/radeon/radeon_atombios.c +@@ -1599,9 +1599,10 @@ struct radeon_encoder_atom_dig *radeon_a + memcpy((u8 *)edid, (u8 *)&fake_edid_record->ucFakeEDIDString[0], + fake_edid_record->ucFakeEDIDLength); + +- if (drm_edid_is_valid(edid)) ++ if (drm_edid_is_valid(edid)) { + rdev->mode_info.bios_hardcoded_edid = edid; +- else ++ rdev->mode_info.bios_hardcoded_edid_size = edid_size; ++ } else + kfree(edid); + } + } + + +-- +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html +Please read the FAQ at http://www.tux.org/lkml/ + diff --git a/efi_default_physical.patch b/efi_default_physical.patch deleted file mode 100644 index 41de7809e..000000000 --- a/efi_default_physical.patch +++ /dev/null @@ -1,403 +0,0 @@ -Default EFI to physical rather than virtual. Upstream seem to be going -in this direction. - -diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h -index 8e4a165..3c62f15 100644 ---- a/arch/x86/include/asm/efi.h -+++ b/arch/x86/include/asm/efi.h -@@ -93,6 +93,9 @@ extern int add_efi_memmap; - extern void efi_memblock_x86_reserve_range(void); - extern void efi_call_phys_prelog(void); - extern void efi_call_phys_epilog(void); -+extern void efi_call_phys_prelog_in_physmode(void); -+extern void efi_call_phys_epilog_in_physmode(void); -+extern void efi_pagetable_init(void); - - #ifndef CONFIG_EFI - /* -diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c -index 0fe27d7..e1158b0 100644 ---- a/arch/x86/platform/efi/efi.c -+++ b/arch/x86/platform/efi/efi.c -@@ -58,6 +58,7 @@ struct efi_memory_map memmap; - - static struct efi efi_phys __initdata; - static efi_system_table_t efi_systab __initdata; -+static efi_runtime_services_t phys_runtime; - - static int __init setup_noefi(char *arg) - { -@@ -172,7 +173,7 @@ static efi_status_t __init phys_efi_set_virtual_address_map( - return status; - } - --static efi_status_t __init phys_efi_get_time(efi_time_t *tm, -+static efi_status_t __init phys_efi_get_time_early(efi_time_t *tm, - efi_time_cap_t *tc) - { - efi_status_t status; -@@ -183,6 +184,112 @@ static efi_status_t __init phys_efi_get_time(efi_time_t *tm, - return status; - } - -+static efi_status_t phys_efi_get_time(efi_time_t *tm, -+ efi_time_cap_t *tc) -+{ -+ efi_status_t status; -+ -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys2((void*)phys_runtime.get_time, tm, tc); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t __init phys_efi_set_time(efi_time_t *tm) -+{ -+ efi_status_t status; -+ -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys1((void*)phys_runtime.set_time, tm); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t phys_efi_get_wakeup_time(efi_bool_t *enabled, -+ efi_bool_t *pending, -+ efi_time_t *tm) -+{ -+ efi_status_t status; -+ -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys3((void*)phys_runtime.get_wakeup_time, enabled, -+ pending, tm); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t phys_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) -+{ -+ efi_status_t status; -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys2((void*)phys_runtime.set_wakeup_time, enabled, -+ tm); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t phys_efi_get_variable(efi_char16_t *name, -+ efi_guid_t *vendor, -+ u32 *attr, -+ unsigned long *data_size, -+ void *data) -+{ -+ efi_status_t status; -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys5((void*)phys_runtime.get_variable, name, vendor, -+ attr, data_size, data); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t phys_efi_get_next_variable(unsigned long *name_size, -+ efi_char16_t *name, -+ efi_guid_t *vendor) -+{ -+ efi_status_t status; -+ -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys3((void*)phys_runtime.get_next_variable, -+ name_size, name, vendor); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t phys_efi_set_variable(efi_char16_t *name, -+ efi_guid_t *vendor, -+ unsigned long attr, -+ unsigned long data_size, -+ void *data) -+{ -+ efi_status_t status; -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys5((void*)phys_runtime.set_variable, name, -+ vendor, attr, data_size, data); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static efi_status_t phys_efi_get_next_high_mono_count(u32 *count) -+{ -+ efi_status_t status; -+ efi_call_phys_prelog_in_physmode(); -+ status = efi_call_phys1((void*)phys_runtime.get_next_high_mono_count, -+ count); -+ efi_call_phys_epilog_in_physmode(); -+ return status; -+} -+ -+static void phys_efi_reset_system(int reset_type, -+ efi_status_t status, -+ unsigned long data_size, -+ efi_char16_t *data) -+{ -+ efi_call_phys_prelog_in_physmode(); -+ efi_call_phys4((void*)phys_runtime.reset_system, reset_type, status, -+ data_size, data); -+ efi_call_phys_epilog_in_physmode(); -+} -+ - int efi_set_rtc_mmss(unsigned long nowtime) - { - int real_seconds, real_minutes; -@@ -435,7 +542,9 @@ void __init efi_init(void) - * Make efi_get_time can be called before entering - * virtual mode. - */ -- efi.get_time = phys_efi_get_time; -+ efi.get_time = phys_efi_get_time_early; -+ -+ memcpy(&phys_runtime, runtime, sizeof(efi_runtime_services_t)); - } else - printk(KERN_ERR "Could not map the EFI runtime service " - "table!\n"); -@@ -466,6 +575,14 @@ void __init efi_init(void) - #if EFI_DEBUG - print_efi_memmap(); - #endif -+ -+#ifndef CONFIG_X86_64 -+ /* -+ * Only x86_64 supports physical mode as of now. Use virtual mode -+ * forcibly. -+ */ -+ usevirtefi = 1; -+#endif - } - - static void __init runtime_code_page_mkexec(void) -@@ -579,6 +696,27 @@ void __init efi_enter_virtual_mode(void) - memmap.map = NULL; - } - -+void __init efi_setup_physical_mode(void) -+{ -+#ifdef CONFIG_X86_64 -+ efi_pagetable_init(); -+#endif -+ efi.get_time = phys_efi_get_time; -+ efi.set_time = phys_efi_set_time; -+ efi.get_wakeup_time = phys_efi_get_wakeup_time; -+ efi.set_wakeup_time = phys_efi_set_wakeup_time; -+ efi.get_variable = phys_efi_get_variable; -+ efi.get_next_variable = phys_efi_get_next_variable; -+ efi.set_variable = phys_efi_set_variable; -+ efi.get_next_high_mono_count = -+ phys_efi_get_next_high_mono_count; -+ efi.reset_system = phys_efi_reset_system; -+ efi.set_virtual_address_map = NULL; /* Not needed */ -+ -+ early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); -+ memmap.map = NULL; -+} -+ - /* - * Convenience functions to obtain memory types and attributes - */ -diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c -index 5cab48e..90767b1 100644 ---- a/arch/x86/platform/efi/efi_32.c -+++ b/arch/x86/platform/efi/efi_32.c -@@ -110,3 +110,7 @@ void efi_call_phys_epilog(void) - - local_irq_restore(efi_rt_eflags); - } -+ -+void efi_call_phys_prelog_in_physmode(void) { /* Not supported */ } -+void efi_call_phys_epilog_in_physmode(void) { /* Not supported */ } -+ -diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c -index ac0621a..ad19fe9 100644 ---- a/arch/x86/platform/efi/efi_64.c -+++ b/arch/x86/platform/efi/efi_64.c -@@ -39,7 +39,9 @@ - #include - - static pgd_t save_pgd __initdata; --static unsigned long efi_flags __initdata; -+static DEFINE_PER_CPU(unsigned long, efi_flags); -+static DEFINE_PER_CPU(unsigned long, save_cr3); -+static pgd_t efi_pgd[PTRS_PER_PGD] __page_aligned_bss; - - static void __init early_mapping_set_exec(unsigned long start, - unsigned long end, -@@ -80,7 +82,7 @@ void __init efi_call_phys_prelog(void) - unsigned long vaddress; - - early_runtime_code_mapping_set_exec(1); -- local_irq_save(efi_flags); -+ local_irq_save(get_cpu_var(efi_flags)); - vaddress = (unsigned long)__va(0x0UL); - save_pgd = *pgd_offset_k(0x0UL); - set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress)); -@@ -94,10 +96,23 @@ void __init efi_call_phys_epilog(void) - */ - set_pgd(pgd_offset_k(0x0UL), save_pgd); - __flush_tlb_all(); -- local_irq_restore(efi_flags); -+ local_irq_restore(get_cpu_var(efi_flags)); - early_runtime_code_mapping_set_exec(0); - } - -+void efi_call_phys_prelog_in_physmode(void) -+{ -+ local_irq_save(get_cpu_var(efi_flags)); -+ get_cpu_var(save_cr3)= read_cr3(); -+ write_cr3(virt_to_phys(efi_pgd)); -+} -+ -+void efi_call_phys_epilog_in_physmode(void) -+{ -+ write_cr3(get_cpu_var(save_cr3)); -+ local_irq_restore(get_cpu_var(efi_flags)); -+} -+ - void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, - u32 type) - { -@@ -112,3 +127,78 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, - - return (void __iomem *)__va(phys_addr); - } -+ -+static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr) -+{ -+ if (pgd_none(*pgd)) { -+ pud_t *pud = (pud_t *)get_zeroed_page(GFP_ATOMIC); -+ set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))); -+ if (pud != pud_offset(pgd, 0)) -+ printk(KERN_ERR "EFI PAGETABLE BUG #00! %p <-> %p\n", -+ pud, pud_offset(pgd, 0)); -+ } -+ return pud_offset(pgd, vaddr); -+} -+ -+static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr) -+{ -+ if (pud_none(*pud)) { -+ pmd_t *pmd = (pmd_t *)get_zeroed_page(GFP_ATOMIC); -+ set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd))); -+ if (pmd != pmd_offset(pud, 0)) -+ printk(KERN_ERR "EFI PAGETABLE BUG #01! %p <-> %p\n", -+ pmd, pmd_offset(pud, 0)); -+ } -+ return pmd_offset(pud, vaddr); -+} -+ -+static pte_t *fill_pte(pmd_t *pmd, unsigned long vaddr) -+{ -+ if (pmd_none(*pmd)) { -+ pte_t *pte = (pte_t *)get_zeroed_page(GFP_ATOMIC); -+ set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))); -+ if (pte != pte_offset_kernel(pmd, 0)) -+ printk(KERN_ERR "EFI PAGETABLE BUG #02!\n"); -+ } -+ return pte_offset_kernel(pmd, vaddr); -+} -+ -+void __init efi_pagetable_init(void) -+{ -+ efi_memory_desc_t *md; -+ unsigned long size; -+ u64 start_pfn, end_pfn, pfn, vaddr; -+ void *p; -+ pgd_t *pgd; -+ pud_t *pud; -+ pmd_t *pmd; -+ pte_t *pte; -+ -+ memset(efi_pgd, 0, sizeof(efi_pgd)); -+ for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { -+ md = p; -+ if (!(md->type & EFI_RUNTIME_SERVICES_CODE) && -+ !(md->type & EFI_RUNTIME_SERVICES_DATA)) -+ continue; -+ -+ start_pfn = md->phys_addr >> PAGE_SHIFT; -+ size = md->num_pages << EFI_PAGE_SHIFT; -+ end_pfn = PFN_UP(md->phys_addr + size); -+ -+ for (pfn = start_pfn; pfn <= end_pfn; pfn++) { -+ vaddr = pfn << PAGE_SHIFT; -+ pgd = efi_pgd + pgd_index(vaddr); -+ pud = fill_pud(pgd, vaddr); -+ pmd = fill_pmd(pud, vaddr); -+ pte = fill_pte(pmd, vaddr); -+ if (md->type & EFI_RUNTIME_SERVICES_CODE) -+ set_pte(pte, pfn_pte(pfn, PAGE_KERNEL_EXEC)); -+ else -+ set_pte(pte, pfn_pte(pfn, PAGE_KERNEL)); -+ } -+ } -+ pgd = efi_pgd + pgd_index(PAGE_OFFSET); -+ set_pgd(pgd, *pgd_offset_k(PAGE_OFFSET)); -+ pgd = efi_pgd + pgd_index(__START_KERNEL_map); -+ set_pgd(pgd, *pgd_offset_k(__START_KERNEL_map)); -+} -diff --git a/include/linux/efi.h b/include/linux/efi.h -index fb737bc..c4e310e 100644 ---- a/include/linux/efi.h -+++ b/include/linux/efi.h -@@ -290,6 +290,7 @@ extern void efi_map_pal_code (void); - extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); - extern void efi_gettimeofday (struct timespec *ts); - extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ -+extern void efi_setup_physical_mode(void); - extern u64 efi_get_iobase (void); - extern u32 efi_mem_type (unsigned long phys_addr); - extern u64 efi_mem_attributes (unsigned long phys_addr); -diff --git a/include/linux/init.h b/include/linux/init.h -index 577671c..2f1b28f 100644 ---- a/include/linux/init.h -+++ b/include/linux/init.h -@@ -149,6 +149,7 @@ extern int do_one_initcall(initcall_t fn); - extern char __initdata boot_command_line[]; - extern char *saved_command_line; - extern unsigned int reset_devices; -+extern unsigned int usevirtefi; - - /* used by init/main.c */ - void setup_arch(char **); -diff --git a/init/main.c b/init/main.c -index 8646401..726025e 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -196,6 +196,14 @@ static int __init set_reset_devices(char *str) - - __setup("reset_devices", set_reset_devices); - -+unsigned int usevirtefi; -+static int __init set_virt_efi(char *str) -+{ -+ usevirtefi = 1; -+ return 1; -+} -+__setup("virtefi", set_virt_efi); -+ - static const char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; - const char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; - static const char *panic_later, *panic_param; -@@ -668,8 +676,12 @@ asmlinkage void __init start_kernel(void) - pidmap_init(); - anon_vma_init(); - #ifdef CONFIG_X86 -- if (efi_enabled) -- efi_enter_virtual_mode(); -+ if (efi_enabled) { -+ if (usevirtefi) -+ efi_enter_virtual_mode(); -+ else -+ efi_setup_physical_mode(); -+ } - #endif - thread_info_cache_init(); - cred_init(); diff --git a/efifb_update.patch b/efifb_update.patch deleted file mode 100644 index 7058ba610..000000000 --- a/efifb_update.patch +++ /dev/null @@ -1,217 +0,0 @@ -Fix up efifb so it works properly on the 11" Macbook Air. Upstream in .38? - -diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c -index 70477c2..476ffb1 100644 ---- a/drivers/video/efifb.c -+++ b/drivers/video/efifb.c -@@ -53,6 +53,7 @@ enum { - M_MB_7_1, /* MacBook, 7th rev. */ - M_MB_SR, /* MacBook, 2nd gen, (Santa Rosa) */ - M_MBA, /* MacBook Air */ -+ M_MBA_3, /* Macbook Air, 3rd rev */ - M_MBP, /* MacBook Pro */ - M_MBP_2, /* MacBook Pro 2nd gen */ - M_MBP_2_2, /* MacBook Pro 2,2nd gen */ -@@ -67,40 +68,49 @@ enum { - M_UNKNOWN /* placeholder */ - }; - -+#define OVERRIDE_NONE 0x0 -+#define OVERRIDE_BASE 0x1 -+#define OVERRIDE_STRIDE 0x2 -+#define OVERRIDE_HEIGHT 0x4 -+#define OVERRIDE_WIDTH 0x8 -+ - static struct efifb_dmi_info { - char *optname; - unsigned long base; - int stride; - int width; - int height; -+ int flags; - } dmi_list[] __initdata = { -- [M_I17] = { "i17", 0x80010000, 1472 * 4, 1440, 900 }, -- [M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050 }, /* guess */ -- [M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050 }, -- [M_I24] = { "i24", 0x80010000, 2048 * 4, 1920, 1200 }, /* guess */ -- [M_I24_8_1] = { "imac8", 0xc0060000, 2048 * 4, 1920, 1200 }, -- [M_I24_10_1] = { "imac10", 0xc0010000, 2048 * 4, 1920, 1080 }, -- [M_I27_11_1] = { "imac11", 0xc0010000, 2560 * 4, 2560, 1440 }, -- [M_MINI]= { "mini", 0x80000000, 2048 * 4, 1024, 768 }, -- [M_MINI_3_1] = { "mini31", 0x40010000, 1024 * 4, 1024, 768 }, -- [M_MINI_4_1] = { "mini41", 0xc0010000, 2048 * 4, 1920, 1200 }, -- [M_MB] = { "macbook", 0x80000000, 2048 * 4, 1280, 800 }, -- [M_MB_5_1] = { "macbook51", 0x80010000, 2048 * 4, 1280, 800 }, -- [M_MB_6_1] = { "macbook61", 0x80010000, 2048 * 4, 1280, 800 }, -- [M_MB_7_1] = { "macbook71", 0x80010000, 2048 * 4, 1280, 800 }, -- [M_MBA] = { "mba", 0x80000000, 2048 * 4, 1280, 800 }, -- [M_MBP] = { "mbp", 0x80010000, 1472 * 4, 1440, 900 }, -- [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */ -- [M_MBP_2_2] = { "mbp22", 0x80010000, 1472 * 4, 1440, 900 }, -- [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 }, -- [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 }, -- [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900 }, -- [M_MBP_5_2] = { "mbp52", 0xc0010000, 2048 * 4, 1920, 1200 }, -- [M_MBP_5_3] = { "mbp53", 0xd0010000, 2048 * 4, 1440, 900 }, -- [M_MBP_6_1] = { "mbp61", 0x90030000, 2048 * 4, 1920, 1200 }, -- [M_MBP_6_2] = { "mbp62", 0x90030000, 2048 * 4, 1680, 1050 }, -- [M_MBP_7_1] = { "mbp71", 0xc0010000, 2048 * 4, 1280, 800 }, -- [M_UNKNOWN] = { NULL, 0, 0, 0, 0 } -+ [M_I17] = { "i17", 0x80010000, 1472 * 4, 1440, 900, OVERRIDE_NONE }, -+ [M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050, OVERRIDE_NONE }, /* guess */ -+ [M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050, OVERRIDE_NONE }, -+ [M_I24] = { "i24", 0x80010000, 2048 * 4, 1920, 1200, OVERRIDE_NONE }, /* guess */ -+ [M_I24_8_1] = { "imac8", 0xc0060000, 2048 * 4, 1920, 1200, OVERRIDE_NONE }, -+ [M_I24_10_1] = { "imac10", 0xc0010000, 2048 * 4, 1920, 1080, OVERRIDE_NONE }, -+ [M_I27_11_1] = { "imac11", 0xc0010000, 2560 * 4, 2560, 1440, OVERRIDE_NONE }, -+ [M_MINI]= { "mini", 0x80000000, 2048 * 4, 1024, 768, OVERRIDE_NONE }, -+ [M_MINI_3_1] = { "mini31", 0x40010000, 1024 * 4, 1024, 768, OVERRIDE_NONE }, -+ [M_MINI_4_1] = { "mini41", 0xc0010000, 2048 * 4, 1920, 1200, OVERRIDE_NONE }, -+ [M_MB] = { "macbook", 0x80000000, 2048 * 4, 1280, 800, OVERRIDE_NONE }, -+ [M_MB_5_1] = { "macbook51", 0x80010000, 2048 * 4, 1280, 800, OVERRIDE_NONE }, -+ [M_MB_6_1] = { "macbook61", 0x80010000, 2048 * 4, 1280, 800, OVERRIDE_NONE }, -+ [M_MB_7_1] = { "macbook71", 0x80010000, 2048 * 4, 1280, 800, OVERRIDE_NONE }, -+ [M_MBA] = { "mba", 0x80000000, 2048 * 4, 1280, 800, OVERRIDE_NONE }, -+ /* 11" Macbook Air 3,1 passes the wrong stride */ -+ [M_MBA_3] = { "mba3", 0, 2048 * 4, 0, 0, OVERRIDE_STRIDE }, -+ [M_MBP] = { "mbp", 0x80010000, 1472 * 4, 1440, 900, OVERRIDE_NONE }, -+ [M_MBP_2] = { "mbp2", 0, 0, 0, 0, OVERRIDE_NONE }, /* placeholder */ -+ [M_MBP_2_2] = { "mbp22", 0x80010000, 1472 * 4, 1440, 900, OVERRIDE_NONE }, -+ [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900, OVERRIDE_NONE }, -+ [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200, OVERRIDE_NONE }, -+ [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900, OVERRIDE_NONE }, -+ [M_MBP_5_2] = { "mbp52", 0xc0010000, 2048 * 4, 1920, 1200, OVERRIDE_NONE }, -+ [M_MBP_5_3] = { "mbp53", 0xd0010000, 2048 * 4, 1440, 900, OVERRIDE_NONE }, -+ [M_MBP_6_1] = { "mbp61", 0x90030000, 2048 * 4, 1920, 1200, OVERRIDE_NONE }, -+ [M_MBP_6_2] = { "mbp62", 0x90030000, 2048 * 4, 1680, 1050, OVERRIDE_NONE }, -+ [M_MBP_7_1] = { "mbp71", 0xc0010000, 2048 * 4, 1280, 800, OVERRIDE_NONE }, -+ [M_UNKNOWN] = { NULL, 0, 0, 0, 0, OVERRIDE_NONE } - }; - - static int set_system(const struct dmi_system_id *id); -@@ -138,6 +148,7 @@ static const struct dmi_system_id dmi_system_table[] __initconst = { - EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook6,1", M_MB_6_1), - EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook7,1", M_MB_7_1), - EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA), -+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir3,1", M_MBA_3), - EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP), - EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1", M_MBP_2), - EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,2", M_MBP_2_2), -@@ -154,16 +165,22 @@ static const struct dmi_system_id dmi_system_table[] __initconst = { - {}, - }; - -+#define choose_value(dmivalue, fwvalue, field, flags) ({ \ -+ typeof(fwvalue) _ret_ = fwvalue; \ -+ if ((flags) & (field)) \ -+ _ret_ = dmivalue; \ -+ else if ((fwvalue) == 0) \ -+ _ret_ = dmivalue; \ -+ _ret_; \ -+ }) -+ - static int set_system(const struct dmi_system_id *id) - { - struct efifb_dmi_info *info = id->driver_data; -- if (info->base == 0) -- return 0; - -- printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p " -- "(%dx%d, stride %d)\n", id->ident, -- (void *)info->base, info->width, info->height, -- info->stride); -+ if (info->base == 0 && info->height == 0 && info->width == 0 -+ && info->stride == 0) -+ return 0; - - /* Trust the bootloader over the DMI tables */ - if (screen_info.lfb_base == 0) { -@@ -171,40 +188,47 @@ static int set_system(const struct dmi_system_id *id) - struct pci_dev *dev = NULL; - int found_bar = 0; - #endif -- screen_info.lfb_base = info->base; -+ if (info->base) { -+ screen_info.lfb_base = choose_value(info->base, -+ screen_info.lfb_base, OVERRIDE_BASE, -+ info->flags); - - #if defined(CONFIG_PCI) -- /* make sure that the address in the table is actually on a -- * VGA device's PCI BAR */ -- -- for_each_pci_dev(dev) { -- int i; -- if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) -- continue; -- for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { -- resource_size_t start, end; -- -- start = pci_resource_start(dev, i); -- if (start == 0) -- break; -- end = pci_resource_end(dev, i); -- if (screen_info.lfb_base >= start && -- screen_info.lfb_base < end) { -- found_bar = 1; -+ /* make sure that the address in the table is actually -+ * on a VGA device's PCI BAR */ -+ -+ for_each_pci_dev(dev) { -+ int i; -+ if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) -+ continue; -+ for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { -+ resource_size_t start, end; -+ -+ start = pci_resource_start(dev, i); -+ if (start == 0) -+ break; -+ end = pci_resource_end(dev, i); -+ if (screen_info.lfb_base >= start && -+ screen_info.lfb_base < end) { -+ found_bar = 1; -+ } - } - } -- } -- if (!found_bar) -- screen_info.lfb_base = 0; -+ if (!found_bar) -+ screen_info.lfb_base = 0; - #endif -+ } - } - if (screen_info.lfb_base) { -- if (screen_info.lfb_linelength == 0) -- screen_info.lfb_linelength = info->stride; -- if (screen_info.lfb_width == 0) -- screen_info.lfb_width = info->width; -- if (screen_info.lfb_height == 0) -- screen_info.lfb_height = info->height; -+ screen_info.lfb_linelength = choose_value(info->stride, -+ screen_info.lfb_linelength, OVERRIDE_STRIDE, -+ info->flags); -+ screen_info.lfb_width = choose_value(info->width, -+ screen_info.lfb_width, OVERRIDE_WIDTH, -+ info->flags); -+ screen_info.lfb_height = choose_value(info->height, -+ screen_info.lfb_height, OVERRIDE_HEIGHT, -+ info->flags); - if (screen_info.orig_video_isVGA == 0) - screen_info.orig_video_isVGA = VIDEO_TYPE_EFI; - } else { -@@ -214,6 +238,13 @@ static int set_system(const struct dmi_system_id *id) - screen_info.orig_video_isVGA = 0; - return 0; - } -+ -+ printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p " -+ "(%dx%d, stride %d)\n", id->ident, -+ (void *)screen_info.lfb_base, screen_info.lfb_width, -+ screen_info.lfb_height, screen_info.lfb_linelength); -+ -+ - return 1; - } - diff --git a/flexcop-fix-xlate_proc_name-warning.patch b/flexcop-fix-xlate_proc_name-warning.patch deleted file mode 100644 index 82b50a47f..000000000 --- a/flexcop-fix-xlate_proc_name-warning.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c -index 227c020..7465308 100644 ---- a/drivers/media/dvb/b2c2/flexcop-pci.c -+++ b/drivers/media/dvb/b2c2/flexcop-pci.c -@@ -39,6 +39,7 @@ MODULE_PARM_DESC(debug, - - #define DRIVER_VERSION "0.1" - #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" -+#define FLEXCOP_MODULE_NAME "b2c2-flexcop" - #define DRIVER_AUTHOR "Patrick Boettcher " - - struct flexcop_pci { -@@ -299,7 +300,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) - return ret; - pci_set_master(fc_pci->pdev); - -- if ((ret = pci_request_regions(fc_pci->pdev, DRIVER_NAME)) != 0) -+ if ((ret = pci_request_regions(fc_pci->pdev, FLEXCOP_MODULE_NAME)) != 0) - goto err_pci_disable_device; - - fc_pci->io_mem = pci_iomap(fc_pci->pdev, 0, 0x800); -@@ -313,7 +314,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) - pci_set_drvdata(fc_pci->pdev, fc_pci); - spin_lock_init(&fc_pci->irq_lock); - if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr, -- IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) -+ IRQF_SHARED, FLEXCOP_MODULE_NAME, fc_pci)) != 0) - goto err_pci_iounmap; - - fc_pci->init_state |= FC_PCI_INIT; diff --git a/fs-call-security_d_instantiate-in-d_obtain_alias.patch b/fs-call-security_d_instantiate-in-d_obtain_alias.patch deleted file mode 100644 index 3bce47f5e..000000000 --- a/fs-call-security_d_instantiate-in-d_obtain_alias.patch +++ /dev/null @@ -1,64 +0,0 @@ -From linux-fsdevel-owner@vger.kernel.org Thu Nov 18 21:03:11 2010 -From: Josef Bacik -To: linux-fsdevel@vger.kernel.org, eparis@redhat.com, - linux-kernel@vger.kernel.org, sds@tycho.nsa.gov, - selinux@tycho.nsa.gov, bfields@fieldses.org -Subject: [PATCH] fs: call security_d_instantiate in d_obtain_alias V2 -Date: Thu, 18 Nov 2010 20:52:55 -0500 -Message-Id: <1290131575-2489-1-git-send-email-josef@redhat.com> -X-Mailing-List: linux-fsdevel@vger.kernel.org - -While trying to track down some NFS problems with BTRFS, I kept noticing I was -getting -EACCESS for no apparent reason. Eric Paris and printk() helped me -figure out that it was SELinux that was giving me grief, with the following -denial - -type=AVC msg=audit(1290013638.413:95): avc: denied { 0x800000 } for pid=1772 -comm="nfsd" name="" dev=sda1 ino=256 scontext=system_u:system_r:kernel_t:s0 -tcontext=system_u:object_r:unlabeled_t:s0 tclass=file - -Turns out this is because in d_obtain_alias if we can't find an alias we create -one and do all the normal instantiation stuff, but we don't do the -security_d_instantiate. - -Usually we are protected from getting a hashed dentry that hasn't yet run -security_d_instantiate() by the parent's i_mutex, but obviously this isn't an -option there, so in order to deal with the case that a second thread comes in -and finds our new dentry before we get to run security_d_instantiate(), we go -ahead and call it if we find a dentry already. Eric assures me that this is ok -as the code checks to see if the dentry has been initialized already so calling -security_d_instantiate() against the same dentry multiple times is ok. With -this patch I'm no longer getting errant -EACCESS values. - -Signed-off-by: Josef Bacik ---- -V1->V2: --added second security_d_instantiate() call - - fs/dcache.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/fs/dcache.c b/fs/dcache.c -index 5699d4c..85388fc 100644 ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -1577,9 +1577,13 @@ struct dentry *d_obtain_alias(struct inode *inode) - spin_unlock(&tmp->d_lock); - spin_unlock(&inode->i_lock); - -+ security_d_instantiate(tmp, inode); -+ - return tmp; - - out_iput: -+ if (res && !IS_ERR(res)) -+ security_d_instantiate(res, inode); - iput(inode); - return res; - } - --- -To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/git-linus.diff b/git-linus.diff deleted file mode 100644 index e69de29bb..000000000 diff --git a/hdpvr-ir-enable.patch b/hdpvr-ir-enable.patch deleted file mode 100644 index e73c42122..000000000 --- a/hdpvr-ir-enable.patch +++ /dev/null @@ -1,229 +0,0 @@ -diff --git a/drivers/media/video/hdpvr/Makefile b/drivers/media/video/hdpvr/Makefile -index e0230fc..3baa9f6 100644 ---- a/drivers/media/video/hdpvr/Makefile -+++ b/drivers/media/video/hdpvr/Makefile -@@ -1,6 +1,4 @@ --hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o -- --hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o -+hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o hdpvr-i2c.o - - obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o - -diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c -index 830d47b..70cfdc8 100644 ---- a/drivers/media/video/hdpvr/hdpvr-core.c -+++ b/drivers/media/video/hdpvr/hdpvr-core.c -@@ -364,14 +364,13 @@ static int hdpvr_probe(struct usb_interface *interface, - goto error; - } - --#ifdef CONFIG_I2C -- /* until i2c is working properly */ -- retval = 0; /* hdpvr_register_i2c_adapter(dev); */ -+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) -+ retval = hdpvr_register_i2c_adapter(dev); - if (retval < 0) { - v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n"); - goto error; - } --#endif /* CONFIG_I2C */ -+#endif - - /* let the user know what node this device is now attached to */ - v4l2_info(&dev->v4l2_dev, "device now attached to %s\n", -diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c -index 463b81b..60cdc06 100644 ---- a/drivers/media/video/hdpvr/hdpvr-i2c.c -+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c -@@ -10,6 +10,8 @@ - * - */ - -+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) -+ - #include - #include - -@@ -22,8 +24,11 @@ - #define REQTYPE_I2C_WRITE 0xb0 - #define REQTYPE_I2C_WRITE_STATT 0xd0 - --static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr, -- char *data, int len) -+#define HDPVR_HW_Z8F0811_IR_TX_I2C_ADDR 0x70 -+#define HDPVR_HW_Z8F0811_IR_RX_I2C_ADDR 0x71 -+ -+static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, -+ unsigned char addr, char *data, int len) - { - int ret; - char *buf = kmalloc(len, GFP_KERNEL); -@@ -33,7 +38,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr, - ret = usb_control_msg(dev->udev, - usb_rcvctrlpipe(dev->udev, 0), - REQTYPE_I2C_READ, CTRL_READ_REQUEST, -- 0x100|addr, 0, buf, len, 1000); -+ (bus << 8) | addr, 0, buf, len, 1000); - - if (ret == len) { - memcpy(data, buf, len); -@@ -46,8 +51,8 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr, - return ret; - } - --static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr, -- char *data, int len) -+static int hdpvr_i2c_write(struct hdpvr_device *dev, int bus, -+ unsigned char addr, char *data, int len) - { - int ret; - char *buf = kmalloc(len, GFP_KERNEL); -@@ -58,7 +63,7 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr, - ret = usb_control_msg(dev->udev, - usb_sndctrlpipe(dev->udev, 0), - REQTYPE_I2C_WRITE, CTRL_WRITE_REQUEST, -- 0x100|addr, 0, buf, len, 1000); -+ (bus << 8) | addr, 0, buf, len, 1000); - - if (ret < 0) - goto error; -@@ -68,7 +73,7 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr, - REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST, - 0, 0, buf, 2, 1000); - -- if (ret == 2) -+ if ((ret == 2) && (buf[1] == (len - 1))) - ret = 0; - else if (ret >= 0) - ret = -EIO; -@@ -93,10 +98,10 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs, - addr = msgs[i].addr << 1; - - if (msgs[i].flags & I2C_M_RD) -- retval = hdpvr_i2c_read(dev, addr, msgs[i].buf, -+ retval = hdpvr_i2c_read(dev, 1, addr, msgs[i].buf, - msgs[i].len); - else -- retval = hdpvr_i2c_write(dev, addr, msgs[i].buf, -+ retval = hdpvr_i2c_write(dev, 1, addr, msgs[i].buf, - msgs[i].len); - } - -@@ -115,30 +120,58 @@ static struct i2c_algorithm hdpvr_algo = { - .functionality = hdpvr_functionality, - }; - -+static struct i2c_adapter hdpvr_i2c_adapter_template = { -+ .name = "Hauppage HD PVR I2C", -+ .owner = THIS_MODULE, -+ .id = I2C_HW_B_HDPVR, -+ .algo = &hdpvr_algo, -+}; -+ -+static struct i2c_board_info hdpvr_i2c_board_info = { -+ I2C_BOARD_INFO("ir_tx_z8f0811_haup", HDPVR_HW_Z8F0811_IR_TX_I2C_ADDR), -+ I2C_BOARD_INFO("ir_rx_z8f0811_haup", HDPVR_HW_Z8F0811_IR_RX_I2C_ADDR), -+}; -+ -+static int hdpvr_activate_ir(struct hdpvr_device *dev) -+{ -+ char buffer[8]; -+ -+ mutex_lock(&dev->i2c_mutex); -+ -+ hdpvr_i2c_read(dev, 0, 0x54, buffer, 1); -+ -+ buffer[0] = 0; -+ buffer[1] = 0x8; -+ hdpvr_i2c_write(dev, 1, 0x54, buffer, 2); -+ -+ buffer[1] = 0x18; -+ hdpvr_i2c_write(dev, 1, 0x54, buffer, 2); -+ -+ mutex_unlock(&dev->i2c_mutex); -+ -+ return 0; -+} -+ - int hdpvr_register_i2c_adapter(struct hdpvr_device *dev) - { -- struct i2c_adapter *i2c_adap; - int retval = -ENOMEM; - -- i2c_adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL); -- if (i2c_adap == NULL) -- goto error; -+ hdpvr_activate_ir(dev); - -- strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C", -- sizeof(i2c_adap->name)); -- i2c_adap->algo = &hdpvr_algo; -- i2c_adap->owner = THIS_MODULE; -- i2c_adap->dev.parent = &dev->udev->dev; -+ memcpy(&dev->i2c_adapter, &hdpvr_i2c_adapter_template, -+ sizeof(struct i2c_adapter)); -+ dev->i2c_adapter.dev.parent = &dev->udev->dev; - -- i2c_set_adapdata(i2c_adap, dev); -+ i2c_set_adapdata(&dev->i2c_adapter, dev); - -- retval = i2c_add_adapter(i2c_adap); -+ retval = i2c_add_adapter(&dev->i2c_adapter); -+ if (retval) -+ goto error; - -- if (!retval) -- dev->i2c_adapter = i2c_adap; -- else -- kfree(i2c_adap); -+ i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info); - - error: - return retval; - } -+ -+#endif -diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c -index c338f3f..26fd9bf 100644 ---- a/drivers/media/video/hdpvr/hdpvr-video.c -+++ b/drivers/media/video/hdpvr/hdpvr-video.c -@@ -1221,12 +1221,9 @@ static void hdpvr_device_release(struct video_device *vdev) - v4l2_device_unregister(&dev->v4l2_dev); - - /* deregister I2C adapter */ --#ifdef CONFIG_I2C -+#if defined(CONFIG_I2C) || (CONFIG_I2C_MODULE) - mutex_lock(&dev->i2c_mutex); -- if (dev->i2c_adapter) -- i2c_del_adapter(dev->i2c_adapter); -- kfree(dev->i2c_adapter); -- dev->i2c_adapter = NULL; -+ i2c_del_adapter(&dev->i2c_adapter); - mutex_unlock(&dev->i2c_mutex); - #endif /* CONFIG_I2C */ - -diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h -index b0f046d..2107055 100644 ---- a/drivers/media/video/hdpvr/hdpvr.h -+++ b/drivers/media/video/hdpvr/hdpvr.h -@@ -102,7 +102,7 @@ struct hdpvr_device { - struct work_struct worker; - - /* I2C adapter */ -- struct i2c_adapter *i2c_adapter; -+ struct i2c_adapter i2c_adapter; - /* I2C lock */ - struct mutex i2c_mutex; - -diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h -index 4bef5c5..4385341 100644 ---- a/include/linux/i2c-id.h -+++ b/include/linux/i2c-id.h -@@ -33,5 +33,6 @@ - - /* --- Bit algorithm adapters */ - #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ -+#define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ - - #endif /* LINUX_I2C_ID_H */ diff --git a/hid-multitouch-add-support-for-elo-touchsystems.patch b/hid-multitouch-add-support-for-elo-touchsystems.patch new file mode 100644 index 000000000..789201f81 --- /dev/null +++ b/hid-multitouch-add-support-for-elo-touchsystems.patch @@ -0,0 +1,2256 @@ +commit 9498f954a4ec389806333041a1018909c6fe0518 +Author: Benjamin Tissoires +Date: Fri Mar 18 14:27:52 2011 +0100 + + HID: hid-multitouch: Auto detection of maxcontacts + + This patch enables support of autodetection of maxcontacts. + When adding support for a new device, one is now able to let + the device tell how many contacts it supports, or to manually + set the value if the device happens to provide wrong information. + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Stéphane Chatty + Reviewed-by: Henrik Rydberg + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index ee01e65..b9f9eec 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -60,8 +60,9 @@ struct mt_device { + __s8 inputmode; /* InputMode HID feature, -1 if non-existent */ + __u8 num_received; /* how many contacts we received */ + __u8 num_expected; /* expected last contact index */ ++ __u8 maxcontacts; + bool curvalid; /* is the current contact valid? */ +- struct mt_slot slots[0]; /* first slot */ ++ struct mt_slot *slots; + }; + + struct mt_class { +@@ -79,6 +80,8 @@ struct mt_class { + #define MT_CLS_CYPRESS 4 + #define MT_CLS_EGALAX 5 + ++#define MT_DEFAULT_MAXCONTACT 10 ++ + /* + * these device-dependent functions determine what slot corresponds + * to a valid contact that was just read. +@@ -95,12 +98,12 @@ static int cypress_compute_slot(struct mt_device *td) + static int find_slot_from_contactid(struct mt_device *td) + { + int i; +- for (i = 0; i < td->mtclass->maxcontacts; ++i) { ++ for (i = 0; i < td->maxcontacts; ++i) { + if (td->slots[i].contactid == td->curdata.contactid && + td->slots[i].touch_state) + return i; + } +- for (i = 0; i < td->mtclass->maxcontacts; ++i) { ++ for (i = 0; i < td->maxcontacts; ++i) { + if (!td->slots[i].seen_in_this_frame && + !td->slots[i].touch_state) + return i; +@@ -113,8 +116,7 @@ static int find_slot_from_contactid(struct mt_device *td) + + struct mt_class mt_classes[] = { + { .name = MT_CLS_DEFAULT, +- .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP, +- .maxcontacts = 10 }, ++ .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP }, + { .name = MT_CLS_DUAL_INRANGE_CONTACTID, + .quirks = MT_QUIRK_VALID_IS_INRANGE | + MT_QUIRK_SLOT_IS_CONTACTID, +@@ -142,9 +144,19 @@ struct mt_class mt_classes[] = { + static void mt_feature_mapping(struct hid_device *hdev, + struct hid_field *field, struct hid_usage *usage) + { +- if (usage->hid == HID_DG_INPUTMODE) { +- struct mt_device *td = hid_get_drvdata(hdev); ++ struct mt_device *td = hid_get_drvdata(hdev); ++ ++ switch (usage->hid) { ++ case HID_DG_INPUTMODE: + td->inputmode = field->report->id; ++ break; ++ case HID_DG_CONTACTMAX: ++ td->maxcontacts = field->value[0]; ++ if (td->mtclass->maxcontacts) ++ /* check if the maxcontacts is given by the class */ ++ td->maxcontacts = td->mtclass->maxcontacts; ++ ++ break; + } + } + +@@ -208,8 +220,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + td->last_slot_field = usage->hid; + return 1; + case HID_DG_CONTACTID: +- input_mt_init_slots(hi->input, +- td->mtclass->maxcontacts); ++ input_mt_init_slots(hi->input, td->maxcontacts); + td->last_slot_field = usage->hid; + return 1; + case HID_DG_WIDTH: +@@ -292,7 +303,7 @@ static void mt_complete_slot(struct mt_device *td) + if (td->curvalid) { + int slotnum = mt_compute_slot(td); + +- if (slotnum >= 0 && slotnum < td->mtclass->maxcontacts) ++ if (slotnum >= 0 && slotnum < td->maxcontacts) + td->slots[slotnum] = td->curdata; + } + td->num_received++; +@@ -307,7 +318,7 @@ static void mt_emit_event(struct mt_device *td, struct input_dev *input) + { + int i; + +- for (i = 0; i < td->mtclass->maxcontacts; ++i) { ++ for (i = 0; i < td->maxcontacts; ++i) { + struct mt_slot *s = &(td->slots[i]); + if ((td->mtclass->quirks & MT_QUIRK_NOT_SEEN_MEANS_UP) && + !s->seen_in_this_frame) { +@@ -341,7 +352,7 @@ static int mt_event(struct hid_device *hid, struct hid_field *field, + struct mt_device *td = hid_get_drvdata(hid); + __s32 quirks = td->mtclass->quirks; + +- if (hid->claimed & HID_CLAIMED_INPUT) { ++ if (hid->claimed & HID_CLAIMED_INPUT && td->slots) { + switch (usage->hid) { + case HID_DG_INRANGE: + if (quirks & MT_QUIRK_VALID_IS_INRANGE) +@@ -442,9 +453,7 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) + */ + hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; + +- td = kzalloc(sizeof(struct mt_device) + +- mtclass->maxcontacts * sizeof(struct mt_slot), +- GFP_KERNEL); ++ td = kzalloc(sizeof(struct mt_device), GFP_KERNEL); + if (!td) { + dev_err(&hdev->dev, "cannot allocate multitouch data\n"); + return -ENOMEM; +@@ -461,6 +470,18 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) + if (ret) + goto fail; + ++ if (!td->maxcontacts) ++ td->maxcontacts = MT_DEFAULT_MAXCONTACT; ++ ++ td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot), ++ GFP_KERNEL); ++ if (!td->slots) { ++ dev_err(&hdev->dev, "cannot allocate multitouch slots\n"); ++ hid_hw_stop(hdev); ++ ret = -ENOMEM; ++ goto fail; ++ } ++ + mt_set_input_mode(hdev); + + return 0; +@@ -482,6 +503,7 @@ static void mt_remove(struct hid_device *hdev) + { + struct mt_device *td = hid_get_drvdata(hdev); + hid_hw_stop(hdev); ++ kfree(td->slots); + kfree(td); + hid_set_drvdata(hdev, NULL); + } +commit 043b403aede4a528ed99ceaf050f567f1283a23e +Author: Benjamin Tissoires +Date: Fri Mar 18 14:27:53 2011 +0100 + + HID: hid-multitouch: migrate support for Stantum panels to the unified driver. + + This patch merges hid-stantum to the generic multitouch driver. + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Stéphane Chatty + Reviewed-by: Henrik Rydberg + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index b7ec405..3c72f16 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -327,6 +327,7 @@ config HID_MULTITOUCH + - 'Sensing Win7-TwoFinger' panel by GeneralTouch + - eGalax dual-touch panels, including the + Joojoo and Wetab tablets ++ - Stantum multitouch panels + + If unsure, say N. + +@@ -493,12 +494,6 @@ config HID_SONY + ---help--- + Support for Sony PS3 controller. + +-config HID_STANTUM +- tristate "Stantum multitouch panel" +- depends on USB_HID +- ---help--- +- Support for Stantum multitouch panel. +- + config HID_SUNPLUS + tristate "Sunplus wireless desktop" + depends on USB_HID +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index 06c68ae..a13cb4e 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -66,7 +66,6 @@ obj-$(CONFIG_HID_ROCCAT_PYRA) += hid-roccat-pyra.o + obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o + obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o + obj-$(CONFIG_HID_SONY) += hid-sony.o +-obj-$(CONFIG_HID_STANTUM) += hid-stantum.o + obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o + obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o + obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index b9f9eec..5983e55 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -79,6 +79,7 @@ struct mt_class { + #define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 3 + #define MT_CLS_CYPRESS 4 + #define MT_CLS_EGALAX 5 ++#define MT_CLS_STANTUM 6 + + #define MT_DEFAULT_MAXCONTACT 10 + +@@ -138,6 +139,9 @@ struct mt_class mt_classes[] = { + .sn_move = 4096, + .sn_pressure = 32, + }, ++ { .name = MT_CLS_STANTUM, ++ .quirks = MT_QUIRK_VALID_IS_CONFIDENCE }, ++ + { } + }; + +@@ -552,6 +556,17 @@ static const struct hid_device_id mt_devices[] = { + HID_USB_DEVICE(USB_VENDOR_ID_DWAV, + USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4) }, + ++ /* Stantum panels */ ++ { .driver_data = MT_CLS_STANTUM, ++ HID_USB_DEVICE(USB_VENDOR_ID_STANTUM, ++ USB_DEVICE_ID_MTP)}, ++ { .driver_data = MT_CLS_STANTUM, ++ HID_USB_DEVICE(USB_VENDOR_ID_STANTUM, ++ USB_DEVICE_ID_MTP_STM)}, ++ { .driver_data = MT_CLS_STANTUM, ++ HID_USB_DEVICE(USB_VENDOR_ID_STANTUM, ++ USB_DEVICE_ID_MTP_SITRONIX)}, ++ + { } + }; + MODULE_DEVICE_TABLE(hid, mt_devices); +diff --git a/drivers/hid/hid-stantum.c b/drivers/hid/hid-stantum.c +deleted file mode 100644 +index b2be1d1..0000000 +--- a/drivers/hid/hid-stantum.c ++++ /dev/null +@@ -1,286 +0,0 @@ +-/* +- * HID driver for Stantum multitouch panels +- * +- * Copyright (c) 2009 Stephane Chatty +- * +- */ +- +-/* +- * 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. +- */ +- +-#include +-#include +-#include +-#include +- +-MODULE_AUTHOR("Stephane Chatty "); +-MODULE_DESCRIPTION("Stantum HID multitouch panels"); +-MODULE_LICENSE("GPL"); +- +-#include "hid-ids.h" +- +-struct stantum_data { +- __s32 x, y, z, w, h; /* x, y, pressure, width, height */ +- __u16 id; /* touch id */ +- bool valid; /* valid finger data, or just placeholder? */ +- bool first; /* first finger in the HID packet? */ +- bool activity; /* at least one active finger so far? */ +-}; +- +-static int stantum_input_mapping(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- switch (usage->hid & HID_USAGE_PAGE) { +- +- case HID_UP_GENDESK: +- switch (usage->hid) { +- case HID_GD_X: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_X); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_X, +- field->logical_minimum, +- field->logical_maximum, 0, 0); +- return 1; +- case HID_GD_Y: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_Y); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_Y, +- field->logical_minimum, +- field->logical_maximum, 0, 0); +- return 1; +- } +- return 0; +- +- case HID_UP_DIGITIZER: +- switch (usage->hid) { +- case HID_DG_INRANGE: +- case HID_DG_CONFIDENCE: +- case HID_DG_INPUTMODE: +- case HID_DG_DEVICEINDEX: +- case HID_DG_CONTACTCOUNT: +- case HID_DG_CONTACTMAX: +- return -1; +- +- case HID_DG_TIPSWITCH: +- /* touchscreen emulation */ +- hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH); +- return 1; +- +- case HID_DG_WIDTH: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TOUCH_MAJOR); +- return 1; +- case HID_DG_HEIGHT: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TOUCH_MINOR); +- input_set_abs_params(hi->input, ABS_MT_ORIENTATION, +- 1, 1, 0, 0); +- return 1; +- case HID_DG_TIPPRESSURE: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_PRESSURE); +- return 1; +- +- case HID_DG_CONTACTID: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TRACKING_ID); +- return 1; +- +- } +- return 0; +- +- case 0xff000000: +- /* no input-oriented meaning */ +- return -1; +- } +- +- return 0; +-} +- +-static int stantum_input_mapped(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- if (usage->type == EV_KEY || usage->type == EV_ABS) +- clear_bit(usage->code, *bit); +- +- return 0; +-} +- +-/* +- * this function is called when a whole finger has been parsed, +- * so that it can decide what to send to the input layer. +- */ +-static void stantum_filter_event(struct stantum_data *sd, +- struct input_dev *input) +-{ +- bool wide; +- +- if (!sd->valid) { +- /* +- * touchscreen emulation: if the first finger is not valid and +- * there previously was finger activity, this is a release +- */ +- if (sd->first && sd->activity) { +- input_event(input, EV_KEY, BTN_TOUCH, 0); +- sd->activity = false; +- } +- return; +- } +- +- input_event(input, EV_ABS, ABS_MT_TRACKING_ID, sd->id); +- input_event(input, EV_ABS, ABS_MT_POSITION_X, sd->x); +- input_event(input, EV_ABS, ABS_MT_POSITION_Y, sd->y); +- +- wide = (sd->w > sd->h); +- input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide); +- input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, wide ? sd->w : sd->h); +- input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, wide ? sd->h : sd->w); +- +- input_event(input, EV_ABS, ABS_MT_PRESSURE, sd->z); +- +- input_mt_sync(input); +- sd->valid = false; +- +- /* touchscreen emulation */ +- if (sd->first) { +- if (!sd->activity) { +- input_event(input, EV_KEY, BTN_TOUCH, 1); +- sd->activity = true; +- } +- input_event(input, EV_ABS, ABS_X, sd->x); +- input_event(input, EV_ABS, ABS_Y, sd->y); +- } +- sd->first = false; +-} +- +- +-static int stantum_event(struct hid_device *hid, struct hid_field *field, +- struct hid_usage *usage, __s32 value) +-{ +- struct stantum_data *sd = hid_get_drvdata(hid); +- +- if (hid->claimed & HID_CLAIMED_INPUT) { +- struct input_dev *input = field->hidinput->input; +- +- switch (usage->hid) { +- case HID_DG_INRANGE: +- /* this is the last field in a finger */ +- stantum_filter_event(sd, input); +- break; +- case HID_DG_WIDTH: +- sd->w = value; +- break; +- case HID_DG_HEIGHT: +- sd->h = value; +- break; +- case HID_GD_X: +- sd->x = value; +- break; +- case HID_GD_Y: +- sd->y = value; +- break; +- case HID_DG_TIPPRESSURE: +- sd->z = value; +- break; +- case HID_DG_CONTACTID: +- sd->id = value; +- break; +- case HID_DG_CONFIDENCE: +- sd->valid = !!value; +- break; +- case 0xff000002: +- /* this comes only before the first finger */ +- sd->first = true; +- break; +- +- default: +- /* ignore the others */ +- return 1; +- } +- } +- +- /* we have handled the hidinput part, now remains hiddev */ +- if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event) +- hid->hiddev_hid_event(hid, field, usage, value); +- +- return 1; +-} +- +-static int stantum_probe(struct hid_device *hdev, +- const struct hid_device_id *id) +-{ +- int ret; +- struct stantum_data *sd; +- +- sd = kmalloc(sizeof(struct stantum_data), GFP_KERNEL); +- if (!sd) { +- hid_err(hdev, "cannot allocate Stantum data\n"); +- return -ENOMEM; +- } +- sd->valid = false; +- sd->first = false; +- sd->activity = false; +- hid_set_drvdata(hdev, sd); +- +- ret = hid_parse(hdev); +- if (!ret) +- ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); +- +- if (ret) +- kfree(sd); +- +- return ret; +-} +- +-static void stantum_remove(struct hid_device *hdev) +-{ +- hid_hw_stop(hdev); +- kfree(hid_get_drvdata(hdev)); +- hid_set_drvdata(hdev, NULL); +-} +- +-static const struct hid_device_id stantum_devices[] = { +- { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM, USB_DEVICE_ID_MTP) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_MTP_STM) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX, USB_DEVICE_ID_MTP_SITRONIX) }, +- { } +-}; +-MODULE_DEVICE_TABLE(hid, stantum_devices); +- +-static const struct hid_usage_id stantum_grabbed_usages[] = { +- { HID_ANY_ID, HID_ANY_ID, HID_ANY_ID }, +- { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1} +-}; +- +-static struct hid_driver stantum_driver = { +- .name = "stantum", +- .id_table = stantum_devices, +- .probe = stantum_probe, +- .remove = stantum_remove, +- .input_mapping = stantum_input_mapping, +- .input_mapped = stantum_input_mapped, +- .usage_table = stantum_grabbed_usages, +- .event = stantum_event, +-}; +- +-static int __init stantum_init(void) +-{ +- return hid_register_driver(&stantum_driver); +-} +- +-static void __exit stantum_exit(void) +-{ +- hid_unregister_driver(&stantum_driver); +-} +- +-module_init(stantum_init); +-module_exit(stantum_exit); +- +commit a841b62c5d5f75ce3676fde755696d30cc8de99a +Author: Benjamin Tissoires +Date: Fri Mar 18 14:27:54 2011 +0100 + + HID: hid-multitouch: migrate Cando dual touch panels to hid-multitouch + + This patch merges hid-cando into the unified multitouch driver. + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Stéphane Chatty + Reviewed-by: Henrik Rydberg + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 3c72f16..1edb0bd 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -100,12 +100,6 @@ config HID_BELKIN + ---help--- + Support for Belkin Flip KVM and Wireless keyboard. + +-config HID_CANDO +- tristate "Cando dual touch panel" +- depends on USB_HID +- ---help--- +- Support for Cando dual touch panel. +- + config HID_CHERRY + tristate "Cherry Cymotion keyboard" if EXPERT + depends on USB_HID +@@ -320,6 +314,7 @@ config HID_MULTITOUCH + Generic support for HID multitouch panels. + + Say Y here if you have one of the following devices: ++ - Cando dual touch panel + - Cypress TrueTouch panels + - Hanvon dual touch panels + - IrTouch Infrared USB panels +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index a13cb4e..f8b90e4 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -30,7 +30,6 @@ obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o + obj-$(CONFIG_HID_ACRUX) += hid-axff.o + obj-$(CONFIG_HID_APPLE) += hid-apple.o + obj-$(CONFIG_HID_BELKIN) += hid-belkin.o +-obj-$(CONFIG_HID_CANDO) += hid-cando.o + obj-$(CONFIG_HID_CHERRY) += hid-cherry.o + obj-$(CONFIG_HID_CHICONY) += hid-chicony.o + obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o +diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c +deleted file mode 100644 +index 1ea066c..0000000 +--- a/drivers/hid/hid-cando.c ++++ /dev/null +@@ -1,276 +0,0 @@ +-/* +- * HID driver for Cando dual-touch panels +- * +- * Copyright (c) 2010 Stephane Chatty +- * +- */ +- +-/* +- * 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. +- */ +- +-#include +-#include +-#include +-#include +- +-MODULE_AUTHOR("Stephane Chatty "); +-MODULE_DESCRIPTION("Cando dual-touch panel"); +-MODULE_LICENSE("GPL"); +- +-#include "hid-ids.h" +- +-struct cando_data { +- __u16 x, y; +- __u8 id; +- __s8 oldest; /* id of the oldest finger in previous frame */ +- bool valid; /* valid finger data, or just placeholder? */ +- bool first; /* is this the first finger in this frame? */ +- __s8 firstid; /* id of the first finger in the frame */ +- __u16 firstx, firsty; /* (x, y) of the first finger in the frame */ +-}; +- +-static int cando_input_mapping(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- switch (usage->hid & HID_USAGE_PAGE) { +- +- case HID_UP_GENDESK: +- switch (usage->hid) { +- case HID_GD_X: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_X); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_X, +- field->logical_minimum, +- field->logical_maximum, 0, 0); +- return 1; +- case HID_GD_Y: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_Y); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_Y, +- field->logical_minimum, +- field->logical_maximum, 0, 0); +- return 1; +- } +- return 0; +- +- case HID_UP_DIGITIZER: +- switch (usage->hid) { +- case HID_DG_TIPSWITCH: +- case HID_DG_CONTACTMAX: +- return -1; +- case HID_DG_INRANGE: +- /* touchscreen emulation */ +- hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH); +- return 1; +- case HID_DG_CONTACTID: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TRACKING_ID); +- return 1; +- } +- return 0; +- } +- +- return 0; +-} +- +-static int cando_input_mapped(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- if (usage->type == EV_KEY || usage->type == EV_ABS) +- clear_bit(usage->code, *bit); +- +- return 0; +-} +- +-/* +- * this function is called when a whole finger has been parsed, +- * so that it can decide what to send to the input layer. +- */ +-static void cando_filter_event(struct cando_data *td, struct input_dev *input) +-{ +- td->first = !td->first; /* touchscreen emulation */ +- +- if (!td->valid) { +- /* +- * touchscreen emulation: if this is the second finger and +- * the first was valid, the first was the oldest; if the +- * first was not valid and there was a valid finger in the +- * previous frame, this is a release. +- */ +- if (td->first) { +- td->firstid = -1; +- } else if (td->firstid >= 0) { +- input_event(input, EV_ABS, ABS_X, td->firstx); +- input_event(input, EV_ABS, ABS_Y, td->firsty); +- td->oldest = td->firstid; +- } else if (td->oldest >= 0) { +- input_event(input, EV_KEY, BTN_TOUCH, 0); +- td->oldest = -1; +- } +- +- return; +- } +- +- input_event(input, EV_ABS, ABS_MT_TRACKING_ID, td->id); +- input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x); +- input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y); +- +- input_mt_sync(input); +- +- /* +- * touchscreen emulation: if there was no touching finger previously, +- * emit touch event +- */ +- if (td->oldest < 0) { +- input_event(input, EV_KEY, BTN_TOUCH, 1); +- td->oldest = td->id; +- } +- +- /* +- * touchscreen emulation: if this is the first finger, wait for the +- * second; the oldest is then the second if it was the oldest already +- * or if there was no first, the first otherwise. +- */ +- if (td->first) { +- td->firstx = td->x; +- td->firsty = td->y; +- td->firstid = td->id; +- } else { +- int x, y, oldest; +- if (td->id == td->oldest || td->firstid < 0) { +- x = td->x; +- y = td->y; +- oldest = td->id; +- } else { +- x = td->firstx; +- y = td->firsty; +- oldest = td->firstid; +- } +- input_event(input, EV_ABS, ABS_X, x); +- input_event(input, EV_ABS, ABS_Y, y); +- td->oldest = oldest; +- } +-} +- +- +-static int cando_event(struct hid_device *hid, struct hid_field *field, +- struct hid_usage *usage, __s32 value) +-{ +- struct cando_data *td = hid_get_drvdata(hid); +- +- if (hid->claimed & HID_CLAIMED_INPUT) { +- struct input_dev *input = field->hidinput->input; +- +- switch (usage->hid) { +- case HID_DG_INRANGE: +- td->valid = value; +- break; +- case HID_DG_CONTACTID: +- td->id = value; +- break; +- case HID_GD_X: +- td->x = value; +- break; +- case HID_GD_Y: +- td->y = value; +- cando_filter_event(td, input); +- break; +- case HID_DG_TIPSWITCH: +- /* avoid interference from generic hidinput handling */ +- break; +- +- default: +- /* fallback to the generic hidinput handling */ +- return 0; +- } +- } +- +- /* we have handled the hidinput part, now remains hiddev */ +- if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event) +- hid->hiddev_hid_event(hid, field, usage, value); +- +- return 1; +-} +- +-static int cando_probe(struct hid_device *hdev, const struct hid_device_id *id) +-{ +- int ret; +- struct cando_data *td; +- +- td = kmalloc(sizeof(struct cando_data), GFP_KERNEL); +- if (!td) { +- hid_err(hdev, "cannot allocate Cando Touch data\n"); +- return -ENOMEM; +- } +- hid_set_drvdata(hdev, td); +- td->first = false; +- td->oldest = -1; +- td->valid = false; +- +- ret = hid_parse(hdev); +- if (!ret) +- ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); +- +- if (ret) +- kfree(td); +- +- return ret; +-} +- +-static void cando_remove(struct hid_device *hdev) +-{ +- hid_hw_stop(hdev); +- kfree(hid_get_drvdata(hdev)); +- hid_set_drvdata(hdev, NULL); +-} +- +-static const struct hid_device_id cando_devices[] = { +- { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, +- USB_DEVICE_ID_CANDO_MULTI_TOUCH) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, +- USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, +- USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, +- USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) }, +- { } +-}; +-MODULE_DEVICE_TABLE(hid, cando_devices); +- +-static const struct hid_usage_id cando_grabbed_usages[] = { +- { HID_ANY_ID, HID_ANY_ID, HID_ANY_ID }, +- { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1} +-}; +- +-static struct hid_driver cando_driver = { +- .name = "cando-touch", +- .id_table = cando_devices, +- .probe = cando_probe, +- .remove = cando_remove, +- .input_mapping = cando_input_mapping, +- .input_mapped = cando_input_mapped, +- .usage_table = cando_grabbed_usages, +- .event = cando_event, +-}; +- +-static int __init cando_init(void) +-{ +- return hid_register_driver(&cando_driver); +-} +- +-static void __exit cando_exit(void) +-{ +- hid_unregister_driver(&cando_driver); +-} +- +-module_init(cando_init); +-module_exit(cando_exit); +- +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 5983e55..e6e1ea2 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -514,6 +514,20 @@ static void mt_remove(struct hid_device *hdev) + + static const struct hid_device_id mt_devices[] = { + ++ /* Cando panels */ ++ { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, ++ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, ++ USB_DEVICE_ID_CANDO_MULTI_TOUCH) }, ++ { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, ++ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, ++ USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) }, ++ { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, ++ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, ++ USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) }, ++ { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, ++ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, ++ USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) }, ++ + /* Cypress panel */ + { .driver_data = MT_CLS_CYPRESS, + HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, +commit 1e648a13720ef5de51f132501acf3e443d1a36d4 +Author: Benjamin Tissoires +Date: Fri Mar 18 14:27:55 2011 +0100 + + HID: hid-multitouch: refactor initialization of ABS_MT_ORIENTATION + + The way the input_set_abs_params was called for the new composite field + ABS_MT_ORIENTATION was not very clear at second reading. We can remove the + non-necessary call to set_abs and use the simple call to input_set_abs_params. + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Stéphane Chatty + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index e6e1ea2..d31301e 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -235,9 +235,8 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + case HID_DG_HEIGHT: + hid_map_usage(hi, usage, bit, max, + EV_ABS, ABS_MT_TOUCH_MINOR); +- field->logical_maximum = 1; +- field->logical_minimum = 0; +- set_abs(hi->input, ABS_MT_ORIENTATION, field, 0); ++ input_set_abs_params(hi->input, ++ ABS_MT_ORIENTATION, 0, 1, 0, 0); + td->last_slot_field = usage->hid; + return 1; + case HID_DG_TIPPRESSURE: +commit f786bba4499cf3de20da345ce090457ebcef03b0 +Author: Benjamin Tissoires +Date: Tue Mar 22 17:34:01 2011 +0100 + + HID: hid-multitouch: migrate 3M PCT touch screens to hid-multitouch + + This patch merges the hid-3m-pct driver into hid-multitouch. + To keep devices working the same way they used to with hid-3m-pct, + we need to add two signal/noise ratios for width and height. + We also need to work on width/height to send proper + ABS_MT_ORIENTATION flag. + + Importing 3M into hid-multitouch also solved the bug in which + devices handling width and height in their report descriptors + did not show ABS_MT_TOUCH_MAJOR and ABS_MT_TOUCH_MINOR. + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Stéphane Chatty + Reviewed-and-tested-by: Henrik Rydberg + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 1edb0bd..996ae3a 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -55,12 +55,6 @@ source "drivers/hid/usbhid/Kconfig" + menu "Special HID drivers" + depends on HID + +-config HID_3M_PCT +- tristate "3M PCT touchscreen" +- depends on USB_HID +- ---help--- +- Support for 3M PCT touch screens. +- + config HID_A4TECH + tristate "A4 tech mice" if EXPERT + depends on USB_HID +@@ -314,6 +308,7 @@ config HID_MULTITOUCH + Generic support for HID multitouch panels. + + Say Y here if you have one of the following devices: ++ - 3M PCT touch screens + - Cando dual touch panel + - Cypress TrueTouch panels + - Hanvon dual touch panels +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index f8b90e4..11c9f0b 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -25,7 +25,6 @@ ifdef CONFIG_LOGIWII_FF + hid-logitech-y += hid-lg4ff.o + endif + +-obj-$(CONFIG_HID_3M_PCT) += hid-3m-pct.o + obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o + obj-$(CONFIG_HID_ACRUX) += hid-axff.o + obj-$(CONFIG_HID_APPLE) += hid-apple.o +diff --git a/drivers/hid/hid-3m-pct.c b/drivers/hid/hid-3m-pct.c +deleted file mode 100644 +index 5243ae2..0000000 +--- a/drivers/hid/hid-3m-pct.c ++++ /dev/null +@@ -1,305 +0,0 @@ +-/* +- * HID driver for 3M PCT multitouch panels +- * +- * Copyright (c) 2009-2010 Stephane Chatty +- * Copyright (c) 2010 Henrik Rydberg +- * Copyright (c) 2010 Canonical, Ltd. +- * +- */ +- +-/* +- * 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. +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-MODULE_AUTHOR("Stephane Chatty "); +-MODULE_DESCRIPTION("3M PCT multitouch panels"); +-MODULE_LICENSE("GPL"); +- +-#include "hid-ids.h" +- +-#define MAX_SLOTS 60 +- +-/* estimated signal-to-noise ratios */ +-#define SN_MOVE 2048 +-#define SN_WIDTH 128 +- +-struct mmm_finger { +- __s32 x, y, w, h; +- bool touch, valid; +-}; +- +-struct mmm_data { +- struct mmm_finger f[MAX_SLOTS]; +- __u8 curid; +- __u8 nexp, nreal; +- bool touch, valid; +-}; +- +-static int mmm_input_mapping(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- int f1 = field->logical_minimum; +- int f2 = field->logical_maximum; +- int df = f2 - f1; +- +- switch (usage->hid & HID_USAGE_PAGE) { +- +- case HID_UP_BUTTON: +- return -1; +- +- case HID_UP_GENDESK: +- switch (usage->hid) { +- case HID_GD_X: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_X); +- input_set_abs_params(hi->input, ABS_MT_POSITION_X, +- f1, f2, df / SN_MOVE, 0); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_X, +- f1, f2, df / SN_MOVE, 0); +- return 1; +- case HID_GD_Y: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_Y); +- input_set_abs_params(hi->input, ABS_MT_POSITION_Y, +- f1, f2, df / SN_MOVE, 0); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_Y, +- f1, f2, df / SN_MOVE, 0); +- return 1; +- } +- return 0; +- +- case HID_UP_DIGITIZER: +- switch (usage->hid) { +- /* we do not want to map these: no input-oriented meaning */ +- case 0x14: +- case 0x23: +- case HID_DG_INPUTMODE: +- case HID_DG_DEVICEINDEX: +- case HID_DG_CONTACTCOUNT: +- case HID_DG_CONTACTMAX: +- case HID_DG_INRANGE: +- case HID_DG_CONFIDENCE: +- return -1; +- case HID_DG_TIPSWITCH: +- /* touchscreen emulation */ +- hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH); +- input_set_capability(hi->input, EV_KEY, BTN_TOUCH); +- return 1; +- case HID_DG_WIDTH: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TOUCH_MAJOR); +- input_set_abs_params(hi->input, ABS_MT_TOUCH_MAJOR, +- f1, f2, df / SN_WIDTH, 0); +- return 1; +- case HID_DG_HEIGHT: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TOUCH_MINOR); +- input_set_abs_params(hi->input, ABS_MT_TOUCH_MINOR, +- f1, f2, df / SN_WIDTH, 0); +- input_set_abs_params(hi->input, ABS_MT_ORIENTATION, +- 0, 1, 0, 0); +- return 1; +- case HID_DG_CONTACTID: +- input_mt_init_slots(hi->input, MAX_SLOTS); +- return 1; +- } +- /* let hid-input decide for the others */ +- return 0; +- +- case 0xff000000: +- /* we do not want to map these: no input-oriented meaning */ +- return -1; +- } +- +- return 0; +-} +- +-static int mmm_input_mapped(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- /* tell hid-input to skip setup of these event types */ +- if (usage->type == EV_KEY || usage->type == EV_ABS) +- set_bit(usage->type, hi->input->evbit); +- return -1; +-} +- +-/* +- * this function is called when a whole packet has been received and processed, +- * so that it can decide what to send to the input layer. +- */ +-static void mmm_filter_event(struct mmm_data *md, struct input_dev *input) +-{ +- int i; +- for (i = 0; i < MAX_SLOTS; ++i) { +- struct mmm_finger *f = &md->f[i]; +- if (!f->valid) { +- /* this finger is just placeholder data, ignore */ +- continue; +- } +- input_mt_slot(input, i); +- input_mt_report_slot_state(input, MT_TOOL_FINGER, f->touch); +- if (f->touch) { +- /* this finger is on the screen */ +- int wide = (f->w > f->h); +- /* divided by two to match visual scale of touch */ +- int major = max(f->w, f->h) >> 1; +- int minor = min(f->w, f->h) >> 1; +- +- input_event(input, EV_ABS, ABS_MT_POSITION_X, f->x); +- input_event(input, EV_ABS, ABS_MT_POSITION_Y, f->y); +- input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide); +- input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major); +- input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor); +- } +- f->valid = 0; +- } +- +- input_mt_report_pointer_emulation(input, true); +- input_sync(input); +-} +- +-/* +- * this function is called upon all reports +- * so that we can accumulate contact point information, +- * and call input_mt_sync after each point. +- */ +-static int mmm_event(struct hid_device *hid, struct hid_field *field, +- struct hid_usage *usage, __s32 value) +-{ +- struct mmm_data *md = hid_get_drvdata(hid); +- /* +- * strangely, this function can be called before +- * field->hidinput is initialized! +- */ +- if (hid->claimed & HID_CLAIMED_INPUT) { +- struct input_dev *input = field->hidinput->input; +- switch (usage->hid) { +- case HID_DG_TIPSWITCH: +- md->touch = value; +- break; +- case HID_DG_CONFIDENCE: +- md->valid = value; +- break; +- case HID_DG_WIDTH: +- if (md->valid) +- md->f[md->curid].w = value; +- break; +- case HID_DG_HEIGHT: +- if (md->valid) +- md->f[md->curid].h = value; +- break; +- case HID_DG_CONTACTID: +- value = clamp_val(value, 0, MAX_SLOTS - 1); +- if (md->valid) { +- md->curid = value; +- md->f[value].touch = md->touch; +- md->f[value].valid = 1; +- md->nreal++; +- } +- break; +- case HID_GD_X: +- if (md->valid) +- md->f[md->curid].x = value; +- break; +- case HID_GD_Y: +- if (md->valid) +- md->f[md->curid].y = value; +- break; +- case HID_DG_CONTACTCOUNT: +- if (value) +- md->nexp = value; +- if (md->nreal >= md->nexp) { +- mmm_filter_event(md, input); +- md->nreal = 0; +- } +- break; +- } +- } +- +- /* we have handled the hidinput part, now remains hiddev */ +- if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event) +- hid->hiddev_hid_event(hid, field, usage, value); +- +- return 1; +-} +- +-static int mmm_probe(struct hid_device *hdev, const struct hid_device_id *id) +-{ +- int ret; +- struct mmm_data *md; +- +- hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; +- +- md = kzalloc(sizeof(struct mmm_data), GFP_KERNEL); +- if (!md) { +- hid_err(hdev, "cannot allocate 3M data\n"); +- return -ENOMEM; +- } +- hid_set_drvdata(hdev, md); +- +- ret = hid_parse(hdev); +- if (!ret) +- ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); +- +- if (ret) +- kfree(md); +- return ret; +-} +- +-static void mmm_remove(struct hid_device *hdev) +-{ +- hid_hw_stop(hdev); +- kfree(hid_get_drvdata(hdev)); +- hid_set_drvdata(hdev, NULL); +-} +- +-static const struct hid_device_id mmm_devices[] = { +- { HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M1968) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M2256) }, +- { } +-}; +-MODULE_DEVICE_TABLE(hid, mmm_devices); +- +-static const struct hid_usage_id mmm_grabbed_usages[] = { +- { HID_ANY_ID, HID_ANY_ID, HID_ANY_ID }, +- { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1} +-}; +- +-static struct hid_driver mmm_driver = { +- .name = "3m-pct", +- .id_table = mmm_devices, +- .probe = mmm_probe, +- .remove = mmm_remove, +- .input_mapping = mmm_input_mapping, +- .input_mapped = mmm_input_mapped, +- .usage_table = mmm_grabbed_usages, +- .event = mmm_event, +-}; +- +-static int __init mmm_init(void) +-{ +- return hid_register_driver(&mmm_driver); +-} +- +-static void __exit mmm_exit(void) +-{ +- hid_unregister_driver(&mmm_driver); +-} +- +-module_init(mmm_init); +-module_exit(mmm_exit); +- +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index d31301e..0175f85 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -11,6 +11,12 @@ + * Copyright (c) 2010 Henrik Rydberg + * Copyright (c) 2010 Canonical, Ltd. + * ++ * This code is partly based on hid-3m-pct.c: ++ * ++ * Copyright (c) 2009-2010 Stephane Chatty ++ * Copyright (c) 2010 Henrik Rydberg ++ * Copyright (c) 2010 Canonical, Ltd. ++ * + */ + + /* +@@ -69,6 +75,8 @@ struct mt_class { + __s32 name; /* MT_CLS */ + __s32 quirks; + __s32 sn_move; /* Signal/noise ratio for move events */ ++ __s32 sn_width; /* Signal/noise ratio for width events */ ++ __s32 sn_height; /* Signal/noise ratio for height events */ + __s32 sn_pressure; /* Signal/noise ratio for pressure events */ + __u8 maxcontacts; + }; +@@ -80,6 +88,7 @@ struct mt_class { + #define MT_CLS_CYPRESS 4 + #define MT_CLS_EGALAX 5 + #define MT_CLS_STANTUM 6 ++#define MT_CLS_3M 7 + + #define MT_DEFAULT_MAXCONTACT 10 + +@@ -141,6 +150,12 @@ struct mt_class mt_classes[] = { + }, + { .name = MT_CLS_STANTUM, + .quirks = MT_QUIRK_VALID_IS_CONFIDENCE }, ++ { .name = MT_CLS_3M, ++ .quirks = MT_QUIRK_VALID_IS_CONFIDENCE | ++ MT_QUIRK_SLOT_IS_CONTACTID, ++ .sn_move = 2048, ++ .sn_width = 128, ++ .sn_height = 128 }, + + { } + }; +@@ -230,11 +245,15 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + case HID_DG_WIDTH: + hid_map_usage(hi, usage, bit, max, + EV_ABS, ABS_MT_TOUCH_MAJOR); ++ set_abs(hi->input, ABS_MT_TOUCH_MAJOR, field, ++ cls->sn_width); + td->last_slot_field = usage->hid; + return 1; + case HID_DG_HEIGHT: + hid_map_usage(hi, usage, bit, max, + EV_ABS, ABS_MT_TOUCH_MINOR); ++ set_abs(hi->input, ABS_MT_TOUCH_MINOR, field, ++ cls->sn_height); + input_set_abs_params(hi->input, + ABS_MT_ORIENTATION, 0, 1, 0, 0); + td->last_slot_field = usage->hid; +@@ -332,11 +351,18 @@ static void mt_emit_event(struct mt_device *td, struct input_dev *input) + input_mt_report_slot_state(input, MT_TOOL_FINGER, + s->touch_state); + if (s->touch_state) { ++ /* this finger is on the screen */ ++ int wide = (s->w > s->h); ++ /* divided by two to match visual scale of touch */ ++ int major = max(s->w, s->h) >> 1; ++ int minor = min(s->w, s->h) >> 1; ++ + input_event(input, EV_ABS, ABS_MT_POSITION_X, s->x); + input_event(input, EV_ABS, ABS_MT_POSITION_Y, s->y); ++ input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide); + input_event(input, EV_ABS, ABS_MT_PRESSURE, s->p); +- input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, s->w); +- input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, s->h); ++ input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major); ++ input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor); + } + s->seen_in_this_frame = false; + +@@ -398,6 +424,15 @@ static int mt_event(struct hid_device *hid, struct hid_field *field, + break; + + default: ++ if (td->last_field_index ++ && field->index == td->last_field_index) ++ /* we reach here when the last field in the ++ * report is not related to multitouch. ++ * This is not good. As a temporary solution, ++ * we trigger our mt event completion and ++ * ignore the field. ++ */ ++ break; + /* fallback to the generic hidinput handling */ + return 0; + } +@@ -513,6 +548,14 @@ static void mt_remove(struct hid_device *hdev) + + static const struct hid_device_id mt_devices[] = { + ++ /* 3M panels */ ++ { .driver_data = MT_CLS_3M, ++ HID_USB_DEVICE(USB_VENDOR_ID_3M, ++ USB_DEVICE_ID_3M1968) }, ++ { .driver_data = MT_CLS_3M, ++ HID_USB_DEVICE(USB_VENDOR_ID_3M, ++ USB_DEVICE_ID_3M2256) }, ++ + /* Cando panels */ + { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, + HID_USB_DEVICE(USB_VENDOR_ID_CANDO, +commit 2955caed8b9865c1f04fcde6bd7103d5d5ec9415 +Author: Benjamin Tissoires +Date: Thu Apr 21 14:15:59 2011 +0200 + + HID: hid-multitouch: refactor last_field_index + + the current implementation requires the devices to report + HID_DG_CONTACTCOUNT to set the last_field_index value. + However, devices reporting in serial mode (DWAV and PenMount) + do not send this field. + Other devices (3M) add other fields in the reports descriptor + that are not multitouch related at the end, thus the need to + add a special case in the default case when handling events. + + A first work around has been set up but with PenMount devices, + we have reached the limit. + + The idea is to calculate the last_field_index by relying only on + multitouch fields the device send. This allows us to remove + the handling of non-multitouch events in hid-multitouch, and + guarantee that the function mt_emit_event is always called. + + Signed-off-by: Benjamin Tissoires + Reviewed-and-tested-by: Henrik Rydberg + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 0175f85..6005e78 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -210,6 +210,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + /* touchscreen emulation */ + set_abs(hi->input, ABS_X, field, cls->sn_move); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_GD_Y: + if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP) +@@ -221,6 +222,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + /* touchscreen emulation */ + set_abs(hi->input, ABS_Y, field, cls->sn_move); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + } + return 0; +@@ -229,18 +231,22 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + switch (usage->hid) { + case HID_DG_INRANGE: + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_CONFIDENCE: + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_TIPSWITCH: + hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH); + input_set_capability(hi->input, EV_KEY, BTN_TOUCH); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_CONTACTID: + input_mt_init_slots(hi->input, td->maxcontacts); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_WIDTH: + hid_map_usage(hi, usage, bit, max, +@@ -248,6 +254,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + set_abs(hi->input, ABS_MT_TOUCH_MAJOR, field, + cls->sn_width); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_HEIGHT: + hid_map_usage(hi, usage, bit, max, +@@ -257,6 +264,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + input_set_abs_params(hi->input, + ABS_MT_ORIENTATION, 0, 1, 0, 0); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_TIPPRESSURE: + if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP) +@@ -269,13 +277,15 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, + set_abs(hi->input, ABS_PRESSURE, field, + cls->sn_pressure); + td->last_slot_field = usage->hid; ++ td->last_field_index = field->index; + return 1; + case HID_DG_CONTACTCOUNT: +- td->last_field_index = field->report->maxfield - 1; ++ td->last_field_index = field->index; + return 1; + case HID_DG_CONTACTMAX: + /* we don't set td->last_slot_field as contactcount and + * contact max are global to the report */ ++ td->last_field_index = field->index; + return -1; + } + /* let hid-input decide for the others */ +@@ -424,23 +434,12 @@ static int mt_event(struct hid_device *hid, struct hid_field *field, + break; + + default: +- if (td->last_field_index +- && field->index == td->last_field_index) +- /* we reach here when the last field in the +- * report is not related to multitouch. +- * This is not good. As a temporary solution, +- * we trigger our mt event completion and +- * ignore the field. +- */ +- break; + /* fallback to the generic hidinput handling */ + return 0; + } + + if (usage->hid == td->last_slot_field) { + mt_complete_slot(td); +- if (!td->last_field_index) +- mt_emit_event(td, field->hidinput->input); + } + + if (field->index == td->last_field_index +commit 6ab3a9a63fc16b04f7de48eb0190d516dd7574df +Author: John Sung +Date: Thu Apr 21 16:21:52 2011 +0200 + + HID: hid-multitouch: add support for PenMount dual-touch panel + + This patch adds PenMount support to hid-multitouch. A new class + MT_CLS_CONFIDENCE is defined for PenMount, since it uses HID_DG_CONFIDENCE as + the valid flag. + + Signed-off-by: John Sung + [benjamin.tissoires@enac.fr: rebased on top of last_index_field changes] + Signed-off-by: Benjamin Tissoires + Acked-by: Henrik Rydberg + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 996ae3a..8058cf1 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -313,6 +313,7 @@ config HID_MULTITOUCH + - Cypress TrueTouch panels + - Hanvon dual touch panels + - IrTouch Infrared USB panels ++ - PenMount dual touch panels + - Pixcir dual touch panels + - 'Sensing Win7-TwoFinger' panel by GeneralTouch + - eGalax dual-touch panels, including the +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index c3d6626..6e31b9f 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1438,6 +1438,7 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_PCI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) }, + { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN) }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index d485894..252aeba 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -484,6 +484,9 @@ + #define USB_VENDOR_ID_PANTHERLORD 0x0810 + #define USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK 0x0001 + ++#define USB_VENDOR_ID_PENMOUNT 0x14e1 ++#define USB_DEVICE_ID_PENMOUNT_PCI 0x3500 ++ + #define USB_VENDOR_ID_PETALYNX 0x18b1 + #define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037 + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 6005e78..51b5d27 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -89,6 +89,7 @@ struct mt_class { + #define MT_CLS_EGALAX 5 + #define MT_CLS_STANTUM 6 + #define MT_CLS_3M 7 ++#define MT_CLS_CONFIDENCE 8 + + #define MT_DEFAULT_MAXCONTACT 10 + +@@ -156,6 +157,8 @@ struct mt_class mt_classes[] = { + .sn_move = 2048, + .sn_width = 128, + .sn_height = 128 }, ++ { .name = MT_CLS_CONFIDENCE, ++ .quirks = MT_QUIRK_VALID_IS_CONFIDENCE }, + + { } + }; +@@ -584,6 +587,11 @@ static const struct hid_device_id mt_devices[] = { + HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, + USB_DEVICE_ID_IRTOUCH_INFRARED_USB) }, + ++ /* PenMount panels */ ++ { .driver_data = MT_CLS_CONFIDENCE, ++ HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, ++ USB_DEVICE_ID_PENMOUNT_PCI) }, ++ + /* PixCir-based panels */ + { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTID, + HID_USB_DEVICE(USB_VENDOR_ID_HANVON, +commit 4a6ee685fbcba4a440cf86f41557752ba81e2ccf +Author: Benjamin Tissoires +Date: Fri Apr 22 11:51:48 2011 +0200 + + HID: hid-multitouch: merge hid-mosart into hid-multitouch + + This patch include MosArt devices into hid-multitouch. + MosArt devices now support mt-protocol B. + + We also need to introduce a new quirk for mosart devices to support + their contactID. + + Signed-off-by: Benjamin Tissoires + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 8058cf1..d2d4e5f 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -288,12 +288,6 @@ config HID_MICROSOFT + ---help--- + Support for Microsoft devices that are not fully compliant with HID standard. + +-config HID_MOSART +- tristate "MosArt dual-touch panels" +- depends on USB_HID +- ---help--- +- Support for MosArt dual-touch panels. +- + config HID_MONTEREY + tristate "Monterey Genius KB29E keyboard" if EXPERT + depends on USB_HID +@@ -313,6 +307,7 @@ config HID_MULTITOUCH + - Cypress TrueTouch panels + - Hanvon dual touch panels + - IrTouch Infrared USB panels ++ - MosArt dual-touch panels + - PenMount dual touch panels + - Pixcir dual touch panels + - 'Sensing Win7-TwoFinger' panel by GeneralTouch +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index 11c9f0b..f8cc4ea 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -45,7 +45,6 @@ obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o + obj-$(CONFIG_HID_MAGICMOUSE) += hid-magicmouse.o + obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o + obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o +-obj-$(CONFIG_HID_MOSART) += hid-mosart.o + obj-$(CONFIG_HID_MULTITOUCH) += hid-multitouch.o + obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o + obj-$(CONFIG_HID_ORTEK) += hid-ortek.o +diff --git a/drivers/hid/hid-mosart.c b/drivers/hid/hid-mosart.c +deleted file mode 100644 +index aed7ffe..0000000 +--- a/drivers/hid/hid-mosart.c ++++ /dev/null +@@ -1,296 +0,0 @@ +-/* +- * HID driver for the multitouch panel on the ASUS EeePC T91MT +- * +- * Copyright (c) 2009-2010 Stephane Chatty +- * Copyright (c) 2010 Teemu Tuominen +- * +- */ +- +-/* +- * 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. +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include "usbhid/usbhid.h" +- +-MODULE_AUTHOR("Stephane Chatty "); +-MODULE_DESCRIPTION("MosArt dual-touch panel"); +-MODULE_LICENSE("GPL"); +- +-#include "hid-ids.h" +- +-struct mosart_data { +- __u16 x, y; +- __u8 id; +- bool valid; /* valid finger data, or just placeholder? */ +- bool first; /* is this the first finger in this frame? */ +- bool activity_now; /* at least one active finger in this frame? */ +- bool activity; /* at least one active finger previously? */ +-}; +- +-static int mosart_input_mapping(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- switch (usage->hid & HID_USAGE_PAGE) { +- +- case HID_UP_GENDESK: +- switch (usage->hid) { +- case HID_GD_X: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_X); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_X, +- field->logical_minimum, +- field->logical_maximum, 0, 0); +- return 1; +- case HID_GD_Y: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_POSITION_Y); +- /* touchscreen emulation */ +- input_set_abs_params(hi->input, ABS_Y, +- field->logical_minimum, +- field->logical_maximum, 0, 0); +- return 1; +- } +- return 0; +- +- case HID_UP_DIGITIZER: +- switch (usage->hid) { +- case HID_DG_CONFIDENCE: +- case HID_DG_TIPSWITCH: +- case HID_DG_INPUTMODE: +- case HID_DG_DEVICEINDEX: +- case HID_DG_CONTACTCOUNT: +- case HID_DG_CONTACTMAX: +- case HID_DG_TIPPRESSURE: +- case HID_DG_WIDTH: +- case HID_DG_HEIGHT: +- return -1; +- case HID_DG_INRANGE: +- /* touchscreen emulation */ +- hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH); +- return 1; +- +- case HID_DG_CONTACTID: +- hid_map_usage(hi, usage, bit, max, +- EV_ABS, ABS_MT_TRACKING_ID); +- return 1; +- +- } +- return 0; +- +- case 0xff000000: +- /* ignore HID features */ +- return -1; +- +- case HID_UP_BUTTON: +- /* ignore buttons */ +- return -1; +- } +- +- return 0; +-} +- +-static int mosart_input_mapped(struct hid_device *hdev, struct hid_input *hi, +- struct hid_field *field, struct hid_usage *usage, +- unsigned long **bit, int *max) +-{ +- if (usage->type == EV_KEY || usage->type == EV_ABS) +- clear_bit(usage->code, *bit); +- +- return 0; +-} +- +-/* +- * this function is called when a whole finger has been parsed, +- * so that it can decide what to send to the input layer. +- */ +-static void mosart_filter_event(struct mosart_data *td, struct input_dev *input) +-{ +- td->first = !td->first; /* touchscreen emulation */ +- +- if (!td->valid) { +- /* +- * touchscreen emulation: if no finger in this frame is valid +- * and there previously was finger activity, this is a release +- */ +- if (!td->first && !td->activity_now && td->activity) { +- input_event(input, EV_KEY, BTN_TOUCH, 0); +- td->activity = false; +- } +- return; +- } +- +- input_event(input, EV_ABS, ABS_MT_TRACKING_ID, td->id); +- input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x); +- input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y); +- +- input_mt_sync(input); +- td->valid = false; +- +- /* touchscreen emulation: if first active finger in this frame... */ +- if (!td->activity_now) { +- /* if there was no previous activity, emit touch event */ +- if (!td->activity) { +- input_event(input, EV_KEY, BTN_TOUCH, 1); +- td->activity = true; +- } +- td->activity_now = true; +- /* and in any case this is our preferred finger */ +- input_event(input, EV_ABS, ABS_X, td->x); +- input_event(input, EV_ABS, ABS_Y, td->y); +- } +-} +- +- +-static int mosart_event(struct hid_device *hid, struct hid_field *field, +- struct hid_usage *usage, __s32 value) +-{ +- struct mosart_data *td = hid_get_drvdata(hid); +- +- if (hid->claimed & HID_CLAIMED_INPUT) { +- struct input_dev *input = field->hidinput->input; +- switch (usage->hid) { +- case HID_DG_INRANGE: +- td->valid = !!value; +- break; +- case HID_GD_X: +- td->x = value; +- break; +- case HID_GD_Y: +- td->y = value; +- mosart_filter_event(td, input); +- break; +- case HID_DG_CONTACTID: +- td->id = value; +- break; +- case HID_DG_CONTACTCOUNT: +- /* touch emulation: this is the last field in a frame */ +- td->first = false; +- td->activity_now = false; +- break; +- case HID_DG_CONFIDENCE: +- case HID_DG_TIPSWITCH: +- /* avoid interference from generic hidinput handling */ +- break; +- +- default: +- /* fallback to the generic hidinput handling */ +- return 0; +- } +- } +- +- /* we have handled the hidinput part, now remains hiddev */ +- if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event) +- hid->hiddev_hid_event(hid, field, usage, value); +- +- return 1; +-} +- +-static int mosart_probe(struct hid_device *hdev, const struct hid_device_id *id) +-{ +- int ret; +- struct mosart_data *td; +- +- +- td = kmalloc(sizeof(struct mosart_data), GFP_KERNEL); +- if (!td) { +- hid_err(hdev, "cannot allocate MosArt data\n"); +- return -ENOMEM; +- } +- td->valid = false; +- td->activity = false; +- td->activity_now = false; +- td->first = false; +- hid_set_drvdata(hdev, td); +- +- /* currently, it's better to have one evdev device only */ +-#if 0 +- hdev->quirks |= HID_QUIRK_MULTI_INPUT; +-#endif +- +- ret = hid_parse(hdev); +- if (ret == 0) +- ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); +- +- if (ret == 0) { +- struct hid_report_enum *re = hdev->report_enum +- + HID_FEATURE_REPORT; +- struct hid_report *r = re->report_id_hash[7]; +- +- r->field[0]->value[0] = 0x02; +- usbhid_submit_report(hdev, r, USB_DIR_OUT); +- } else +- kfree(td); +- +- return ret; +-} +- +-#ifdef CONFIG_PM +-static int mosart_reset_resume(struct hid_device *hdev) +-{ +- struct hid_report_enum *re = hdev->report_enum +- + HID_FEATURE_REPORT; +- struct hid_report *r = re->report_id_hash[7]; +- +- r->field[0]->value[0] = 0x02; +- usbhid_submit_report(hdev, r, USB_DIR_OUT); +- return 0; +-} +-#endif +- +-static void mosart_remove(struct hid_device *hdev) +-{ +- hid_hw_stop(hdev); +- kfree(hid_get_drvdata(hdev)); +- hid_set_drvdata(hdev, NULL); +-} +- +-static const struct hid_device_id mosart_devices[] = { +- { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) }, +- { } +-}; +-MODULE_DEVICE_TABLE(hid, mosart_devices); +- +-static const struct hid_usage_id mosart_grabbed_usages[] = { +- { HID_ANY_ID, HID_ANY_ID, HID_ANY_ID }, +- { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1} +-}; +- +-static struct hid_driver mosart_driver = { +- .name = "mosart", +- .id_table = mosart_devices, +- .probe = mosart_probe, +- .remove = mosart_remove, +- .input_mapping = mosart_input_mapping, +- .input_mapped = mosart_input_mapped, +- .usage_table = mosart_grabbed_usages, +- .event = mosart_event, +-#ifdef CONFIG_PM +- .reset_resume = mosart_reset_resume, +-#endif +-}; +- +-static int __init mosart_init(void) +-{ +- return hid_register_driver(&mosart_driver); +-} +- +-static void __exit mosart_exit(void) +-{ +- hid_unregister_driver(&mosart_driver); +-} +- +-module_init(mosart_init); +-module_exit(mosart_exit); +- +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 51b5d27..bf46804 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -50,6 +50,7 @@ MODULE_LICENSE("GPL"); + #define MT_QUIRK_VALID_IS_INRANGE (1 << 4) + #define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 5) + #define MT_QUIRK_EGALAX_XYZ_FIXUP (1 << 6) ++#define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 7) + + struct mt_slot { + __s32 x, y, p, w, h; +@@ -90,6 +91,7 @@ struct mt_class { + #define MT_CLS_STANTUM 6 + #define MT_CLS_3M 7 + #define MT_CLS_CONFIDENCE 8 ++#define MT_CLS_CONFIDENCE_MINUS_ONE 9 + + #define MT_DEFAULT_MAXCONTACT 10 + +@@ -140,7 +142,9 @@ struct mt_class mt_classes[] = { + .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP | + MT_QUIRK_CYPRESS, + .maxcontacts = 10 }, +- ++ { .name = MT_CLS_CONFIDENCE_MINUS_ONE, ++ .quirks = MT_QUIRK_VALID_IS_CONFIDENCE | ++ MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE }, + { .name = MT_CLS_EGALAX, + .quirks = MT_QUIRK_SLOT_IS_CONTACTID | + MT_QUIRK_VALID_IS_INRANGE | +@@ -325,6 +329,9 @@ static int mt_compute_slot(struct mt_device *td) + if (quirks & MT_QUIRK_SLOT_IS_CONTACTNUMBER) + return td->num_received; + ++ if (quirks & MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE) ++ return td->curdata.contactid - 1; ++ + return find_slot_from_contactid(td); + } + +@@ -587,6 +594,17 @@ static const struct hid_device_id mt_devices[] = { + HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, + USB_DEVICE_ID_IRTOUCH_INFRARED_USB) }, + ++ /* MosArt panels */ ++ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, ++ HID_USB_DEVICE(USB_VENDOR_ID_ASUS, ++ USB_DEVICE_ID_ASUS_T91MT)}, ++ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, ++ HID_USB_DEVICE(USB_VENDOR_ID_ASUS, ++ USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) }, ++ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, ++ HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, ++ USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) }, ++ + /* PenMount panels */ + { .driver_data = MT_CLS_CONFIDENCE, + HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, +commit 4e61f0d75aa86c9e59451f6bcffcdceb355b4fc4 +Author: Austin Zhang +Date: Mon May 9 23:54:14 2011 +0800 + + HID: hid-multitouch: add support for Ilitek dual-touch panel + + Added ILITEK hid dual touch panel support into hid-multitouch. + + Signed-off-by: Austin Zhang + Reviewed-by: Benjamin Tissoires + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index d2d4e5f..d9635d6 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -306,6 +306,7 @@ config HID_MULTITOUCH + - Cando dual touch panel + - Cypress TrueTouch panels + - Hanvon dual touch panels ++ - Ilitek dual touch panel + - IrTouch Infrared USB panels + - MosArt dual-touch panels + - PenMount dual touch panels +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index 6e31b9f..c0ea857 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1377,6 +1377,7 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) }, + { HID_USB_DEVICE(USB_VENDOR_ID_HANVON, USB_DEVICE_ID_HANVON_MULTITOUCH) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_ILITEK, USB_DEVICE_ID_ILITEK_MULTITOUCH) }, + { HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, USB_DEVICE_ID_IRTOUCH_INFRARED_USB) }, + { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 252aeba..0f29b3f 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -330,6 +330,9 @@ + #define USB_DEVICE_ID_UGCI_FLYING 0x0020 + #define USB_DEVICE_ID_UGCI_FIGHTING 0x0030 + ++#define USB_VENDOR_ID_ILITEK 0x222a ++#define USB_DEVICE_ID_ILITEK_MULTITOUCH 0x0001 ++ + #define USB_VENDOR_ID_IMATION 0x0718 + #define USB_DEVICE_ID_DISC_STAKKA 0xd000 + +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index bf46804..b21251b 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -589,6 +589,11 @@ static const struct hid_device_id mt_devices[] = { + HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, + USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) }, + ++ /* Ilitek dual touch panel */ ++ { .driver_data = MT_CLS_DEFAULT, ++ HID_USB_DEVICE(USB_VENDOR_ID_ILITEK, ++ USB_DEVICE_ID_ILITEK_MULTITOUCH) }, ++ + /* IRTOUCH panels */ + { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTID, + HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, +commit df167c4a0d68a9dbde044a39a77f255ac666f93e +Author: Benjamin Tissoires +Date: Wed May 18 15:27:24 2011 +0200 + + HID: hid-multitouch: Add support for Lumio panels + + This patch enables support for Lumio optical devices. + + Signed-off-by: Benjamin Tissoires + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index d9635d6..5a54b13 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -308,6 +308,7 @@ config HID_MULTITOUCH + - Hanvon dual touch panels + - Ilitek dual touch panel + - IrTouch Infrared USB panels ++ - Lumio CrystalTouch panels + - MosArt dual-touch panels + - PenMount dual touch panels + - Pixcir dual touch panels +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index c0ea857..3dad069 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1410,6 +1410,7 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 0f29b3f..bfbc0d2 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -410,6 +410,9 @@ + #define USB_DEVICE_ID_DINOVO_MINI 0xc71f + #define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2 0xca03 + ++#define USB_VENDOR_ID_LUMIO 0x202e ++#define USB_DEVICE_ID_CRYSTALTOUCH 0x0006 ++ + #define USB_VENDOR_ID_MCC 0x09db + #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 + #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index b21251b..ef33e2d 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -599,6 +599,11 @@ static const struct hid_device_id mt_devices[] = { + HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, + USB_DEVICE_ID_IRTOUCH_INFRARED_USB) }, + ++ /* Lumio panels */ ++ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, ++ HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, ++ USB_DEVICE_ID_CRYSTALTOUCH) }, ++ + /* MosArt panels */ + { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, + HID_USB_DEVICE(USB_VENDOR_ID_ASUS, +commit c04abeeff9d76a703cac1e6d312853b0fc8136f5 +Author: Benjamin Tissoires +Date: Thu May 19 11:37:29 2011 +0200 + + HID: hid-multitouch: add support for Elo TouchSystems 2515 IntelliTouch Plus + + This patch adds support for Elo TouchSystems 2515 IntelliTouch Plus + that can be found in Lenovo A700 all-in-one. + + Signed-off-by: Benjamin Tissoires + Tested-by: Bastien Nocera + Signed-off-by: Jiri Kosina + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 5a54b13..1572ff1 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -305,6 +305,7 @@ config HID_MULTITOUCH + - 3M PCT touch screens + - Cando dual touch panel + - Cypress TrueTouch panels ++ - Elo TouchSystems IntelliTouch Plus panels + - Hanvon dual touch panels + - Ilitek dual touch panel + - IrTouch Infrared USB panels +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index 3dad069..053fc08 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1366,6 +1366,7 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3) }, + { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2515) }, + { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) }, + { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, + { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index bfbc0d2..6c19d1a 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -216,6 +216,7 @@ + #define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34 + + #define USB_VENDOR_ID_ELO 0x04E7 ++#define USB_DEVICE_ID_ELO_TS2515 0x0022 + #define USB_DEVICE_ID_ELO_TS2700 0x0020 + + #define USB_VENDOR_ID_EMS 0x2006 +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index ef33e2d..3bc8de6 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -92,6 +92,7 @@ struct mt_class { + #define MT_CLS_3M 7 + #define MT_CLS_CONFIDENCE 8 + #define MT_CLS_CONFIDENCE_MINUS_ONE 9 ++#define MT_CLS_DUAL_NSMU_CONTACTID 10 + + #define MT_DEFAULT_MAXCONTACT 10 + +@@ -163,6 +164,10 @@ struct mt_class mt_classes[] = { + .sn_height = 128 }, + { .name = MT_CLS_CONFIDENCE, + .quirks = MT_QUIRK_VALID_IS_CONFIDENCE }, ++ { .name = MT_CLS_DUAL_NSMU_CONTACTID, ++ .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP | ++ MT_QUIRK_SLOT_IS_CONTACTID, ++ .maxcontacts = 2 }, + + { } + }; +@@ -584,6 +589,11 @@ static const struct hid_device_id mt_devices[] = { + HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, + USB_DEVICE_ID_CYPRESS_TRUETOUCH) }, + ++ /* Elo TouchSystems IntelliTouch Plus panel */ ++ { .driver_data = MT_CLS_DUAL_NSMU_CONTACTID, ++ HID_USB_DEVICE(USB_VENDOR_ID_ELO, ++ USB_DEVICE_ID_ELO_TS2515) }, ++ + /* GeneralTouch panel */ + { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, + HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, diff --git a/kernel.spec b/kernel.spec index 43e9a3a2d..b75966edb 100644 --- a/kernel.spec +++ b/kernel.spec @@ -57,13 +57,13 @@ Summary: The Linux kernel # base_sublevel is the kernel version we're starting with and patching # on top of -- for example, 2.6.22-rc7-git1 starts with a 2.6.21 base, # which yields a base_sublevel of 21. -%define base_sublevel 38 +%define base_sublevel 39 ## If this is a released kernel ## %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 0 +%define stable_update 3 # Is it a -stable RC? %define stable_rc 0 # Set rpm version accordingly @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 8 +%define rcrev 0 # The git snapshot level -%define gitrev 4 +%define gitrev 0 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -345,7 +345,7 @@ Summary: The Linux kernel %define asmarch sparc %define all_arch_configs kernel-%{version}-sparc64*.config %define make_target image -%define kernel_image arch/sparc/boot/image +%define kernel_image vmlinux %define image_install_path boot %define with_perf 0 %endif @@ -596,8 +596,6 @@ Patch00: patch-2.6.%{base_sublevel}-git%{gitrev}.bz2 ### BRANCH PATCH ### %endif -Patch02: git-linus.diff - # we also need compile fixes for -vanilla Patch04: linux-2.6-compile-fixes.patch @@ -609,10 +607,7 @@ Patch05: linux-2.6-makefile-after_link.patch # revert upstream patches we get via other methods Patch09: linux-2.6-upstream-reverts.patch -# Git trees. -# Standalone patches -Patch20: linux-2.6-hotfixes.patch Patch29: linux-2.6-utrace-revert-make-ptrace-functions-static.patch Patch30: linux-2.6-tracehook.patch @@ -620,22 +615,21 @@ Patch31: linux-2.6-utrace.patch Patch32: linux-2.6-utrace-ptrace.patch Patch150: linux-2.6.29-sparc-IOC_TYPECHECK.patch -Patch151: sparc64_fix_build_errors_with_gcc460.patch Patch160: linux-2.6-32bit-mmap-exec-randomization.patch Patch161: linux-2.6-i386-nx-emulation.patch -Patch200: linux-2.6-debug-sizeof-structs.patch Patch202: linux-2.6-debug-taint-vm.patch Patch203: linux-2.6-debug-vm-would-have-oomkilled.patch -Patch204: linux-2.6-debug-always-inline-kzalloc.patch Patch380: linux-2.6-defaults-pci_no_msi.patch Patch381: linux-2.6-defaults-pci_use_crs.patch -Patch383: linux-2.6-defaults-aspm.patch -Patch386: pci-_osc-supported-field-should-contain-supported-features-not-enabled-ones.patch -Patch385: ima-allow-it-to-be-completely-disabled-and-default-off.patch +# ASPM: enable powersave by default +Patch383: linux-2.6-defaults-aspm.patch +Patch385: pci-enable-aspm-state-clearing-regardless-of-policy.patch + +Patch389: ima-allow-it-to-be-completely-disabled-and-default-off.patch Patch390: linux-2.6-defaults-acpi-video.patch Patch391: linux-2.6-acpi-video-dos.patch @@ -644,7 +638,8 @@ Patch394: linux-2.6-acpi-debug-infinite-loop.patch Patch450: linux-2.6-input-kill-stupid-messages.patch Patch452: linux-2.6.30-no-pcspkr-modalias.patch -Patch454: thinkpad-acpi-fix-backlight.patch +Patch453: revert-hid-magicmouse-ignore-ivalid-report-id-while-switching.patch +Patch456: hid-multitouch-add-support-for-elo-touchsystems.patch Patch460: linux-2.6-serial-460800.patch @@ -655,7 +650,12 @@ Patch530: linux-2.6-silence-fbcon-logo.patch Patch570: linux-2.6-selinux-mprotect-checks.patch Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch -Patch610: hda_intel-prealloc-4mb-dmabuffer.patch +# scsi / block + +# libata +Patch621: libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch + +Patch650: hda_intel-prealloc-4mb-dmabuffer.patch Patch700: linux-2.6-e1000-ich9-montevina.patch @@ -669,6 +669,7 @@ Patch1555: fix_xen_guest_on_old_EC2.patch # DRM # nouveau + drm fixes +Patch1809: drm-nouveau-fixes.patch Patch1810: drm-nouveau-updates.patch Patch1819: drm-intel-big-hammer.patch # intel drm is all merged upstream @@ -676,7 +677,8 @@ Patch1824: drm-intel-next.patch # make sure the lvds comes back on lid open Patch1825: drm-intel-make-lvds-work.patch Patch1826: drm-intel-edp-fixes.patch -Patch1827: drm-i915-gen4-has-non-power-of-two-strides.patch +# radeon - new hw + fixes for fusion and t500 regression +Patch1839: drm-radeon-fix-regression-on-atom-cards-with-hardcoded-EDID-record.patch Patch1900: linux-2.6-intel-iommu-igfx.patch @@ -692,15 +694,6 @@ Patch2802: linux-2.6-silence-acpi-blacklist.patch Patch2899: linux-2.6-v4l-dvb-fixes.patch Patch2900: linux-2.6-v4l-dvb-update.patch Patch2901: linux-2.6-v4l-dvb-experimental.patch -Patch2902: linux-2.6-v4l-dvb-uvcvideo-update.patch - -Patch2910: linux-2.6-v4l-dvb-add-lgdt3304-support.patch -Patch2912: linux-2.6-v4l-dvb-ir-core-update.patch - -#Patch2916: lirc-staging-2.6.36-fixes.patch -#Patch2917: hdpvr-ir-enable.patch - -Patch2918: flexcop-fix-xlate_proc_name-warning.patch # fs fixes @@ -708,30 +701,27 @@ Patch2918: flexcop-fix-xlate_proc_name-warning.patch # patches headed upstream -Patch12001: perf-gcc460-build-fixes.patch - Patch12010: add-appleir-usb-driver.patch Patch12016: disable-i8042-check-on-apple-mac.patch -Patch12017: prevent-runtime-conntrack-changes.patch - Patch12018: neuter_intel_microcode_load.patch -Patch12101: apple_backlight.patch -Patch12102: efifb_update.patch -Patch12200: acpi_reboot.patch -Patch12210: efi_default_physical.patch - # Runtime power management -Patch12202: linux-2.6-ehci-check-port-status.patch Patch12203: linux-2.6-usb-pci-autosuspend.patch Patch12204: linux-2.6-enable-more-pci-autosuspend.patch -Patch12205: runtime_pm_fixups.patch Patch12303: dmar-disable-when-ricoh-multifunction.patch -Patch12421: fs-call-security_d_instantiate-in-d_obtain_alias.patch +Patch12306: scsi-sd-downgrade-caching-printk-from-error-to-notice.patch + +# Fix breakage of PCI network adapter names on older Dell systems +Patch12404: x86-pci-preserve-existing-pci-bfsort-whitelist-for-dell-systems.patch + +Patch12416: bluetooth-device-ids-for-ath3k-on-pegatron-lucid-tablets.patch + + +Patch12420: crypto-aesni_intel-merge-with-fpu_ko.patch %endif @@ -1156,8 +1146,6 @@ do done %endif -ApplyOptionalPatch git-linus.diff - ApplyPatch linux-2.6-makefile-after_link.patch # @@ -1170,21 +1158,17 @@ ApplyOptionalPatch linux-2.6-compile-fixes.patch # revert patches from upstream that conflict or that we get via other means ApplyOptionalPatch linux-2.6-upstream-reverts.patch -R -ApplyPatch linux-2.6-hotfixes.patch - -# Roland's utrace ptrace replacement. +# utrace ApplyPatch linux-2.6-utrace-revert-make-ptrace-functions-static.patch ApplyPatch linux-2.6-tracehook.patch ApplyPatch linux-2.6-utrace.patch ApplyPatch linux-2.6-utrace-ptrace.patch +# mm patches + # Architecture patches # x86(-64) -# -# Intel IOMMU -# - # # PowerPC # @@ -1193,7 +1177,6 @@ ApplyPatch linux-2.6-utrace-ptrace.patch # SPARC64 # ApplyPatch linux-2.6.29-sparc-IOC_TYPECHECK.patch -ApplyPatch sparc64_fix_build_errors_with_gcc460.patch # # Exec shield @@ -1227,10 +1210,8 @@ ApplyPatch acpi-ec-add-delay-before-write.patch ApplyPatch linux-2.6-acpi-debug-infinite-loop.patch # Various low-impact patches to aid debugging. -ApplyPatch linux-2.6-debug-sizeof-structs.patch ApplyPatch linux-2.6-debug-taint-vm.patch ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch -ApplyPatch linux-2.6-debug-always-inline-kzalloc.patch # # PCI @@ -1240,15 +1221,20 @@ ApplyPatch linux-2.6-defaults-pci_no_msi.patch ApplyPatch linux-2.6-defaults-pci_use_crs.patch # enable ASPM by default on hardware we expect to work ApplyPatch linux-2.6-defaults-aspm.patch -# rhbz#638912 -#ApplyPatch pci-_osc-supported-field-should-contain-supported-features-not-enabled-ones.patch +ApplyPatch pci-enable-aspm-state-clearing-regardless-of-policy.patch +# Fix breakage of PCI network adapter names on older Dell systems +ApplyPatch x86-pci-preserve-existing-pci-bfsort-whitelist-for-dell-systems.patch #ApplyPatch ima-allow-it-to-be-completely-disabled-and-default-off.patch # -# SCSI Bits. +# SCSI / block Bits. # +# libata +# Fix drive detection failure on mvsas (rhbz#705019) +ApplyPatch libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch + # ACPI # ALSA @@ -1259,14 +1245,13 @@ ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch # Misc fixes # The input layer spews crap no-one cares about. ApplyPatch linux-2.6-input-kill-stupid-messages.patch +ApplyPatch linux-2.6.30-no-pcspkr-modalias.patch +ApplyPatch revert-hid-magicmouse-ignore-ivalid-report-id-while-switching.patch +ApplyPatch hid-multitouch-add-support-for-elo-touchsystems.patch # stop floppy.ko from autoloading during udev... ApplyPatch die-floppy-die.patch -ApplyPatch linux-2.6.30-no-pcspkr-modalias.patch - -#ApplyPatch thinkpad-acpi-fix-backlight.patch - # Allow to use 480600 baud on 16C950 UARTs ApplyPatch linux-2.6-serial-460800.patch @@ -1299,6 +1284,7 @@ ApplyPatch fix_xen_guest_on_old_EC2.patch # DRM core # Nouveau DRM +ApplyOptionalPatch drm-nouveau-fixes.patch ApplyOptionalPatch drm-nouveau-updates.patch # Intel DRM @@ -1307,9 +1293,9 @@ ApplyPatch drm-intel-big-hammer.patch ApplyPatch drm-intel-make-lvds-work.patch ApplyPatch linux-2.6-intel-iommu-igfx.patch ApplyPatch drm-intel-edp-fixes.patch -# rhbz#681285 (i965: crash in brw_wm_surface_state.c::prepare_wm_surfaces() -# where intelObj->mt == NULL) -#ApplyPatch drm-i915-gen4-has-non-power-of-two-strides.patch + +# radeon DRM (add cayman support) +ApplyPatch drm-radeon-fix-regression-on-atom-cards-with-hardcoded-EDID-record.patch -R # linux1394 git patches #ApplyPatch linux-2.6-firewire-git-update.patch @@ -1323,21 +1309,8 @@ ApplyPatch linux-2.6-silence-acpi-blacklist.patch ApplyOptionalPatch linux-2.6-v4l-dvb-fixes.patch ApplyOptionalPatch linux-2.6-v4l-dvb-update.patch ApplyOptionalPatch linux-2.6-v4l-dvb-experimental.patch -#ApplyPatch linux-2.6-v4l-dvb-uvcvideo-update.patch -#ApplyPatch linux-2.6-v4l-dvb-ir-core-update.patch - -###FIX###ApplyPatch linux-2.6-v4l-dvb-add-lgdt3304-support.patch - -# http://www.lirc.org/ -#ApplyOptionalPatch lirc-staging-2.6.36-fixes.patch -# enable IR receiver on Hauppauge HD PVR (v4l-dvb merge pending) -#ApplyPatch hdpvr-ir-enable.patch - -# rhbz#664852 -ApplyPatch flexcop-fix-xlate_proc_name-warning.patch # Patches headed upstream -ApplyPatch perf-gcc460-build-fixes.patch ApplyPatch disable-i8042-check-on-apple-mac.patch @@ -1345,24 +1318,20 @@ ApplyPatch add-appleir-usb-driver.patch ApplyPatch neuter_intel_microcode_load.patch -# various fixes for Apple and EFI -ApplyPatch apple_backlight.patch -ApplyPatch efifb_update.patch -ApplyPatch acpi_reboot.patch -ApplyPatch efi_default_physical.patch - # Runtime PM -ApplyPatch linux-2.6-ehci-check-port-status.patch #ApplyPatch linux-2.6-usb-pci-autosuspend.patch ### Broken by implicit notify support & ACPICA rebase ###ApplyPatch linux-2.6-enable-more-pci-autosuspend.patch -#ApplyPatch runtime_pm_fixups.patch # rhbz#605888 ApplyPatch dmar-disable-when-ricoh-multifunction.patch -# rhbz#662344,600690 -ApplyPatch fs-call-security_d_instantiate-in-d_obtain_alias.patch +ApplyPatch scsi-sd-downgrade-caching-printk-from-error-to-notice.patch + +ApplyPatch bluetooth-device-ids-for-ath3k-on-pegatron-lucid-tablets.patch + +# rhbz#589390 +ApplyPatch crypto-aesni_intel-merge-with-fpu_ko.patch # END OF PATCH APPLICATIONS @@ -1972,6 +1941,301 @@ fi # and build. %changelog +* Tue Jul 12 2011 Dave Jones +- 2.6.39.3 + dropped: (merged upstream) + ath5k-disable-fast-channel-switching-by-default.patch + cfq-iosched-fix-locking-around-ioc-ioc-data-assignment.patch + drm-i915-apply-hwstam-workaround-for-bsd-ring-on-sandybridge.patch + drm-i915-snb-irq-stalls-fix.patch + ksm-fix-null-pointer-dereference-in-scan-get-next-rmap-item.patch + +* Wed Jun 29 2011 Dave Jones +- 2.6.39.2 + +* Mon Jun 27 2011 Dave Jones +- Disable CONFIG_CRYPTO_MANAGER_DISABLE_TESTS, as this also disables FIPS (rhbz 716942) + +* Sat Jun 25 2011 Chuck Ebbert +- Intel IOMMU fixes from 2.6.39.2 +- drm-i915-apply-hwstam-workaround-for-bsd-ring-on-sandybridge.patch: + Another fix for Sandybridge stalls + +* Fri Jun 24 2011 Chuck Ebbert +- Minor cleanup: use upstream patch to export block_{get,put}_queue +- block-blkdev_get-should-access-bd_disk-only-after.patch: + fix potential oops introduced in 2.6.38.8 +- ahci-add-another-pci-id-for-marvell.patch (rhbz#705960) +- CVE-2011-2183: ksm: race between ksmd and exiting task +- Revert 2.6.38.8 patch that broke magicmouse (rhbz#714381) +- Fix drive detection failure on mvsas (rhbz#705019) +- Fix oopses in the CFQ disk scheduler (rhbz#577968) +- Support Wacom touchscreen 00e6 in Thinkpad x220 (rhbz#708307) + +* Thu Jun 23 2011 Dave Airlie 2.6.38.8-34 +- drm-i915-snb-irq-stalls-fix.patch: fix Sandybridge IRQ stalls + +* Thu Jun 23 2011 Dave Airlie +- drm-radeon-update3.patch: more radeon fixes backport + +* Tue Jun 21 2011 Dave Jones +- HID: ntrig don't dereference unclaimed hidinput (rhbz#714827) + +* Mon Jun 20 2011 Kyle McMartin 2.6.38.8-33 +- [sgruszka@] iwlwifi: fix general 11n instability (rhbz#648732) + +* Wed Jun 15 2011 Kyle McMartin +- crypto: aesni-intel - Merge with fpu.ko (rhbz#589390) + +* Thu Jun 09 2011 Kyle McMartin 2.6.38.8-32 +- ath5k-disable-fast-channel-switching-by-default.patch (rhbz#709122) + (korgbz#34992) [a99168ee in wireless-next] + +* Tue Jun 07 2011 Dave Jones +- [SCSI] Fix oops caused by queue refcounting failure. + +* Sat Jun 04 2011 Chuck Ebbert 2.6.38.8-31 +- Linux 2.6.38.8 +- Revert radeon patches we already have: + drm/radeon/kms: add wait idle ioctl for eg->cayman + drm/radeon/evergreen/btc/fusion: setup hdp to invalidate and flush when asked +- Drop individual patches we have: + ips-use-interruptible-waits-in-ips-monitor.patch + drm-vblank-events-fix-hangs.patch + mm-vmscan-correct-use-of-pgdat_balanced-in-sleeping_prematurely.patch + mm-vmscan-correctly-check-if-reclaimer-should-schedule-during-shrink_slab.patch +- Drop x86-amd-arat-bug-on-sempron-workaround.patch; the proper fix is in 2.6.38.8 + +* Sun May 29 2011 Dave Airlie +- fix oops on pageflipping sometimes (#680651) + +* Fri May 27 2011 Ben Skeggs 2.6.38.7-30 +- nouveau: minor fixes for various issues from upstream +- nv40 modesetting fix (rhbz#708235) +- nv50+ support for LVDS panels using SPWG spec (blank/corrupt screen fixes) +- nva3+ pm clock get/set fixes + +* Wed May 25 2011 Dave Airlie +- drm-radeon-update2.patch: more radeon updates + cayman accel support + +* Tue May 24 2011 Kyle McMartin +- hid-multitouch: add support for elo touchsystems panels (requested + by hadess, backported from hid-next) +- bluetooth: add support for more ath3k devices (Ditto.) + +* Mon May 23 2011 Chuck Ebbert 2.6.38.7-29 +- Linux 2.6.38.7 +- Eliminate hangs when using frequent high-order allocations + +* Fri May 20 2011 Chuck Ebbert 2.6.38.7-28.rc1 +- Linux 2.6.38.7-rc1 +- Fix up context in utrace-ptrace.patch +- Revert radeon patches already in our radeon update: + drm-radeon-kms-fix-gart-setup-on-fusion-parts-v2-backport.patch +- Drop merged patches: + iwlwifi-add-_ack_plpc_check-module-parameters.patch +- Fix stalls on AMD Sempron notebooks (#704059) + +* Fri May 13 2011 Kyle McMartin 2.6.38.6-27 +- [fabbione@] Fix a deadlock when using hp_sw with an HP san. + (7a1e9d82 upstream) + +* Wed May 11 2011 Chuck Ebbert +- Fix Intel IPS driver so it doesn't run continuously (#703511) + +* Tue May 10 2011 Kyle McMartin +- [sgruszka@] iwlwifi: add {ack,plpc}_check module parameters (#666646) + +* Tue May 10 2011 Chuck Ebbert +- Linux 2.6.38.6 (no functional changes from 2.6.38.6-26.rc1) +- Drop merged patches: + can-add-missing-socket-check-in-can_raw_release.patch + scsi-fix-oops-in-scsi_run_queue.patch + vm-skip-the-stack-guard-page-lookup-in-get_user_pages-only-for-mlock.patch + +* Mon May 09 2011 Chuck Ebbert 2.6.38.6-26.rc1 +- Fix a VM bug introduced in 2.6.38.4 + +* Mon May 09 2011 Kyle McMartin +- Update to stable review 2.6.38.6-rc1 +- Revert DRM patch duplicated in drm-radeon-update rollup. +- Revert cx88 fix in stable which has been fixed differently in the + v4l-dvb-update backport. +- Add two patches which should make it into the final 2.6.38.6 release. + - can-add-missing-socket-check-in-can_raw_release.patch + - scsi-fix-oops-in-scsi_run_queue.patch + +* Mon May 09 2011 Chuck Ebbert +- Enable CONFIG_FB_UDL (#634636) + +* Mon May 09 2011 Dave Airlie +- fix dual-gpu intel/radeon laptops where intel would cause radeon crash. + +* Sat May 07 2011 Chuck Ebbert +- Fix breakage of network device names on Dell systems (#702740) + +* Fri May 06 2011 Dave Airlie 2.6.38.5-24 +- forgot the cayman PCI IDs. + +* Tue May 03 2011 Dave Airlie 2.6.38.5-23 +- radeon updates from 2.6.39 with cayman + fixes for lots of things including Fusion. +- vblank fix for core drm + +* Mon May 02 2011 Chuck Ebbert +- [SCSI] mpt2sas: prevent heap overflows and unchecked reads + (CVE-2011-1494, CVE-2011-1495) +- bonding: Incorrect TX queue offset (CVE-2011-1581) +- Restore reliable stack backtraces, and hopefully fix RHBZ #700718 + +* Mon May 02 2011 Kyle McMartin 2.6.38.5-22 +- And to the released 2.6.38.5 + +* Sun May 01 2011 Kyle McMartin 2.6.38.5-21.rc1 +- Update to stable release candidate 2.6.38.5-rc1 + +* Thu Apr 28 2011 Kyle McMartin 2.6.38.4-20 +- [sgruszka@] Upstream fixes for iwl3945 bugs (#683571, #688252, #671366) + +* Tue Apr 26 2011 Chuck Ebbert +- Another fix for ASPM powersave mode + +* Mon Apr 25 2011 Jarod Wilson +- ite-cir: fix modular build on powerpc (#698378) +- mceusb: add Dell-branded transceiver device ID +- nuvoton-cir: improve compatibility with lirc raw IR mode + +* Mon Apr 25 2011 Neil Horman +- netconsole: fix deadlock in netdev notifier handler + +* Sun Apr 24 2011 Kyle McMartin +- ppc64: disable TUNE_CELL, which causes problems with illegal instuctions + being generated on non-Cell PPC machines. (#698256) + +* Fri Apr 22 2011 Kyle McMartin 2.6.38.4-19 +- Update to 2.6.38.4 + +* Fri Apr 22 2011 Kyle McMartin 2.6.38.3-18 +- iwlwifi: fix scanning when channel changing (#688252) + +* Tue Apr 19 2011 Jarod Wilson +- Add basic support for full 32-bit NEC IR scancodes +- Add latest patches sent upstream for hid layer expansion and full + support for the TiVo Slide bluetooth/hid remote +- Add a TiVo IR remote keymap, use it by default with TiVo mceusb device +- Add ite-cir driver, nuke crappy old lirc_it* drivers +- Add an initial Apple remote keymap +- Add support for more Nuvoton IR hardware variants +- Overhaul lirc_zilog refcounting so it doesn't suck so badly anymore +- Clean up myriad of Hauppauge keymaps +- Make ir-kbd-i2c pass full rc5 scancodes when it can +- Misc minor v4l/dvb fixes + +* Fri Apr 15 2011 Kyle McMartin +- Drop x86-hibernate-initialize-mmu_cr4_features-during-boot.patch, + e5f15b45 was reverted in stable. + +* Thu Apr 14 2011 Chuck Ebbert 2.6.38.3-16 +- Linux 2.6.38.3 +- Drop merged patches: + linux-2.6-x86-fix-mtrr-resume.patch + pci-acpi-report-aspm-support-to-bios-if-not-disabled-from-command-line.patch +- Drop some obsolete patches: + runtime_pm_fixups.patch + drm-i915-gen4-has-non-power-of-two-strides.patch' + +* Wed Apr 13 2011 Chuck Ebbert 2.6.38.3-15.rc1 +- Linux 2.6.38.3-rc1 + +* Tue Apr 12 2011 Kyle McMartin +- fix hibernate which was broken by 2.6.38.y (korg#32222) + +* Tue Apr 12 2011 Ben Skeggs 2.6.38-2.14 +- nouveau: correct lock ordering problem + +* Mon Apr 11 2011 Dave Airlie +- x86: add upstream patch to fix MTRR on resume - will come via stable later. + +* Fri Apr 08 2011 Ben Skeggs 2.6.38-2.13 +- nouveau: fix pcie nv3x (rhbz#692588) + +* Thu Apr 07 2011 Hans de Goede +- i915: Add a no lvds quirk for the Asus EB1007, this fixes gnome-shell + +* Thu Apr 07 2011 Ben Skeggs 2.6.38-2.12 +- nouveau: switch nv4x back to DMA32 only (rhbz#689825) + +* Mon Apr 04 2011 Ben Skeggs 2.6.38-2.11 +- ttm: add patch from upstream to fix a recent nouveau issue + +* Thu Mar 31 2011 Ben Skeggs 2.6.38-2.10 +- nouveau: nva3+ stability improvements +- nouveau: nvc0 "stutter" fixes +- nouveau: nv50/nvc0 page flipping +- nouveau: nv50 z compression + +* Wed Mar 29 2011 Kyle McMartin 2.6.38.2-9 +- Downgrade SCSI sd printk's about disk caching from KERN_ERR to KERN_NOTICE + so they don't show up in our pretty quiet boot. Ray noticed them when + booting from a USB stick which doesn't have a cache page returned in the + sense buffer. + +* Tue Mar 29 2011 Kyle McMartin +- Disable CONFIG_IMA, CONFIG_TCG_TPM on powerpc (#689468) + +* Tue Mar 29 2011 Kyle McMartin +- printk: do not mangle valid userspace syslog prefixes with + /dev/kmsg (#691888) + - The patch is upstream in 2.6.39, and Lennart tells me the patch has been + backported for the next Suse release as well. +- Disable qla4xxx (CONFIG_SCSI_QLA_ISCSI) driver on powerpc32 (#686199) + +* Sun Mar 27 2011 Chuck Ebbert 2.6.38.2-8 +- Linux 2.6.38.2 +- Drop patches merged in 2.6.38.2: + dcdbas-force-smi-to-happen-when-expected.patch + fs-call-security_d_instantiate-in-d_obtain_alias.patch + prevent-rt_sigqueueinfo-and-rt_tgsigqueueinfo-from-spoofing-the-signal-code.patch +- Fix more PCIe ASPM bugs: + kworker task over 65% after resume (#683156) + ASPM powersave mode does not get enabled + +* Sat Mar 26 2011 Chuck Ebbert 2.6.38.2-7.rc1 +- Linux 2.6.38.2-rc1 + +* Fri Mar 25 2011 Chuck Ebbert +- CVE-2011-1182: kernel signal spoofing issue +- Drop unused patches already applied upstream: + hdpvr-ir-enable.patch + thinkpad-acpi-fix-backlight.patch + +* Wed Mar 23 2011 Chuck Ebbert 2.6.38.1-6 +- Linux 2.6.38.1 +- Drop linux-2.6-ehci-check-port-status.patch, merged in .38.1 +- Add dcdbas-force-smi-to-happen-when-expected.patch + +* Wed Mar 23 2011 Kyle McMartin +- Re-create ACPI battery sysfs files on resume from suspend, fixes the + upstream changes to the dropped + acpi-update-battery-information-on-notification-0x81.patch. + +* Wed Mar 23 2011 Dave Airlie 2.6.38-5 +- i915: add fix for 945G misrendering terminal + +* Tue Mar 22 2011 Ben Skeggs 2.6.38-4 +- nouveau: implement missing bios opcode 0x5c (rhbz#688569) +- nouveau: a couple of minor fixes from nouveau git + +* Mon Mar 21 2011 Chuck Ebbert 2.6.38-3 +- Add contents of 2.6.38.1 patch queue (in git-linus.diff) + +* Thu Mar 17 2011 Matthew Garrett 2.6.38-2 +- drop efi_default_physical.patch - it's actually setting up something that's + neither physical nor virtual, and it's probably breaking EFI boots + +* Wed Mar 16 2011 Dennis Gilmore +- build sparc imagae as vmlinux +- fixes buildid conflicts since the sparc kernel is just a elf image + * Tue Mar 15 2011 Chuck Ebbert 2.6.38-1 - Linux 2.6.38 @@ -2389,583 +2653,6 @@ fi * Wed Oct 20 2010 Chuck Ebbert 2.6.36-1 - Linux 2.6.36 -* Wed Oct 20 2010 Matthew Garrett 2.6.36-0.42.rc8.git5 -- runtime_pm_fixups.patch: should fix this on Thinkpads - -* Tue Oct 19 2010 Chuck Ebbert 2.6.36-0.41.rc8.git5 -- Linux 2.6.36-rc8-git5 -- Update PCI _CRS fixes - -* Mon Oct 18 2010 Kyle McMartin 2.6.36-0.40.rc8.git0 -- Backport xHCI suspend/resume code from linux-next. - -* Mon Oct 18 2010 Kyle McMartin -- ima: Default it to off, pass ima=on to enable. Reduce impact of the option - when disabled. - -* Mon Oct 18 2010 Kyle McMartin -- Quirk to disable DMAR with Ricoh card reader/firewire. (rhbz#605888) - -* Fri Oct 15 2010 Kyle McMartin -- Switched to pci=use_crs by default (it should have been fixed since - cebbert sucked in the patches anyway.) - -* Fri Oct 15 2010 Kyle McMartin -- backport pnpacpi-cope-with-invalid-device-ids from linux-next. - (rhbz#641468) - -* Fri Oct 15 2010 Kyle McMartin 2.6.36-0.39.rc8.git0 -- Linux 2.6.36-rc8. - -* Thu Oct 14 2010 Kyle McMartin 2.6.36-0.38.rc7.git5 -- Linux 2.6.36-rc7-git5 -- Disable runtime PM until it can be poked at. - -* Tue Oct 12 2010 Kyle McMartin 2.6.36-0.36.rc7.git3 -- Linux 2.6.36-rc7-git3 -- Drop fix-oldnoconfig-to-dtrt.patch, nonintconfig patches are upstream! - -* Mon Oct 11 2010 Matthew Garrett 2.6.36-0.35.rc7.git1 -- linux-2.6-enable-more-pci-autosuspend.patch: Enable more PCI autosuspend - -* Wed Oct 06 2010 Kyle McMartin 2.6.36-0.35.rc7.git0 -- Linux 2.6.36-rc7 upstream. - -* Wed Oct 06 2010 Dave Jones -- Another day, another rcu_dereference warning. (#640673) - -* Tue Oct 05 2010 Kyle McMartin 2.6.36-0.34.rc6.git3 -- Linux 2.6.36-rc6-git3 -- Drop intel_ips patches merged upstream. - -* Sun Oct 03 2010 Kyle McMartin 2.6.36-0.32.rc6.git2 -- Enable printk.time by default for more useful logs. - -* Sat Oct 02 2010 Kyle McMartin 2.6.36-0.31.rc6.git2 -- Linux 2.6.36-rc6-git2 - -* Thu Sep 30 2010 Dave Jones -- silence another rcu_reference warning - -* Thu Sep 30 2010 Kyle McMartin 2.6.36-0.30.rc6 -- Collection of patches to make intel_ips work properly. - -* Wed Sep 29 2010 Dave Jones -- Add back an old hack to make an SDV e1000e variant work. - -* Wed Sep 29 2010 Dave Jones -- Enable IB700 watchdog (used by qemu/kvm). (#637152) - -* Tue Sep 28 2010 Kyle McMartin 2.6.36-0.28.rc6 -- Linux 2.6.36-rc6 - -* Fri Sep 24 2010 Chuck Ebbert 2.6.36-0.27.rc5.git6 -- Linux 2.6.36-rc5-git6 - -* Thu Sep 23 2010 Kyle McMartin -- Bump x86 NR_CPUS to 64. (Still 512/256 on x86_64.) - -* Thu Sep 23 2010 Chuck Ebbert 2.6.36-0.26.rc5.git4 -- Linux 2.6.36-rc5-git4 -- Drop merged patches: - fix-icebp-breakpoints.patch - linux-2.6.35.4-virtio_console-fix-poll.patch -- Add patches to fix problems with PCI _CRS - -* Thu Sep 23 2010 Kyle McMartin 2.6.36-0.25.rc5 -- Add s390 vdso AFTER_LINK to Roland's linux-2.6-makefile-after_link.patch - -* Thu Sep 23 2010 Kyle McMartin -- Snipe ACPI patch from mjg59 to fix battery levels on some laptops. - -* Tue Sep 21 2010 Kyle McMartin -- Add new btusb ids for MacBookPro from wwoods@. - -* Mon Sep 20 2010 Chuck Ebbert - 2.6.36-0.24.rc5 -- Linux 2.6.36-rc5 - -* Sun Sep 19 2010 Chuck Ebbert - 2.6.36-0.23.rc4.git4 -- Linux 2.6.36-rc4-git4 -- Drop alsa-fix-substream-proc-status-read.patch, now merged. - -* Fri Sep 17 2010 Matthew Garrett -- linux-2.6-bluetooth-autosuspend.patch - linux-2.6-uvc-autosuspend.patch - linux-2.6-qcserial-autosuspend.patch - linux-2.6-usb-pci-autosuspend.patch - Get some more devices into USB - autosuspend by default, and then put unused USB controllers to sleep - -* Thu Sep 16 2010 Hans de Goede -- Small fix to virtio_console poll fix from upstream review - -* Wed Sep 15 2010 Hans de Goede -- virtio_console: Fix poll/select blocking even though there is data to read - -* Wed Sep 15 2010 Chuck Ebbert - 2.6.36-0.22.rc4.git2 -- Linux 2.6.36-rc4-git2 -- Fix up add-appleir-usb-driver.patch after HID core changes. - -* Mon Sep 13 2010 Chuck Ebbert - 2.6.36-0.21.rc4.git1 -- Linux 2.6.36-rc4-git1 -- Add preliminary support for Wacom Bamboo pen and touch devices. -- Require python-devel and perl(ExtUtils::Embed) when building perf package (#632942) - -* Sat Sep 11 2010 Chuck Ebbert - 2.6.36-0.20.rc3.git4 -- Linux 2.6.36-rc3-git4 -- Drop revert-drm-i915-enable-rc6-on-ironlake.patch, now merged - -* Fri Sep 10 2010 Bastien Nocera - 2.6.36-0.19.rc3.git1 -- Update AppleIR patch to work, and support the enter key on - newer remotes - -* Wed Sep 08 2010 Kyle McMartin -- Enable GPIO_SYSFS. (#631958) - -* Wed Sep 08 2010 Kyle McMartin -- Make pci=use_crs a compile-time config option we can switch the default - value of easily. - -* Wed Sep 08 2010 Kyle McMartin 2.6.36-0.18.rc3.git1 -- 2.6.36-rc3-git1 -- Set CONFIG_CRYPTO_MANAGER_DISABLE_TESTS for nodebug, and unset for debug. - Which seems like the sensible thing to do given the Kconfig default is y. - -* Tue Sep 07 2010 Dave Jones -- Disable hung task checker, it only ever causes false positives. (#630777) - -* Tue Sep 07 2010 Kyle McMartin 2.6.36-0.17.rc3.git0 -- Revert ce171780 which breaks my graphics on resume. - (drm/i915: Enable RC6 on Ironlake.) - -* Fri Sep 03 2010 Kyle McMartin -- Restore AppleIR USB driver which got lost between F-13 and now. - -* Fri Sep 03 2010 Dave Jones 2.6.36-0.16.rc3.git0 -- exec-randomization: brk away from exec rand area (Kees Cook) - -* Fri Sep 03 2010 Dave Jones -- Remove the execshield boot parameter. - Based on a patch from Kees Cook - -* Thu Sep 02 2010 Chuck Ebbert - 2.6.36-0.15.rc3.git0 -- Add patch from ALSA mailing list to try to fix bug #628404 -- tpm-fix-stall-on-boot.patch: attempt to fix stalls during boot (#530393) - -* Wed Sep 01 2010 Kyle McMartin - 2.6.36-0.14.rc3.git0 -- Fix icebp breakpoints, patch from Frederic Weisbecker. - (https://bugzilla.kernel.org/show_bug.cgi?id=16315#c26) - -* Wed Sep 01 2010 Kyle McMartin - 2.6.36-0.13.rc3.git0 -- Swap back to roland's auto-updated utrace patches. - -* Mon Aug 30 2010 Kyle McMartin - 2.6.36-0.12.rc3.git0 -- Linux 2.6.36-rc3 - -* Sun Aug 29 2010 Chuck Ebbert - 2.6.36-0.11.rc2.git5 -- Linux 2.6.36-rc2-git5 - -* Wed Aug 25 2010 Chuck Ebbert - 2.6.36-0.10.rc2.git4 -- Linux 2.6.36-rc2-git4 - -* Tue Aug 24 2010 Chuck Ebbert - 2.6.36-0.9.rc2.git3 -- Linux 2.6.36-rc2-git3 - -* Mon Aug 23 2010 Roland McGrath - 2.6.36-0.8.rc2.git0 -- utrace update - -* Sun Aug 22 2010 Chuck Ebbert - 2.6.36-0.7.rc2.git0 -- Linux 2.6.36-rc2 - -* Sun Aug 22 2010 Chuck Ebbert - 2.6.36-0.7.rc1.git4 -- Linux 2.6.36-rc1-git4 -- Fix context in linux-2.6-i386-nx-emulation.patch - -* Sat Aug 21 2010 Chuck Ebbert - 2.6.36-0.6.rc1.git3 -- Drop utrace patch that causes hang on boot. - -* Fri Aug 20 2010 Chuck Ebbert - 2.6.36-0.5.rc1.git3 -- Linux 2.6.36-rc1-git3 -- Drop x86-cpu-fix-regression-in-amd-errata-checking-code.patch, now merged. - -* Thu Aug 19 2010 Kyle McMartin - 2.6.36-0.4.rc1.git1 -- Run oldnoconfig on the configs during make prep. -- Make the fix oldnoconfig patch a one liner. - -* Wed Aug 18 2010 Chuck Ebbert - 2.6.36-0.3.rc1.git1 -- Fix hangs on boot with some AMD processors - (x86-cpu-fix-regression-in-amd-errata-checking-code.patch) -- Drop unused ssb_check_for_sprom.patch - -* Wed Aug 18 2010 Dave Jones -- systemd is dependant upon autofs, so build it in instead of modular. - -* Wed Aug 18 2010 Chuck Ebbert -- Linux 2.6.36-rc1-git1 - -* Wed Aug 18 2010 Kyle McMartin - 2.6.36-0.2.rc1.git0 -- Link perf against libnewt for TUI support. - -* Tue Aug 17 2010 Kyle McMartin - 2.6.36-0.1.rc1.git0 -- Fix 'oldnoconfig' to do what nonint_loose_oldconfig did. - -* Tue Aug 17 2010 Kyle McMartin -- explicitly set KERNEL_GZIP - -* Tue Aug 17 2010 Kyle McMartin -- Linux 2.6.36-rc1 - -* Tue Aug 17 2010 Kyle McMartin -- Prevent scripts/setlocalversion from mucking with our version - numbers. - -* Wed Aug 04 2010 Kyle McMartin -- Disable %%released_kernel. -- This is properly 2.6.36-0.git1, unlike the last commit. Had to make - a mistake sometime, I'm glad it was early. - -* Wed Aug 04 2010 Kyle McMartin -- Linux 2.6.35-git1, beginning of rawhide for 2.6.36... - -* Sun Aug 01 2010 Dave Jones -- Linux 2.6.35 - -* Sun Aug 01 2010 Dave Jones -- 2.6.35-rc6-git6 - -* Fri Jul 30 2010 Jarod Wilson -- lirc staging update -- update kworld patch to one committed upstream -- can't believe how much nicer dist-git is than dist-cvs -- patch memory leaks in mceusb and imon drivers - -* Fri Jul 30 2010 Dave Jones -- Enable PPS (#619392) - -* Thu Jul 29 2010 Dave Jones -- 2.6.35-rc6-git5 - -* Mon Jul 27 2010 Kyle McMartin -- Patch from linville to only use the country code to set band limits. - (Fixes Apple Airport base stations from limiting you from associating - with other channels.) - -* Fri Jul 23 2010 Chuck Ebbert 2.6.35-0.56.rc6.git1 -- Linux 2.6.35-rc6-git1 - -* Thu Jul 22 2010 Dave Jones -- 2.6.35-rc6 - -* Thu Jul 22 2010 Ben Skeggsb -- drm-nouveau-updates: bring back, most patches *weren't* upstream yet, - they're queued for 2.6.36. - -* Wed Jul 21 2010 Chuck Ebbert 2.6.35-0.53.rc5.git7 -- Linux 2.6.35-rc5-git7 - -* Wed Jul 21 2010 Dave Jones -- Remove the %%verify (no mtime) on kernel-devel's files. - If they got modified, they should fail rpm verify. - -* Wed Jul 21 2010 Dave Jones -- Linux 2.6.35-rc5-git6 -- Removed drm-nouveau-updates.patch (upstreamed) - -* Mon Jul 19 2010 Chuck Ebbert -- Linux 2.6.35-rc5-git4 - -* Mon Jul 19 2010 Jarod Wilson 2.6.35-0.49.rc5.git2 -- Fix from Kyle for input_set_key oops introduced by ir-core patches (#615707) -- Update lirc-staging patches to match what's about to be submitted upstream, - complete with updated copy_from_user overflow check fixages - -* Sun Jul 18 2010 Chuck Ebbert 2.6.35-0.47.rc5.git2 -- Linux 2.6.35-rc5-git2 - -* Sun Jul 18 2010 Chuck Ebbert -- lirc-staging-2.6.36-fixes.patch: Fix up buffer size checking in - lirc code, found by CONFIG_DEBUG_STRICT_USER_COPY_CHECKS - -* Sun Jul 18 2010 Hans de Goede -- Add support for dynamic menu controls to the uvcvideo driver (#576023) - -* Sun Jul 18 2010 Jarod Wilson 2.6.35-0.44.rc5.git1 -- Oops, minor oversight when moving lirc bits into staging resulted - in the modules themselves not getting built. Fix that. - -* Fri Jul 16 2010 Dave Jones -- Limit some alsa spew that the nuforce udac makes happen a lot. - -* Fri Jul 16 2010 Jarod Wilson 2.6.35-0.41.rc5.git1 -- Pull in ir-core update from v4l/dvb staging for 2.6.36, which includes - new in-kernel lirc_dev and ir-core mceusb driver -- Move not-yet-merged/ported lirc bits to drivers/staging/, patch to be - sent upstream for 2.6.36 staging tree RSN - -* Thu Jul 15 2010 Chuck Ebbert 2.6.35-0.40.rc5.git1 -- Replace pci-acpi-disable-aspm-if-no-osc.patch with - updated version from F-13 - -* Thu Jul 15 2010 Chuck Ebbert -- Linux 2.6.35-rc5-git1 - -* Tue Jul 13 2010 Chuck Ebbert -- Linux 2.6.35-rc5 - -* Tue Jul 13 2010 Ben Skeggs -- nouveau: miscellanous fixes - -* Mon Jul 12 2010 Dave Jones -- 2.6.35-rc4-git5 - -* Mon Jul 12 2010 Dave Jones -- Remove a bunch of x86 options from config files that get set - automatically, and can't be overridden. - -* Fri Jul 9 2010 Roland McGrath -- Split execshield into two patches. - -* Thu Jul 08 2010 Chuck Ebbert 2.6.35-0.31.rc4.git4 -- Linux 2.6.35-rc4-git4 - -* Thu Jul 8 2010 Roland McGrath -- Remove exec-shield=2 setting, some other cruft from execshield. - -* Wed Jul 7 2010 Roland McGrath 2.6.35-0.29.rc4.git0.fc14 -- Revamp perf packaging. - -* Wed Jul 07 2010 Chuck Ebbert -- pci-acpi-disable-aspm-if-no-osc.patch, pci-aspm-dont-enable-too-early.patch - PCI layer fixes for problems with hardware that doesn't support ASPM. - -* Wed Jul 07 2010 Ben Skeggs -- nouveau: bring in nouveau upstream - -* Mon Jul 05 2010 Dave Jones -- 2.6.35-rc4 - -* Fri Jul 02 2010 Dave Jones -- 2.6.35-rc3-git7 - dropped: i915-fix-crt-hotplug-regression.patch (upstream) - dropped: drm-i915-fix-edp-panels.patch (upstream) - -* Fri Jul 02 2010 Dave Jones -- 2.6.35-rc3-git6 - -* Thu Jul 01 2010 Dave Jones -- Add a patch to debug an infinite loop warning from acpi. - -* Thu Jul 01 2010 Dave Jones -- 2.6.35-rc3-git5 - -* Thu Jul 01 2010 Chuck Ebbert -- Copy fix for BZ#220892 from F-13. - -* Wed Jun 30 2010 Kyle McMartin 2.6.35-0.19.rc3.git4 -- 2.6.35-rc3-git4 - -* Tue Jun 29 2010 Chuck Ebbert -- Disable Intel Moorestown support -- it breaks PC keyboard controllers. - -* Tue Jun 29 2010 Dave Jones -- Building external modules requires perl. (#608525) - -* Tue Jun 29 2010 Kyle McMartin 2.6.35-0.15.rc3.git3 -- 2.6.35-rc3-git3 -- i915-fix-crt-hotplug-regression.patch: attempt to solve the gm45 hotplug - irq storm. - -* Mon Jun 28 2010 Chuck Ebbert -- ppc64: enable active memory sharing and DLPAR memory remove (#607175) - -* Mon Jun 28 2010 Dave Jones -- 2.6.35-rc3-git2 - -* Mon Jun 28 2010 Dave Jones -- 2.6.35-rc3-git1 - -* Mon Jun 28 2010 Dave Airlie -- drm-i915-fix-edp-panels.patch: update to newer version - -* Fri Jun 25 2010 Kyle McMartin -- drm-i915-fix-edp-panels.patch: copy from rawhide. - -* Wed Jun 23 2010 Eric Sandeen -- Fix ext4 freeze deadlock (#607245) - -* Wed Jun 23 2010 Kyle McMartin -- Override generic's CONFIG_HZ_1000 on s390. - -* Tue Jun 22 2010 Dave Jones -- Fix localhost networking. - -* Tue Jun 22 2010 Kyle McMartin 2.6.35-0.1.rc3.git0 -- Putting the raw back into rawhide... Yeehaw. -- 2.6.35-rc3 -- Drop a tonne of patches that were merged upstream, or were backports. -- Rebase execshield, utrace. -- Fix up a bunch of rejects, build failures. -- Fix up lirc to build with strict copy_from_user checking. - -* Mon Jun 21 2010 Dave Jones -- Disable workaround for obscure SMP pentium pro errata. - I miss the 1990s too, but it's time to move on. - If anyone actually needs this it would be better done using - the apply_alternatives infrastructure. - -* Mon Jun 21 2010 Kyle McMartin 2.6.34-45 -- drm-revert-drm-fbdev-rework-output-polling-to-be-back-in-core.patch - Revert eb1f8e4f, bisected by Nicolas Kaiser. Thanks! (rhbz#599190) - (If this works, will try to root-cause.) -- rebase previous patch on top of above reversion - -* Mon Jun 21 2010 Kyle McMartin 2.6.34-44 -- revert-drm-kms-toggle-poll-around-switcheroo.patch (rhbz#599190) - -* Thu Jun 17 2010 Kyle McMartin 2.6.34-43 -- Suck in patch from Dave Miller in 2.6.35 to add async hash testing, - hopefully fixes error from previous commit. (But making it modular - is still a good idea.) - -* Thu Jun 17 2010 Kyle McMartin -- make ghash-clmulni modular to get rid of early boot noise (rhbz#586954) - (not a /fix/ but it should at least quiet boot down a bit if you have - the cpu support) - -* Wed Jun 16 2010 Kyle McMartin 2.6.34-40 -- Snag some more DRM commits into drm-next.patch that I missed the first - time. -- Fix up radeon_pm toggle to work with the upstream code. - -* Tue Jun 15 2010 Prarit Bhargava -- Turn off CONFIG_I2O on x86. - It is broken on 64-bit address spaces (i686/PAE, x86_64), and frankly, I'm - having trouble finding anyone who actually uses it. - -* Tue Jun 15 2010 Kyle McMartin 2.6.34-38 -- Fix build by nuking superfluous "%%{expand" which was missing a - trailing '}'. You may now reward me with an array of alcoholic - beverages, I so richly deserve for spending roughly a full - day staring at the diff of the spec. - -* Mon Jun 14 2010 Kyle McMartin 2.6.34-37 -- btrfs ACL fixes from CVE-2010-2071. - -* Sun Jun 13 2010 Kyle McMartin 2.6.34-36 -- remunge and reapply hdpvr-ir-enable - -* Sun Jun 13 2010 Kyle McMartin 2.6.34-35 -- mac80211/iwlwifi fix connections to some APs (rhbz#558002) - patches from sgruszka@. - -* Sun Jun 13 2010 Kyle McMartin 2.6.34-34 -- Provide a knob to enable radeon_pm to allow users to test - that functionality. Add radeon.pm=1 to your kernel cmdline - in order to enable it. (It still defaults to off though.) - -* Sun Jun 13 2010 Kyle McMartin 2.6.34-33 -- Update drm-next to include fixes since 2.6.35-rc1. - -* Fri Jun 11 2010 Justin M. Forbes -- Disable xsave for so that kernel will boot on ancient EC2 hosts. - -* Wed Jun 09 2010 John W. Linville -- Disable rt20xx and rt35xx chipset support in rt2800 drivers (#570869) - -* Wed Jun 09 2010 David Woodhouse -- Include PHY modules in modules.networking (#602155) - -* Tue Jun 08 2010 Dave Jones -- Remove useless -kdump kernel support - -* Tue Jun 08 2010 Dave Jones -- Remove ia64 ata quirk which had no explanation, and still - isn't upstream. No-one cares. - -* Tue Jun 08 2010 Dave Jones -- Drop linux-2.6-vio-modalias.patch - Two years should have been long enough to get upstream if this is important. - -* Tue Jun 08 2010 Dave Jones -- Remove crufty Xen remnants from specfile. - -* Tue Jun 08 2010 Dave Jones -- Remove mkinitrd ifdefs. Dracut or GTFO. - -* Thu Jun 03 2010 Kyle McMartin -- Build kernel headers on s390. - -* Wed Jun 02 2010 Kyle McMartin 2.6.34-20 -- Disable doc_build_fail because xmlto et al. are crud. - -* Wed Jun 02 2010 Kyle McMartin 2.6.34-19 -- Enable -debug flavour builds, until we branch for 2.6.35-rcX. - -* Wed Jun 02 2010 Kyle McMartin -- revert writeback fixes for now, there appear to be dragons - lurking there still. - -* Tue Jun 01 2010 Kyle McMartin 2.6.34-18 -- fix mismerge in i915_gem.c, drm_gem_object_alloc is now - i915_gem_alloc_object. -- add a hunk to rcu_read{,un}lock in sched_fair too. - -* Tue Jun 01 2010 Kyle McMartin 2.6.34-17 -- backport writeback fixes from Jens until stable@ picks them up. - -* Tue Jun 01 2010 Kyle McMartin 2.6.34-16 -- quiet-prove_RCU-in-cgroups.patch: shut RCU lockdep up - as in 8b08ca52f5942c21564bbb90ccfb61053f2c26a1. - -* Tue Jun 01 2010 Kyle McMartin -- disable radeon_pm for now. - -* Mon May 31 2010 Kyle McMartin 2.6.34-14 -- re-add drm-next.patch, should be in sync with 2.6.35 and what - was backported to Fedora 13. -- drop patches merged in drm-next to 2.6.35 -- rebase relevant iwl fixes on top of 2.6.34 from the ones committed - to F-13 by linville. - -* Wed May 26 2010 Adam Jackson -- config-generic: Stop building i830.ko - -* Wed May 26 2010 Kyle McMartin -- iwlwifi-recover_from_tx_stall.patch: copy from F-13. - -* Fri May 21 2010 Roland McGrath 2.6.34-11 -- utrace update - -* Fri May 21 2010 Dave Jones -- Update the SELinux mprotect patch with a newer version from Stephen - -* Fri May 21 2010 Roland McGrath -- perf requires libdw now, not libdwarf - -* Fri May 21 2010 Kyle McMartin 2.6.34-6 -- Fixups for virt_console from Amit Shah, thanks! - -* Thu May 20 2010 Kyle McMartin 2.6.34-5 -- disable intel sdvo fixes until dependent code is backported. - -* Thu May 20 2010 Kyle McMartin 2.6.34-4 -- resync a lot of stuff with F-13... -- linux-2.6-acpi-video-export-edid.patch: rebase & copy from F-13 -- acpi-ec-add-delay-before-write.patch: copy from F-13 -- ... and a whole lot more that I can't be bothered typing. - -* Mon May 17 2010 Matthew Garrett -- thinkpad-acpi-fix-backlight.patch: Fix backlight support on some recent - Thinkpads - -* Sun May 16 2010 Kyle McMartin 2.6.34-2 -- Disable strict copy_from_user checking until lirc is fixed. - -* Sun May 16 2010 Kyle McMartin 2.6.34-1 -- Linux 2.6.34 - -* Sun May 16 2010 Kyle McMartin -- Trimmed changelog, see CVS. - ### # The following Emacs magic makes C-c C-e use UTC dates. # Local Variables: diff --git a/libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch b/libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch new file mode 100644 index 000000000..85016b40a --- /dev/null +++ b/libata-sas-only-set-frozen-flag-if-new-eh-is-supported.patch @@ -0,0 +1,72 @@ +From: Nishanth Aravamudan +Date: Thu, 16 Jun 2011 15:28:36 +0000 (-0700) +Subject: libata/sas: only set FROZEN flag if new EH is supported +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=3f1e046ad3370d22d39529103667354eb50abc08 + +libata/sas: only set FROZEN flag if new EH is supported + +On 16.06.2011 [08:28:39 -0500], Brian King wrote: +> On 06/16/2011 02:51 AM, Tejun Heo wrote: +> > On Wed, Jun 15, 2011 at 04:34:17PM -0700, Nishanth Aravamudan wrote: +> >>> That looks like the right thing to do. For ipr's usage of +> >>> libata, we don't have the concept of a port frozen state, so this flag +> >>> should really never get set. The alternate way to fix this would be to +> >>> only set ATA_PFLAG_FROZEN in ata_port_alloc if ap->ops->error_handler +> >>> is not NULL. +> >> +> >> It seemed like ipr is as you say, but I wasn't sure if it was +> >> appropriate to make the change above in the common libata-scis code or +> >> not. I don't want to break some other device on accident. +> >> +> >> Also, I tried your suggestion, but I don't think that can happen in +> >> ata_port_alloc? ata_port_alloc is allocated ap itself, and it seems like +> >> ap->ops typically gets set only after ata_port_alloc returns? +> > +> > Maybe we can test error_handler in ata_sas_port_start()? +> +> Good point. Since libsas is converted to the new eh now, we would need to have +> this test. + +Commit 7b3a24c57d2eeda8dba9c205342b12689c4679f9 ("ahci: don't enable +port irq before handler is registered") caused a regression for CD-ROMs +attached to the IPR SATA bus on Power machines: + + ata_port_alloc: ENTER + ata_port_probe: ata1: bus probe begin + ata1.00: ata_dev_read_id: ENTER + ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40) + ata1.00: ata_dev_read_id: ENTER + ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40) + ata1.00: limiting speed to UDMA7:PIO5 + ata1.00: ata_dev_read_id: ENTER + ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40) + ata1.00: disabled + ata_port_probe: ata1: bus probe end + scsi_alloc_sdev: Allocation failure during SCSI scanning, some SCSI devices might not be configured + +The FROZEN flag added in that commit is only cleared by the new EH code, +which is not used by ipr. Clear this flag in the SAS code if we don't +support new EH. + +Reported-by: Benjamin Herrenschmidt +Signed-off-by: Nishanth Aravamudan +Signed-off-by: Jeff Garzik +--- + +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c +index d51f979..927f968 100644 +--- a/drivers/ata/libata-scsi.c ++++ b/drivers/ata/libata-scsi.c +@@ -3797,6 +3797,12 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc); + */ + int ata_sas_port_start(struct ata_port *ap) + { ++ /* ++ * the port is marked as frozen at allocation time, but if we don't ++ * have new eh, we won't thaw it ++ */ ++ if (!ap->ops->error_handler) ++ ap->pflags &= ~ATA_PFLAG_FROZEN; + return 0; + } + EXPORT_SYMBOL_GPL(ata_sas_port_start); diff --git a/linux-2.6-acpi-debug-infinite-loop.patch b/linux-2.6-acpi-debug-infinite-loop.patch index 45cb05165..d20025224 100644 --- a/linux-2.6-acpi-debug-infinite-loop.patch +++ b/linux-2.6-acpi-debug-infinite-loop.patch @@ -1,16 +1,3 @@ ---- linux-2.6.34.noarch/drivers/acpi/acpica/dsopcode.c~ 2010-07-01 14:40:44.000000000 -0400 -+++ linux-2.6.34.noarch/drivers/acpi/acpica/dsopcode.c 2010-07-01 14:48:56.000000000 -0400 -@@ -1276,6 +1276,10 @@ acpi_ds_exec_end_control_op(struct acpi_ - * loop does not implement a timeout. - */ - control_state->control.loop_count++; -+ if ((control_state->control.loop_count > 1) && (control_state->control.loop_count % 0xffff == 0)) -+ printk("ACPI: While loop taking a really long time. loop_count=0x%x\n", -+ control_state->control.loop_count); -+ - if (control_state->control.loop_count > - ACPI_MAX_LOOP_ITERATIONS) { - status = AE_AML_INFINITE_LOOP; --- linux-2.6.34.noarch/drivers/acpi/acpica/acconfig.h~ 2010-07-01 14:49:03.000000000 -0400 +++ linux-2.6.34.noarch/drivers/acpi/acpica/acconfig.h 2010-07-01 14:49:17.000000000 -0400 @@ -117,7 +117,7 @@ @@ -22,3 +9,17 @@ /* Maximum sleep allowed via Sleep() operator */ +--- a/drivers/acpi/acpica/dscontrol.c ++++ b/drivers/acpi/acpica/dscontrol.c +@@ -212,6 +212,11 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state, + * loop does not implement a timeout. + */ + control_state->control.loop_count++; ++ if ((control_state->control.loop_count > 1) && ++ (control_state->control.loop_count % 0xffff == 0)) ++ printk("ACPI: While loop taking a really long time. loop_count=0x%x\n", ++ control_state->control.loop_count); ++ + if (control_state->control.loop_count > + ACPI_MAX_LOOP_ITERATIONS) { + status = AE_AML_INFINITE_LOOP; diff --git a/linux-2.6-crash-driver.patch b/linux-2.6-crash-driver.patch index 0f11aba0d..512774340 100644 --- a/linux-2.6-crash-driver.patch +++ b/linux-2.6-crash-driver.patch @@ -220,20 +220,18 @@ index 5eb1ba7..3e525d2 100644 /* * Fix up the linear direct mapping of the kernel to avoid cache attribute * conflicts. -diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 3141dd3..153658c 100644 ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -471,6 +471,8 @@ config LEGACY_PTYS - security. This option enables these legacy devices; on most - systems, it is safe to say N. +--- linux-2.6.39.noarch/drivers/char/Kconfig~ 2011-06-29 23:41:24.386370545 -0400 ++++ linux-2.6.39.noarch/drivers/char/Kconfig 2011-06-29 23:42:11.984193335 -0400 +@@ -15,6 +15,9 @@ config DEVKMEM + kind of kernel debugging operations. + When in doubt, say "N". +config CRASH -+ tristate "Crash Utility memory driver" - - config LEGACY_PTY_COUNT - int "Maximum number of legacy PTY in use" - ++ tristate "Crash Utility memory driver" ++ + config STALDRV + bool "Stallion multiport serial support" + depends on SERIAL_NONSTANDARD diff --git a/drivers/char/crash.c b/drivers/char/crash.c new file mode 100644 index 0000000..e5437de diff --git a/linux-2.6-debug-always-inline-kzalloc.patch b/linux-2.6-debug-always-inline-kzalloc.patch deleted file mode 100644 index 24f665ca6..000000000 --- a/linux-2.6-debug-always-inline-kzalloc.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 76ec0e2e6d6edf81abc0331d5e7873ef7b2f6019 Mon Sep 17 00:00:00 2001 -From: Kyle McMartin -Date: Wed, 8 Jul 2009 13:06:01 -0400 -Subject: [PATCH 6/6] fedora: linux-2.6-debug-always-inline-kzalloc.patch - ---- - include/linux/slab.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/include/linux/slab.h b/include/linux/slab.h -index 2da8372..d4ef74f 100644 ---- a/include/linux/slab.h -+++ b/include/linux/slab.h -@@ -310,7 +310,7 @@ static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) - * @size: how many bytes of memory are required. - * @flags: the type of memory to allocate (see kmalloc). - */ --static inline void *kzalloc(size_t size, gfp_t flags) -+static __always_inline void *kzalloc(size_t size, gfp_t flags) - { - return kmalloc(size, flags | __GFP_ZERO); - } --- -1.6.2.5 - diff --git a/linux-2.6-debug-sizeof-structs.patch b/linux-2.6-debug-sizeof-structs.patch deleted file mode 100644 index e027d98a1..000000000 --- a/linux-2.6-debug-sizeof-structs.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/init/main.c b/init/main.c -index 7449819..98cfaae 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -369,6 +369,11 @@ static void __init setup_nr_cpu_ids(void) - nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; - } - -+#include <../fs/ext4/ext4.h> -+#include -+#include -+#include -+ - /* Called by boot processor to activate the rest. */ - static void __init smp_init(void) - { -@@ -391,6 +395,16 @@ static void __init smp_init(void) - /* Any cleanup work */ - printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus()); - smp_cpus_done(setup_max_cpus); -+ -+ printk(KERN_DEBUG "sizeof(vma)=%u bytes\n", (unsigned int) sizeof(struct vm_area_struct)); -+ printk(KERN_DEBUG "sizeof(page)=%u bytes\n", (unsigned int) sizeof(struct page)); -+ printk(KERN_DEBUG "sizeof(inode)=%u bytes\n", (unsigned int) sizeof(struct inode)); -+ printk(KERN_DEBUG "sizeof(dentry)=%u bytes\n", (unsigned int) sizeof(struct dentry)); -+ printk(KERN_DEBUG "sizeof(ext3inode)=%u bytes\n", (unsigned int) sizeof(struct ext3_inode_info)); -+ printk(KERN_DEBUG "sizeof(ext4inode)=%u bytes\n", (unsigned int) sizeof(struct ext4_inode_info)); -+ printk(KERN_DEBUG "sizeof(buffer_head)=%u bytes\n", (unsigned int) sizeof(struct buffer_head)); -+ printk(KERN_DEBUG "sizeof(skbuff)=%u bytes\n", (unsigned int) sizeof(struct sk_buff)); -+ printk(KERN_DEBUG "sizeof(task_struct)=%u bytes\n", (unsigned int) sizeof(struct task_struct)); - } - - #endif diff --git a/linux-2.6-ehci-check-port-status.patch b/linux-2.6-ehci-check-port-status.patch deleted file mode 100644 index f3c5faf70..000000000 --- a/linux-2.6-ehci-check-port-status.patch +++ /dev/null @@ -1,54 +0,0 @@ -commit e17a07a9e0b62d5a5f0a5683ecbabad3aa95a4d5 -Author: Matthew Garrett -Date: Tue Jan 11 12:19:40 2011 -0500 - - ehci: Check individual port status registers on resume - - If a device plug/unplug is detected on an ATI SB700 USB controller in D3, - it appears to set the port status register but not the controller status - register. As a result we'll fail to detect the plug event. Check the port - status register on resume as well in order to catch this case. - - Signed-off-by: Matthew Garrett - -diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c -index 796ea0c..d9c0748 100644 ---- a/drivers/usb/host/ehci-hub.c -+++ b/drivers/usb/host/ehci-hub.c -@@ -106,6 +106,27 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci) - ehci->owned_ports = 0; - } - -+static int ehci_port_change(struct ehci_hcd *ehci) -+{ -+ int i = HCS_N_PORTS(ehci->hcs_params); -+ -+ /* First check if the controller indicates a change event */ -+ -+ if (ehci_readl(ehci, &ehci->regs->status) & STS_PCD) -+ return 1; -+ -+ /* -+ * Not all controllers appear to update this while going from D3 to D0, -+ * so check the individual port status registers as well -+ */ -+ -+ while (i--) -+ if (ehci_readl(ehci, &ehci->regs->port_status[i]) & PORT_CSC) -+ return 1; -+ -+ return 0; -+} -+ - static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, - bool suspending, bool do_wakeup) - { -@@ -168,7 +189,7 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, - } - - /* Does the root hub have a port wakeup pending? */ -- if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD)) -+ if (!suspending && ehci_port_change(ehci)) - usb_hcd_resume_root_hub(ehci_to_hcd(ehci)); - - spin_unlock_irqrestore(&ehci->lock, flags); diff --git a/linux-2.6-hotfixes.patch b/linux-2.6-hotfixes.patch deleted file mode 100644 index 494947322..000000000 --- a/linux-2.6-hotfixes.patch +++ /dev/null @@ -1,15 +0,0 @@ -fixes: -implicit declaration of function kzalloc - ---- linux-2.6.34.noarch/drivers/usb/serial/qcserial.c~ 2010-06-08 15:19:41.000000000 -0400 -+++ linux-2.6.34.noarch/drivers/usb/serial/qcserial.c 2010-06-08 15:19:47.000000000 -0400 -@@ -11,6 +11,7 @@ - * - */ - -+#include - #include - #include - #include - - diff --git a/linux-2.6-i386-nx-emulation.patch b/linux-2.6-i386-nx-emulation.patch index da84cc672..3d2c96874 100644 --- a/linux-2.6-i386-nx-emulation.patch +++ b/linux-2.6-i386-nx-emulation.patch @@ -46,7 +46,7 @@ #endif /* _ASM_X86_DESC_H */ --- a/arch/x86/include/asm/mmu.h +++ b/arch/x86/include/asm/mmu.h -@@ -7,12 +7,19 @@ +@@ -7,18 +7,25 @@ /* * The x86 doesn't have a mmu context, but * we put the segment information here. @@ -59,10 +59,16 @@ int size; struct mutex lock; void *vdso; + + #ifdef CONFIG_X86_64 + /* True if mm supports a task running in 32 bit compatibility mode. */ + unsigned short ia32_compat; + #endif +#ifdef CONFIG_X86_32 + struct desc_struct user_cs; + unsigned long exec_limit; +#endif + } mm_context_t; #ifdef CONFIG_SMP @@ -132,7 +138,7 @@ .store_gdt = native_store_gdt, --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c -@@ -243,7 +243,10 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, +@@ -243,7 +243,10 @@ int copy_thread(unsigned long clone_flag void start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) { @@ -141,8 +147,8 @@ set_user_gs(regs, 0); + regs->fs = 0; - set_fs(USER_DS); regs->ds = __USER_DS; + regs->es = __USER_DS; @@ -252,6 +255,11 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) regs->cs = __USER_CS; regs->ip = new_ip; @@ -472,8 +478,8 @@ --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -101,6 +101,9 @@ struct bio_list; - struct fs_struct; struct perf_event_context; + struct blk_plug; +extern int disable_nx; +extern int print_fatal_signals; diff --git a/linux-2.6-silence-noise.patch b/linux-2.6-silence-noise.patch index 32c678b1f..11d941e46 100644 --- a/linux-2.6-silence-noise.patch +++ b/linux-2.6-silence-noise.patch @@ -57,16 +57,14 @@ in ye olde CVS tree. I have no idea why. Originally the pr_debug in device_pm_remove was nuked as well, but that seems to have gotten lost in the r1.634 of kernel.spec (2.6.26-rc2-git5.) -diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c -index 2a52270..bacbdd2 100644 ---- a/drivers/base/power/main.c -+++ b/drivers/base/power/main.c -@@ -87,8 +87,6 @@ void device_pm_unlock(void) +--- linux-2.6.39.x86_64/drivers/base/power/main.c~ 2011-07-12 19:58:19.788854464 -0400 ++++ linux-2.6.39.x86_64/drivers/base/power/main.c 2011-07-12 19:58:39.684798674 -0400 +@@ -89,8 +89,6 @@ void device_pm_unlock(void) */ void device_pm_add(struct device *dev) { - pr_debug("PM: Adding info for %s:%s\n", - dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); mutex_lock(&dpm_list_mtx); - if (dev->parent && dev->parent->power.in_suspend) + if (dev->parent && dev->parent->power.is_prepared) dev_warn(dev, "parent %s should not be sleeping\n", diff --git a/linux-2.6-upstream-reverts.patch b/linux-2.6-upstream-reverts.patch index 607602cfc..e69de29bb 100644 --- a/linux-2.6-upstream-reverts.patch +++ b/linux-2.6-upstream-reverts.patch @@ -1 +0,0 @@ -nil diff --git a/linux-2.6-utrace-ptrace.patch b/linux-2.6-utrace-ptrace.patch index bc5681d95..55c6f617c 100644 --- a/linux-2.6-utrace-ptrace.patch +++ b/linux-2.6-utrace-ptrace.patch @@ -48,7 +48,7 @@ new file mode 100644 index ...a5bcb9e 100644 --- /dev/null +++ b/kernel/ptrace-utrace.c -@@ -0,0 +1,1187 @@ +@@ -0,0 +1,1186 @@ +/* + * linux/kernel/ptrace.c + * @@ -65,7 +65,6 @@ index ...a5bcb9e 100644 +#include +#include +#include -+#include +#include +#include +#include @@ -1248,389 +1247,6 @@ index e275608..72ea65c 100644 #include #include #include -@@ -24,7 +23,320 @@ - #include - #include - -+int __ptrace_may_access(struct task_struct *task, unsigned int mode) -+{ -+ const struct cred *cred = current_cred(), *tcred; -+ -+ /* May we inspect the given task? -+ * This check is used both for attaching with ptrace -+ * and for allowing access to sensitive information in /proc. -+ * -+ * ptrace_attach denies several cases that /proc allows -+ * because setting up the necessary parent/child relationship -+ * or halting the specified task is impossible. -+ */ -+ int dumpable = 0; -+ /* Don't let security modules deny introspection */ -+ if (task == current) -+ return 0; -+ rcu_read_lock(); -+ tcred = __task_cred(task); -+ if ((cred->uid != tcred->euid || -+ cred->uid != tcred->suid || -+ cred->uid != tcred->uid || -+ cred->gid != tcred->egid || -+ cred->gid != tcred->sgid || -+ cred->gid != tcred->gid) && -+ !capable(CAP_SYS_PTRACE)) { -+ rcu_read_unlock(); -+ return -EPERM; -+ } -+ rcu_read_unlock(); -+ smp_rmb(); -+ if (task->mm) -+ dumpable = get_dumpable(task->mm); -+ if (!dumpable && !capable(CAP_SYS_PTRACE)) -+ return -EPERM; -+ -+ return security_ptrace_access_check(task, mode); -+} -+ -+bool ptrace_may_access(struct task_struct *task, unsigned int mode) -+{ -+ int err; -+ task_lock(task); -+ err = __ptrace_may_access(task, mode); -+ task_unlock(task); -+ return !err; -+} -+ -+/* -+ * Called with irqs disabled, returns true if childs should reap themselves. -+ */ -+static int ignoring_children(struct sighand_struct *sigh) -+{ -+ int ret; -+ spin_lock(&sigh->siglock); -+ ret = (sigh->action[SIGCHLD-1].sa.sa_handler == SIG_IGN) || -+ (sigh->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDWAIT); -+ spin_unlock(&sigh->siglock); -+ return ret; -+} -+ -+/* -+ * Called with tasklist_lock held for writing. -+ * Unlink a traced task, and clean it up if it was a traced zombie. -+ * Return true if it needs to be reaped with release_task(). -+ * (We can't call release_task() here because we already hold tasklist_lock.) -+ * -+ * If it's a zombie, our attachedness prevented normal parent notification -+ * or self-reaping. Do notification now if it would have happened earlier. -+ * If it should reap itself, return true. -+ * -+ * If it's our own child, there is no notification to do. But if our normal -+ * children self-reap, then this child was prevented by ptrace and we must -+ * reap it now, in that case we must also wake up sub-threads sleeping in -+ * do_wait(). -+ */ -+bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p) -+{ -+ __ptrace_unlink(p); -+ -+ if (p->exit_state == EXIT_ZOMBIE) { -+ if (!task_detached(p) && thread_group_empty(p)) { -+ if (!same_thread_group(p->real_parent, tracer)) -+ do_notify_parent(p, p->exit_signal); -+ else if (ignoring_children(tracer->sighand)) { -+ __wake_up_parent(p, tracer); -+ p->exit_signal = -1; -+ } -+ } -+ if (task_detached(p)) { -+ /* Mark it as in the process of being reaped. */ -+ p->exit_state = EXIT_DEAD; -+ return true; -+ } -+ } -+ -+ return false; -+} -+ -+int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len) -+{ -+ int copied = 0; -+ -+ while (len > 0) { -+ char buf[128]; -+ int this_len, retval; -+ -+ this_len = (len > sizeof(buf)) ? sizeof(buf) : len; -+ retval = access_process_vm(tsk, src, buf, this_len, 0); -+ if (!retval) { -+ if (copied) -+ break; -+ return -EIO; -+ } -+ if (copy_to_user(dst, buf, retval)) -+ return -EFAULT; -+ copied += retval; -+ src += retval; -+ dst += retval; -+ len -= retval; -+ } -+ return copied; -+} -+ -+int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len) -+{ -+ int copied = 0; -+ -+ while (len > 0) { -+ char buf[128]; -+ int this_len, retval; -+ -+ this_len = (len > sizeof(buf)) ? sizeof(buf) : len; -+ if (copy_from_user(buf, src, this_len)) -+ return -EFAULT; -+ retval = access_process_vm(tsk, dst, buf, this_len, 1); -+ if (!retval) { -+ if (copied) -+ break; -+ return -EIO; -+ } -+ copied += retval; -+ src += retval; -+ dst += retval; -+ len -= retval; -+ } -+ return copied; -+} -+ -+#ifdef CONFIG_HAVE_ARCH_TRACEHOOK -+ -+static const struct user_regset * -+find_regset(const struct user_regset_view *view, unsigned int type) -+{ -+ const struct user_regset *regset; -+ int n; -+ -+ for (n = 0; n < view->n; ++n) { -+ regset = view->regsets + n; -+ if (regset->core_note_type == type) -+ return regset; -+ } -+ -+ return NULL; -+} -+ -+int ptrace_regset(struct task_struct *task, int req, unsigned int type, -+ struct iovec *kiov) -+{ -+ const struct user_regset_view *view = task_user_regset_view(task); -+ const struct user_regset *regset = find_regset(view, type); -+ int regset_no; -+ -+ if (!regset || (kiov->iov_len % regset->size) != 0) -+ return -EINVAL; -+ -+ regset_no = regset - view->regsets; -+ kiov->iov_len = min(kiov->iov_len, -+ (__kernel_size_t) (regset->n * regset->size)); -+ -+ if (req == PTRACE_GETREGSET) -+ return copy_regset_to_user(task, view, regset_no, 0, -+ kiov->iov_len, kiov->iov_base); -+ else -+ return copy_regset_from_user(task, view, regset_no, 0, -+ kiov->iov_len, kiov->iov_base); -+} -+ -+#endif -+ -+static struct task_struct *ptrace_get_task_struct(pid_t pid) -+{ -+ struct task_struct *child; -+ -+ rcu_read_lock(); -+ child = find_task_by_vpid(pid); -+ if (child) -+ get_task_struct(child); -+ rcu_read_unlock(); -+ -+ if (!child) -+ return ERR_PTR(-ESRCH); -+ return child; -+} -+ -+#ifndef arch_ptrace_attach -+#define arch_ptrace_attach(child) do { } while (0) -+#endif -+ -+SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, -+ unsigned long, data) -+{ -+ struct task_struct *child; -+ long ret; -+ -+ if (request == PTRACE_TRACEME) { -+ ret = ptrace_traceme(); -+ if (!ret) -+ arch_ptrace_attach(current); -+ goto out; -+ } - -+ child = ptrace_get_task_struct(pid); -+ if (IS_ERR(child)) { -+ ret = PTR_ERR(child); -+ goto out; -+ } -+ -+ if (request == PTRACE_ATTACH) { -+ ret = ptrace_attach(child); -+ /* -+ * Some architectures need to do book-keeping after -+ * a ptrace attach. -+ */ -+ if (!ret) -+ arch_ptrace_attach(child); -+ goto out_put_task_struct; -+ } -+ -+ ret = ptrace_check_attach(child, request == PTRACE_KILL); -+ if (ret < 0) -+ goto out_put_task_struct; -+ -+ ret = arch_ptrace(child, request, addr, data); -+ -+ out_put_task_struct: -+ put_task_struct(child); -+ out: -+ return ret; -+} -+ -+int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, -+ unsigned long data) -+{ -+ unsigned long tmp; -+ int copied; -+ -+ copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0); -+ if (copied != sizeof(tmp)) -+ return -EIO; -+ return put_user(tmp, (unsigned long __user *)data); -+} -+ -+int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, -+ unsigned long data) -+{ -+ int copied; -+ -+ copied = access_process_vm(tsk, addr, &data, sizeof(data), 1); -+ return (copied == sizeof(data)) ? 0 : -EIO; -+} -+ -+#if defined CONFIG_COMPAT -+#include -+ -+asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, -+ compat_long_t addr, compat_long_t data) -+{ -+ struct task_struct *child; -+ long ret; -+ -+ if (request == PTRACE_TRACEME) { -+ ret = ptrace_traceme(); -+ goto out; -+ } -+ -+ child = ptrace_get_task_struct(pid); -+ if (IS_ERR(child)) { -+ ret = PTR_ERR(child); -+ goto out; -+ } -+ -+ if (request == PTRACE_ATTACH) { -+ ret = ptrace_attach(child); -+ /* -+ * Some architectures need to do book-keeping after -+ * a ptrace attach. -+ */ -+ if (!ret) -+ arch_ptrace_attach(child); -+ goto out_put_task_struct; -+ } -+ -+ ret = ptrace_check_attach(child, request == PTRACE_KILL); -+ if (!ret) -+ ret = compat_arch_ptrace(child, request, addr, data); -+ -+ out_put_task_struct: -+ put_task_struct(child); -+ out: -+ return ret; -+} -+#endif /* CONFIG_COMPAT */ -+ -+#ifndef CONFIG_UTRACE - /* - * ptrace a task: make the debugger its new parent and - * move it to the ptrace list. -@@ -117,61 +429,6 @@ int ptrace_check_attach(struct task_stru - return ret; - } - --int __ptrace_may_access(struct task_struct *task, unsigned int mode) --{ -- const struct cred *cred = current_cred(), *tcred; -- -- /* May we inspect the given task? -- * This check is used both for attaching with ptrace -- * and for allowing access to sensitive information in /proc. -- * -- * ptrace_attach denies several cases that /proc allows -- * because setting up the necessary parent/child relationship -- * or halting the specified task is impossible. -- */ -- int dumpable = 0; -- /* Don't let security modules deny introspection */ -- if (task == current) -- return 0; -- rcu_read_lock(); -- tcred = __task_cred(task); -- if ((cred->uid != tcred->euid || -- cred->uid != tcred->suid || -- cred->uid != tcred->uid || -- cred->gid != tcred->egid || -- cred->gid != tcred->sgid || -- cred->gid != tcred->gid) && -- !capable(CAP_SYS_PTRACE)) { -- rcu_read_unlock(); -- return -EPERM; -- } -- rcu_read_unlock(); -- smp_rmb(); -- if (task->mm) -- dumpable = get_dumpable(task->mm); -- if (!dumpable && !capable(CAP_SYS_PTRACE)) -- return -EPERM; -- -- return security_ptrace_access_check(task, mode); --} -- --bool ptrace_may_access(struct task_struct *task, unsigned int mode) --{ -- int err; -- task_lock(task); -- err = __ptrace_may_access(task, mode); -- task_unlock(task); -- return !err; --} -- --/* -- * For experimental use of utrace, exclude ptrace on the same task. -- */ --static inline bool exclude_ptrace(struct task_struct *task) --{ -- return unlikely(!!task_utrace_flags(task)); --} -- - int ptrace_attach(struct task_struct *task) - { - int retval; @@ -195,8 +452,6 @@ int ptrace_attach(struct task_struct *ta task_lock(task); @@ -1955,11 +1571,399 @@ index e275608..72ea65c 100644 int compat_ptrace_request(struct task_struct *child, compat_long_t request, compat_ulong_t addr, compat_ulong_t data) { -@@ -851,42 +876,5 @@ int compat_ptrace_request(struct task_st +--- linux-2.6.39.noarch/kernel/ptrace.c~ 2011-06-30 01:26:39.872164118 -0400 ++++ linux-2.6.39.noarch/kernel/ptrace.c 2011-06-30 01:30:09.682400285 -0400 +@@ -24,8 +24,321 @@ + #include + #include ++int __ptrace_may_access(struct task_struct *task, unsigned int mode) ++{ ++ const struct cred *cred = current_cred(), *tcred; ++ ++ /* May we inspect the given task? ++ * This check is used both for attaching with ptrace ++ * and for allowing access to sensitive information in /proc. ++ * ++ * ptrace_attach denies several cases that /proc allows ++ * because setting up the necessary parent/child relationship ++ * or halting the specified task is impossible. ++ */ ++ int dumpable = 0; ++ /* Don't let security modules deny introspection */ ++ if (task == current) ++ return 0; ++ rcu_read_lock(); ++ tcred = __task_cred(task); ++ if ((cred->uid != tcred->euid || ++ cred->uid != tcred->suid || ++ cred->uid != tcred->uid || ++ cred->gid != tcred->egid || ++ cred->gid != tcred->sgid || ++ cred->gid != tcred->gid) && ++ !capable(CAP_SYS_PTRACE)) { ++ rcu_read_unlock(); ++ return -EPERM; ++ } ++ rcu_read_unlock(); ++ smp_rmb(); ++ if (task->mm) ++ dumpable = get_dumpable(task->mm); ++ if (!dumpable && !capable(CAP_SYS_PTRACE)) ++ return -EPERM; ++ ++ return security_ptrace_access_check(task, mode); ++} ++ ++bool ptrace_may_access(struct task_struct *task, unsigned int mode) ++{ ++ int err; ++ task_lock(task); ++ err = __ptrace_may_access(task, mode); ++ task_unlock(task); ++ return !err; ++} + + /* ++ * Called with irqs disabled, returns true if childs should reap themselves. ++ */ ++static int ignoring_children(struct sighand_struct *sigh) ++{ ++ int ret; ++ spin_lock(&sigh->siglock); ++ ret = (sigh->action[SIGCHLD-1].sa.sa_handler == SIG_IGN) || ++ (sigh->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDWAIT); ++ spin_unlock(&sigh->siglock); ++ return ret; ++} ++ ++/* ++ * Called with tasklist_lock held for writing. ++ * Unlink a traced task, and clean it up if it was a traced zombie. ++ * Return true if it needs to be reaped with release_task(). ++ * (We can't call release_task() here because we already hold tasklist_lock.) ++ * ++ * If it's a zombie, our attachedness prevented normal parent notification ++ * or self-reaping. Do notification now if it would have happened earlier. ++ * If it should reap itself, return true. ++ * ++ * If it's our own child, there is no notification to do. But if our normal ++ * children self-reap, then this child was prevented by ptrace and we must ++ * reap it now, in that case we must also wake up sub-threads sleeping in ++ * do_wait(). ++ */ ++bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p) ++{ ++ __ptrace_unlink(p); ++ ++ if (p->exit_state == EXIT_ZOMBIE) { ++ if (!task_detached(p) && thread_group_empty(p)) { ++ if (!same_thread_group(p->real_parent, tracer)) ++ do_notify_parent(p, p->exit_signal); ++ else if (ignoring_children(tracer->sighand)) { ++ __wake_up_parent(p, tracer); ++ p->exit_signal = -1; ++ } ++ } ++ if (task_detached(p)) { ++ /* Mark it as in the process of being reaped. */ ++ p->exit_state = EXIT_DEAD; ++ return true; ++ } ++ } ++ ++ return false; ++} ++ ++int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len) ++{ ++ int copied = 0; ++ ++ while (len > 0) { ++ char buf[128]; ++ int this_len, retval; ++ ++ this_len = (len > sizeof(buf)) ? sizeof(buf) : len; ++ retval = access_process_vm(tsk, src, buf, this_len, 0); ++ if (!retval) { ++ if (copied) ++ break; ++ return -EIO; ++ } ++ if (copy_to_user(dst, buf, retval)) ++ return -EFAULT; ++ copied += retval; ++ src += retval; ++ dst += retval; ++ len -= retval; ++ } ++ return copied; ++} ++ ++int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len) ++{ ++ int copied = 0; ++ ++ while (len > 0) { ++ char buf[128]; ++ int this_len, retval; ++ ++ this_len = (len > sizeof(buf)) ? sizeof(buf) : len; ++ if (copy_from_user(buf, src, this_len)) ++ return -EFAULT; ++ retval = access_process_vm(tsk, dst, buf, this_len, 1); ++ if (!retval) { ++ if (copied) ++ break; ++ return -EIO; ++ } ++ copied += retval; ++ src += retval; ++ dst += retval; ++ len -= retval; ++ } ++ return copied; ++} ++ ++#ifdef CONFIG_HAVE_ARCH_TRACEHOOK ++ ++static const struct user_regset * ++find_regset(const struct user_regset_view *view, unsigned int type) ++{ ++ const struct user_regset *regset; ++ int n; ++ ++ for (n = 0; n < view->n; ++n) { ++ regset = view->regsets + n; ++ if (regset->core_note_type == type) ++ return regset; ++ } ++ ++ return NULL; ++} ++ ++int ptrace_regset(struct task_struct *task, int req, unsigned int type, ++ struct iovec *kiov) ++{ ++ const struct user_regset_view *view = task_user_regset_view(task); ++ const struct user_regset *regset = find_regset(view, type); ++ int regset_no; ++ ++ if (!regset || (kiov->iov_len % regset->size) != 0) ++ return -EINVAL; ++ ++ regset_no = regset - view->regsets; ++ kiov->iov_len = min(kiov->iov_len, ++ (__kernel_size_t) (regset->n * regset->size)); ++ ++ if (req == PTRACE_GETREGSET) ++ return copy_regset_to_user(task, view, regset_no, 0, ++ kiov->iov_len, kiov->iov_base); ++ else ++ return copy_regset_from_user(task, view, regset_no, 0, ++ kiov->iov_len, kiov->iov_base); ++} ++ ++#endif ++ ++static struct task_struct *ptrace_get_task_struct(pid_t pid) ++{ ++ struct task_struct *child; ++ ++ rcu_read_lock(); ++ child = find_task_by_vpid(pid); ++ if (child) ++ get_task_struct(child); ++ rcu_read_unlock(); ++ ++ if (!child) ++ return ERR_PTR(-ESRCH); ++ return child; ++} ++ ++#ifndef arch_ptrace_attach ++#define arch_ptrace_attach(child) do { } while (0) ++#endif ++ ++SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, ++ unsigned long, data) ++{ ++ struct task_struct *child; ++ long ret; ++ ++ if (request == PTRACE_TRACEME) { ++ ret = ptrace_traceme(); ++ if (!ret) ++ arch_ptrace_attach(current); ++ goto out; ++ } ++ ++ child = ptrace_get_task_struct(pid); ++ if (IS_ERR(child)) { ++ ret = PTR_ERR(child); ++ goto out; ++ } ++ ++ if (request == PTRACE_ATTACH) { ++ ret = ptrace_attach(child); ++ /* ++ * Some architectures need to do book-keeping after ++ * a ptrace attach. ++ */ ++ if (!ret) ++ arch_ptrace_attach(child); ++ goto out_put_task_struct; ++ } ++ ++ ret = ptrace_check_attach(child, request == PTRACE_KILL); ++ if (ret < 0) ++ goto out_put_task_struct; ++ ++ ret = arch_ptrace(child, request, addr, data); ++ ++ out_put_task_struct: ++ put_task_struct(child); ++ out: ++ return ret; ++} ++ ++int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, ++ unsigned long data) ++{ ++ unsigned long tmp; ++ int copied; ++ ++ copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0); ++ if (copied != sizeof(tmp)) ++ return -EIO; ++ return put_user(tmp, (unsigned long __user *)data); ++} ++ ++int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, ++ unsigned long data) ++{ ++ int copied; ++ ++ copied = access_process_vm(tsk, addr, &data, sizeof(data), 1); ++ return (copied == sizeof(data)) ? 0 : -EIO; ++} ++ ++#if defined CONFIG_COMPAT ++#include ++ ++asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, ++ compat_long_t addr, compat_long_t data) ++{ ++ struct task_struct *child; ++ long ret; ++ ++ if (request == PTRACE_TRACEME) { ++ ret = ptrace_traceme(); ++ goto out; ++ } ++ ++ child = ptrace_get_task_struct(pid); ++ if (IS_ERR(child)) { ++ ret = PTR_ERR(child); ++ goto out; ++ } ++ ++ if (request == PTRACE_ATTACH) { ++ ret = ptrace_attach(child); ++ /* ++ * Some architectures need to do book-keeping after ++ * a ptrace attach. ++ */ ++ if (!ret) ++ arch_ptrace_attach(child); ++ goto out_put_task_struct; ++ } ++ ++ ret = ptrace_check_attach(child, request == PTRACE_KILL); ++ if (!ret) ++ ret = compat_arch_ptrace(child, request, addr, data); ++ ++ out_put_task_struct: ++ put_task_struct(child); ++ out: ++ return ret; ++} ++#endif /* CONFIG_COMPAT */ ++ ++#ifndef CONFIG_UTRACE ++/* + * ptrace a task: make the debugger its new parent and + * move it to the ptrace list. + * +@@ -117,64 +430,6 @@ int ptrace_check_attach(struct task_stru return ret; } + +-int __ptrace_may_access(struct task_struct *task, unsigned int mode) +-{ +- const struct cred *cred = current_cred(), *tcred; - +- /* May we inspect the given task? +- * This check is used both for attaching with ptrace +- * and for allowing access to sensitive information in /proc. +- * +- * ptrace_attach denies several cases that /proc allows +- * because setting up the necessary parent/child relationship +- * or halting the specified task is impossible. +- */ +- int dumpable = 0; +- /* Don't let security modules deny introspection */ +- if (task == current) +- return 0; +- rcu_read_lock(); +- tcred = __task_cred(task); +- if (cred->user->user_ns == tcred->user->user_ns && +- (cred->uid == tcred->euid && +- cred->uid == tcred->suid && +- cred->uid == tcred->uid && +- cred->gid == tcred->egid && +- cred->gid == tcred->sgid && +- cred->gid == tcred->gid)) +- goto ok; +- if (ns_capable(tcred->user->user_ns, CAP_SYS_PTRACE)) +- goto ok; +- rcu_read_unlock(); +- return -EPERM; +-ok: +- rcu_read_unlock(); +- smp_rmb(); +- if (task->mm) +- dumpable = get_dumpable(task->mm); +- if (!dumpable && !task_ns_capable(task, CAP_SYS_PTRACE)) +- return -EPERM; +- +- return security_ptrace_access_check(task, mode); +-} +- +-bool ptrace_may_access(struct task_struct *task, unsigned int mode) +-{ +- int err; +- task_lock(task); +- err = __ptrace_may_access(task, mode); +- task_unlock(task); +- return !err; +-} +- +-/* +- * For experimental use of utrace, exclude ptrace on the same task. +- */ +-static inline bool exclude_ptrace(struct task_struct *task) +-{ +- return unlikely(!!task_utrace_flags(task)); +-} +- + int ptrace_attach(struct task_struct *task) + { + int retval; +@@ -624,44 +879,8 @@ int compat_ptrace_request(struct task_st + return ret; + } + -asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, - compat_long_t addr, compat_long_t data) -{ @@ -1998,7 +2002,10 @@ index e275608..72ea65c 100644 - return ret; -} #endif /* CONFIG_COMPAT */ -+#endif /* CONFIG_UTRACE */ ++#endif /* CONFIG_UTRACE */ + + #ifdef CONFIG_HAVE_HW_BREAKPOINT + int ptrace_get_breakpoints(struct task_struct *tsk) diff --git a/kernel/utrace.c b/kernel/utrace.c index 26d6faf..37dce16 100644 --- a/kernel/utrace.c diff --git a/linux-2.6-v4l-dvb-add-lgdt3304-support.patch b/linux-2.6-v4l-dvb-add-lgdt3304-support.patch deleted file mode 100644 index 30c50434f..000000000 --- a/linux-2.6-v4l-dvb-add-lgdt3304-support.patch +++ /dev/null @@ -1,350 +0,0 @@ -From b71e18093e2e7f240797875c50c49552722f8825 Mon Sep 17 00:00:00 2001 -From: Jarod Wilson -Date: Mon, 15 Feb 2010 17:13:25 -0500 -Subject: [PATCH 1/2] dvb: add lgdt3304 support to lgdt3305 driver - -There's a currently-unused lgdt3304 demod driver, which leaves a lot to -be desired as far as functionality. The 3304 is unsurprisingly quite -similar to the 3305, and empirical testing yeilds far better results -and more complete functionality by merging 3304 support into the 3305 -driver. (For example, the current lgdt3304 driver lacks support for -signal strength, snr, ucblocks, etc., which we get w/the lgdt3305). - -For the moment, not dropping the lgdt3304 driver, and its still up to -a given device's config setup to choose which demod driver to use, but -I'd suggest dropping the 3304 driver entirely. - -As a follow-up to this patch, I've got another patch that adds support -for the KWorld PlusTV 340U (ATSC) em2870-based tuner stick, driving -its lgdt3304 demod via this lgdt3305 driver, which is what I used to -successfully test this patch with both VSB_8 and QAM_256 signals. - -A few pieces are still a touch crude, but I think its a solid start, -as well as much cleaner and more feature-complete than the existing -lgdt3304 driver. - -Signed-off-by: Jarod Wilson ---- - drivers/media/dvb/frontends/lgdt3305.c | 206 ++++++++++++++++++++++++++++++-- - drivers/media/dvb/frontends/lgdt3305.h | 6 + - 2 files changed, 203 insertions(+), 9 deletions(-) - -diff --git a/drivers/media/dvb/frontends/lgdt3305.c b/drivers/media/dvb/frontends/lgdt3305.c -index fde8c59..40695e6 100644 ---- a/drivers/media/dvb/frontends/lgdt3305.c -+++ b/drivers/media/dvb/frontends/lgdt3305.c -@@ -1,5 +1,5 @@ - /* -- * Support for LGDT3305 - VSB/QAM -+ * Support for LG Electronics LGDT3304 and LGDT3305 - VSB/QAM - * - * Copyright (C) 2008, 2009 Michael Krufky - * -@@ -357,7 +357,10 @@ static int lgdt3305_rfagc_loop(struct lgdt3305_state *state, - case QAM_256: - agcdelay = 0x046b; - rfbw = 0x8889; -- ifbw = 0x8888; -+ if (state->cfg->demod_chip == LGDT3305) -+ ifbw = 0x8888; -+ else -+ ifbw = 0x6666; - break; - default: - return -EINVAL; -@@ -409,8 +412,18 @@ static int lgdt3305_agc_setup(struct lgdt3305_state *state, - lg_dbg("lockdten = %d, acqen = %d\n", lockdten, acqen); - - /* control agc function */ -- lgdt3305_write_reg(state, LGDT3305_AGC_CTRL_4, 0xe1 | lockdten << 1); -- lgdt3305_set_reg_bit(state, LGDT3305_AGC_CTRL_1, 2, acqen); -+ switch (state->cfg->demod_chip) { -+ case LGDT3304: -+ lgdt3305_write_reg(state, 0x0314, 0xe1 | lockdten << 1); -+ lgdt3305_set_reg_bit(state, 0x030e, 2, acqen); -+ break; -+ case LGDT3305: -+ lgdt3305_write_reg(state, LGDT3305_AGC_CTRL_4, 0xe1 | lockdten << 1); -+ lgdt3305_set_reg_bit(state, LGDT3305_AGC_CTRL_1, 2, acqen); -+ break; -+ default: -+ return -EINVAL; -+ } - - return lgdt3305_rfagc_loop(state, param); - } -@@ -543,6 +556,11 @@ static int lgdt3305_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) - enable ? 0 : 1); - } - -+static int lgdt3304_sleep(struct dvb_frontend *fe) -+{ -+ return 0; -+} -+ - static int lgdt3305_sleep(struct dvb_frontend *fe) - { - struct lgdt3305_state *state = fe->demodulator_priv; -@@ -571,6 +589,55 @@ static int lgdt3305_sleep(struct dvb_frontend *fe) - return 0; - } - -+static int lgdt3304_init(struct dvb_frontend *fe) -+{ -+ struct lgdt3305_state *state = fe->demodulator_priv; -+ int ret; -+ -+ static struct lgdt3305_reg lgdt3304_init_data[] = { -+ { .reg = LGDT3305_GEN_CTRL_1, .val = 0x03, }, -+ { .reg = 0x000d, .val = 0x02, }, -+ { .reg = 0x000e, .val = 0x02, }, -+ { .reg = LGDT3305_DGTL_AGC_REF_1, .val = 0x32, }, -+ { .reg = LGDT3305_DGTL_AGC_REF_2, .val = 0xc4, }, -+ { .reg = LGDT3305_CR_CTR_FREQ_1, .val = 0x00, }, -+ { .reg = LGDT3305_CR_CTR_FREQ_2, .val = 0x00, }, -+ { .reg = LGDT3305_CR_CTR_FREQ_3, .val = 0x00, }, -+ { .reg = LGDT3305_CR_CTR_FREQ_4, .val = 0x00, }, -+ { .reg = LGDT3305_CR_CTRL_7, .val = 0xf9, }, -+ { .reg = 0x0112, .val = 0x17, }, -+ { .reg = 0x0113, .val = 0x15, }, -+ { .reg = 0x0114, .val = 0x18, }, -+ { .reg = 0x0115, .val = 0xff, }, -+ { .reg = 0x0116, .val = 0x3c, }, -+ { .reg = 0x0214, .val = 0x67, }, -+ { .reg = 0x0424, .val = 0x8d, }, -+ { .reg = 0x0427, .val = 0x12, }, -+ { .reg = 0x0428, .val = 0x4f, }, -+ { .reg = LGDT3305_IFBW_1, .val = 0x80, }, -+ { .reg = LGDT3305_IFBW_2, .val = 0x00, }, -+ { .reg = 0x030a, .val = 0x08, }, -+ { .reg = 0x030b, .val = 0x9b, }, -+ { .reg = 0x030d, .val = 0x00, }, -+ { .reg = 0x030e, .val = 0x1c, }, -+ { .reg = 0x0314, .val = 0xe1, }, -+ { .reg = 0x000d, .val = 0x82, }, -+ { .reg = LGDT3305_TP_CTRL_1, .val = 0x5b, }, -+ { .reg = LGDT3305_TP_CTRL_1, .val = 0x5b, }, -+ }; -+ -+ lg_dbg("\n"); -+ -+ ret = lgdt3305_write_regs(state, lgdt3304_init_data, -+ ARRAY_SIZE(lgdt3304_init_data)); -+ if (lg_fail(ret)) -+ goto fail; -+ -+ ret = lgdt3305_soft_reset(state); -+fail: -+ return ret; -+} -+ - static int lgdt3305_init(struct dvb_frontend *fe) - { - struct lgdt3305_state *state = fe->demodulator_priv; -@@ -639,6 +706,88 @@ fail: - return ret; - } - -+static int lgdt3304_set_parameters(struct dvb_frontend *fe, -+ struct dvb_frontend_parameters *param) -+{ -+ struct lgdt3305_state *state = fe->demodulator_priv; -+ int ret; -+ -+ lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation); -+ -+ if (fe->ops.tuner_ops.set_params) { -+ ret = fe->ops.tuner_ops.set_params(fe, param); -+ if (fe->ops.i2c_gate_ctrl) -+ fe->ops.i2c_gate_ctrl(fe, 0); -+ if (lg_fail(ret)) -+ goto fail; -+ state->current_frequency = param->frequency; -+ } -+ -+ ret = lgdt3305_set_modulation(state, param); -+ if (lg_fail(ret)) -+ goto fail; -+ -+ ret = lgdt3305_passband_digital_agc(state, param); -+ if (lg_fail(ret)) -+ goto fail; -+ -+ ret = lgdt3305_agc_setup(state, param); -+ if (lg_fail(ret)) -+ goto fail; -+ -+ /* reg 0x030d is 3304-only... seen in vsb and qam usbsnoops... */ -+ switch (param->u.vsb.modulation) { -+ case VSB_8: -+ lgdt3305_write_reg(state, 0x030d, 0x00); -+#if 1 -+ lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_1, 0x4f); -+ lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_2, 0x0c); -+ lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_3, 0xac); -+ lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_4, 0xba); -+#endif -+ break; -+ case QAM_64: -+ case QAM_256: -+ lgdt3305_write_reg(state, 0x030d, 0x14); -+#if 1 -+ ret = lgdt3305_set_if(state, param); -+ if (lg_fail(ret)) -+ goto fail; -+#endif -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+#if 0 -+ /* the set_if vsb formula doesn't work for the 3304, we end up sending -+ * 0x40851e07 instead of 0x4f0cacba (which works back to 94050, rather -+ * than 3250, in the case of the kworld 340u) */ -+ ret = lgdt3305_set_if(state, param); -+ if (lg_fail(ret)) -+ goto fail; -+#endif -+ -+ ret = lgdt3305_spectral_inversion(state, param, -+ state->cfg->spectral_inversion -+ ? 1 : 0); -+ if (lg_fail(ret)) -+ goto fail; -+ -+ state->current_modulation = param->u.vsb.modulation; -+ -+ ret = lgdt3305_mpeg_mode(state, state->cfg->mpeg_mode); -+ if (lg_fail(ret)) -+ goto fail; -+ -+ /* lgdt3305_mpeg_mode_polarity calls lgdt3305_soft_reset */ -+ ret = lgdt3305_mpeg_mode_polarity(state, -+ state->cfg->tpclk_edge, -+ state->cfg->tpvalid_polarity); -+fail: -+ return ret; -+} -+ - static int lgdt3305_set_parameters(struct dvb_frontend *fe, - struct dvb_frontend_parameters *param) - { -@@ -847,6 +996,10 @@ static int lgdt3305_read_status(struct dvb_frontend *fe, fe_status_t *status) - switch (state->current_modulation) { - case QAM_256: - case QAM_64: -+#if 0 /* needed w/3304 to set FE_HAS_SIGNAL */ -+ if (cr_lock) -+ *status |= FE_HAS_SIGNAL; -+#endif - ret = lgdt3305_read_fec_lock_status(state, &fec_lock); - if (lg_fail(ret)) - goto fail; -@@ -992,6 +1145,7 @@ static void lgdt3305_release(struct dvb_frontend *fe) - kfree(state); - } - -+static struct dvb_frontend_ops lgdt3304_ops; - static struct dvb_frontend_ops lgdt3305_ops; - - struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config, -@@ -1012,11 +1166,21 @@ struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config, - state->cfg = config; - state->i2c_adap = i2c_adap; - -- memcpy(&state->frontend.ops, &lgdt3305_ops, -- sizeof(struct dvb_frontend_ops)); -+ switch (config->demod_chip) { -+ case LGDT3304: -+ memcpy(&state->frontend.ops, &lgdt3304_ops, -+ sizeof(struct dvb_frontend_ops)); -+ break; -+ case LGDT3305: -+ memcpy(&state->frontend.ops, &lgdt3305_ops, -+ sizeof(struct dvb_frontend_ops)); -+ break; -+ default: -+ goto fail; -+ } - state->frontend.demodulator_priv = state; - -- /* verify that we're talking to a lg dt3305 */ -+ /* verify that we're talking to a lg dt3304/5 */ - ret = lgdt3305_read_reg(state, LGDT3305_GEN_CTRL_2, &val); - if ((lg_fail(ret)) | (val == 0)) - goto fail; -@@ -1035,12 +1199,36 @@ struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config, - - return &state->frontend; - fail: -- lg_warn("unable to detect LGDT3305 hardware\n"); -+ lg_warn("unable to detect %s hardware\n", -+ config->demod_chip ? "LGDT3304" : "LGDT3305"); - kfree(state); - return NULL; - } - EXPORT_SYMBOL(lgdt3305_attach); - -+static struct dvb_frontend_ops lgdt3304_ops = { -+ .info = { -+ .name = "LG Electronics LGDT3304 VSB/QAM Frontend", -+ .type = FE_ATSC, -+ .frequency_min = 54000000, -+ .frequency_max = 858000000, -+ .frequency_stepsize = 62500, -+ .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB -+ }, -+ .i2c_gate_ctrl = lgdt3305_i2c_gate_ctrl, -+ .init = lgdt3304_init, -+ .sleep = lgdt3304_sleep, -+ .set_frontend = lgdt3304_set_parameters, -+ .get_frontend = lgdt3305_get_frontend, -+ .get_tune_settings = lgdt3305_get_tune_settings, -+ .read_status = lgdt3305_read_status, -+ .read_ber = lgdt3305_read_ber, -+ .read_signal_strength = lgdt3305_read_signal_strength, -+ .read_snr = lgdt3305_read_snr, -+ .read_ucblocks = lgdt3305_read_ucblocks, -+ .release = lgdt3305_release, -+}; -+ - static struct dvb_frontend_ops lgdt3305_ops = { - .info = { - .name = "LG Electronics LGDT3305 VSB/QAM Frontend", -@@ -1064,7 +1252,7 @@ static struct dvb_frontend_ops lgdt3305_ops = { - .release = lgdt3305_release, - }; - --MODULE_DESCRIPTION("LG Electronics LGDT3305 ATSC/QAM-B Demodulator Driver"); -+MODULE_DESCRIPTION("LG Electronics LGDT3304/5 ATSC/QAM-B Demodulator Driver"); - MODULE_AUTHOR("Michael Krufky "); - MODULE_LICENSE("GPL"); - MODULE_VERSION("0.1"); -diff --git a/drivers/media/dvb/frontends/lgdt3305.h b/drivers/media/dvb/frontends/lgdt3305.h -index 9cb11c9..a7f30c2 100644 ---- a/drivers/media/dvb/frontends/lgdt3305.h -+++ b/drivers/media/dvb/frontends/lgdt3305.h -@@ -41,6 +41,11 @@ enum lgdt3305_tp_valid_polarity { - LGDT3305_TP_VALID_HIGH = 1, - }; - -+enum lgdt_demod_chip_type { -+ LGDT3305 = 0, -+ LGDT3304 = 1, -+}; -+ - struct lgdt3305_config { - u8 i2c_addr; - -@@ -65,6 +70,7 @@ struct lgdt3305_config { - enum lgdt3305_mpeg_mode mpeg_mode; - enum lgdt3305_tp_clock_edge tpclk_edge; - enum lgdt3305_tp_valid_polarity tpvalid_polarity; -+ enum lgdt_demod_chip_type demod_chip; - }; - - #if defined(CONFIG_DVB_LGDT3305) || (defined(CONFIG_DVB_LGDT3305_MODULE) && \ --- -1.6.6 - diff --git a/linux-2.6-v4l-dvb-ir-core-update.patch b/linux-2.6-v4l-dvb-ir-core-update.patch deleted file mode 100644 index c1105a330..000000000 --- a/linux-2.6-v4l-dvb-ir-core-update.patch +++ /dev/null @@ -1,6741 +0,0 @@ -Patch generated from the linuxtv staging/other branch, with a few -additional pending fixes merged in, and just about everything not -essential to the ir-core update chopped out. - -(Patch generated 2010.07.16) - -Signed-off-by: Jarod Wilson - ---- - Documentation/DocBook/media-entities.tmpl | 1 - Documentation/DocBook/media.tmpl | 8 - Documentation/DocBook/v4l/lirc_device_interface.xml | 235 ++++ - Documentation/DocBook/v4l/remote_controllers.xml | 2 - Documentation/dvb/get_dvb_firmware | 19 - Documentation/video4linux/CARDLIST.cx23885 | 6 - drivers/input/evdev.c | 39 - drivers/input/input.c | 268 ++++ - drivers/media/IR/Kconfig | 34 - drivers/media/IR/Makefile | 3 - drivers/media/IR/imon.c | 5 - drivers/media/IR/ir-core-priv.h | 54 - drivers/media/IR/ir-jvc-decoder.c | 152 -- - drivers/media/IR/ir-lirc-codec.c | 283 ++++ - drivers/media/IR/ir-nec-decoder.c | 151 -- - drivers/media/IR/ir-raw-event.c | 167 +- - drivers/media/IR/ir-rc5-decoder.c | 167 -- - drivers/media/IR/ir-rc6-decoder.c | 153 -- - drivers/media/IR/ir-sony-decoder.c | 155 -- - drivers/media/IR/ir-sysfs.c | 261 ++-- - drivers/media/IR/keymaps/Makefile | 2 - drivers/media/IR/keymaps/rc-lirc.c | 41 - drivers/media/IR/keymaps/rc-rc6-mce.c | 105 + - drivers/media/IR/lirc_dev.c | 764 +++++++++++++ - drivers/media/IR/mceusb.c | 1143 ++++++++++++++++++++ - drivers/media/common/tuners/tda18271-fe.c | 8 - drivers/media/dvb/mantis/Kconfig | 14 - drivers/media/dvb/mantis/mantis_input.c | 5 - drivers/media/video/cx23885/cx23885-cards.c | 40 - drivers/media/video/cx23885/cx23885-core.c | 11 - drivers/media/video/cx23885/cx23885-dvb.c | 2 - drivers/media/video/cx23885/cx23885-input.c | 317 +---- - drivers/media/video/cx23885/cx23885-ir.c | 2 - drivers/media/video/cx23885/cx23885.h | 12 - drivers/media/video/cx88/cx88-cards.c | 9 - drivers/media/video/cx88/cx88-i2c.c | 6 - drivers/media/video/cx88/cx88-input.c | 46 - drivers/media/video/cx88/cx88.h | 1 - drivers/media/video/em28xx/em28xx-input.c | 80 - - drivers/media/video/em28xx/em28xx-video.c | 4 - drivers/media/video/em28xx/em28xx.h | 1 - drivers/media/video/hdpvr/hdpvr-core.c | 5 - drivers/media/video/ir-kbd-i2c.c | 14 - drivers/media/video/pvrusb2/pvrusb2-ioread.c | 5 - include/linux/input.h | 39 - include/media/ir-core.h | 8 - include/media/ir-kbd-i2c.h | 2 - include/media/lirc.h | 165 ++ - include/media/lirc_dev.h | 225 +++ - include/media/rc-map.h | 7 - 50 files changed, 3971 insertions(+), 1275 deletions(-) - -diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl -index 5d4d40f..6ae9715 100644 ---- a/Documentation/DocBook/media-entities.tmpl -+++ b/Documentation/DocBook/media-entities.tmpl -@@ -218,6 +218,7 @@ - - - -+ - - - -diff --git a/Documentation/DocBook/media.tmpl b/Documentation/DocBook/media.tmpl -index eea564b..f11048d 100644 ---- a/Documentation/DocBook/media.tmpl -+++ b/Documentation/DocBook/media.tmpl -@@ -28,7 +28,7 @@ - LINUX MEDIA INFRASTRUCTURE API - - -- 2009 -+ 2009-2010 - LinuxTV Developers - - -@@ -61,7 +61,7 @@ Foundation. A copy of the license is included in the chapter entitled - in fact it covers several different video standards including - DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated - to documment support also for DVB-S2, ISDB-T and ISDB-S. -- The third part covers other API's used by all media infrastructure devices -+ The third part covers Remote Controller API - For additional information and for the latest development code, - see: http://linuxtv.org. - For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: Linux Media Mailing List (LMML).. -@@ -86,7 +86,7 @@ Foundation. A copy of the license is included in the chapter entitled - - - -- 2009 -+ 2009-2010 - Mauro Carvalho Chehab - - -@@ -101,7 +101,7 @@ Foundation. A copy of the license is included in the chapter entitled - - - --Other API's used by media infrastructure drivers -+Remote Controller API - - &sub-remote_controllers; - -diff --git a/Documentation/DocBook/v4l/lirc_device_interface.xml b/Documentation/DocBook/v4l/lirc_device_interface.xml -new file mode 100644 -index 0000000..0413234 ---- /dev/null -+++ b/Documentation/DocBook/v4l/lirc_device_interface.xml -@@ -0,0 +1,235 @@ -+
-+LIRC Device Interface -+ -+ -+
-+Introduction -+ -+The LIRC device interface is a bi-directional interface for -+transporting raw IR data between userspace and kernelspace. Fundamentally, -+it is just a chardev (/dev/lircX, for X = 0, 1, 2, ...), with a number -+of standard struct file_operations defined on it. With respect to -+transporting raw IR data to and fro, the essential fops are read, write -+and ioctl. -+ -+Example dmesg output upon a driver registering w/LIRC: -+
-+ $ dmesg |grep lirc_dev -+ lirc_dev: IR Remote Control driver registered, major 248 -+ rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0 -+
-+ -+What you should see for a chardev: -+
-+ $ ls -l /dev/lirc* -+ crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0 -+
-+
-+ -+
-+LIRC read fop -+ -+The lircd userspace daemon reads raw IR data from the LIRC chardev. The -+exact format of the data depends on what modes a driver supports, and what -+mode has been selected. lircd obtains supported modes and sets the active mode -+via the ioctl interface, detailed at . The generally -+preferred mode is LIRC_MODE_MODE2, in which packets containing an int value -+describing an IR signal are read from the chardev. -+ -+See also http://www.lirc.org/html/technical.html for more info. -+
-+ -+
-+LIRC write fop -+ -+The data written to the chardev is a pulse/space sequence of integer -+values. Pulses and spaces are only marked implicitly by their position. The -+data must start and end with a pulse, therefore, the data must always include -+an unevent number of samples. The write function must block until the data has -+been transmitted by the hardware. -+
-+ -+
-+LIRC ioctl fop -+ -+The LIRC device's ioctl definition is bound by the ioctl function -+definition of struct file_operations, leaving us with an unsigned int -+for the ioctl command and an unsigned long for the arg. For the purposes -+of ioctl portability across 32-bit and 64-bit, these values are capped -+to their 32-bit sizes. -+ -+The following ioctls can be used to change specific hardware settings. -+In general each driver should have a default set of settings. The driver -+implementation is expected to re-apply the default settings when the device -+is closed by user-space, so that every application opening the device can rely -+on working with the default settings initially. -+ -+ -+ -+ LIRC_GET_FEATURES -+ -+ Obviously, get the underlying hardware device's features. If a driver -+ does not announce support of certain features, calling of the corresponding -+ ioctls is undefined. -+ -+ -+ -+ LIRC_GET_SEND_MODE -+ -+ Get supported transmit mode. Only LIRC_MODE_PULSE is supported by lircd. -+ -+ -+ -+ LIRC_GET_REC_MODE -+ -+ Get supported receive modes. Only LIRC_MODE_MODE2 and LIRC_MODE_LIRCCODE -+ are supported by lircd. -+ -+ -+ -+ LIRC_GET_SEND_CARRIER -+ -+ Get carrier frequency (in Hz) currently used for transmit. -+ -+ -+ -+ LIRC_GET_REC_CARRIER -+ -+ Get carrier frequency (in Hz) currently used for IR reception. -+ -+ -+ -+ LIRC_{G,S}ET_{SEND,REC}_DUTY_CYCLE -+ -+ Get/set the duty cycle (from 0 to 100) of the carrier signal. Currently, -+ no special meaning is defined for 0 or 100, but this could be used to switch -+ off carrier generation in the future, so these values should be reserved. -+ -+ -+ -+ LIRC_GET_REC_RESOLUTION -+ -+ Some receiver have maximum resolution which is defined by internal -+ sample rate or data format limitations. E.g. it's common that signals can -+ only be reported in 50 microsecond steps. This integer value is used by -+ lircd to automatically adjust the aeps tolerance value in the lircd -+ config file. -+ -+ -+ -+ LIRC_GET_M{IN,AX}_TIMEOUT -+ -+ Some devices have internal timers that can be used to detect when -+ there's no IR activity for a long time. This can help lircd in detecting -+ that a IR signal is finished and can speed up the decoding process. -+ Returns an integer value with the minimum/maximum timeout that can be -+ set. Some devices have a fixed timeout, in that case both ioctls will -+ return the same value even though the timeout cannot be changed. -+ -+ -+ -+ LIRC_GET_M{IN,AX}_FILTER_{PULSE,SPACE} -+ -+ Some devices are able to filter out spikes in the incoming signal -+ using given filter rules. These ioctls return the hardware capabilities -+ that describe the bounds of the possible filters. Filter settings depend -+ on the IR protocols that are expected. lircd derives the settings from -+ all protocols definitions found in its config file. -+ -+ -+ -+ LIRC_GET_LENGTH -+ -+ Retrieves the code length in bits (only for LIRC_MODE_LIRCCODE). -+ Reads on the device must be done in blocks matching the bit count. -+ The bit could should be rounded up so that it matches full bytes. -+ -+ -+ -+ LIRC_SET_{SEND,REC}_MODE -+ -+ Set send/receive mode. Largely obsolete for send, as only -+ LIRC_MODE_PULSE is supported. -+ -+ -+ -+ LIRC_SET_{SEND,REC}_CARRIER -+ -+ Set send/receive carrier (in Hz). -+ -+ -+ -+ LIRC_SET_TRANSMITTER_MASK -+ -+ This enables the given set of transmitters. The first transmitter -+ is encoded by the least significant bit, etc. When an invalid bit mask -+ is given, i.e. a bit is set, even though the device does not have so many -+ transitters, then this ioctl returns the number of available transitters -+ and does nothing otherwise. -+ -+ -+ -+ LIRC_SET_REC_TIMEOUT -+ -+ Sets the integer value for IR inactivity timeout (cf. -+ LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT). A value of 0 (if -+ supported by the hardware) disables all hardware timeouts and data should -+ be reported as soon as possible. If the exact value cannot be set, then -+ the next possible value _greater_ than the given value should be set. -+ -+ -+ -+ LIRC_SET_REC_TIMEOUT_REPORTS -+ -+ Enable (1) or disable (0) timeout reports in LIRC_MODE_MODE2. By -+ default, timeout reports should be turned off. -+ -+ -+ -+ LIRC_SET_REC_FILTER_{,PULSE,SPACE} -+ -+ Pulses/spaces shorter than this are filtered out by hardware. If -+ filters cannot be set independently for pulse/space, the corresponding -+ ioctls must return an error and LIRC_SET_REC_FILTER shall be used instead. -+ -+ -+ -+ LIRC_SET_MEASURE_CARRIER_MODE -+ -+ Enable (1)/disable (0) measure mode. If enabled, from the next key -+ press on, the driver will send LIRC_MODE2_FREQUENCY packets. By default -+ this should be turned off. -+ -+ -+ -+ LIRC_SET_REC_{DUTY_CYCLE,CARRIER}_RANGE -+ -+ To set a range use LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE -+ with the lower bound first and later LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER -+ with the upper bound. -+ -+ -+ -+ LIRC_NOTIFY_DECODE -+ -+ This ioctl is called by lircd whenever a successful decoding of an -+ incoming IR signal could be done. This can be used by supporting hardware -+ to give visual feedback to the user e.g. by flashing a LED. -+ -+ -+ -+ LIRC_SETUP_{START,END} -+ -+ Setting of several driver parameters can be optimized by encapsulating -+ the according ioctl calls with LIRC_SETUP_START/LIRC_SETUP_END. When a -+ driver receives a LIRC_SETUP_START ioctl it can choose to not commit -+ further setting changes to the hardware until a LIRC_SETUP_END is received. -+ But this is open to the driver implementation and every driver must also -+ handle parameter changes which are not encapsulated by LIRC_SETUP_START -+ and LIRC_SETUP_END. Drivers can also choose to ignore these ioctls. -+ -+ -+ -+ -+
-+
-diff --git a/Documentation/DocBook/v4l/remote_controllers.xml b/Documentation/DocBook/v4l/remote_controllers.xml -index 73f5eab..3c3b667 100644 ---- a/Documentation/DocBook/v4l/remote_controllers.xml -+++ b/Documentation/DocBook/v4l/remote_controllers.xml -@@ -173,3 +173,5 @@ keymapping. - This program demonstrates how to replace the keymap tables. - &sub-keytable-c; - -+ -+&sub-lirc_device_interface; -diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware -index 239cbdb..9ea94dc 100644 ---- a/Documentation/dvb/get_dvb_firmware -+++ b/Documentation/dvb/get_dvb_firmware -@@ -26,7 +26,7 @@ use IO::Handle; - "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", - "or51211", "or51132_qam", "or51132_vsb", "bluebird", - "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", -- "af9015", "ngene"); -+ "af9015", "ngene", "az6027"); - - # Check args - syntax() if (scalar(@ARGV) != 1); -@@ -567,6 +567,23 @@ sub ngene { - "$file1, $file2"; - } - -+sub az6027{ -+ my $file = "AZ6027_Linux_Driver.tar.gz"; -+ my $url = "http://linux.terratec.de/files/$file"; -+ my $firmware = "dvb-usb-az6027-03.fw"; -+ -+ wgetfile($file, $url); -+ -+ #untar -+ if( system("tar xzvf $file $firmware")){ -+ die "failed to untar firmware"; -+ } -+ if( system("rm $file")){ -+ die ("unable to remove unnecessary files"); -+ } -+ -+ $firmware; -+} - # --------------------------------------------------------------- - # Utilities - -diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 -index 16ca030..87c4634 100644 ---- a/Documentation/video4linux/CARDLIST.cx23885 -+++ b/Documentation/video4linux/CARDLIST.cx23885 -@@ -17,9 +17,9 @@ - 16 -> DVBWorld DVB-S2 2005 [0001:2005] - 17 -> NetUP Dual DVB-S2 CI [1b55:2a2c] - 18 -> Hauppauge WinTV-HVR1270 [0070:2211] -- 19 -> Hauppauge WinTV-HVR1275 [0070:2215] -- 20 -> Hauppauge WinTV-HVR1255 [0070:2251] -- 21 -> Hauppauge WinTV-HVR1210 [0070:2291,0070:2295] -+ 19 -> Hauppauge WinTV-HVR1275 [0070:2215,0070:221d,0070:22f2] -+ 20 -> Hauppauge WinTV-HVR1255 [0070:2251,0070:2259,0070:22f1] -+ 21 -> Hauppauge WinTV-HVR1210 [0070:2291,0070:2295,0070:2299,0070:229d,0070:22f0,0070:22f3,0070:22f4,0070:22f5] - 22 -> Mygica X8506 DMB-TH [14f1:8651] - 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657] - 24 -> Hauppauge WinTV-HVR1850 [0070:8541] -diff --git a/Documentation/video4linux/extract_xc3028.pl b/Documentation/video4linux/extract_xc3028.pl -old mode 100644 -new mode 100755 -diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c -index 2ee6c7a..b8a5673 100644 ---- a/drivers/input/evdev.c -+++ b/drivers/input/evdev.c -@@ -515,6 +515,8 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, - struct input_absinfo abs; - struct ff_effect effect; - int __user *ip = (int __user *)p; -+ struct keycode_table_entry kt, *kt_p = p; -+ char scancode[16]; - unsigned int i, t, u, v; - int error; - -@@ -569,6 +571,43 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, - - return input_set_keycode(dev, t, v); - -+ case EVIOCGKEYCODEBIG: -+ if (copy_from_user(&kt, kt_p, sizeof(kt))) -+ return -EFAULT; -+ -+ if (kt.len > sizeof(scancode)) -+ return -EINVAL; -+ -+ kt.scancode = scancode; -+ -+ error = input_get_keycode_big(dev, &kt); -+ if (error) -+ return error; -+ -+ if (copy_to_user(kt_p, &kt, sizeof(kt))) -+ return -EFAULT; -+ -+ /* FIXME: probably need some compat32 code */ -+ if (copy_to_user(kt_p->scancode, kt.scancode, kt.len)) -+ return -EFAULT; -+ -+ return 0; -+ -+ case EVIOCSKEYCODEBIG: -+ if (copy_from_user(&kt, kt_p, sizeof(kt))) -+ return -EFAULT; -+ -+ if (kt.len > sizeof(scancode)) -+ return -EINVAL; -+ -+ kt.scancode = scancode; -+ -+ /* FIXME: probably need some compat32 code */ -+ if (copy_from_user(kt.scancode, kt_p->scancode, kt.len)) -+ return -EFAULT; -+ -+ return input_set_keycode_big(dev, &kt); -+ - case EVIOCRMFF: - return input_ff_erase(dev, (int)(unsigned long) p, file); - -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 9c79bd5..43aeb71 100644 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -568,6 +568,11 @@ static void input_disconnect_device(struct input_dev *dev) - spin_unlock_irq(&dev->event_lock); - } - -+/* -+ * Those routines handle the default case where no [gs]etkeycode() is -+ * defined. In this case, an array indexed by the scancode is used. -+ */ -+ - static int input_fetch_keycode(struct input_dev *dev, int scancode) - { - switch (dev->keycodesize) { -@@ -582,27 +587,74 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode) - } - } - --static int input_default_getkeycode(struct input_dev *dev, -- unsigned int scancode, -- unsigned int *keycode) -+/* -+ * Supports only 8, 16 and 32 bit scancodes. It wouldn't be that -+ * hard to write some machine-endian logic to support 24 bit scancodes, -+ * but it seemed overkill. It should also be noticed that, since there -+ * are, in general, less than 256 scancodes sparsed into the scancode -+ * space, even with 16 bits, the codespace is sparsed, with leads into -+ * memory and code ineficiency, when retrieving the entire scancode -+ * space. -+ * So, it is highly recommended to implement getkeycodebig/setkeycodebig -+ * instead of using a normal table approach, when more than 8 bits is -+ * needed for the scancode. -+ */ -+static int input_fetch_scancode(struct keycode_table_entry *kt_entry, -+ u32 *scancode) - { -+ switch (kt_entry->len) { -+ case 1: -+ *scancode = *((u8 *)kt_entry->scancode); -+ break; -+ case 2: -+ *scancode = *((u16 *)kt_entry->scancode); -+ break; -+ case 4: -+ *scancode = *((u32 *)kt_entry->scancode); -+ break; -+ default: -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+ -+static int input_default_getkeycode_from_index(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry) -+{ -+ u32 scancode = kt_entry->index; -+ - if (!dev->keycodesize) - return -EINVAL; - - if (scancode >= dev->keycodemax) - return -EINVAL; - -- *keycode = input_fetch_keycode(dev, scancode); -+ kt_entry->keycode = input_fetch_keycode(dev, scancode); -+ memcpy(kt_entry->scancode, &scancode, 4); - - return 0; - } - -+static int input_default_getkeycode_from_scancode(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry) -+{ -+ if (input_fetch_scancode(kt_entry, &kt_entry->index)) -+ return -EINVAL; -+ -+ return input_default_getkeycode_from_index(dev, kt_entry); -+} -+ -+ - static int input_default_setkeycode(struct input_dev *dev, -- unsigned int scancode, -- unsigned int keycode) -+ struct keycode_table_entry *kt_entry) - { -- int old_keycode; -+ u32 old_keycode; - int i; -+ u32 scancode; -+ -+ if (input_fetch_scancode(kt_entry, &scancode)) -+ return -EINVAL; - - if (scancode >= dev->keycodemax) - return -EINVAL; -@@ -610,32 +662,33 @@ static int input_default_setkeycode(struct input_dev *dev, - if (!dev->keycodesize) - return -EINVAL; - -- if (dev->keycodesize < sizeof(keycode) && (keycode >> (dev->keycodesize * 8))) -+ if (dev->keycodesize < sizeof(dev->keycode) && -+ (kt_entry->keycode >> (dev->keycodesize * 8))) - return -EINVAL; - - switch (dev->keycodesize) { - case 1: { - u8 *k = (u8 *)dev->keycode; - old_keycode = k[scancode]; -- k[scancode] = keycode; -+ k[scancode] = kt_entry->keycode; - break; - } - case 2: { - u16 *k = (u16 *)dev->keycode; - old_keycode = k[scancode]; -- k[scancode] = keycode; -+ k[scancode] = kt_entry->keycode; - break; - } - default: { - u32 *k = (u32 *)dev->keycode; - old_keycode = k[scancode]; -- k[scancode] = keycode; -+ k[scancode] = kt_entry->keycode; - break; - } - } - - __clear_bit(old_keycode, dev->keybit); -- __set_bit(keycode, dev->keybit); -+ __set_bit(kt_entry->keycode, dev->keybit); - - for (i = 0; i < dev->keycodemax; i++) { - if (input_fetch_keycode(dev, i) == old_keycode) { -@@ -648,6 +701,110 @@ static int input_default_setkeycode(struct input_dev *dev, - } - - /** -+ * input_get_keycode_big - retrieve keycode currently mapped to a given scancode -+ * @dev: input device which keymap is being queried -+ * @kt_entry: keytable entry -+ * -+ * This function should be called by anyone interested in retrieving current -+ * keymap. Presently evdev handlers use it. -+ */ -+int input_get_keycode_big(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry) -+{ -+ if (dev->getkeycode) { -+ u32 scancode = kt_entry->index; -+ -+ /* -+ * Support for legacy drivers, that don't implement the new -+ * ioctls -+ */ -+ memcpy(kt_entry->scancode, &scancode, 4); -+ return dev->getkeycode(dev, scancode, -+ &kt_entry->keycode); -+ } else -+ return dev->getkeycodebig_from_index(dev, kt_entry); -+} -+EXPORT_SYMBOL(input_get_keycode_big); -+ -+/** -+ * input_set_keycode_big - attribute a keycode to a given scancode -+ * @dev: input device which keymap is being queried -+ * @kt_entry: keytable entry -+ * -+ * This function should be called by anyone needing to update current -+ * keymap. Presently keyboard and evdev handlers use it. -+ */ -+int input_set_keycode_big(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry) -+{ -+ unsigned long flags; -+ int old_keycode; -+ int retval = -EINVAL; -+ u32 uninitialized_var(scancode); -+ -+ if (kt_entry->keycode < 0 || kt_entry->keycode > KEY_MAX) -+ return -EINVAL; -+ -+ spin_lock_irqsave(&dev->event_lock, flags); -+ -+ /* -+ * We need to know the old scancode, in order to generate a -+ * keyup effect, if the set operation happens successfully -+ */ -+ if (dev->getkeycode) { -+ /* -+ * Support for legacy drivers, that don't implement the new -+ * ioctls -+ */ -+ if (!dev->setkeycode) -+ goto out; -+ -+ retval = input_fetch_scancode(kt_entry, &scancode); -+ if (retval) -+ goto out; -+ -+ retval = dev->getkeycode(dev, scancode, -+ &old_keycode); -+ } else { -+ int new_keycode = kt_entry->keycode; -+ -+ retval = dev->getkeycodebig_from_scancode(dev, kt_entry); -+ old_keycode = kt_entry->keycode; -+ kt_entry->keycode = new_keycode; -+ } -+ -+ if (retval) -+ goto out; -+ -+ if (dev->getkeycode) -+ retval = dev->setkeycode(dev, scancode, -+ kt_entry->keycode); -+ else -+ retval = dev->setkeycodebig(dev, kt_entry); -+ if (retval) -+ goto out; -+ -+ /* -+ * Simulate keyup event if keycode is not present -+ * in the keymap anymore -+ */ -+ if (test_bit(EV_KEY, dev->evbit) && -+ !is_event_supported(old_keycode, dev->keybit, KEY_MAX) && -+ __test_and_clear_bit(old_keycode, dev->key)) { -+ -+ input_pass_event(dev, EV_KEY, old_keycode, 0); -+ if (dev->sync) -+ input_pass_event(dev, EV_SYN, SYN_REPORT, 1); -+ } -+ -+ out: -+ spin_unlock_irqrestore(&dev->event_lock, flags); -+ -+ return retval; -+} -+EXPORT_SYMBOL(input_set_keycode_big); -+ -+/** - * input_get_keycode - retrieve keycode currently mapped to a given scancode - * @dev: input device which keymap is being queried - * @scancode: scancode (or its equivalent for device in question) for which -@@ -661,13 +818,35 @@ int input_get_keycode(struct input_dev *dev, - unsigned int scancode, unsigned int *keycode) - { - unsigned long flags; -- int retval; - -- spin_lock_irqsave(&dev->event_lock, flags); -- retval = dev->getkeycode(dev, scancode, keycode); -- spin_unlock_irqrestore(&dev->event_lock, flags); -+ if (dev->getkeycode) { -+ /* -+ * Use the legacy calls -+ */ -+ return dev->getkeycode(dev, scancode, keycode); -+ } else { -+ int retval; -+ struct keycode_table_entry kt_entry; - -- return retval; -+ /* -+ * Userspace is using a legacy call with a driver ported -+ * to the new way. This is a bad idea with long sparsed -+ * tables, since lots of the retrieved values will be in -+ * blank. Also, it makes sense only if the table size is -+ * lower than 2^32. -+ */ -+ memset(&kt_entry, 0, sizeof(kt_entry)); -+ kt_entry.len = 4; -+ kt_entry.index = scancode; -+ kt_entry.scancode = (char *)&scancode; -+ -+ spin_lock_irqsave(&dev->event_lock, flags); -+ retval = dev->getkeycodebig_from_index(dev, &kt_entry); -+ spin_unlock_irqrestore(&dev->event_lock, flags); -+ -+ *keycode = kt_entry.keycode; -+ return retval; -+ } - } - EXPORT_SYMBOL(input_get_keycode); - -@@ -692,13 +871,42 @@ int input_set_keycode(struct input_dev *dev, - - spin_lock_irqsave(&dev->event_lock, flags); - -- retval = dev->getkeycode(dev, scancode, &old_keycode); -- if (retval) -- goto out; -+ if (dev->getkeycode) { -+ /* -+ * Use the legacy calls -+ */ -+ retval = dev->getkeycode(dev, scancode, &old_keycode); -+ if (retval) -+ goto out; - -- retval = dev->setkeycode(dev, scancode, keycode); -- if (retval) -- goto out; -+ retval = dev->setkeycode(dev, scancode, keycode); -+ if (retval) -+ goto out; -+ } else { -+ struct keycode_table_entry kt_entry; -+ -+ /* -+ * Userspace is using a legacy call with a driver ported -+ * to the new way. This is a bad idea with long sparsed -+ * tables, since lots of the retrieved values will be in -+ * blank. Also, it makes sense only if the table size is -+ * lower than 2^32. -+ */ -+ memset(&kt_entry, 0, sizeof(kt_entry)); -+ kt_entry.len = 4; -+ kt_entry.scancode = (char *)&scancode; -+ -+ retval = dev->getkeycodebig_from_scancode(dev, &kt_entry); -+ if (retval) -+ goto out; -+ -+ old_keycode = kt_entry.keycode; -+ kt_entry.keycode = keycode; -+ -+ retval = dev->setkeycodebig(dev, &kt_entry); -+ if (retval) -+ goto out; -+ } - - /* Make sure KEY_RESERVED did not get enabled. */ - __clear_bit(KEY_RESERVED, dev->keybit); -@@ -1636,11 +1843,17 @@ int input_register_device(struct input_dev *dev) - dev->rep[REP_PERIOD] = 33; - } - -- if (!dev->getkeycode) -- dev->getkeycode = input_default_getkeycode; -+ if (!dev->getkeycode) { -+ if (!dev->getkeycodebig_from_index) -+ dev->getkeycodebig_from_index = input_default_getkeycode_from_index; -+ if (!dev->getkeycodebig_from_scancode) -+ dev->getkeycodebig_from_scancode = input_default_getkeycode_from_scancode; -+ } - -- if (!dev->setkeycode) -- dev->setkeycode = input_default_setkeycode; -+ if (!dev->setkeycode) { -+ if (!dev->setkeycodebig) -+ dev->setkeycodebig = input_default_setkeycode; -+ } - - dev_set_name(&dev->dev, "input%ld", - (unsigned long) atomic_inc_return(&input_no) - 1); -diff --git a/drivers/media/IR/Kconfig b/drivers/media/IR/Kconfig -index d22a8ec..e557ae0 100644 ---- a/drivers/media/IR/Kconfig -+++ b/drivers/media/IR/Kconfig -@@ -8,6 +8,17 @@ config VIDEO_IR - depends on IR_CORE - default IR_CORE - -+config LIRC -+ tristate -+ default y -+ -+ ---help--- -+ Enable this option to build the Linux Infrared Remote -+ Control (LIRC) core device interface driver. The LIRC -+ interface passes raw IR to and from userspace, where the -+ LIRC daemon handles protocol decoding for IR reception ann -+ encoding for IR transmitting (aka "blasting"). -+ - source "drivers/media/IR/keymaps/Kconfig" - - config IR_NEC_DECODER -@@ -42,6 +53,7 @@ config IR_RC6_DECODER - config IR_JVC_DECODER - tristate "Enable IR raw decoder for the JVC protocol" - depends on IR_CORE -+ select BITREVERSE - default y - - ---help--- -@@ -57,6 +69,16 @@ config IR_SONY_DECODER - Enable this option if you have an infrared remote control which - uses the Sony protocol, and you need software decoding support. - -+config IR_LIRC_CODEC -+ tristate "Enable IR to LIRC bridge" -+ depends on IR_CORE -+ depends on LIRC -+ default y -+ -+ ---help--- -+ Enable this option to pass raw IR to and from userspace via -+ the LIRC interface. -+ - config IR_IMON - tristate "SoundGraph iMON Receiver and Display" - depends on USB_ARCH_HAS_HCD -@@ -68,3 +90,15 @@ config IR_IMON - - To compile this driver as a module, choose M here: the - module will be called imon. -+ -+config IR_MCEUSB -+ tristate "Windows Media Center Ed. eHome Infrared Transceiver" -+ depends on USB_ARCH_HAS_HCD -+ depends on IR_CORE -+ select USB -+ ---help--- -+ Say Y here if you want to use a Windows Media Center Edition -+ eHome Infrared Transceiver. -+ -+ To compile this driver as a module, choose M here: the -+ module will be called mceusb. -diff --git a/drivers/media/IR/Makefile b/drivers/media/IR/Makefile -index b998fcc..2ae4f3a 100644 ---- a/drivers/media/IR/Makefile -+++ b/drivers/media/IR/Makefile -@@ -5,11 +5,14 @@ obj-y += keymaps/ - - obj-$(CONFIG_IR_CORE) += ir-core.o - obj-$(CONFIG_VIDEO_IR) += ir-common.o -+obj-$(CONFIG_LIRC) += lirc_dev.o - obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o - obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o - obj-$(CONFIG_IR_RC6_DECODER) += ir-rc6-decoder.o - obj-$(CONFIG_IR_JVC_DECODER) += ir-jvc-decoder.o - obj-$(CONFIG_IR_SONY_DECODER) += ir-sony-decoder.o -+obj-$(CONFIG_IR_LIRC_CODEC) += ir-lirc-codec.o - - # stand-alone IR receivers/transmitters - obj-$(CONFIG_IR_IMON) += imon.o -+obj-$(CONFIG_IR_MCEUSB) += mceusb.o -diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c -index 4bbd45f..0195dd5 100644 ---- a/drivers/media/IR/imon.c -+++ b/drivers/media/IR/imon.c -@@ -1943,7 +1943,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) - return ictx; - - urb_submit_failed: -- input_unregister_device(ictx->idev); -+ ir_input_unregister(ictx->idev); - input_free_device(ictx->idev); - idev_setup_failed: - find_endpoint_failed: -@@ -2067,6 +2067,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx) - detected_display_type = IMON_DISPLAY_TYPE_VFD; - break; - /* iMON LCD, MCE IR */ -+ case 0x9e: - case 0x9f: - dev_info(ictx->dev, "0xffdc iMON LCD, MCE IR"); - detected_display_type = IMON_DISPLAY_TYPE_LCD; -@@ -2306,7 +2307,7 @@ static void __devexit imon_disconnect(struct usb_interface *interface) - if (ifnum == 0) { - ictx->dev_present_intf0 = false; - usb_kill_urb(ictx->rx_urb_intf0); -- input_unregister_device(ictx->idev); -+ ir_input_unregister(ictx->idev); - if (ictx->display_supported) { - if (ictx->display_type == IMON_DISPLAY_TYPE_LCD) - usb_deregister_dev(interface, &imon_lcd_class); -diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h -index 9a5e65a..babd520 100644 ---- a/drivers/media/IR/ir-core-priv.h -+++ b/drivers/media/IR/ir-core-priv.h -@@ -22,17 +22,62 @@ - struct ir_raw_handler { - struct list_head list; - -+ u64 protocols; /* which are handled by this handler */ - int (*decode)(struct input_dev *input_dev, struct ir_raw_event event); -+ -+ /* These two should only be used by the lirc decoder */ - int (*raw_register)(struct input_dev *input_dev); - int (*raw_unregister)(struct input_dev *input_dev); - }; - - struct ir_raw_event_ctrl { -+ struct list_head list; /* to keep track of raw clients */ - struct work_struct rx_work; /* for the rx decoding workqueue */ - struct kfifo kfifo; /* fifo for the pulse/space durations */ - ktime_t last_event; /* when last event occurred */ - enum raw_event_type last_type; /* last event type */ - struct input_dev *input_dev; /* pointer to the parent input_dev */ -+ u64 enabled_protocols; /* enabled raw protocol decoders */ -+ -+ /* raw decoder state follows */ -+ struct ir_raw_event prev_ev; -+ struct nec_dec { -+ int state; -+ unsigned count; -+ u32 bits; -+ } nec; -+ struct rc5_dec { -+ int state; -+ u32 bits; -+ unsigned count; -+ unsigned wanted_bits; -+ } rc5; -+ struct rc6_dec { -+ int state; -+ u8 header; -+ u32 body; -+ bool toggle; -+ unsigned count; -+ unsigned wanted_bits; -+ } rc6; -+ struct sony_dec { -+ int state; -+ u32 bits; -+ unsigned count; -+ } sony; -+ struct jvc_dec { -+ int state; -+ u16 bits; -+ u16 old_bits; -+ unsigned count; -+ bool first; -+ bool toggle; -+ } jvc; -+ struct lirc_codec { -+ struct ir_input_dev *ir_dev; -+ struct lirc_driver *drv; -+ int lircdata; -+ } lirc; - }; - - /* macros for IR decoders */ -@@ -74,6 +119,7 @@ void ir_unregister_class(struct input_dev *input_dev); - /* - * Routines from ir-raw-event.c to be used internally and by decoders - */ -+u64 ir_raw_get_allowed_protocols(void); - int ir_raw_event_register(struct input_dev *input_dev); - void ir_raw_event_unregister(struct input_dev *input_dev); - int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler); -@@ -123,4 +169,12 @@ void ir_raw_init(void); - #define load_sony_decode() 0 - #endif - -+/* from ir-lirc-codec.c */ -+#ifdef CONFIG_IR_LIRC_CODEC_MODULE -+#define load_lirc_codec() request_module("ir-lirc-codec") -+#else -+#define load_lirc_codec() 0 -+#endif -+ -+ - #endif /* _IR_RAW_EVENT */ -diff --git a/drivers/media/IR/ir-jvc-decoder.c b/drivers/media/IR/ir-jvc-decoder.c -index 0b80494..8894d8b 100644 ---- a/drivers/media/IR/ir-jvc-decoder.c -+++ b/drivers/media/IR/ir-jvc-decoder.c -@@ -25,10 +25,6 @@ - #define JVC_TRAILER_PULSE (1 * JVC_UNIT) - #define JVC_TRAILER_SPACE (35 * JVC_UNIT) - --/* Used to register jvc_decoder clients */ --static LIST_HEAD(decoder_list); --DEFINE_SPINLOCK(decoder_lock); -- - enum jvc_state { - STATE_INACTIVE, - STATE_HEADER_SPACE, -@@ -38,87 +34,6 @@ enum jvc_state { - STATE_TRAILER_SPACE, - }; - --struct decoder_data { -- struct list_head list; -- struct ir_input_dev *ir_dev; -- int enabled:1; -- -- /* State machine control */ -- enum jvc_state state; -- u16 jvc_bits; -- u16 jvc_old_bits; -- unsigned count; -- bool first; -- bool toggle; --}; -- -- --/** -- * get_decoder_data() - gets decoder data -- * @input_dev: input device -- * -- * Returns the struct decoder_data that corresponds to a device -- */ --static struct decoder_data *get_decoder_data(struct ir_input_dev *ir_dev) --{ -- struct decoder_data *data = NULL; -- -- spin_lock(&decoder_lock); -- list_for_each_entry(data, &decoder_list, list) { -- if (data->ir_dev == ir_dev) -- break; -- } -- spin_unlock(&decoder_lock); -- return data; --} -- --static ssize_t store_enabled(struct device *d, -- struct device_attribute *mattr, -- const char *buf, -- size_t len) --{ -- unsigned long value; -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (strict_strtoul(buf, 10, &value) || value > 1) -- return -EINVAL; -- -- data->enabled = value; -- -- return len; --} -- --static ssize_t show_enabled(struct device *d, -- struct device_attribute *mattr, char *buf) --{ -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (data->enabled) -- return sprintf(buf, "1\n"); -- else -- return sprintf(buf, "0\n"); --} -- --static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, show_enabled, store_enabled); -- --static struct attribute *decoder_attributes[] = { -- &dev_attr_enabled.attr, -- NULL --}; -- --static struct attribute_group decoder_attribute_group = { -- .name = "jvc_decoder", -- .attrs = decoder_attributes, --}; -- - /** - * ir_jvc_decode() - Decode one JVC pulse or space - * @input_dev: the struct input_dev descriptor of the device -@@ -128,14 +43,10 @@ static struct attribute_group decoder_attribute_group = { - */ - static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) - { -- struct decoder_data *data; - struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct jvc_dec *data = &ir_dev->raw->jvc; - -- data = get_decoder_data(ir_dev); -- if (!data) -- return -EINVAL; -- -- if (!data->enabled) -+ if (!(ir_dev->raw->enabled_protocols & IR_TYPE_JVC)) - return 0; - - if (IS_RESET(ev)) { -@@ -188,9 +99,9 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) - if (ev.pulse) - break; - -- data->jvc_bits <<= 1; -+ data->bits <<= 1; - if (eq_margin(ev.duration, JVC_BIT_1_SPACE, JVC_UNIT / 2)) { -- data->jvc_bits |= 1; -+ data->bits |= 1; - decrease_duration(&ev, JVC_BIT_1_SPACE); - } else if (eq_margin(ev.duration, JVC_BIT_0_SPACE, JVC_UNIT / 2)) - decrease_duration(&ev, JVC_BIT_0_SPACE); -@@ -223,13 +134,13 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) - - if (data->first) { - u32 scancode; -- scancode = (bitrev8((data->jvc_bits >> 8) & 0xff) << 8) | -- (bitrev8((data->jvc_bits >> 0) & 0xff) << 0); -+ scancode = (bitrev8((data->bits >> 8) & 0xff) << 8) | -+ (bitrev8((data->bits >> 0) & 0xff) << 0); - IR_dprintk(1, "JVC scancode 0x%04x\n", scancode); - ir_keydown(input_dev, scancode, data->toggle); - data->first = false; -- data->jvc_old_bits = data->jvc_bits; -- } else if (data->jvc_bits == data->jvc_old_bits) { -+ data->old_bits = data->bits; -+ } else if (data->bits == data->old_bits) { - IR_dprintk(1, "JVC repeat\n"); - ir_repeat(input_dev); - } else { -@@ -249,54 +160,9 @@ out: - return -EINVAL; - } - --static int ir_jvc_register(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- struct decoder_data *data; -- int rc; -- -- rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- if (rc < 0) -- return rc; -- -- data = kzalloc(sizeof(*data), GFP_KERNEL); -- if (!data) { -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- return -ENOMEM; -- } -- -- data->ir_dev = ir_dev; -- data->enabled = 1; -- -- spin_lock(&decoder_lock); -- list_add_tail(&data->list, &decoder_list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- --static int ir_jvc_unregister(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- static struct decoder_data *data; -- -- data = get_decoder_data(ir_dev); -- if (!data) -- return 0; -- -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- -- spin_lock(&decoder_lock); -- list_del(&data->list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- - static struct ir_raw_handler jvc_handler = { -+ .protocols = IR_TYPE_JVC, - .decode = ir_jvc_decode, -- .raw_register = ir_jvc_register, -- .raw_unregister = ir_jvc_unregister, - }; - - static int __init ir_jvc_decode_init(void) -diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c -new file mode 100644 -index 0000000..afb1ada ---- /dev/null -+++ b/drivers/media/IR/ir-lirc-codec.c -@@ -0,0 +1,283 @@ -+/* ir-lirc-codec.c - ir-core to classic lirc interface bridge -+ * -+ * Copyright (C) 2010 by Jarod Wilson -+ * -+ * 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 version 2 of the License. -+ * -+ * 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. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include "ir-core-priv.h" -+ -+#define LIRCBUF_SIZE 256 -+ -+/** -+ * ir_lirc_decode() - Send raw IR data to lirc_dev to be relayed to the -+ * lircd userspace daemon for decoding. -+ * @input_dev: the struct input_dev descriptor of the device -+ * @duration: the struct ir_raw_event descriptor of the pulse/space -+ * -+ * This function returns -EINVAL if the lirc interfaces aren't wired up. -+ */ -+static int ir_lirc_decode(struct input_dev *input_dev, struct ir_raw_event ev) -+{ -+ struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ -+ if (!(ir_dev->raw->enabled_protocols & IR_TYPE_LIRC)) -+ return 0; -+ -+ if (!ir_dev->raw->lirc.drv || !ir_dev->raw->lirc.drv->rbuf) -+ return -EINVAL; -+ -+ IR_dprintk(2, "LIRC data transfer started (%uus %s)\n", -+ TO_US(ev.duration), TO_STR(ev.pulse)); -+ -+ ir_dev->raw->lirc.lircdata += ev.duration / 1000; -+ if (ev.pulse) -+ ir_dev->raw->lirc.lircdata |= PULSE_BIT; -+ -+ lirc_buffer_write(ir_dev->raw->lirc.drv->rbuf, -+ (unsigned char *) &ir_dev->raw->lirc.lircdata); -+ wake_up(&ir_dev->raw->lirc.drv->rbuf->wait_poll); -+ -+ ir_dev->raw->lirc.lircdata = 0; -+ -+ return 0; -+} -+ -+static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf, -+ size_t n, loff_t *ppos) -+{ -+ struct lirc_codec *lirc; -+ struct ir_input_dev *ir_dev; -+ int *txbuf; /* buffer with values to transmit */ -+ int ret = 0, count; -+ -+ lirc = lirc_get_pdata(file); -+ if (!lirc) -+ return -EFAULT; -+ -+ if (n % sizeof(int)) -+ return -EINVAL; -+ -+ count = n / sizeof(int); -+ if (count > LIRCBUF_SIZE || count % 2 == 0) -+ return -EINVAL; -+ -+ txbuf = kzalloc(sizeof(int) * LIRCBUF_SIZE, GFP_KERNEL); -+ if (!txbuf) -+ return -ENOMEM; -+ -+ if (copy_from_user(txbuf, buf, n)) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ ir_dev = lirc->ir_dev; -+ if (!ir_dev) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ if (ir_dev->props && ir_dev->props->tx_ir) -+ ret = ir_dev->props->tx_ir(ir_dev->props->priv, txbuf, (u32)n); -+ -+out: -+ kfree(txbuf); -+ return ret; -+} -+ -+static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) -+{ -+ struct lirc_codec *lirc; -+ struct ir_input_dev *ir_dev; -+ int ret = 0; -+ void *drv_data; -+ unsigned long val; -+ -+ lirc = lirc_get_pdata(filep); -+ if (!lirc) -+ return -EFAULT; -+ -+ ir_dev = lirc->ir_dev; -+ if (!ir_dev || !ir_dev->props || !ir_dev->props->priv) -+ return -EFAULT; -+ -+ drv_data = ir_dev->props->priv; -+ -+ switch (cmd) { -+ case LIRC_SET_TRANSMITTER_MASK: -+ ret = get_user(val, (unsigned long *)arg); -+ if (ret) -+ return ret; -+ -+ if (ir_dev->props && ir_dev->props->s_tx_mask) -+ ret = ir_dev->props->s_tx_mask(drv_data, (u32)val); -+ else -+ return -EINVAL; -+ break; -+ -+ case LIRC_SET_SEND_CARRIER: -+ ret = get_user(val, (unsigned long *)arg); -+ if (ret) -+ return ret; -+ -+ if (ir_dev->props && ir_dev->props->s_tx_carrier) -+ ir_dev->props->s_tx_carrier(drv_data, (u32)val); -+ else -+ return -EINVAL; -+ break; -+ -+ case LIRC_GET_SEND_MODE: -+ val = LIRC_CAN_SEND_PULSE & LIRC_CAN_SEND_MASK; -+ ret = put_user(val, (unsigned long *)arg); -+ break; -+ -+ case LIRC_SET_SEND_MODE: -+ ret = get_user(val, (unsigned long *)arg); -+ if (ret) -+ return ret; -+ -+ if (val != (LIRC_MODE_PULSE & LIRC_CAN_SEND_MASK)) -+ return -EINVAL; -+ break; -+ -+ default: -+ return lirc_dev_fop_ioctl(filep, cmd, arg); -+ } -+ -+ return ret; -+} -+ -+static int ir_lirc_open(void *data) -+{ -+ return 0; -+} -+ -+static void ir_lirc_close(void *data) -+{ -+ return; -+} -+ -+static struct file_operations lirc_fops = { -+ .owner = THIS_MODULE, -+ .write = ir_lirc_transmit_ir, -+ .unlocked_ioctl = ir_lirc_ioctl, -+ .read = lirc_dev_fop_read, -+ .poll = lirc_dev_fop_poll, -+ .open = lirc_dev_fop_open, -+ .release = lirc_dev_fop_close, -+}; -+ -+static int ir_lirc_register(struct input_dev *input_dev) -+{ -+ struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct lirc_driver *drv; -+ struct lirc_buffer *rbuf; -+ int rc = -ENOMEM; -+ unsigned long features; -+ -+ drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); -+ if (!drv) -+ return rc; -+ -+ rbuf = kzalloc(sizeof(struct lirc_buffer), GFP_KERNEL); -+ if (!drv) -+ goto rbuf_alloc_failed; -+ -+ rc = lirc_buffer_init(rbuf, sizeof(int), LIRCBUF_SIZE); -+ if (rc) -+ goto rbuf_init_failed; -+ -+ features = LIRC_CAN_REC_MODE2; -+ if (ir_dev->props->tx_ir) { -+ features |= LIRC_CAN_SEND_PULSE; -+ if (ir_dev->props->s_tx_mask) -+ features |= LIRC_CAN_SET_TRANSMITTER_MASK; -+ if (ir_dev->props->s_tx_carrier) -+ features |= LIRC_CAN_SET_SEND_CARRIER; -+ } -+ -+ snprintf(drv->name, sizeof(drv->name), "ir-lirc-codec (%s)", -+ ir_dev->driver_name); -+ drv->minor = -1; -+ drv->features = features; -+ drv->data = &ir_dev->raw->lirc; -+ drv->rbuf = rbuf; -+ drv->set_use_inc = &ir_lirc_open; -+ drv->set_use_dec = &ir_lirc_close; -+ drv->code_length = sizeof(struct ir_raw_event) * 8; -+ drv->fops = &lirc_fops; -+ drv->dev = &ir_dev->dev; -+ drv->owner = THIS_MODULE; -+ -+ drv->minor = lirc_register_driver(drv); -+ if (drv->minor < 0) { -+ rc = -ENODEV; -+ goto lirc_register_failed; -+ } -+ -+ ir_dev->raw->lirc.drv = drv; -+ ir_dev->raw->lirc.ir_dev = ir_dev; -+ ir_dev->raw->lirc.lircdata = PULSE_MASK; -+ -+ return 0; -+ -+lirc_register_failed: -+rbuf_init_failed: -+ kfree(rbuf); -+rbuf_alloc_failed: -+ kfree(drv); -+ -+ return rc; -+} -+ -+static int ir_lirc_unregister(struct input_dev *input_dev) -+{ -+ struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct lirc_codec *lirc = &ir_dev->raw->lirc; -+ -+ lirc_unregister_driver(lirc->drv->minor); -+ lirc_buffer_free(lirc->drv->rbuf); -+ kfree(lirc->drv); -+ -+ return 0; -+} -+ -+static struct ir_raw_handler lirc_handler = { -+ .protocols = IR_TYPE_LIRC, -+ .decode = ir_lirc_decode, -+ .raw_register = ir_lirc_register, -+ .raw_unregister = ir_lirc_unregister, -+}; -+ -+static int __init ir_lirc_codec_init(void) -+{ -+ ir_raw_handler_register(&lirc_handler); -+ -+ printk(KERN_INFO "IR LIRC bridge handler initialized\n"); -+ return 0; -+} -+ -+static void __exit ir_lirc_codec_exit(void) -+{ -+ ir_raw_handler_unregister(&lirc_handler); -+} -+ -+module_init(ir_lirc_codec_init); -+module_exit(ir_lirc_codec_exit); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jarod Wilson "); -+MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)"); -+MODULE_DESCRIPTION("LIRC IR handler bridge"); -diff --git a/drivers/media/IR/ir-nec-decoder.c b/drivers/media/IR/ir-nec-decoder.c -index ba79233..52e0f37 100644 ---- a/drivers/media/IR/ir-nec-decoder.c -+++ b/drivers/media/IR/ir-nec-decoder.c -@@ -27,10 +27,6 @@ - #define NEC_TRAILER_PULSE (1 * NEC_UNIT) - #define NEC_TRAILER_SPACE (10 * NEC_UNIT) /* even longer in reality */ - --/* Used to register nec_decoder clients */ --static LIST_HEAD(decoder_list); --static DEFINE_SPINLOCK(decoder_lock); -- - enum nec_state { - STATE_INACTIVE, - STATE_HEADER_SPACE, -@@ -40,84 +36,6 @@ enum nec_state { - STATE_TRAILER_SPACE, - }; - --struct decoder_data { -- struct list_head list; -- struct ir_input_dev *ir_dev; -- int enabled:1; -- -- /* State machine control */ -- enum nec_state state; -- u32 nec_bits; -- unsigned count; --}; -- -- --/** -- * get_decoder_data() - gets decoder data -- * @input_dev: input device -- * -- * Returns the struct decoder_data that corresponds to a device -- */ --static struct decoder_data *get_decoder_data(struct ir_input_dev *ir_dev) --{ -- struct decoder_data *data = NULL; -- -- spin_lock(&decoder_lock); -- list_for_each_entry(data, &decoder_list, list) { -- if (data->ir_dev == ir_dev) -- break; -- } -- spin_unlock(&decoder_lock); -- return data; --} -- --static ssize_t store_enabled(struct device *d, -- struct device_attribute *mattr, -- const char *buf, -- size_t len) --{ -- unsigned long value; -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (strict_strtoul(buf, 10, &value) || value > 1) -- return -EINVAL; -- -- data->enabled = value; -- -- return len; --} -- --static ssize_t show_enabled(struct device *d, -- struct device_attribute *mattr, char *buf) --{ -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (data->enabled) -- return sprintf(buf, "1\n"); -- else -- return sprintf(buf, "0\n"); --} -- --static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, show_enabled, store_enabled); -- --static struct attribute *decoder_attributes[] = { -- &dev_attr_enabled.attr, -- NULL --}; -- --static struct attribute_group decoder_attribute_group = { -- .name = "nec_decoder", -- .attrs = decoder_attributes, --}; -- - /** - * ir_nec_decode() - Decode one NEC pulse or space - * @input_dev: the struct input_dev descriptor of the device -@@ -127,16 +45,12 @@ static struct attribute_group decoder_attribute_group = { - */ - static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev) - { -- struct decoder_data *data; - struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct nec_dec *data = &ir_dev->raw->nec; - u32 scancode; - u8 address, not_address, command, not_command; - -- data = get_decoder_data(ir_dev); -- if (!data) -- return -EINVAL; -- -- if (!data->enabled) -+ if (!(ir_dev->raw->enabled_protocols & IR_TYPE_NEC)) - return 0; - - if (IS_RESET(ev)) { -@@ -191,9 +105,9 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev) - if (ev.pulse) - break; - -- data->nec_bits <<= 1; -+ data->bits <<= 1; - if (eq_margin(ev.duration, NEC_BIT_1_SPACE, NEC_UNIT / 2)) -- data->nec_bits |= 1; -+ data->bits |= 1; - else if (!eq_margin(ev.duration, NEC_BIT_0_SPACE, NEC_UNIT / 2)) - break; - data->count++; -@@ -222,14 +136,14 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev) - if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2)) - break; - -- address = bitrev8((data->nec_bits >> 24) & 0xff); -- not_address = bitrev8((data->nec_bits >> 16) & 0xff); -- command = bitrev8((data->nec_bits >> 8) & 0xff); -- not_command = bitrev8((data->nec_bits >> 0) & 0xff); -+ address = bitrev8((data->bits >> 24) & 0xff); -+ not_address = bitrev8((data->bits >> 16) & 0xff); -+ command = bitrev8((data->bits >> 8) & 0xff); -+ not_command = bitrev8((data->bits >> 0) & 0xff); - - if ((command ^ not_command) != 0xff) { - IR_dprintk(1, "NEC checksum error: received 0x%08x\n", -- data->nec_bits); -+ data->bits); - break; - } - -@@ -256,54 +170,9 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev) - return -EINVAL; - } - --static int ir_nec_register(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- struct decoder_data *data; -- int rc; -- -- rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- if (rc < 0) -- return rc; -- -- data = kzalloc(sizeof(*data), GFP_KERNEL); -- if (!data) { -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- return -ENOMEM; -- } -- -- data->ir_dev = ir_dev; -- data->enabled = 1; -- -- spin_lock(&decoder_lock); -- list_add_tail(&data->list, &decoder_list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- --static int ir_nec_unregister(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- static struct decoder_data *data; -- -- data = get_decoder_data(ir_dev); -- if (!data) -- return 0; -- -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- -- spin_lock(&decoder_lock); -- list_del(&data->list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- - static struct ir_raw_handler nec_handler = { -+ .protocols = IR_TYPE_NEC, - .decode = ir_nec_decode, -- .raw_register = ir_nec_register, -- .raw_unregister = ir_nec_unregister, - }; - - static int __init ir_nec_decode_init(void) -diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c -index ea68a3f..6f192ef 100644 ---- a/drivers/media/IR/ir-raw-event.c -+++ b/drivers/media/IR/ir-raw-event.c -@@ -20,35 +20,13 @@ - /* Define the max number of pulse/space transitions to buffer */ - #define MAX_IR_EVENT_SIZE 512 - -+/* Used to keep track of IR raw clients, protected by ir_raw_handler_lock */ -+static LIST_HEAD(ir_raw_client_list); -+ - /* Used to handle IR raw handler extensions */ --static LIST_HEAD(ir_raw_handler_list); - static DEFINE_SPINLOCK(ir_raw_handler_lock); -- --/** -- * RUN_DECODER() - runs an operation on all IR decoders -- * @ops: IR raw handler operation to be called -- * @arg: arguments to be passed to the callback -- * -- * Calls ir_raw_handler::ops for all registered IR handlers. It prevents -- * new decode addition/removal while running, by locking ir_raw_handler_lock -- * mutex. If an error occurs, it stops the ops. Otherwise, it returns a sum -- * of the return codes. -- */ --#define RUN_DECODER(ops, ...) ({ \ -- struct ir_raw_handler *_ir_raw_handler; \ -- int _sumrc = 0, _rc; \ -- spin_lock(&ir_raw_handler_lock); \ -- list_for_each_entry(_ir_raw_handler, &ir_raw_handler_list, list) { \ -- if (_ir_raw_handler->ops) { \ -- _rc = _ir_raw_handler->ops(__VA_ARGS__); \ -- if (_rc < 0) \ -- break; \ -- _sumrc += _rc; \ -- } \ -- } \ -- spin_unlock(&ir_raw_handler_lock); \ -- _sumrc; \ --}) -+static LIST_HEAD(ir_raw_handler_list); -+static u64 available_protocols; - - #ifdef MODULE - /* Used to load the decoders */ -@@ -58,57 +36,17 @@ static struct work_struct wq_load; - static void ir_raw_event_work(struct work_struct *work) - { - struct ir_raw_event ev; -+ struct ir_raw_handler *handler; - struct ir_raw_event_ctrl *raw = - container_of(work, struct ir_raw_event_ctrl, rx_work); - -- while (kfifo_out(&raw->kfifo, &ev, sizeof(ev)) == sizeof(ev)) -- RUN_DECODER(decode, raw->input_dev, ev); --} -- --int ir_raw_event_register(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir = input_get_drvdata(input_dev); -- int rc; -- -- ir->raw = kzalloc(sizeof(*ir->raw), GFP_KERNEL); -- if (!ir->raw) -- return -ENOMEM; -- -- ir->raw->input_dev = input_dev; -- INIT_WORK(&ir->raw->rx_work, ir_raw_event_work); -- -- rc = kfifo_alloc(&ir->raw->kfifo, sizeof(s64) * MAX_IR_EVENT_SIZE, -- GFP_KERNEL); -- if (rc < 0) { -- kfree(ir->raw); -- ir->raw = NULL; -- return rc; -- } -- -- rc = RUN_DECODER(raw_register, input_dev); -- if (rc < 0) { -- kfifo_free(&ir->raw->kfifo); -- kfree(ir->raw); -- ir->raw = NULL; -- return rc; -+ while (kfifo_out(&raw->kfifo, &ev, sizeof(ev)) == sizeof(ev)) { -+ spin_lock(&ir_raw_handler_lock); -+ list_for_each_entry(handler, &ir_raw_handler_list, list) -+ handler->decode(raw->input_dev, ev); -+ spin_unlock(&ir_raw_handler_lock); -+ raw->prev_ev = ev; - } -- -- return rc; --} -- --void ir_raw_event_unregister(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir = input_get_drvdata(input_dev); -- -- if (!ir->raw) -- return; -- -- cancel_work_sync(&ir->raw->rx_work); -- RUN_DECODER(raw_unregister, input_dev); -- -- kfifo_free(&ir->raw->kfifo); -- kfree(ir->raw); -- ir->raw = NULL; - } - - /** -@@ -204,23 +142,103 @@ void ir_raw_event_handle(struct input_dev *input_dev) - } - EXPORT_SYMBOL_GPL(ir_raw_event_handle); - -+/* used internally by the sysfs interface */ -+u64 -+ir_raw_get_allowed_protocols() -+{ -+ u64 protocols; -+ spin_lock(&ir_raw_handler_lock); -+ protocols = available_protocols; -+ spin_unlock(&ir_raw_handler_lock); -+ return protocols; -+} -+ -+/* -+ * Used to (un)register raw event clients -+ */ -+int ir_raw_event_register(struct input_dev *input_dev) -+{ -+ struct ir_input_dev *ir = input_get_drvdata(input_dev); -+ int rc; -+ struct ir_raw_handler *handler; -+ -+ ir->raw = kzalloc(sizeof(*ir->raw), GFP_KERNEL); -+ if (!ir->raw) -+ return -ENOMEM; -+ -+ ir->raw->input_dev = input_dev; -+ INIT_WORK(&ir->raw->rx_work, ir_raw_event_work); -+ ir->raw->enabled_protocols = ~0; -+ rc = kfifo_alloc(&ir->raw->kfifo, sizeof(s64) * MAX_IR_EVENT_SIZE, -+ GFP_KERNEL); -+ if (rc < 0) { -+ kfree(ir->raw); -+ ir->raw = NULL; -+ return rc; -+ } -+ -+ spin_lock(&ir_raw_handler_lock); -+ list_add_tail(&ir->raw->list, &ir_raw_client_list); -+ list_for_each_entry(handler, &ir_raw_handler_list, list) -+ if (handler->raw_register) -+ handler->raw_register(ir->raw->input_dev); -+ spin_unlock(&ir_raw_handler_lock); -+ -+ return 0; -+} -+ -+void ir_raw_event_unregister(struct input_dev *input_dev) -+{ -+ struct ir_input_dev *ir = input_get_drvdata(input_dev); -+ struct ir_raw_handler *handler; -+ -+ if (!ir->raw) -+ return; -+ -+ cancel_work_sync(&ir->raw->rx_work); -+ -+ spin_lock(&ir_raw_handler_lock); -+ list_del(&ir->raw->list); -+ list_for_each_entry(handler, &ir_raw_handler_list, list) -+ if (handler->raw_unregister) -+ handler->raw_unregister(ir->raw->input_dev); -+ spin_unlock(&ir_raw_handler_lock); -+ -+ kfifo_free(&ir->raw->kfifo); -+ kfree(ir->raw); -+ ir->raw = NULL; -+} -+ - /* - * Extension interface - used to register the IR decoders - */ - - int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler) - { -+ struct ir_raw_event_ctrl *raw; -+ - spin_lock(&ir_raw_handler_lock); - list_add_tail(&ir_raw_handler->list, &ir_raw_handler_list); -+ if (ir_raw_handler->raw_register) -+ list_for_each_entry(raw, &ir_raw_client_list, list) -+ ir_raw_handler->raw_register(raw->input_dev); -+ available_protocols |= ir_raw_handler->protocols; - spin_unlock(&ir_raw_handler_lock); -+ - return 0; - } - EXPORT_SYMBOL(ir_raw_handler_register); - - void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) - { -+ struct ir_raw_event_ctrl *raw; -+ - spin_lock(&ir_raw_handler_lock); - list_del(&ir_raw_handler->list); -+ if (ir_raw_handler->raw_unregister) -+ list_for_each_entry(raw, &ir_raw_client_list, list) -+ ir_raw_handler->raw_unregister(raw->input_dev); -+ available_protocols &= ~ir_raw_handler->protocols; - spin_unlock(&ir_raw_handler_lock); - } - EXPORT_SYMBOL(ir_raw_handler_unregister); -@@ -235,6 +253,7 @@ static void init_decoders(struct work_struct *work) - load_rc6_decode(); - load_jvc_decode(); - load_sony_decode(); -+ load_lirc_codec(); - - /* If needed, we may later add some init code. In this case, - it is needed to change the CONFIG_MODULE test at ir-core.h -diff --git a/drivers/media/IR/ir-rc5-decoder.c b/drivers/media/IR/ir-rc5-decoder.c -index 23cdb1b..df4770d 100644 ---- a/drivers/media/IR/ir-rc5-decoder.c -+++ b/drivers/media/IR/ir-rc5-decoder.c -@@ -30,10 +30,6 @@ - #define RC5_BIT_END (1 * RC5_UNIT) - #define RC5X_SPACE (4 * RC5_UNIT) - --/* Used to register rc5_decoder clients */ --static LIST_HEAD(decoder_list); --static DEFINE_SPINLOCK(decoder_lock); -- - enum rc5_state { - STATE_INACTIVE, - STATE_BIT_START, -@@ -42,87 +38,6 @@ enum rc5_state { - STATE_FINISHED, - }; - --struct decoder_data { -- struct list_head list; -- struct ir_input_dev *ir_dev; -- int enabled:1; -- -- /* State machine control */ -- enum rc5_state state; -- u32 rc5_bits; -- struct ir_raw_event prev_ev; -- unsigned count; -- unsigned wanted_bits; --}; -- -- --/** -- * get_decoder_data() - gets decoder data -- * @input_dev: input device -- * -- * Returns the struct decoder_data that corresponds to a device -- */ -- --static struct decoder_data *get_decoder_data(struct ir_input_dev *ir_dev) --{ -- struct decoder_data *data = NULL; -- -- spin_lock(&decoder_lock); -- list_for_each_entry(data, &decoder_list, list) { -- if (data->ir_dev == ir_dev) -- break; -- } -- spin_unlock(&decoder_lock); -- return data; --} -- --static ssize_t store_enabled(struct device *d, -- struct device_attribute *mattr, -- const char *buf, -- size_t len) --{ -- unsigned long value; -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (strict_strtoul(buf, 10, &value) || value > 1) -- return -EINVAL; -- -- data->enabled = value; -- -- return len; --} -- --static ssize_t show_enabled(struct device *d, -- struct device_attribute *mattr, char *buf) --{ -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (data->enabled) -- return sprintf(buf, "1\n"); -- else -- return sprintf(buf, "0\n"); --} -- --static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, show_enabled, store_enabled); -- --static struct attribute *decoder_attributes[] = { -- &dev_attr_enabled.attr, -- NULL --}; -- --static struct attribute_group decoder_attribute_group = { -- .name = "rc5_decoder", -- .attrs = decoder_attributes, --}; -- - /** - * ir_rc5_decode() - Decode one RC-5 pulse or space - * @input_dev: the struct input_dev descriptor of the device -@@ -132,17 +47,13 @@ static struct attribute_group decoder_attribute_group = { - */ - static int ir_rc5_decode(struct input_dev *input_dev, struct ir_raw_event ev) - { -- struct decoder_data *data; - struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct rc5_dec *data = &ir_dev->raw->rc5; - u8 toggle; - u32 scancode; - -- data = get_decoder_data(ir_dev); -- if (!data) -- return -EINVAL; -- -- if (!data->enabled) -- return 0; -+ if (!(ir_dev->raw->enabled_protocols & IR_TYPE_RC5)) -+ return 0; - - if (IS_RESET(ev)) { - data->state = STATE_INACTIVE; -@@ -176,16 +87,15 @@ again: - if (!eq_margin(ev.duration, RC5_BIT_START, RC5_UNIT / 2)) - break; - -- data->rc5_bits <<= 1; -+ data->bits <<= 1; - if (!ev.pulse) -- data->rc5_bits |= 1; -+ data->bits |= 1; - data->count++; -- data->prev_ev = ev; - data->state = STATE_BIT_END; - return 0; - - case STATE_BIT_END: -- if (!is_transition(&ev, &data->prev_ev)) -+ if (!is_transition(&ev, &ir_dev->raw->prev_ev)) - break; - - if (data->count == data->wanted_bits) -@@ -217,11 +127,11 @@ again: - if (data->wanted_bits == RC5X_NBITS) { - /* RC5X */ - u8 xdata, command, system; -- xdata = (data->rc5_bits & 0x0003F) >> 0; -- command = (data->rc5_bits & 0x00FC0) >> 6; -- system = (data->rc5_bits & 0x1F000) >> 12; -- toggle = (data->rc5_bits & 0x20000) ? 1 : 0; -- command += (data->rc5_bits & 0x01000) ? 0 : 0x40; -+ xdata = (data->bits & 0x0003F) >> 0; -+ command = (data->bits & 0x00FC0) >> 6; -+ system = (data->bits & 0x1F000) >> 12; -+ toggle = (data->bits & 0x20000) ? 1 : 0; -+ command += (data->bits & 0x01000) ? 0 : 0x40; - scancode = system << 16 | command << 8 | xdata; - - IR_dprintk(1, "RC5X scancode 0x%06x (toggle: %u)\n", -@@ -230,10 +140,10 @@ again: - } else { - /* RC5 */ - u8 command, system; -- command = (data->rc5_bits & 0x0003F) >> 0; -- system = (data->rc5_bits & 0x007C0) >> 6; -- toggle = (data->rc5_bits & 0x00800) ? 1 : 0; -- command += (data->rc5_bits & 0x01000) ? 0 : 0x40; -+ command = (data->bits & 0x0003F) >> 0; -+ system = (data->bits & 0x007C0) >> 6; -+ toggle = (data->bits & 0x00800) ? 1 : 0; -+ command += (data->bits & 0x01000) ? 0 : 0x40; - scancode = system << 8 | command; - - IR_dprintk(1, "RC5 scancode 0x%04x (toggle: %u)\n", -@@ -252,54 +162,9 @@ out: - return -EINVAL; - } - --static int ir_rc5_register(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- struct decoder_data *data; -- int rc; -- -- rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- if (rc < 0) -- return rc; -- -- data = kzalloc(sizeof(*data), GFP_KERNEL); -- if (!data) { -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- return -ENOMEM; -- } -- -- data->ir_dev = ir_dev; -- data->enabled = 1; -- -- spin_lock(&decoder_lock); -- list_add_tail(&data->list, &decoder_list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- --static int ir_rc5_unregister(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- static struct decoder_data *data; -- -- data = get_decoder_data(ir_dev); -- if (!data) -- return 0; -- -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- -- spin_lock(&decoder_lock); -- list_del(&data->list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- - static struct ir_raw_handler rc5_handler = { -+ .protocols = IR_TYPE_RC5, - .decode = ir_rc5_decode, -- .raw_register = ir_rc5_register, -- .raw_unregister = ir_rc5_unregister, - }; - - static int __init ir_rc5_decode_init(void) -diff --git a/drivers/media/IR/ir-rc6-decoder.c b/drivers/media/IR/ir-rc6-decoder.c -index 2bf479f..f1624b8 100644 ---- a/drivers/media/IR/ir-rc6-decoder.c -+++ b/drivers/media/IR/ir-rc6-decoder.c -@@ -36,10 +36,6 @@ - #define RC6_STARTBIT_MASK 0x08 /* for the header bits */ - #define RC6_6A_MCE_TOGGLE_MASK 0x8000 /* for the body bits */ - --/* Used to register rc6_decoder clients */ --static LIST_HEAD(decoder_list); --static DEFINE_SPINLOCK(decoder_lock); -- - enum rc6_mode { - RC6_MODE_0, - RC6_MODE_6A, -@@ -58,89 +54,8 @@ enum rc6_state { - STATE_FINISHED, - }; - --struct decoder_data { -- struct list_head list; -- struct ir_input_dev *ir_dev; -- int enabled:1; -- -- /* State machine control */ -- enum rc6_state state; -- u8 header; -- u32 body; -- struct ir_raw_event prev_ev; -- bool toggle; -- unsigned count; -- unsigned wanted_bits; --}; -- -- --/** -- * get_decoder_data() - gets decoder data -- * @input_dev: input device -- * -- * Returns the struct decoder_data that corresponds to a device -- */ --static struct decoder_data *get_decoder_data(struct ir_input_dev *ir_dev) --{ -- struct decoder_data *data = NULL; -- -- spin_lock(&decoder_lock); -- list_for_each_entry(data, &decoder_list, list) { -- if (data->ir_dev == ir_dev) -- break; -- } -- spin_unlock(&decoder_lock); -- return data; --} -- --static ssize_t store_enabled(struct device *d, -- struct device_attribute *mattr, -- const char *buf, -- size_t len) -+static enum rc6_mode rc6_mode(struct rc6_dec *data) - { -- unsigned long value; -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (strict_strtoul(buf, 10, &value) || value > 1) -- return -EINVAL; -- -- data->enabled = value; -- -- return len; --} -- --static ssize_t show_enabled(struct device *d, -- struct device_attribute *mattr, char *buf) --{ -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (data->enabled) -- return sprintf(buf, "1\n"); -- else -- return sprintf(buf, "0\n"); --} -- --static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, show_enabled, store_enabled); -- --static struct attribute *decoder_attributes[] = { -- &dev_attr_enabled.attr, -- NULL --}; -- --static struct attribute_group decoder_attribute_group = { -- .name = "rc6_decoder", -- .attrs = decoder_attributes, --}; -- --static enum rc6_mode rc6_mode(struct decoder_data *data) { - switch (data->header & RC6_MODE_MASK) { - case 0: - return RC6_MODE_0; -@@ -162,16 +77,12 @@ static enum rc6_mode rc6_mode(struct decoder_data *data) { - */ - static int ir_rc6_decode(struct input_dev *input_dev, struct ir_raw_event ev) - { -- struct decoder_data *data; - struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct rc6_dec *data = &ir_dev->raw->rc6; - u32 scancode; - u8 toggle; - -- data = get_decoder_data(ir_dev); -- if (!data) -- return -EINVAL; -- -- if (!data->enabled) -+ if (!(ir_dev->raw->enabled_protocols & IR_TYPE_RC6)) - return 0; - - if (IS_RESET(ev)) { -@@ -223,12 +134,11 @@ again: - if (ev.pulse) - data->header |= 1; - data->count++; -- data->prev_ev = ev; - data->state = STATE_HEADER_BIT_END; - return 0; - - case STATE_HEADER_BIT_END: -- if (!is_transition(&ev, &data->prev_ev)) -+ if (!is_transition(&ev, &ir_dev->raw->prev_ev)) - break; - - if (data->count == RC6_HEADER_NBITS) -@@ -244,12 +154,11 @@ again: - break; - - data->toggle = ev.pulse; -- data->prev_ev = ev; - data->state = STATE_TOGGLE_END; - return 0; - - case STATE_TOGGLE_END: -- if (!is_transition(&ev, &data->prev_ev) || -+ if (!is_transition(&ev, &ir_dev->raw->prev_ev) || - !geq_margin(ev.duration, RC6_TOGGLE_END, RC6_UNIT / 2)) - break; - -@@ -259,7 +168,6 @@ again: - } - - data->state = STATE_BODY_BIT_START; -- data->prev_ev = ev; - decrease_duration(&ev, RC6_TOGGLE_END); - data->count = 0; - -@@ -291,13 +199,11 @@ again: - if (ev.pulse) - data->body |= 1; - data->count++; -- data->prev_ev = ev; -- - data->state = STATE_BODY_BIT_END; - return 0; - - case STATE_BODY_BIT_END: -- if (!is_transition(&ev, &data->prev_ev)) -+ if (!is_transition(&ev, &ir_dev->raw->prev_ev)) - break; - - if (data->count == data->wanted_bits) -@@ -348,54 +254,9 @@ out: - return -EINVAL; - } - --static int ir_rc6_register(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- struct decoder_data *data; -- int rc; -- -- rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- if (rc < 0) -- return rc; -- -- data = kzalloc(sizeof(*data), GFP_KERNEL); -- if (!data) { -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- return -ENOMEM; -- } -- -- data->ir_dev = ir_dev; -- data->enabled = 1; -- -- spin_lock(&decoder_lock); -- list_add_tail(&data->list, &decoder_list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- --static int ir_rc6_unregister(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- static struct decoder_data *data; -- -- data = get_decoder_data(ir_dev); -- if (!data) -- return 0; -- -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- -- spin_lock(&decoder_lock); -- list_del(&data->list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- - static struct ir_raw_handler rc6_handler = { -+ .protocols = IR_TYPE_RC6, - .decode = ir_rc6_decode, -- .raw_register = ir_rc6_register, -- .raw_unregister = ir_rc6_unregister, - }; - - static int __init ir_rc6_decode_init(void) -diff --git a/drivers/media/IR/ir-sony-decoder.c b/drivers/media/IR/ir-sony-decoder.c -index 9f440c5..b9074f0 100644 ---- a/drivers/media/IR/ir-sony-decoder.c -+++ b/drivers/media/IR/ir-sony-decoder.c -@@ -23,10 +23,6 @@ - #define SONY_BIT_SPACE (1 * SONY_UNIT) - #define SONY_TRAILER_SPACE (10 * SONY_UNIT) /* minimum */ - --/* Used to register sony_decoder clients */ --static LIST_HEAD(decoder_list); --static DEFINE_SPINLOCK(decoder_lock); -- - enum sony_state { - STATE_INACTIVE, - STATE_HEADER_SPACE, -@@ -35,84 +31,6 @@ enum sony_state { - STATE_FINISHED, - }; - --struct decoder_data { -- struct list_head list; -- struct ir_input_dev *ir_dev; -- int enabled:1; -- -- /* State machine control */ -- enum sony_state state; -- u32 sony_bits; -- unsigned count; --}; -- -- --/** -- * get_decoder_data() - gets decoder data -- * @input_dev: input device -- * -- * Returns the struct decoder_data that corresponds to a device -- */ --static struct decoder_data *get_decoder_data(struct ir_input_dev *ir_dev) --{ -- struct decoder_data *data = NULL; -- -- spin_lock(&decoder_lock); -- list_for_each_entry(data, &decoder_list, list) { -- if (data->ir_dev == ir_dev) -- break; -- } -- spin_unlock(&decoder_lock); -- return data; --} -- --static ssize_t store_enabled(struct device *d, -- struct device_attribute *mattr, -- const char *buf, -- size_t len) --{ -- unsigned long value; -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (strict_strtoul(buf, 10, &value) || value > 1) -- return -EINVAL; -- -- data->enabled = value; -- -- return len; --} -- --static ssize_t show_enabled(struct device *d, -- struct device_attribute *mattr, char *buf) --{ -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- struct decoder_data *data = get_decoder_data(ir_dev); -- -- if (!data) -- return -EINVAL; -- -- if (data->enabled) -- return sprintf(buf, "1\n"); -- else -- return sprintf(buf, "0\n"); --} -- --static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, show_enabled, store_enabled); -- --static struct attribute *decoder_attributes[] = { -- &dev_attr_enabled.attr, -- NULL --}; -- --static struct attribute_group decoder_attribute_group = { -- .name = "sony_decoder", -- .attrs = decoder_attributes, --}; -- - /** - * ir_sony_decode() - Decode one Sony pulse or space - * @input_dev: the struct input_dev descriptor of the device -@@ -122,16 +40,12 @@ static struct attribute_group decoder_attribute_group = { - */ - static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev) - { -- struct decoder_data *data; - struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -+ struct sony_dec *data = &ir_dev->raw->sony; - u32 scancode; - u8 device, subdevice, function; - -- data = get_decoder_data(ir_dev); -- if (!data) -- return -EINVAL; -- -- if (!data->enabled) -+ if (!(ir_dev->raw->enabled_protocols & IR_TYPE_SONY)) - return 0; - - if (IS_RESET(ev)) { -@@ -172,9 +86,9 @@ static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev) - if (!ev.pulse) - break; - -- data->sony_bits <<= 1; -+ data->bits <<= 1; - if (eq_margin(ev.duration, SONY_BIT_1_PULSE, SONY_UNIT / 2)) -- data->sony_bits |= 1; -+ data->bits |= 1; - else if (!eq_margin(ev.duration, SONY_BIT_0_PULSE, SONY_UNIT / 2)) - break; - -@@ -208,19 +122,19 @@ static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev) - - switch (data->count) { - case 12: -- device = bitrev8((data->sony_bits << 3) & 0xF8); -+ device = bitrev8((data->bits << 3) & 0xF8); - subdevice = 0; -- function = bitrev8((data->sony_bits >> 4) & 0xFE); -+ function = bitrev8((data->bits >> 4) & 0xFE); - break; - case 15: -- device = bitrev8((data->sony_bits >> 0) & 0xFF); -+ device = bitrev8((data->bits >> 0) & 0xFF); - subdevice = 0; -- function = bitrev8((data->sony_bits >> 7) & 0xFD); -+ function = bitrev8((data->bits >> 7) & 0xFD); - break; - case 20: -- device = bitrev8((data->sony_bits >> 5) & 0xF8); -- subdevice = bitrev8((data->sony_bits >> 0) & 0xFF); -- function = bitrev8((data->sony_bits >> 12) & 0xFE); -+ device = bitrev8((data->bits >> 5) & 0xF8); -+ subdevice = bitrev8((data->bits >> 0) & 0xFF); -+ function = bitrev8((data->bits >> 12) & 0xFE); - break; - default: - IR_dprintk(1, "Sony invalid bitcount %u\n", data->count); -@@ -241,54 +155,9 @@ out: - return -EINVAL; - } - --static int ir_sony_register(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- struct decoder_data *data; -- int rc; -- -- rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- if (rc < 0) -- return rc; -- -- data = kzalloc(sizeof(*data), GFP_KERNEL); -- if (!data) { -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- return -ENOMEM; -- } -- -- data->ir_dev = ir_dev; -- data->enabled = 1; -- -- spin_lock(&decoder_lock); -- list_add_tail(&data->list, &decoder_list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- --static int ir_sony_unregister(struct input_dev *input_dev) --{ -- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); -- static struct decoder_data *data; -- -- data = get_decoder_data(ir_dev); -- if (!data) -- return 0; -- -- sysfs_remove_group(&ir_dev->dev.kobj, &decoder_attribute_group); -- -- spin_lock(&decoder_lock); -- list_del(&data->list); -- spin_unlock(&decoder_lock); -- -- return 0; --} -- - static struct ir_raw_handler sony_handler = { -+ .protocols = IR_TYPE_SONY, - .decode = ir_sony_decode, -- .raw_register = ir_sony_register, -- .raw_unregister = ir_sony_unregister, - }; - - static int __init ir_sony_decode_init(void) -diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c -index 2098dd1..a841e51 100644 ---- a/drivers/media/IR/ir-sysfs.c -+++ b/drivers/media/IR/ir-sysfs.c -@@ -34,122 +34,186 @@ static struct class ir_input_class = { - }; - - /** -- * show_protocol() - shows the current IR protocol -+ * show_protocols() - shows the current IR protocol(s) - * @d: the device descriptor - * @mattr: the device attribute struct (unused) - * @buf: a pointer to the output buffer - * -- * This routine is a callback routine for input read the IR protocol type. -- * it is trigged by reading /sys/class/rc/rc?/current_protocol. -- * It returns the protocol name, as understood by the driver. -+ * This routine is a callback routine for input read the IR protocol type(s). -+ * it is trigged by reading /sys/class/rc/rc?/protocols. -+ * It returns the protocol names of supported protocols. -+ * Enabled protocols are printed in brackets. - */ --static ssize_t show_protocol(struct device *d, -- struct device_attribute *mattr, char *buf) -+static ssize_t show_protocols(struct device *d, -+ struct device_attribute *mattr, char *buf) - { -- char *s; - struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- u64 ir_type = ir_dev->rc_tab.ir_type; -- -- IR_dprintk(1, "Current protocol is %lld\n", (long long)ir_type); -- -- /* FIXME: doesn't support multiple protocols at the same time */ -- if (ir_type == IR_TYPE_UNKNOWN) -- s = "Unknown"; -- else if (ir_type == IR_TYPE_RC5) -- s = "rc-5"; -- else if (ir_type == IR_TYPE_NEC) -- s = "nec"; -- else if (ir_type == IR_TYPE_RC6) -- s = "rc6"; -- else if (ir_type == IR_TYPE_JVC) -- s = "jvc"; -- else if (ir_type == IR_TYPE_SONY) -- s = "sony"; -- else -- s = "other"; -+ u64 allowed, enabled; -+ char *tmp = buf; -+ -+ if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) { -+ enabled = ir_dev->rc_tab.ir_type; -+ allowed = ir_dev->props->allowed_protos; -+ } else { -+ enabled = ir_dev->raw->enabled_protocols; -+ allowed = ir_raw_get_allowed_protocols(); -+ } - -- return sprintf(buf, "%s\n", s); -+ IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n", -+ (long long)allowed, -+ (long long)enabled); -+ -+ if (allowed & enabled & IR_TYPE_UNKNOWN) -+ tmp += sprintf(tmp, "[unknown] "); -+ else if (allowed & IR_TYPE_UNKNOWN) -+ tmp += sprintf(tmp, "unknown "); -+ -+ if (allowed & enabled & IR_TYPE_RC5) -+ tmp += sprintf(tmp, "[rc5] "); -+ else if (allowed & IR_TYPE_RC5) -+ tmp += sprintf(tmp, "rc5 "); -+ -+ if (allowed & enabled & IR_TYPE_NEC) -+ tmp += sprintf(tmp, "[nec] "); -+ else if (allowed & IR_TYPE_NEC) -+ tmp += sprintf(tmp, "nec "); -+ -+ if (allowed & enabled & IR_TYPE_RC6) -+ tmp += sprintf(tmp, "[rc6] "); -+ else if (allowed & IR_TYPE_RC6) -+ tmp += sprintf(tmp, "rc6 "); -+ -+ if (allowed & enabled & IR_TYPE_JVC) -+ tmp += sprintf(tmp, "[jvc] "); -+ else if (allowed & IR_TYPE_JVC) -+ tmp += sprintf(tmp, "jvc "); -+ -+ if (allowed & enabled & IR_TYPE_SONY) -+ tmp += sprintf(tmp, "[sony] "); -+ else if (allowed & IR_TYPE_SONY) -+ tmp += sprintf(tmp, "sony "); -+ -+ if (allowed & enabled & IR_TYPE_LIRC) -+ tmp += sprintf(tmp, "[lirc] "); -+ else if (allowed & IR_TYPE_LIRC) -+ tmp += sprintf(tmp, "lirc "); -+ -+ if (tmp != buf) -+ tmp--; -+ *tmp = '\n'; -+ return tmp + 1 - buf; - } - - /** -- * store_protocol() - shows the current IR protocol -+ * store_protocols() - changes the current IR protocol(s) - * @d: the device descriptor - * @mattr: the device attribute struct (unused) - * @buf: a pointer to the input buffer - * @len: length of the input buffer - * - * This routine is a callback routine for changing the IR protocol type. -- * it is trigged by reading /sys/class/rc/rc?/current_protocol. -- * It changes the IR the protocol name, if the IR type is recognized -- * by the driver. -- * If an unknown protocol name is used, returns -EINVAL. -+ * It is trigged by writing to /sys/class/rc/rc?/protocols. -+ * Writing "+proto" will add a protocol to the list of enabled protocols. -+ * Writing "-proto" will remove a protocol from the list of enabled protocols. -+ * Writing "proto" will enable only "proto". -+ * Returns -EINVAL if an invalid protocol combination or unknown protocol name -+ * is used, otherwise @len. - */ --static ssize_t store_protocol(struct device *d, -- struct device_attribute *mattr, -- const char *data, -- size_t len) -+static ssize_t store_protocols(struct device *d, -+ struct device_attribute *mattr, -+ const char *data, -+ size_t len) - { - struct ir_input_dev *ir_dev = dev_get_drvdata(d); -- u64 ir_type = 0; -- int rc = -EINVAL; -+ bool enable, disable; -+ const char *tmp; -+ u64 type; -+ u64 mask; -+ int rc; - unsigned long flags; -- char *buf; -- -- while ((buf = strsep((char **) &data, " \n")) != NULL) { -- if (!strcasecmp(buf, "rc-5") || !strcasecmp(buf, "rc5")) -- ir_type |= IR_TYPE_RC5; -- if (!strcasecmp(buf, "nec")) -- ir_type |= IR_TYPE_NEC; -- if (!strcasecmp(buf, "jvc")) -- ir_type |= IR_TYPE_JVC; -- if (!strcasecmp(buf, "sony")) -- ir_type |= IR_TYPE_SONY; -+ -+ tmp = skip_spaces(data); -+ -+ if (*tmp == '+') { -+ enable = true; -+ disable = false; -+ tmp++; -+ } else if (*tmp == '-') { -+ enable = false; -+ disable = true; -+ tmp++; -+ } else { -+ enable = false; -+ disable = false; - } - -- if (!ir_type) { -+ if (!strncasecmp(tmp, "unknown", 7)) { -+ tmp += 7; -+ mask = IR_TYPE_UNKNOWN; -+ } else if (!strncasecmp(tmp, "rc5", 3)) { -+ tmp += 3; -+ mask = IR_TYPE_RC5; -+ } else if (!strncasecmp(tmp, "nec", 3)) { -+ tmp += 3; -+ mask = IR_TYPE_NEC; -+ } else if (!strncasecmp(tmp, "rc6", 3)) { -+ tmp += 3; -+ mask = IR_TYPE_RC6; -+ } else if (!strncasecmp(tmp, "jvc", 3)) { -+ tmp += 3; -+ mask = IR_TYPE_JVC; -+ } else if (!strncasecmp(tmp, "sony", 4)) { -+ tmp += 4; -+ mask = IR_TYPE_SONY; -+ } else if (!strncasecmp(tmp, "lirc", 4)) { -+ tmp += 4; -+ mask = IR_TYPE_LIRC; -+ } else { - IR_dprintk(1, "Unknown protocol\n"); - return -EINVAL; - } - -- if (ir_dev->props && ir_dev->props->change_protocol) -- rc = ir_dev->props->change_protocol(ir_dev->props->priv, -- ir_type); -- -- if (rc < 0) { -- IR_dprintk(1, "Error setting protocol to %lld\n", -- (long long)ir_type); -+ tmp = skip_spaces(tmp); -+ if (*tmp != '\0') { -+ IR_dprintk(1, "Invalid trailing characters\n"); - return -EINVAL; - } - -- spin_lock_irqsave(&ir_dev->rc_tab.lock, flags); -- ir_dev->rc_tab.ir_type = ir_type; -- spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); -+ if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) -+ type = ir_dev->rc_tab.ir_type; -+ else -+ type = ir_dev->raw->enabled_protocols; - -- IR_dprintk(1, "Current protocol(s) is(are) %lld\n", -- (long long)ir_type); -+ if (enable) -+ type |= mask; -+ else if (disable) -+ type &= ~mask; -+ else -+ type = mask; - -- return len; --} -+ if (ir_dev->props && ir_dev->props->change_protocol) { -+ rc = ir_dev->props->change_protocol(ir_dev->props->priv, -+ type); -+ if (rc < 0) { -+ IR_dprintk(1, "Error setting protocols to 0x%llx\n", -+ (long long)type); -+ return -EINVAL; -+ } -+ } - --static ssize_t show_supported_protocols(struct device *d, -- struct device_attribute *mattr, char *buf) --{ -- char *orgbuf = buf; -- struct ir_input_dev *ir_dev = dev_get_drvdata(d); -+ if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) { -+ spin_lock_irqsave(&ir_dev->rc_tab.lock, flags); -+ ir_dev->rc_tab.ir_type = type; -+ spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); -+ } else { -+ ir_dev->raw->enabled_protocols = type; -+ } - -- /* FIXME: doesn't support multiple protocols at the same time */ -- if (ir_dev->props->allowed_protos == IR_TYPE_UNKNOWN) -- buf += sprintf(buf, "unknown "); -- if (ir_dev->props->allowed_protos & IR_TYPE_RC5) -- buf += sprintf(buf, "rc-5 "); -- if (ir_dev->props->allowed_protos & IR_TYPE_NEC) -- buf += sprintf(buf, "nec "); -- if (buf == orgbuf) -- buf += sprintf(buf, "other "); - -- buf += sprintf(buf - 1, "\n"); -+ IR_dprintk(1, "Current protocol(s): 0x%llx\n", -+ (long long)type); - -- return buf - orgbuf; -+ return len; - } - - #define ADD_HOTPLUG_VAR(fmt, val...) \ -@@ -159,7 +223,7 @@ static ssize_t show_supported_protocols(struct device *d, - return err; \ - } while (0) - --static int ir_dev_uevent(struct device *device, struct kobj_uevent_env *env) -+static int rc_dev_uevent(struct device *device, struct kobj_uevent_env *env) - { - struct ir_input_dev *ir_dev = dev_get_drvdata(device); - -@@ -174,34 +238,26 @@ static int ir_dev_uevent(struct device *device, struct kobj_uevent_env *env) - /* - * Static device attribute struct with the sysfs attributes for IR's - */ --static DEVICE_ATTR(protocol, S_IRUGO | S_IWUSR, -- show_protocol, store_protocol); -- --static DEVICE_ATTR(supported_protocols, S_IRUGO | S_IWUSR, -- show_supported_protocols, NULL); -+static DEVICE_ATTR(protocols, S_IRUGO | S_IWUSR, -+ show_protocols, store_protocols); - --static struct attribute *ir_hw_dev_attrs[] = { -- &dev_attr_protocol.attr, -- &dev_attr_supported_protocols.attr, -+static struct attribute *rc_dev_attrs[] = { -+ &dev_attr_protocols.attr, - NULL, - }; - --static struct attribute_group ir_hw_dev_attr_grp = { -- .attrs = ir_hw_dev_attrs, -+static struct attribute_group rc_dev_attr_grp = { -+ .attrs = rc_dev_attrs, - }; - --static const struct attribute_group *ir_hw_dev_attr_groups[] = { -- &ir_hw_dev_attr_grp, -+static const struct attribute_group *rc_dev_attr_groups[] = { -+ &rc_dev_attr_grp, - NULL - }; - - static struct device_type rc_dev_type = { -- .groups = ir_hw_dev_attr_groups, -- .uevent = ir_dev_uevent, --}; -- --static struct device_type ir_raw_dev_type = { -- .uevent = ir_dev_uevent, -+ .groups = rc_dev_attr_groups, -+ .uevent = rc_dev_uevent, - }; - - /** -@@ -221,12 +277,7 @@ int ir_register_class(struct input_dev *input_dev) - if (unlikely(devno < 0)) - return devno; - -- if (ir_dev->props) { -- if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) -- ir_dev->dev.type = &rc_dev_type; -- } else -- ir_dev->dev.type = &ir_raw_dev_type; -- -+ ir_dev->dev.type = &rc_dev_type; - ir_dev->dev.class = &ir_input_class; - ir_dev->dev.parent = input_dev->dev.parent; - dev_set_name(&ir_dev->dev, "rc%d", devno); -diff --git a/drivers/media/IR/keymaps/Makefile b/drivers/media/IR/keymaps/Makefile -index aea649f..86d3d1f 100644 ---- a/drivers/media/IR/keymaps/Makefile -+++ b/drivers/media/IR/keymaps/Makefile -@@ -37,6 +37,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ - rc-kaiomy.o \ - rc-kworld-315u.o \ - rc-kworld-plus-tv-analog.o \ -+ rc-lirc.o \ - rc-manli.o \ - rc-msi-tvanywhere.o \ - rc-msi-tvanywhere-plus.o \ -@@ -57,6 +58,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ - rc-pv951.o \ - rc-rc5-hauppauge-new.o \ - rc-rc5-tv.o \ -+ rc-rc6-mce.o \ - rc-real-audio-220-32-keys.o \ - rc-tbs-nec.o \ - rc-terratec-cinergy-xs.o \ -diff --git a/drivers/media/IR/keymaps/rc-lirc.c b/drivers/media/IR/keymaps/rc-lirc.c -new file mode 100644 -index 0000000..43fcf90 ---- /dev/null -+++ b/drivers/media/IR/keymaps/rc-lirc.c -@@ -0,0 +1,41 @@ -+/* rc-lirc.c - Empty dummy keytable, for use when its preferred to pass -+ * all raw IR data to the lirc userspace decoder. -+ * -+ * Copyright (c) 2010 by Jarod Wilson -+ * -+ * 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. -+ */ -+ -+#include -+ -+static struct ir_scancode lirc[] = { -+ { }, -+}; -+ -+static struct rc_keymap lirc_map = { -+ .map = { -+ .scan = lirc, -+ .size = ARRAY_SIZE(lirc), -+ .ir_type = IR_TYPE_LIRC, -+ .name = RC_MAP_LIRC, -+ } -+}; -+ -+static int __init init_rc_map_lirc(void) -+{ -+ return ir_register_map(&lirc_map); -+} -+ -+static void __exit exit_rc_map_lirc(void) -+{ -+ ir_unregister_map(&lirc_map); -+} -+ -+module_init(init_rc_map_lirc) -+module_exit(exit_rc_map_lirc) -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jarod Wilson "); -diff --git a/drivers/media/IR/keymaps/rc-rc6-mce.c b/drivers/media/IR/keymaps/rc-rc6-mce.c -new file mode 100644 -index 0000000..c6726a8 ---- /dev/null -+++ b/drivers/media/IR/keymaps/rc-rc6-mce.c -@@ -0,0 +1,105 @@ -+/* rc-rc6-mce.c - Keytable for Windows Media Center RC-6 remotes for use -+ * with the Media Center Edition eHome Infrared Transceiver. -+ * -+ * Copyright (c) 2010 by Jarod Wilson -+ * -+ * 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. -+ */ -+ -+#include -+ -+static struct ir_scancode rc6_mce[] = { -+ { 0x800f0415, KEY_REWIND }, -+ { 0x800f0414, KEY_FASTFORWARD }, -+ { 0x800f041b, KEY_PREVIOUS }, -+ { 0x800f041a, KEY_NEXT }, -+ -+ { 0x800f0416, KEY_PLAY }, -+ { 0x800f0418, KEY_PAUSE }, -+ { 0x800f0419, KEY_STOP }, -+ { 0x800f0417, KEY_RECORD }, -+ -+ { 0x800f041e, KEY_UP }, -+ { 0x800f041f, KEY_DOWN }, -+ { 0x800f0420, KEY_LEFT }, -+ { 0x800f0421, KEY_RIGHT }, -+ -+ { 0x800f040b, KEY_ENTER }, -+ { 0x800f0422, KEY_OK }, -+ { 0x800f0423, KEY_EXIT }, -+ { 0x800f040a, KEY_DELETE }, -+ -+ { 0x800f040e, KEY_MUTE }, -+ { 0x800f0410, KEY_VOLUMEUP }, -+ { 0x800f0411, KEY_VOLUMEDOWN }, -+ { 0x800f0412, KEY_CHANNELUP }, -+ { 0x800f0413, KEY_CHANNELDOWN }, -+ -+ { 0x800f0401, KEY_NUMERIC_1 }, -+ { 0x800f0402, KEY_NUMERIC_2 }, -+ { 0x800f0403, KEY_NUMERIC_3 }, -+ { 0x800f0404, KEY_NUMERIC_4 }, -+ { 0x800f0405, KEY_NUMERIC_5 }, -+ { 0x800f0406, KEY_NUMERIC_6 }, -+ { 0x800f0407, KEY_NUMERIC_7 }, -+ { 0x800f0408, KEY_NUMERIC_8 }, -+ { 0x800f0409, KEY_NUMERIC_9 }, -+ { 0x800f0400, KEY_NUMERIC_0 }, -+ -+ { 0x800f041d, KEY_NUMERIC_STAR }, -+ { 0x800f041c, KEY_NUMERIC_POUND }, -+ -+ { 0x800f0446, KEY_TV }, -+ { 0x800f0447, KEY_AUDIO }, /* My Music */ -+ { 0x800f0448, KEY_PVR }, /* RecordedTV */ -+ { 0x800f0449, KEY_CAMERA }, -+ { 0x800f044a, KEY_VIDEO }, -+ { 0x800f0424, KEY_DVD }, -+ { 0x800f0425, KEY_TUNER }, /* LiveTV */ -+ { 0x800f0450, KEY_RADIO }, -+ -+ { 0x800f044c, KEY_LANGUAGE }, -+ { 0x800f0427, KEY_ZOOM }, /* Aspect */ -+ -+ { 0x800f045b, KEY_RED }, -+ { 0x800f045c, KEY_GREEN }, -+ { 0x800f045d, KEY_YELLOW }, -+ { 0x800f045e, KEY_BLUE }, -+ -+ { 0x800f040f, KEY_INFO }, -+ { 0x800f0426, KEY_EPG }, /* Guide */ -+ { 0x800f045a, KEY_SUBTITLE }, /* Caption/Teletext */ -+ { 0x800f044d, KEY_TITLE }, -+ -+ { 0x800f040c, KEY_POWER }, -+ { 0x800f040d, KEY_PROG1 }, /* Windows MCE button */ -+ -+}; -+ -+static struct rc_keymap rc6_mce_map = { -+ .map = { -+ .scan = rc6_mce, -+ .size = ARRAY_SIZE(rc6_mce), -+ .ir_type = IR_TYPE_RC6, -+ .name = RC_MAP_RC6_MCE, -+ } -+}; -+ -+static int __init init_rc_map_rc6_mce(void) -+{ -+ return ir_register_map(&rc6_mce_map); -+} -+ -+static void __exit exit_rc_map_rc6_mce(void) -+{ -+ ir_unregister_map(&rc6_mce_map); -+} -+ -+module_init(init_rc_map_rc6_mce) -+module_exit(exit_rc_map_rc6_mce) -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jarod Wilson "); -diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c -new file mode 100644 -index 0000000..899891b ---- /dev/null -+++ b/drivers/media/IR/lirc_dev.c -@@ -0,0 +1,764 @@ -+/* -+ * LIRC base driver -+ * -+ * by Artur Lipowski -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+static int debug; -+ -+#define IRCTL_DEV_NAME "BaseRemoteCtl" -+#define NOPLUG -1 -+#define LOGHEAD "lirc_dev (%s[%d]): " -+ -+static dev_t lirc_base_dev; -+ -+struct irctl { -+ struct lirc_driver d; -+ int attached; -+ int open; -+ -+ struct mutex irctl_lock; -+ struct lirc_buffer *buf; -+ unsigned int chunk_size; -+ -+ struct task_struct *task; -+ long jiffies_to_wait; -+ -+ struct cdev cdev; -+}; -+ -+static DEFINE_MUTEX(lirc_dev_lock); -+ -+static struct irctl *irctls[MAX_IRCTL_DEVICES]; -+ -+/* Only used for sysfs but defined to void otherwise */ -+static struct class *lirc_class; -+ -+/* helper function -+ * initializes the irctl structure -+ */ -+static void init_irctl(struct irctl *ir) -+{ -+ dev_dbg(ir->d.dev, LOGHEAD "initializing irctl\n", -+ ir->d.name, ir->d.minor); -+ mutex_init(&ir->irctl_lock); -+ ir->d.minor = NOPLUG; -+} -+ -+static void cleanup(struct irctl *ir) -+{ -+ dev_dbg(ir->d.dev, LOGHEAD "cleaning up\n", ir->d.name, ir->d.minor); -+ -+ device_destroy(lirc_class, MKDEV(MAJOR(lirc_base_dev), ir->d.minor)); -+ -+ if (ir->buf != ir->d.rbuf) { -+ lirc_buffer_free(ir->buf); -+ kfree(ir->buf); -+ } -+ ir->buf = NULL; -+} -+ -+/* helper function -+ * reads key codes from driver and puts them into buffer -+ * returns 0 on success -+ */ -+static int add_to_buf(struct irctl *ir) -+{ -+ if (ir->d.add_to_buf) { -+ int res = -ENODATA; -+ int got_data = 0; -+ -+ /* -+ * service the device as long as it is returning -+ * data and we have space -+ */ -+get_data: -+ res = ir->d.add_to_buf(ir->d.data, ir->buf); -+ if (res == 0) { -+ got_data++; -+ goto get_data; -+ } -+ -+ if (res == -ENODEV) -+ kthread_stop(ir->task); -+ -+ return got_data ? 0 : res; -+ } -+ -+ return 0; -+} -+ -+/* main function of the polling thread -+ */ -+static int lirc_thread(void *irctl) -+{ -+ struct irctl *ir = irctl; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "poll thread started\n", -+ ir->d.name, ir->d.minor); -+ -+ do { -+ if (ir->open) { -+ if (ir->jiffies_to_wait) { -+ set_current_state(TASK_INTERRUPTIBLE); -+ schedule_timeout(ir->jiffies_to_wait); -+ } -+ if (kthread_should_stop()) -+ break; -+ if (!add_to_buf(ir)) -+ wake_up_interruptible(&ir->buf->wait_poll); -+ } else { -+ set_current_state(TASK_INTERRUPTIBLE); -+ schedule(); -+ } -+ } while (!kthread_should_stop()); -+ -+ dev_dbg(ir->d.dev, LOGHEAD "poll thread ended\n", -+ ir->d.name, ir->d.minor); -+ -+ return 0; -+} -+ -+ -+static struct file_operations fops = { -+ .owner = THIS_MODULE, -+ .read = lirc_dev_fop_read, -+ .write = lirc_dev_fop_write, -+ .poll = lirc_dev_fop_poll, -+ .unlocked_ioctl = lirc_dev_fop_ioctl, -+ .open = lirc_dev_fop_open, -+ .release = lirc_dev_fop_close, -+}; -+ -+static int lirc_cdev_add(struct irctl *ir) -+{ -+ int retval; -+ struct lirc_driver *d = &ir->d; -+ -+ if (d->fops) { -+ cdev_init(&ir->cdev, d->fops); -+ ir->cdev.owner = d->owner; -+ } else { -+ cdev_init(&ir->cdev, &fops); -+ ir->cdev.owner = THIS_MODULE; -+ } -+ kobject_set_name(&ir->cdev.kobj, "lirc%d", d->minor); -+ -+ retval = cdev_add(&ir->cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1); -+ if (retval) -+ kobject_put(&ir->cdev.kobj); -+ -+ return retval; -+} -+ -+int lirc_register_driver(struct lirc_driver *d) -+{ -+ struct irctl *ir; -+ int minor; -+ int bytes_in_key; -+ unsigned int chunk_size; -+ unsigned int buffer_size; -+ int err; -+ -+ if (!d) { -+ printk(KERN_ERR "lirc_dev: lirc_register_driver: " -+ "driver pointer must be not NULL!\n"); -+ err = -EBADRQC; -+ goto out; -+ } -+ -+ if (MAX_IRCTL_DEVICES <= d->minor) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "\"minor\" must be between 0 and %d (%d)!\n", -+ MAX_IRCTL_DEVICES-1, d->minor); -+ err = -EBADRQC; -+ goto out; -+ } -+ -+ if (1 > d->code_length || (BUFLEN * 8) < d->code_length) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "code length in bits for minor (%d) " -+ "must be less than %d!\n", -+ d->minor, BUFLEN * 8); -+ err = -EBADRQC; -+ goto out; -+ } -+ -+ dev_dbg(d->dev, "lirc_dev: lirc_register_driver: sample_rate: %d\n", -+ d->sample_rate); -+ if (d->sample_rate) { -+ if (2 > d->sample_rate || HZ < d->sample_rate) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "sample_rate must be between 2 and %d!\n", HZ); -+ err = -EBADRQC; -+ goto out; -+ } -+ if (!d->add_to_buf) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "add_to_buf cannot be NULL when " -+ "sample_rate is set\n"); -+ err = -EBADRQC; -+ goto out; -+ } -+ } else if (!(d->fops && d->fops->read) && !d->rbuf) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "fops->read and rbuf cannot all be NULL!\n"); -+ err = -EBADRQC; -+ goto out; -+ } else if (!d->rbuf) { -+ if (!(d->fops && d->fops->read && d->fops->poll && -+ d->fops->unlocked_ioctl)) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "neither read, poll nor unlocked_ioctl can be NULL!\n"); -+ err = -EBADRQC; -+ goto out; -+ } -+ } -+ -+ mutex_lock(&lirc_dev_lock); -+ -+ minor = d->minor; -+ -+ if (minor < 0) { -+ /* find first free slot for driver */ -+ for (minor = 0; minor < MAX_IRCTL_DEVICES; minor++) -+ if (!irctls[minor]) -+ break; -+ if (MAX_IRCTL_DEVICES == minor) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "no free slots for drivers!\n"); -+ err = -ENOMEM; -+ goto out_lock; -+ } -+ } else if (irctls[minor]) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "minor (%d) just registered!\n", minor); -+ err = -EBUSY; -+ goto out_lock; -+ } -+ -+ ir = kzalloc(sizeof(struct irctl), GFP_KERNEL); -+ if (!ir) { -+ err = -ENOMEM; -+ goto out_lock; -+ } -+ init_irctl(ir); -+ irctls[minor] = ir; -+ d->minor = minor; -+ -+ if (d->sample_rate) { -+ ir->jiffies_to_wait = HZ / d->sample_rate; -+ } else { -+ /* it means - wait for external event in task queue */ -+ ir->jiffies_to_wait = 0; -+ } -+ -+ /* some safety check 8-) */ -+ d->name[sizeof(d->name)-1] = '\0'; -+ -+ bytes_in_key = BITS_TO_LONGS(d->code_length) + -+ (d->code_length % 8 ? 1 : 0); -+ buffer_size = d->buffer_size ? d->buffer_size : BUFLEN / bytes_in_key; -+ chunk_size = d->chunk_size ? d->chunk_size : bytes_in_key; -+ -+ if (d->rbuf) { -+ ir->buf = d->rbuf; -+ } else { -+ ir->buf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); -+ if (!ir->buf) { -+ err = -ENOMEM; -+ goto out_lock; -+ } -+ err = lirc_buffer_init(ir->buf, chunk_size, buffer_size); -+ if (err) { -+ kfree(ir->buf); -+ goto out_lock; -+ } -+ } -+ ir->chunk_size = ir->buf->chunk_size; -+ -+ if (d->features == 0) -+ d->features = LIRC_CAN_REC_LIRCCODE; -+ -+ ir->d = *d; -+ ir->d.minor = minor; -+ -+ device_create(lirc_class, ir->d.dev, -+ MKDEV(MAJOR(lirc_base_dev), ir->d.minor), NULL, -+ "lirc%u", ir->d.minor); -+ -+ if (d->sample_rate) { -+ /* try to fire up polling thread */ -+ ir->task = kthread_run(lirc_thread, (void *)ir, "lirc_dev"); -+ if (IS_ERR(ir->task)) { -+ dev_err(d->dev, "lirc_dev: lirc_register_driver: " -+ "cannot run poll thread for minor = %d\n", -+ d->minor); -+ err = -ECHILD; -+ goto out_sysfs; -+ } -+ } -+ -+ err = lirc_cdev_add(ir); -+ if (err) -+ goto out_sysfs; -+ -+ ir->attached = 1; -+ mutex_unlock(&lirc_dev_lock); -+ -+ dev_info(ir->d.dev, "lirc_dev: driver %s registered at minor = %d\n", -+ ir->d.name, ir->d.minor); -+ return minor; -+ -+out_sysfs: -+ device_destroy(lirc_class, MKDEV(MAJOR(lirc_base_dev), ir->d.minor)); -+out_lock: -+ mutex_unlock(&lirc_dev_lock); -+out: -+ return err; -+} -+EXPORT_SYMBOL(lirc_register_driver); -+ -+int lirc_unregister_driver(int minor) -+{ -+ struct irctl *ir; -+ -+ if (minor < 0 || minor >= MAX_IRCTL_DEVICES) { -+ printk(KERN_ERR "lirc_dev: lirc_unregister_driver: " -+ "\"minor (%d)\" must be between 0 and %d!\n", -+ minor, MAX_IRCTL_DEVICES-1); -+ return -EBADRQC; -+ } -+ -+ ir = irctls[minor]; -+ -+ mutex_lock(&lirc_dev_lock); -+ -+ if (ir->d.minor != minor) { -+ printk(KERN_ERR "lirc_dev: lirc_unregister_driver: " -+ "minor (%d) device not registered!", minor); -+ mutex_unlock(&lirc_dev_lock); -+ return -ENOENT; -+ } -+ -+ /* end up polling thread */ -+ if (ir->task) -+ kthread_stop(ir->task); -+ -+ dev_dbg(ir->d.dev, "lirc_dev: driver %s unregistered from minor = %d\n", -+ ir->d.name, ir->d.minor); -+ -+ ir->attached = 0; -+ if (ir->open) { -+ dev_dbg(ir->d.dev, LOGHEAD "releasing opened driver\n", -+ ir->d.name, ir->d.minor); -+ wake_up_interruptible(&ir->buf->wait_poll); -+ mutex_lock(&ir->irctl_lock); -+ ir->d.set_use_dec(ir->d.data); -+ module_put(ir->d.owner); -+ mutex_unlock(&ir->irctl_lock); -+ cdev_del(&ir->cdev); -+ } else { -+ cleanup(ir); -+ cdev_del(&ir->cdev); -+ kfree(ir); -+ irctls[minor] = NULL; -+ } -+ -+ mutex_unlock(&lirc_dev_lock); -+ -+ return 0; -+} -+EXPORT_SYMBOL(lirc_unregister_driver); -+ -+int lirc_dev_fop_open(struct inode *inode, struct file *file) -+{ -+ struct irctl *ir; -+ int retval = 0; -+ -+ if (iminor(inode) >= MAX_IRCTL_DEVICES) { -+ printk(KERN_WARNING "lirc_dev [%d]: open result = -ENODEV\n", -+ iminor(inode)); -+ return -ENODEV; -+ } -+ -+ if (mutex_lock_interruptible(&lirc_dev_lock)) -+ return -ERESTARTSYS; -+ -+ ir = irctls[iminor(inode)]; -+ if (!ir) { -+ retval = -ENODEV; -+ goto error; -+ } -+ file->private_data = ir; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "open called\n", ir->d.name, ir->d.minor); -+ -+ if (ir->d.minor == NOPLUG) { -+ retval = -ENODEV; -+ goto error; -+ } -+ -+ if (ir->open) { -+ retval = -EBUSY; -+ goto error; -+ } -+ -+ if (try_module_get(ir->d.owner)) { -+ ++ir->open; -+ retval = ir->d.set_use_inc(ir->d.data); -+ -+ if (retval) { -+ module_put(ir->d.owner); -+ --ir->open; -+ } else { -+ lirc_buffer_clear(ir->buf); -+ } -+ if (ir->task) -+ wake_up_process(ir->task); -+ } -+ -+error: -+ if (ir) -+ dev_dbg(ir->d.dev, LOGHEAD "open result = %d\n", -+ ir->d.name, ir->d.minor, retval); -+ -+ mutex_unlock(&lirc_dev_lock); -+ -+ return retval; -+} -+EXPORT_SYMBOL(lirc_dev_fop_open); -+ -+int lirc_dev_fop_close(struct inode *inode, struct file *file) -+{ -+ struct irctl *ir = irctls[iminor(inode)]; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "close called\n", ir->d.name, ir->d.minor); -+ -+ WARN_ON(mutex_lock_killable(&lirc_dev_lock)); -+ -+ --ir->open; -+ if (ir->attached) { -+ ir->d.set_use_dec(ir->d.data); -+ module_put(ir->d.owner); -+ } else { -+ cleanup(ir); -+ irctls[ir->d.minor] = NULL; -+ kfree(ir); -+ } -+ -+ mutex_unlock(&lirc_dev_lock); -+ -+ return 0; -+} -+EXPORT_SYMBOL(lirc_dev_fop_close); -+ -+unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait) -+{ -+ struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; -+ unsigned int ret; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "poll called\n", ir->d.name, ir->d.minor); -+ -+ if (!ir->attached) { -+ mutex_unlock(&ir->irctl_lock); -+ return POLLERR; -+ } -+ -+ poll_wait(file, &ir->buf->wait_poll, wait); -+ -+ if (ir->buf) -+ if (lirc_buffer_empty(ir->buf)) -+ ret = 0; -+ else -+ ret = POLLIN | POLLRDNORM; -+ else -+ ret = POLLERR; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "poll result = %d\n", -+ ir->d.name, ir->d.minor, ret); -+ -+ return ret; -+} -+EXPORT_SYMBOL(lirc_dev_fop_poll); -+ -+long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -+{ -+ unsigned long mode; -+ int result = 0; -+ struct irctl *ir = file->private_data; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "ioctl called (0x%x)\n", -+ ir->d.name, ir->d.minor, cmd); -+ -+ if (ir->d.minor == NOPLUG || !ir->attached) { -+ dev_dbg(ir->d.dev, LOGHEAD "ioctl result = -ENODEV\n", -+ ir->d.name, ir->d.minor); -+ return -ENODEV; -+ } -+ -+ mutex_lock(&ir->irctl_lock); -+ -+ switch (cmd) { -+ case LIRC_GET_FEATURES: -+ result = put_user(ir->d.features, (unsigned long *)arg); -+ break; -+ case LIRC_GET_REC_MODE: -+ if (!(ir->d.features & LIRC_CAN_REC_MASK)) { -+ result = -ENOSYS; -+ break; -+ } -+ -+ result = put_user(LIRC_REC2MODE -+ (ir->d.features & LIRC_CAN_REC_MASK), -+ (unsigned long *)arg); -+ break; -+ case LIRC_SET_REC_MODE: -+ if (!(ir->d.features & LIRC_CAN_REC_MASK)) { -+ result = -ENOSYS; -+ break; -+ } -+ -+ result = get_user(mode, (unsigned long *)arg); -+ if (!result && !(LIRC_MODE2REC(mode) & ir->d.features)) -+ result = -EINVAL; -+ /* -+ * FIXME: We should actually set the mode somehow but -+ * for now, lirc_serial doesn't support mode changing either -+ */ -+ break; -+ case LIRC_GET_LENGTH: -+ result = put_user(ir->d.code_length, (unsigned long *)arg); -+ break; -+ case LIRC_GET_MIN_TIMEOUT: -+ if (!(ir->d.features & LIRC_CAN_SET_REC_TIMEOUT) || -+ ir->d.min_timeout == 0) { -+ result = -ENOSYS; -+ break; -+ } -+ -+ result = put_user(ir->d.min_timeout, (unsigned long *)arg); -+ break; -+ case LIRC_GET_MAX_TIMEOUT: -+ if (!(ir->d.features & LIRC_CAN_SET_REC_TIMEOUT) || -+ ir->d.max_timeout == 0) { -+ result = -ENOSYS; -+ break; -+ } -+ -+ result = put_user(ir->d.max_timeout, (unsigned long *)arg); -+ break; -+ default: -+ result = -EINVAL; -+ } -+ -+ dev_dbg(ir->d.dev, LOGHEAD "ioctl result = %d\n", -+ ir->d.name, ir->d.minor, result); -+ -+ mutex_unlock(&ir->irctl_lock); -+ -+ return result; -+} -+EXPORT_SYMBOL(lirc_dev_fop_ioctl); -+ -+ssize_t lirc_dev_fop_read(struct file *file, -+ char *buffer, -+ size_t length, -+ loff_t *ppos) -+{ -+ struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; -+ unsigned char buf[ir->chunk_size]; -+ int ret = 0, written = 0; -+ DECLARE_WAITQUEUE(wait, current); -+ -+ dev_dbg(ir->d.dev, LOGHEAD "read called\n", ir->d.name, ir->d.minor); -+ -+ if (mutex_lock_interruptible(&ir->irctl_lock)) -+ return -ERESTARTSYS; -+ if (!ir->attached) { -+ mutex_unlock(&ir->irctl_lock); -+ return -ENODEV; -+ } -+ -+ if (length % ir->chunk_size) { -+ dev_dbg(ir->d.dev, LOGHEAD "read result = -EINVAL\n", -+ ir->d.name, ir->d.minor); -+ mutex_unlock(&ir->irctl_lock); -+ return -EINVAL; -+ } -+ -+ /* -+ * we add ourselves to the task queue before buffer check -+ * to avoid losing scan code (in case when queue is awaken somewhere -+ * between while condition checking and scheduling) -+ */ -+ add_wait_queue(&ir->buf->wait_poll, &wait); -+ set_current_state(TASK_INTERRUPTIBLE); -+ -+ /* -+ * while we didn't provide 'length' bytes, device is opened in blocking -+ * mode and 'copy_to_user' is happy, wait for data. -+ */ -+ while (written < length && ret == 0) { -+ if (lirc_buffer_empty(ir->buf)) { -+ /* According to the read(2) man page, 'written' can be -+ * returned as less than 'length', instead of blocking -+ * again, returning -EWOULDBLOCK, or returning -+ * -ERESTARTSYS */ -+ if (written) -+ break; -+ if (file->f_flags & O_NONBLOCK) { -+ ret = -EWOULDBLOCK; -+ break; -+ } -+ if (signal_pending(current)) { -+ ret = -ERESTARTSYS; -+ break; -+ } -+ -+ mutex_unlock(&ir->irctl_lock); -+ schedule(); -+ set_current_state(TASK_INTERRUPTIBLE); -+ -+ if (mutex_lock_interruptible(&ir->irctl_lock)) { -+ ret = -ERESTARTSYS; -+ remove_wait_queue(&ir->buf->wait_poll, &wait); -+ set_current_state(TASK_RUNNING); -+ goto out_unlocked; -+ } -+ -+ if (!ir->attached) { -+ ret = -ENODEV; -+ break; -+ } -+ } else { -+ lirc_buffer_read(ir->buf, buf); -+ ret = copy_to_user((void *)buffer+written, buf, -+ ir->buf->chunk_size); -+ written += ir->buf->chunk_size; -+ } -+ } -+ -+ remove_wait_queue(&ir->buf->wait_poll, &wait); -+ set_current_state(TASK_RUNNING); -+ mutex_unlock(&ir->irctl_lock); -+ -+out_unlocked: -+ dev_dbg(ir->d.dev, LOGHEAD "read result = %s (%d)\n", -+ ir->d.name, ir->d.minor, ret ? "-EFAULT" : "OK", ret); -+ -+ return ret ? ret : written; -+} -+EXPORT_SYMBOL(lirc_dev_fop_read); -+ -+void *lirc_get_pdata(struct file *file) -+{ -+ void *data = NULL; -+ -+ if (file && file->f_dentry && file->f_dentry->d_inode && -+ file->f_dentry->d_inode->i_rdev) { -+ struct irctl *ir; -+ ir = irctls[iminor(file->f_dentry->d_inode)]; -+ data = ir->d.data; -+ } -+ -+ return data; -+} -+EXPORT_SYMBOL(lirc_get_pdata); -+ -+ -+ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, -+ size_t length, loff_t *ppos) -+{ -+ struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; -+ -+ dev_dbg(ir->d.dev, LOGHEAD "write called\n", ir->d.name, ir->d.minor); -+ -+ if (!ir->attached) -+ return -ENODEV; -+ -+ return -EINVAL; -+} -+EXPORT_SYMBOL(lirc_dev_fop_write); -+ -+ -+static int __init lirc_dev_init(void) -+{ -+ int retval; -+ -+ lirc_class = class_create(THIS_MODULE, "lirc"); -+ if (IS_ERR(lirc_class)) { -+ retval = PTR_ERR(lirc_class); -+ printk(KERN_ERR "lirc_dev: class_create failed\n"); -+ goto error; -+ } -+ -+ retval = alloc_chrdev_region(&lirc_base_dev, 0, MAX_IRCTL_DEVICES, -+ IRCTL_DEV_NAME); -+ if (retval) { -+ class_destroy(lirc_class); -+ printk(KERN_ERR "lirc_dev: alloc_chrdev_region failed\n"); -+ goto error; -+ } -+ -+ -+ printk(KERN_INFO "lirc_dev: IR Remote Control driver registered, " -+ "major %d \n", MAJOR(lirc_base_dev)); -+ -+error: -+ return retval; -+} -+ -+ -+ -+static void __exit lirc_dev_exit(void) -+{ -+ class_destroy(lirc_class); -+ unregister_chrdev_region(lirc_base_dev, MAX_IRCTL_DEVICES); -+ printk(KERN_INFO "lirc_dev: module unloaded\n"); -+} -+ -+module_init(lirc_dev_init); -+module_exit(lirc_dev_exit); -+ -+MODULE_DESCRIPTION("LIRC base driver module"); -+MODULE_AUTHOR("Artur Lipowski"); -+MODULE_LICENSE("GPL"); -+ -+module_param(debug, bool, S_IRUGO | S_IWUSR); -+MODULE_PARM_DESC(debug, "Enable debugging messages"); -diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c -new file mode 100644 -index 0000000..78bf7f7 ---- /dev/null -+++ b/drivers/media/IR/mceusb.c -@@ -0,0 +1,1143 @@ -+/* -+ * Driver for USB Windows Media Center Ed. eHome Infrared Transceivers -+ * -+ * Copyright (c) 2010 by Jarod Wilson -+ * -+ * Based on the original lirc_mceusb and lirc_mceusb2 drivers, by Dan -+ * Conti, Martin Blatter and Daniel Melander, the latter of which was -+ * in turn also based on the lirc_atiusb driver by Paul Miller. The -+ * two mce drivers were merged into one by Jarod Wilson, with transmit -+ * support for the 1st-gen device added primarily by Patrick Calhoun, -+ * with a bit of tweaks by Jarod. Debugging improvements and proper -+ * support for what appears to be 3rd-gen hardware added by Jarod. -+ * Initial port from lirc driver to ir-core drivery by Jarod, based -+ * partially on a port to an earlier proposed IR infrastructure by -+ * Jon Smirl, which included enhancements and simplifications to the -+ * incoming IR buffer parsing routines. -+ * -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define DRIVER_VERSION "1.91" -+#define DRIVER_AUTHOR "Jarod Wilson " -+#define DRIVER_DESC "Windows Media Center Ed. eHome Infrared Transceiver " \ -+ "device driver" -+#define DRIVER_NAME "mceusb" -+ -+#define USB_BUFLEN 32 /* USB reception buffer length */ -+#define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */ -+#define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */ -+ -+/* MCE constants */ -+#define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */ -+#define MCE_TIME_UNIT 50 /* Approx 50us resolution */ -+#define MCE_CODE_LENGTH 5 /* Normal length of packet (with header) */ -+#define MCE_PACKET_SIZE 4 /* Normal length of packet (without header) */ -+#define MCE_PACKET_HEADER 0x84 /* Actual header format is 0x80 + num_bytes */ -+#define MCE_CONTROL_HEADER 0x9F /* MCE status header */ -+#define MCE_TX_HEADER_LENGTH 3 /* # of bytes in the initializing tx header */ -+#define MCE_MAX_CHANNELS 2 /* Two transmitters, hardware dependent? */ -+#define MCE_DEFAULT_TX_MASK 0x03 /* Val opts: TX1=0x01, TX2=0x02, ALL=0x03 */ -+#define MCE_PULSE_BIT 0x80 /* Pulse bit, MSB set == PULSE else SPACE */ -+#define MCE_PULSE_MASK 0x7F /* Pulse mask */ -+#define MCE_MAX_PULSE_LENGTH 0x7F /* Longest transmittable pulse symbol */ -+#define MCE_PACKET_LENGTH_MASK 0x1F /* Packet length mask */ -+ -+ -+/* module parameters */ -+#ifdef CONFIG_USB_DEBUG -+static int debug = 1; -+#else -+static int debug; -+#endif -+ -+/* general constants */ -+#define SEND_FLAG_IN_PROGRESS 1 -+#define SEND_FLAG_COMPLETE 2 -+#define RECV_FLAG_IN_PROGRESS 3 -+#define RECV_FLAG_COMPLETE 4 -+ -+#define MCEUSB_RX 1 -+#define MCEUSB_TX 2 -+ -+#define VENDOR_PHILIPS 0x0471 -+#define VENDOR_SMK 0x0609 -+#define VENDOR_TATUNG 0x1460 -+#define VENDOR_GATEWAY 0x107b -+#define VENDOR_SHUTTLE 0x1308 -+#define VENDOR_SHUTTLE2 0x051c -+#define VENDOR_MITSUMI 0x03ee -+#define VENDOR_TOPSEED 0x1784 -+#define VENDOR_RICAVISION 0x179d -+#define VENDOR_ITRON 0x195d -+#define VENDOR_FIC 0x1509 -+#define VENDOR_LG 0x043e -+#define VENDOR_MICROSOFT 0x045e -+#define VENDOR_FORMOSA 0x147a -+#define VENDOR_FINTEK 0x1934 -+#define VENDOR_PINNACLE 0x2304 -+#define VENDOR_ECS 0x1019 -+#define VENDOR_WISTRON 0x0fb8 -+#define VENDOR_COMPRO 0x185b -+#define VENDOR_NORTHSTAR 0x04eb -+#define VENDOR_REALTEK 0x0bda -+#define VENDOR_TIVO 0x105a -+ -+static struct usb_device_id mceusb_dev_table[] = { -+ /* Original Microsoft MCE IR Transceiver (often HP-branded) */ -+ { USB_DEVICE(VENDOR_MICROSOFT, 0x006d) }, -+ /* Philips Infrared Transceiver - Sahara branded */ -+ { USB_DEVICE(VENDOR_PHILIPS, 0x0608) }, -+ /* Philips Infrared Transceiver - HP branded */ -+ { USB_DEVICE(VENDOR_PHILIPS, 0x060c) }, -+ /* Philips SRM5100 */ -+ { USB_DEVICE(VENDOR_PHILIPS, 0x060d) }, -+ /* Philips Infrared Transceiver - Omaura */ -+ { USB_DEVICE(VENDOR_PHILIPS, 0x060f) }, -+ /* Philips Infrared Transceiver - Spinel plus */ -+ { USB_DEVICE(VENDOR_PHILIPS, 0x0613) }, -+ /* Philips eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_PHILIPS, 0x0815) }, -+ /* Realtek MCE IR Receiver */ -+ { USB_DEVICE(VENDOR_REALTEK, 0x0161) }, -+ /* SMK/Toshiba G83C0004D410 */ -+ { USB_DEVICE(VENDOR_SMK, 0x031d) }, -+ /* SMK eHome Infrared Transceiver (Sony VAIO) */ -+ { USB_DEVICE(VENDOR_SMK, 0x0322) }, -+ /* bundled with Hauppauge PVR-150 */ -+ { USB_DEVICE(VENDOR_SMK, 0x0334) }, -+ /* SMK eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_SMK, 0x0338) }, -+ /* Tatung eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TATUNG, 0x9150) }, -+ /* Shuttle eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_SHUTTLE, 0xc001) }, -+ /* Shuttle eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_SHUTTLE2, 0xc001) }, -+ /* Gateway eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_GATEWAY, 0x3009) }, -+ /* Mitsumi */ -+ { USB_DEVICE(VENDOR_MITSUMI, 0x2501) }, -+ /* Topseed eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0001) }, -+ /* Topseed HP eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0006) }, -+ /* Topseed eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0007) }, -+ /* Topseed eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0008) }, -+ /* Topseed eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TOPSEED, 0x000a) }, -+ /* Topseed eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0011) }, -+ /* Ricavision internal Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_RICAVISION, 0x0010) }, -+ /* Itron ione Libra Q-11 */ -+ { USB_DEVICE(VENDOR_ITRON, 0x7002) }, -+ /* FIC eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_FIC, 0x9242) }, -+ /* LG eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_LG, 0x9803) }, -+ /* Microsoft MCE Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_MICROSOFT, 0x00a0) }, -+ /* Formosa eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe015) }, -+ /* Formosa21 / eHome Infrared Receiver */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe016) }, -+ /* Formosa aim / Trust MCE Infrared Receiver */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe017) }, -+ /* Formosa Industrial Computing / Beanbag Emulation Device */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe018) }, -+ /* Formosa21 / eHome Infrared Receiver */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe03a) }, -+ /* Formosa Industrial Computing AIM IR605/A */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe03c) }, -+ /* Formosa Industrial Computing */ -+ { USB_DEVICE(VENDOR_FORMOSA, 0xe03e) }, -+ /* Fintek eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_FINTEK, 0x0602) }, -+ /* Fintek eHome Infrared Transceiver (in the AOpen MP45) */ -+ { USB_DEVICE(VENDOR_FINTEK, 0x0702) }, -+ /* Pinnacle Remote Kit */ -+ { USB_DEVICE(VENDOR_PINNACLE, 0x0225) }, -+ /* Elitegroup Computer Systems IR */ -+ { USB_DEVICE(VENDOR_ECS, 0x0f38) }, -+ /* Wistron Corp. eHome Infrared Receiver */ -+ { USB_DEVICE(VENDOR_WISTRON, 0x0002) }, -+ /* Compro K100 */ -+ { USB_DEVICE(VENDOR_COMPRO, 0x3020) }, -+ /* Compro K100 v2 */ -+ { USB_DEVICE(VENDOR_COMPRO, 0x3082) }, -+ /* Northstar Systems, Inc. eHome Infrared Transceiver */ -+ { USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) }, -+ /* TiVo PC IR Receiver */ -+ { USB_DEVICE(VENDOR_TIVO, 0x2000) }, -+ /* Terminating entry */ -+ { } -+}; -+ -+static struct usb_device_id gen3_list[] = { -+ { USB_DEVICE(VENDOR_PINNACLE, 0x0225) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0008) }, -+ {} -+}; -+ -+static struct usb_device_id microsoft_gen1_list[] = { -+ { USB_DEVICE(VENDOR_MICROSOFT, 0x006d) }, -+ {} -+}; -+ -+static struct usb_device_id std_tx_mask_list[] = { -+ { USB_DEVICE(VENDOR_MICROSOFT, 0x006d) }, -+ { USB_DEVICE(VENDOR_PHILIPS, 0x060c) }, -+ { USB_DEVICE(VENDOR_SMK, 0x031d) }, -+ { USB_DEVICE(VENDOR_SMK, 0x0322) }, -+ { USB_DEVICE(VENDOR_SMK, 0x0334) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0001) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0006) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0007) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0008) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x000a) }, -+ { USB_DEVICE(VENDOR_TOPSEED, 0x0011) }, -+ { USB_DEVICE(VENDOR_PINNACLE, 0x0225) }, -+ {} -+}; -+ -+/* data structure for each usb transceiver */ -+struct mceusb_dev { -+ /* ir-core bits */ -+ struct ir_input_dev *irdev; -+ struct ir_dev_props *props; -+ struct ir_raw_event rawir; -+ -+ /* core device bits */ -+ struct device *dev; -+ struct input_dev *idev; -+ -+ /* usb */ -+ struct usb_device *usbdev; -+ struct urb *urb_in; -+ struct usb_endpoint_descriptor *usb_ep_in; -+ struct usb_endpoint_descriptor *usb_ep_out; -+ -+ /* buffers and dma */ -+ unsigned char *buf_in; -+ unsigned int len_in; -+ u8 cmd; /* MCE command type */ -+ u8 rem; /* Remaining IR data bytes in packet */ -+ dma_addr_t dma_in; -+ dma_addr_t dma_out; -+ -+ struct { -+ u32 connected:1; -+ u32 tx_mask_inverted:1; -+ u32 microsoft_gen1:1; -+ u32 reserved:29; -+ } flags; -+ -+ /* transmit support */ -+ int send_flags; -+ u32 carrier; -+ unsigned char tx_mask; -+ -+ char name[128]; -+ char phys[64]; -+}; -+ -+/* -+ * MCE Device Command Strings -+ * Device command responses vary from device to device... -+ * - DEVICE_RESET resets the hardware to its default state -+ * - GET_REVISION fetches the hardware/software revision, common -+ * replies are ff 0b 45 ff 1b 08 and ff 0b 50 ff 1b 42 -+ * - GET_CARRIER_FREQ gets the carrier mode and frequency of the -+ * device, with replies in the form of 9f 06 MM FF, where MM is 0-3, -+ * meaning clk of 10000000, 2500000, 625000 or 156250, and FF is -+ * ((clk / frequency) - 1) -+ * - GET_RX_TIMEOUT fetches the receiver timeout in units of 50us, -+ * response in the form of 9f 0c msb lsb -+ * - GET_TX_BITMASK fetches the transmitter bitmask, replies in -+ * the form of 9f 08 bm, where bm is the bitmask -+ * - GET_RX_SENSOR fetches the RX sensor setting -- long-range -+ * general use one or short-range learning one, in the form of -+ * 9f 14 ss, where ss is either 01 for long-range or 02 for short -+ * - SET_CARRIER_FREQ sets a new carrier mode and frequency -+ * - SET_TX_BITMASK sets the transmitter bitmask -+ * - SET_RX_TIMEOUT sets the receiver timeout -+ * - SET_RX_SENSOR sets which receiver sensor to use -+ */ -+static char DEVICE_RESET[] = {0x00, 0xff, 0xaa}; -+static char GET_REVISION[] = {0xff, 0x0b}; -+static char GET_UNKNOWN[] = {0xff, 0x18}; -+static char GET_UNKNOWN2[] = {0x9f, 0x05}; -+static char GET_CARRIER_FREQ[] = {0x9f, 0x07}; -+static char GET_RX_TIMEOUT[] = {0x9f, 0x0d}; -+static char GET_TX_BITMASK[] = {0x9f, 0x13}; -+static char GET_RX_SENSOR[] = {0x9f, 0x15}; -+/* sub in desired values in lower byte or bytes for full command */ -+/* FIXME: make use of these for transmit. -+static char SET_CARRIER_FREQ[] = {0x9f, 0x06, 0x00, 0x00}; -+static char SET_TX_BITMASK[] = {0x9f, 0x08, 0x00}; -+static char SET_RX_TIMEOUT[] = {0x9f, 0x0c, 0x00, 0x00}; -+static char SET_RX_SENSOR[] = {0x9f, 0x14, 0x00}; -+*/ -+ -+static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, -+ int len, bool out) -+{ -+ char codes[USB_BUFLEN * 3 + 1]; -+ char inout[9]; -+ int i; -+ u8 cmd, subcmd, data1, data2; -+ struct device *dev = ir->dev; -+ int idx = 0; -+ -+ /* skip meaningless 0xb1 0x60 header bytes on orig receiver */ -+ if (ir->flags.microsoft_gen1 && !out) -+ idx = 2; -+ -+ if (len <= idx) -+ return; -+ -+ for (i = 0; i < len && i < USB_BUFLEN; i++) -+ snprintf(codes + i * 3, 4, "%02x ", buf[i] & 0xFF); -+ -+ dev_info(dev, "%sx data: %s (length=%d)\n", -+ (out ? "t" : "r"), codes, len); -+ -+ if (out) -+ strcpy(inout, "Request\0"); -+ else -+ strcpy(inout, "Got\0"); -+ -+ cmd = buf[idx] & 0xff; -+ subcmd = buf[idx + 1] & 0xff; -+ data1 = buf[idx + 2] & 0xff; -+ data2 = buf[idx + 3] & 0xff; -+ -+ switch (cmd) { -+ case 0x00: -+ if (subcmd == 0xff && data1 == 0xaa) -+ dev_info(dev, "Device reset requested\n"); -+ else -+ dev_info(dev, "Unknown command 0x%02x 0x%02x\n", -+ cmd, subcmd); -+ break; -+ case 0xff: -+ switch (subcmd) { -+ case 0x0b: -+ if (len == 2) -+ dev_info(dev, "Get hw/sw rev?\n"); -+ else -+ dev_info(dev, "hw/sw rev 0x%02x 0x%02x " -+ "0x%02x 0x%02x\n", data1, data2, -+ buf[idx + 4], buf[idx + 5]); -+ break; -+ case 0xaa: -+ dev_info(dev, "Device reset requested\n"); -+ break; -+ case 0xfe: -+ dev_info(dev, "Previous command not supported\n"); -+ break; -+ case 0x18: -+ case 0x1b: -+ default: -+ dev_info(dev, "Unknown command 0x%02x 0x%02x\n", -+ cmd, subcmd); -+ break; -+ } -+ break; -+ case 0x9f: -+ switch (subcmd) { -+ case 0x03: -+ dev_info(dev, "Ping\n"); -+ break; -+ case 0x04: -+ dev_info(dev, "Resp to 9f 05 of 0x%02x 0x%02x\n", -+ data1, data2); -+ break; -+ case 0x06: -+ dev_info(dev, "%s carrier mode and freq of " -+ "0x%02x 0x%02x\n", inout, data1, data2); -+ break; -+ case 0x07: -+ dev_info(dev, "Get carrier mode and freq\n"); -+ break; -+ case 0x08: -+ dev_info(dev, "%s transmit blaster mask of 0x%02x\n", -+ inout, data1); -+ break; -+ case 0x0c: -+ /* value is in units of 50us, so x*50/100 or x/2 ms */ -+ dev_info(dev, "%s receive timeout of %d ms\n", -+ inout, ((data1 << 8) | data2) / 2); -+ break; -+ case 0x0d: -+ dev_info(dev, "Get receive timeout\n"); -+ break; -+ case 0x13: -+ dev_info(dev, "Get transmit blaster mask\n"); -+ break; -+ case 0x14: -+ dev_info(dev, "%s %s-range receive sensor in use\n", -+ inout, data1 == 0x02 ? "short" : "long"); -+ break; -+ case 0x15: -+ if (len == 2) -+ dev_info(dev, "Get receive sensor\n"); -+ else -+ dev_info(dev, "Received pulse count is %d\n", -+ ((data1 << 8) | data2)); -+ break; -+ case 0xfe: -+ dev_info(dev, "Error! Hardware is likely wedged...\n"); -+ break; -+ case 0x05: -+ case 0x09: -+ case 0x0f: -+ default: -+ dev_info(dev, "Unknown command 0x%02x 0x%02x\n", -+ cmd, subcmd); -+ break; -+ } -+ break; -+ default: -+ break; -+ } -+} -+ -+static void usb_async_callback(struct urb *urb, struct pt_regs *regs) -+{ -+ struct mceusb_dev *ir; -+ int len; -+ -+ if (!urb) -+ return; -+ -+ ir = urb->context; -+ if (ir) { -+ len = urb->actual_length; -+ -+ dev_dbg(ir->dev, "callback called (status=%d len=%d)\n", -+ urb->status, len); -+ -+ if (debug) -+ mceusb_dev_printdata(ir, urb->transfer_buffer, -+ len, true); -+ } -+ -+} -+ -+/* request incoming or send outgoing usb packet - used to initialize remote */ -+static void mce_request_packet(struct mceusb_dev *ir, -+ struct usb_endpoint_descriptor *ep, -+ unsigned char *data, int size, int urb_type) -+{ -+ int res; -+ struct urb *async_urb; -+ struct device *dev = ir->dev; -+ unsigned char *async_buf; -+ -+ if (urb_type == MCEUSB_TX) { -+ async_urb = usb_alloc_urb(0, GFP_KERNEL); -+ if (unlikely(!async_urb)) { -+ dev_err(dev, "Error, couldn't allocate urb!\n"); -+ return; -+ } -+ -+ async_buf = kzalloc(size, GFP_KERNEL); -+ if (!async_buf) { -+ dev_err(dev, "Error, couldn't allocate buf!\n"); -+ usb_free_urb(async_urb); -+ return; -+ } -+ -+ /* outbound data */ -+ usb_fill_int_urb(async_urb, ir->usbdev, -+ usb_sndintpipe(ir->usbdev, ep->bEndpointAddress), -+ async_buf, size, (usb_complete_t) usb_async_callback, -+ ir, ep->bInterval); -+ memcpy(async_buf, data, size); -+ -+ } else if (urb_type == MCEUSB_RX) { -+ /* standard request */ -+ async_urb = ir->urb_in; -+ ir->send_flags = RECV_FLAG_IN_PROGRESS; -+ -+ } else { -+ dev_err(dev, "Error! Unknown urb type %d\n", urb_type); -+ return; -+ } -+ -+ dev_dbg(dev, "receive request called (size=%#x)\n", size); -+ -+ async_urb->transfer_buffer_length = size; -+ async_urb->dev = ir->usbdev; -+ -+ res = usb_submit_urb(async_urb, GFP_ATOMIC); -+ if (res) { -+ dev_dbg(dev, "receive request FAILED! (res=%d)\n", res); -+ return; -+ } -+ dev_dbg(dev, "receive request complete (res=%d)\n", res); -+} -+ -+static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size) -+{ -+ mce_request_packet(ir, ir->usb_ep_out, data, size, MCEUSB_TX); -+} -+ -+static void mce_sync_in(struct mceusb_dev *ir, unsigned char *data, int size) -+{ -+ mce_request_packet(ir, ir->usb_ep_in, data, size, MCEUSB_RX); -+} -+ -+/* Send data out the IR blaster port(s) */ -+static int mceusb_tx_ir(void *priv, int *txbuf, u32 n) -+{ -+ struct mceusb_dev *ir = priv; -+ int i, ret = 0; -+ int count, cmdcount = 0; -+ unsigned char *cmdbuf; /* MCE command buffer */ -+ long signal_duration = 0; /* Singnal length in us */ -+ struct timeval start_time, end_time; -+ -+ do_gettimeofday(&start_time); -+ -+ count = n / sizeof(int); -+ -+ cmdbuf = kzalloc(sizeof(int) * MCE_CMDBUF_SIZE, GFP_KERNEL); -+ if (!cmdbuf) -+ return -ENOMEM; -+ -+ /* MCE tx init header */ -+ cmdbuf[cmdcount++] = MCE_CONTROL_HEADER; -+ cmdbuf[cmdcount++] = 0x08; -+ cmdbuf[cmdcount++] = ir->tx_mask; -+ -+ /* Generate mce packet data */ -+ for (i = 0; (i < count) && (cmdcount < MCE_CMDBUF_SIZE); i++) { -+ signal_duration += txbuf[i]; -+ txbuf[i] = txbuf[i] / MCE_TIME_UNIT; -+ -+ do { /* loop to support long pulses/spaces > 127*50us=6.35ms */ -+ -+ /* Insert mce packet header every 4th entry */ -+ if ((cmdcount < MCE_CMDBUF_SIZE) && -+ (cmdcount - MCE_TX_HEADER_LENGTH) % -+ MCE_CODE_LENGTH == 0) -+ cmdbuf[cmdcount++] = MCE_PACKET_HEADER; -+ -+ /* Insert mce packet data */ -+ if (cmdcount < MCE_CMDBUF_SIZE) -+ cmdbuf[cmdcount++] = -+ (txbuf[i] < MCE_PULSE_BIT ? -+ txbuf[i] : MCE_MAX_PULSE_LENGTH) | -+ (i & 1 ? 0x00 : MCE_PULSE_BIT); -+ else { -+ ret = -EINVAL; -+ goto out; -+ } -+ -+ } while ((txbuf[i] > MCE_MAX_PULSE_LENGTH) && -+ (txbuf[i] -= MCE_MAX_PULSE_LENGTH)); -+ } -+ -+ /* Fix packet length in last header */ -+ cmdbuf[cmdcount - (cmdcount - MCE_TX_HEADER_LENGTH) % MCE_CODE_LENGTH] = -+ 0x80 + (cmdcount - MCE_TX_HEADER_LENGTH) % MCE_CODE_LENGTH - 1; -+ -+ /* Check if we have room for the empty packet at the end */ -+ if (cmdcount >= MCE_CMDBUF_SIZE) { -+ ret = -EINVAL; -+ goto out; -+ } -+ -+ /* All mce commands end with an empty packet (0x80) */ -+ cmdbuf[cmdcount++] = 0x80; -+ -+ /* Transmit the command to the mce device */ -+ mce_async_out(ir, cmdbuf, cmdcount); -+ -+ /* -+ * The lircd gap calculation expects the write function to -+ * wait the time it takes for the ircommand to be sent before -+ * it returns. -+ */ -+ do_gettimeofday(&end_time); -+ signal_duration -= (end_time.tv_usec - start_time.tv_usec) + -+ (end_time.tv_sec - start_time.tv_sec) * 1000000; -+ -+ /* delay with the closest number of ticks */ -+ set_current_state(TASK_INTERRUPTIBLE); -+ schedule_timeout(usecs_to_jiffies(signal_duration)); -+ -+out: -+ kfree(cmdbuf); -+ return ret ? ret : n; -+} -+ -+/* Sets active IR outputs -- mce devices typically (all?) have two */ -+static int mceusb_set_tx_mask(void *priv, u32 mask) -+{ -+ struct mceusb_dev *ir = priv; -+ -+ if (ir->flags.tx_mask_inverted) -+ ir->tx_mask = (mask != 0x03 ? mask ^ 0x03 : mask) << 1; -+ else -+ ir->tx_mask = mask; -+ -+ return 0; -+} -+ -+/* Sets the send carrier frequency and mode */ -+static int mceusb_set_tx_carrier(void *priv, u32 carrier) -+{ -+ struct mceusb_dev *ir = priv; -+ int clk = 10000000; -+ int prescaler = 0, divisor = 0; -+ unsigned char cmdbuf[4] = { 0x9f, 0x06, 0x00, 0x00 }; -+ -+ /* Carrier has changed */ -+ if (ir->carrier != carrier) { -+ -+ if (carrier == 0) { -+ ir->carrier = carrier; -+ cmdbuf[2] = 0x01; -+ cmdbuf[3] = 0x80; -+ dev_dbg(ir->dev, "%s: disabling carrier " -+ "modulation\n", __func__); -+ mce_async_out(ir, cmdbuf, sizeof(cmdbuf)); -+ return carrier; -+ } -+ -+ for (prescaler = 0; prescaler < 4; ++prescaler) { -+ divisor = (clk >> (2 * prescaler)) / carrier; -+ if (divisor <= 0xFF) { -+ ir->carrier = carrier; -+ cmdbuf[2] = prescaler; -+ cmdbuf[3] = divisor; -+ dev_dbg(ir->dev, "%s: requesting %u HZ " -+ "carrier\n", __func__, carrier); -+ -+ /* Transmit new carrier to mce device */ -+ mce_async_out(ir, cmdbuf, sizeof(cmdbuf)); -+ return carrier; -+ } -+ } -+ -+ return -EINVAL; -+ -+ } -+ -+ return carrier; -+} -+ -+static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) -+{ -+ struct ir_raw_event rawir = { .pulse = false, .duration = 0 }; -+ int i, start_index = 0; -+ u8 hdr = MCE_CONTROL_HEADER; -+ -+ /* skip meaningless 0xb1 0x60 header bytes on orig receiver */ -+ if (ir->flags.microsoft_gen1) -+ start_index = 2; -+ -+ for (i = start_index; i < buf_len;) { -+ if (ir->rem == 0) { -+ /* decode mce packets of the form (84),AA,BB,CC,DD */ -+ /* IR data packets can span USB messages - rem */ -+ hdr = ir->buf_in[i]; -+ ir->rem = (hdr & MCE_PACKET_LENGTH_MASK); -+ ir->cmd = (hdr & ~MCE_PACKET_LENGTH_MASK); -+ dev_dbg(ir->dev, "New data. rem: 0x%02x, cmd: 0x%02x\n", -+ ir->rem, ir->cmd); -+ i++; -+ } -+ -+ /* don't process MCE commands */ -+ if (hdr == MCE_CONTROL_HEADER || hdr == 0xff) { -+ ir->rem = 0; -+ return; -+ } -+ -+ for (; (ir->rem > 0) && (i < buf_len); i++) { -+ ir->rem--; -+ -+ rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); -+ rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) -+ * MCE_TIME_UNIT * 1000; -+ -+ if ((ir->buf_in[i] & MCE_PULSE_MASK) == 0x7f) { -+ if (ir->rawir.pulse == rawir.pulse) -+ ir->rawir.duration += rawir.duration; -+ else { -+ ir->rawir.duration = rawir.duration; -+ ir->rawir.pulse = rawir.pulse; -+ } -+ continue; -+ } -+ rawir.duration += ir->rawir.duration; -+ ir->rawir.duration = 0; -+ ir->rawir.pulse = rawir.pulse; -+ -+ dev_dbg(ir->dev, "Storing %s with duration %d\n", -+ rawir.pulse ? "pulse" : "space", -+ rawir.duration); -+ -+ ir_raw_event_store(ir->idev, &rawir); -+ } -+ -+ if (ir->buf_in[i] == 0x80 || ir->buf_in[i] == 0x9f) -+ ir->rem = 0; -+ -+ dev_dbg(ir->dev, "calling ir_raw_event_handle\n"); -+ ir_raw_event_handle(ir->idev); -+ } -+} -+ -+static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs) -+{ -+ struct mceusb_dev *ir; -+ int buf_len; -+ -+ if (!urb) -+ return; -+ -+ ir = urb->context; -+ if (!ir) { -+ usb_unlink_urb(urb); -+ return; -+ } -+ -+ buf_len = urb->actual_length; -+ -+ if (debug) -+ mceusb_dev_printdata(ir, urb->transfer_buffer, buf_len, false); -+ -+ if (ir->send_flags == RECV_FLAG_IN_PROGRESS) { -+ ir->send_flags = SEND_FLAG_COMPLETE; -+ dev_dbg(&ir->irdev->dev, "setup answer received %d bytes\n", -+ buf_len); -+ } -+ -+ switch (urb->status) { -+ /* success */ -+ case 0: -+ mceusb_process_ir_data(ir, buf_len); -+ break; -+ -+ case -ECONNRESET: -+ case -ENOENT: -+ case -ESHUTDOWN: -+ usb_unlink_urb(urb); -+ return; -+ -+ case -EPIPE: -+ default: -+ break; -+ } -+ -+ usb_submit_urb(urb, GFP_ATOMIC); -+} -+ -+static void mceusb_gen1_init(struct mceusb_dev *ir) -+{ -+ int ret; -+ int maxp = ir->len_in; -+ struct device *dev = ir->dev; -+ char *data; -+ -+ data = kzalloc(USB_CTRL_MSG_SZ, GFP_KERNEL); -+ if (!data) { -+ dev_err(dev, "%s: memory allocation failed!\n", __func__); -+ return; -+ } -+ -+ /* -+ * This is a strange one. Windows issues a set address to the device -+ * on the receive control pipe and expect a certain value pair back -+ */ -+ ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0), -+ USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0, -+ data, USB_CTRL_MSG_SZ, HZ * 3); -+ dev_dbg(dev, "%s - ret = %d\n", __func__, ret); -+ dev_dbg(dev, "%s - data[0] = %d, data[1] = %d\n", -+ __func__, data[0], data[1]); -+ -+ /* set feature: bit rate 38400 bps */ -+ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), -+ USB_REQ_SET_FEATURE, USB_TYPE_VENDOR, -+ 0xc04e, 0x0000, NULL, 0, HZ * 3); -+ -+ dev_dbg(dev, "%s - ret = %d\n", __func__, ret); -+ -+ /* bRequest 4: set char length to 8 bits */ -+ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), -+ 4, USB_TYPE_VENDOR, -+ 0x0808, 0x0000, NULL, 0, HZ * 3); -+ dev_dbg(dev, "%s - retB = %d\n", __func__, ret); -+ -+ /* bRequest 2: set handshaking to use DTR/DSR */ -+ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), -+ 2, USB_TYPE_VENDOR, -+ 0x0000, 0x0100, NULL, 0, HZ * 3); -+ dev_dbg(dev, "%s - retC = %d\n", __func__, ret); -+ -+ /* device reset */ -+ mce_async_out(ir, DEVICE_RESET, sizeof(DEVICE_RESET)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* get hw/sw revision? */ -+ mce_async_out(ir, GET_REVISION, sizeof(GET_REVISION)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ kfree(data); -+}; -+ -+static void mceusb_gen2_init(struct mceusb_dev *ir) -+{ -+ int maxp = ir->len_in; -+ -+ /* device reset */ -+ mce_async_out(ir, DEVICE_RESET, sizeof(DEVICE_RESET)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* get hw/sw revision? */ -+ mce_async_out(ir, GET_REVISION, sizeof(GET_REVISION)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* unknown what the next two actually return... */ -+ mce_async_out(ir, GET_UNKNOWN, sizeof(GET_UNKNOWN)); -+ mce_sync_in(ir, NULL, maxp); -+ mce_async_out(ir, GET_UNKNOWN2, sizeof(GET_UNKNOWN2)); -+ mce_sync_in(ir, NULL, maxp); -+} -+ -+static void mceusb_get_parameters(struct mceusb_dev *ir) -+{ -+ int maxp = ir->len_in; -+ -+ /* get the carrier and frequency */ -+ mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* get the transmitter bitmask */ -+ mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* get receiver timeout value */ -+ mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT)); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* get receiver sensor setting */ -+ mce_async_out(ir, GET_RX_SENSOR, sizeof(GET_RX_SENSOR)); -+ mce_sync_in(ir, NULL, maxp); -+} -+ -+static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) -+{ -+ struct input_dev *idev; -+ struct ir_dev_props *props; -+ struct ir_input_dev *irdev; -+ struct device *dev = ir->dev; -+ int ret = -ENODEV; -+ -+ idev = input_allocate_device(); -+ if (!idev) { -+ dev_err(dev, "remote input dev allocation failed\n"); -+ goto idev_alloc_failed; -+ } -+ -+ ret = -ENOMEM; -+ props = kzalloc(sizeof(struct ir_dev_props), GFP_KERNEL); -+ if (!props) { -+ dev_err(dev, "remote ir dev props allocation failed\n"); -+ goto props_alloc_failed; -+ } -+ -+ irdev = kzalloc(sizeof(struct ir_input_dev), GFP_KERNEL); -+ if (!irdev) { -+ dev_err(dev, "remote ir input dev allocation failed\n"); -+ goto ir_dev_alloc_failed; -+ } -+ -+ snprintf(ir->name, sizeof(ir->name), "Media Center Ed. eHome " -+ "Infrared Remote Transceiver (%04x:%04x)", -+ le16_to_cpu(ir->usbdev->descriptor.idVendor), -+ le16_to_cpu(ir->usbdev->descriptor.idProduct)); -+ -+ idev->name = ir->name; -+ usb_make_path(ir->usbdev, ir->phys, sizeof(ir->phys)); -+ strlcat(ir->phys, "/input0", sizeof(ir->phys)); -+ idev->phys = ir->phys; -+ -+ props->priv = ir; -+ props->driver_type = RC_DRIVER_IR_RAW; -+ props->allowed_protos = IR_TYPE_ALL; -+ props->s_tx_mask = mceusb_set_tx_mask; -+ props->s_tx_carrier = mceusb_set_tx_carrier; -+ props->tx_ir = mceusb_tx_ir; -+ -+ ir->props = props; -+ ir->irdev = irdev; -+ -+ input_set_drvdata(idev, irdev); -+ -+ ret = ir_input_register(idev, RC_MAP_RC6_MCE, props, DRIVER_NAME); -+ if (ret < 0) { -+ dev_err(dev, "remote input device register failed\n"); -+ goto irdev_failed; -+ } -+ -+ return idev; -+ -+irdev_failed: -+ kfree(irdev); -+ir_dev_alloc_failed: -+ kfree(props); -+props_alloc_failed: -+ input_free_device(idev); -+idev_alloc_failed: -+ return NULL; -+} -+ -+static int __devinit mceusb_dev_probe(struct usb_interface *intf, -+ const struct usb_device_id *id) -+{ -+ struct usb_device *dev = interface_to_usbdev(intf); -+ struct usb_host_interface *idesc; -+ struct usb_endpoint_descriptor *ep = NULL; -+ struct usb_endpoint_descriptor *ep_in = NULL; -+ struct usb_endpoint_descriptor *ep_out = NULL; -+ struct usb_host_config *config; -+ struct mceusb_dev *ir = NULL; -+ int pipe, maxp, i; -+ char buf[63], name[128] = ""; -+ bool is_gen3; -+ bool is_microsoft_gen1; -+ bool tx_mask_inverted; -+ -+ dev_dbg(&intf->dev, ": %s called\n", __func__); -+ -+ config = dev->actconfig; -+ idesc = intf->cur_altsetting; -+ -+ is_gen3 = usb_match_id(intf, gen3_list) ? 1 : 0; -+ is_microsoft_gen1 = usb_match_id(intf, microsoft_gen1_list) ? 1 : 0; -+ tx_mask_inverted = usb_match_id(intf, std_tx_mask_list) ? 0 : 1; -+ -+ /* step through the endpoints to find first bulk in and out endpoint */ -+ for (i = 0; i < idesc->desc.bNumEndpoints; ++i) { -+ ep = &idesc->endpoint[i].desc; -+ -+ if ((ep_in == NULL) -+ && ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) -+ == USB_DIR_IN) -+ && (((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) -+ == USB_ENDPOINT_XFER_BULK) -+ || ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) -+ == USB_ENDPOINT_XFER_INT))) { -+ -+ ep_in = ep; -+ ep_in->bmAttributes = USB_ENDPOINT_XFER_INT; -+ ep_in->bInterval = 1; -+ dev_dbg(&intf->dev, ": acceptable inbound endpoint " -+ "found\n"); -+ } -+ -+ if ((ep_out == NULL) -+ && ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) -+ == USB_DIR_OUT) -+ && (((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) -+ == USB_ENDPOINT_XFER_BULK) -+ || ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) -+ == USB_ENDPOINT_XFER_INT))) { -+ -+ ep_out = ep; -+ ep_out->bmAttributes = USB_ENDPOINT_XFER_INT; -+ ep_out->bInterval = 1; -+ dev_dbg(&intf->dev, ": acceptable outbound endpoint " -+ "found\n"); -+ } -+ } -+ if (ep_in == NULL) { -+ dev_dbg(&intf->dev, ": inbound and/or endpoint not found\n"); -+ return -ENODEV; -+ } -+ -+ pipe = usb_rcvintpipe(dev, ep_in->bEndpointAddress); -+ maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); -+ -+ ir = kzalloc(sizeof(struct mceusb_dev), GFP_KERNEL); -+ if (!ir) -+ goto mem_alloc_fail; -+ -+ ir->buf_in = usb_alloc_coherent(dev, maxp, GFP_ATOMIC, &ir->dma_in); -+ if (!ir->buf_in) -+ goto buf_in_alloc_fail; -+ -+ ir->urb_in = usb_alloc_urb(0, GFP_KERNEL); -+ if (!ir->urb_in) -+ goto urb_in_alloc_fail; -+ -+ ir->usbdev = dev; -+ ir->dev = &intf->dev; -+ ir->len_in = maxp; -+ ir->flags.microsoft_gen1 = is_microsoft_gen1; -+ ir->flags.tx_mask_inverted = tx_mask_inverted; -+ -+ /* Saving usb interface data for use by the transmitter routine */ -+ ir->usb_ep_in = ep_in; -+ ir->usb_ep_out = ep_out; -+ -+ if (dev->descriptor.iManufacturer -+ && usb_string(dev, dev->descriptor.iManufacturer, -+ buf, sizeof(buf)) > 0) -+ strlcpy(name, buf, sizeof(name)); -+ if (dev->descriptor.iProduct -+ && usb_string(dev, dev->descriptor.iProduct, -+ buf, sizeof(buf)) > 0) -+ snprintf(name + strlen(name), sizeof(name) - strlen(name), -+ " %s", buf); -+ -+ ir->idev = mceusb_init_input_dev(ir); -+ if (!ir->idev) -+ goto input_dev_fail; -+ -+ /* flush buffers on the device */ -+ mce_sync_in(ir, NULL, maxp); -+ mce_sync_in(ir, NULL, maxp); -+ -+ /* wire up inbound data handler */ -+ usb_fill_int_urb(ir->urb_in, dev, pipe, ir->buf_in, -+ maxp, (usb_complete_t) mceusb_dev_recv, ir, ep_in->bInterval); -+ ir->urb_in->transfer_dma = ir->dma_in; -+ ir->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; -+ -+ /* initialize device */ -+ if (ir->flags.microsoft_gen1) -+ mceusb_gen1_init(ir); -+ else if (!is_gen3) -+ mceusb_gen2_init(ir); -+ -+ mceusb_get_parameters(ir); -+ -+ mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK); -+ -+ usb_set_intfdata(intf, ir); -+ -+ dev_info(&intf->dev, "Registered %s on usb%d:%d\n", name, -+ dev->bus->busnum, dev->devnum); -+ -+ return 0; -+ -+ /* Error-handling path */ -+input_dev_fail: -+ usb_free_urb(ir->urb_in); -+urb_in_alloc_fail: -+ usb_free_coherent(dev, maxp, ir->buf_in, ir->dma_in); -+buf_in_alloc_fail: -+ kfree(ir); -+mem_alloc_fail: -+ dev_err(&intf->dev, "%s: device setup failed!\n", __func__); -+ -+ return -ENOMEM; -+} -+ -+ -+static void __devexit mceusb_dev_disconnect(struct usb_interface *intf) -+{ -+ struct usb_device *dev = interface_to_usbdev(intf); -+ struct mceusb_dev *ir = usb_get_intfdata(intf); -+ -+ usb_set_intfdata(intf, NULL); -+ -+ if (!ir) -+ return; -+ -+ ir->usbdev = NULL; -+ ir_input_unregister(ir->idev); -+ usb_kill_urb(ir->urb_in); -+ usb_free_urb(ir->urb_in); -+ usb_free_coherent(dev, ir->len_in, ir->buf_in, ir->dma_in); -+ -+ kfree(ir); -+} -+ -+static int mceusb_dev_suspend(struct usb_interface *intf, pm_message_t message) -+{ -+ struct mceusb_dev *ir = usb_get_intfdata(intf); -+ dev_info(ir->dev, "suspend\n"); -+ usb_kill_urb(ir->urb_in); -+ return 0; -+} -+ -+static int mceusb_dev_resume(struct usb_interface *intf) -+{ -+ struct mceusb_dev *ir = usb_get_intfdata(intf); -+ dev_info(ir->dev, "resume\n"); -+ if (usb_submit_urb(ir->urb_in, GFP_ATOMIC)) -+ return -EIO; -+ return 0; -+} -+ -+static struct usb_driver mceusb_dev_driver = { -+ .name = DRIVER_NAME, -+ .probe = mceusb_dev_probe, -+ .disconnect = mceusb_dev_disconnect, -+ .suspend = mceusb_dev_suspend, -+ .resume = mceusb_dev_resume, -+ .reset_resume = mceusb_dev_resume, -+ .id_table = mceusb_dev_table -+}; -+ -+static int __init mceusb_dev_init(void) -+{ -+ int ret; -+ -+ ret = usb_register(&mceusb_dev_driver); -+ if (ret < 0) -+ printk(KERN_ERR DRIVER_NAME -+ ": usb register failed, result = %d\n", ret); -+ -+ return ret; -+} -+ -+static void __exit mceusb_dev_exit(void) -+{ -+ usb_deregister(&mceusb_dev_driver); -+} -+ -+module_init(mceusb_dev_init); -+module_exit(mceusb_dev_exit); -+ -+MODULE_DESCRIPTION(DRIVER_DESC); -+MODULE_AUTHOR(DRIVER_AUTHOR); -+MODULE_LICENSE("GPL"); -+MODULE_DEVICE_TABLE(usb, mceusb_dev_table); -+ -+module_param(debug, bool, S_IRUGO | S_IWUSR); -+MODULE_PARM_DESC(debug, "Debug enabled or not"); -diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c -index b2e1545..7955e49 100644 ---- a/drivers/media/common/tuners/tda18271-fe.c -+++ b/drivers/media/common/tuners/tda18271-fe.c -@@ -1249,7 +1249,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, - struct tda18271_config *cfg) - { - struct tda18271_priv *priv = NULL; -- int instance; -+ int instance, ret; - - mutex_lock(&tda18271_list_mutex); - -@@ -1268,10 +1268,12 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, - priv->cal_initialized = false; - mutex_init(&priv->lock); - -- if (tda_fail(tda18271_get_id(fe))) -+ ret = tda18271_get_id(fe); -+ if (tda_fail(ret)) - goto fail; - -- if (tda_fail(tda18271_assign_map_layout(fe))) -+ ret = tda18271_assign_map_layout(fe); -+ if (tda_fail(ret)) - goto fail; - - mutex_lock(&priv->lock); -diff --git a/drivers/media/dvb/mantis/Kconfig b/drivers/media/dvb/mantis/Kconfig -index f7b72a3..decdeda 100644 ---- a/drivers/media/dvb/mantis/Kconfig -+++ b/drivers/media/dvb/mantis/Kconfig -@@ -10,9 +10,15 @@ config MANTIS_CORE - config DVB_MANTIS - tristate "MANTIS based cards" - depends on MANTIS_CORE && DVB_CORE && PCI && I2C -- select DVB_MB86A16 -- select DVB_ZL10353 -- select DVB_STV0299 -+ select DVB_MB86A16 if !DVB_FE_CUSTOMISE -+ select DVB_ZL10353 if !DVB_FE_CUSTOMISE -+ select DVB_STV0299 if !DVB_FE_CUSTOMISE -+ select DVB_LNBP21 if !DVB_FE_CUSTOMISE -+ select DVB_STB0899 if !DVB_FE_CUSTOMISE -+ select DVB_STB6100 if !DVB_FE_CUSTOMISE -+ select DVB_TDA665x if !DVB_FE_CUSTOMISE -+ select DVB_TDA10021 if !DVB_FE_CUSTOMISE -+ select DVB_TDA10023 if !DVB_FE_CUSTOMISE - select DVB_PLL - help - Support for PCI cards based on the Mantis PCI bridge. -@@ -23,7 +29,7 @@ config DVB_MANTIS - config DVB_HOPPER - tristate "HOPPER based cards" - depends on MANTIS_CORE && DVB_CORE && PCI && I2C -- select DVB_ZL10353 -+ select DVB_ZL10353 if !DVB_FE_CUSTOMISE - select DVB_PLL - help - Support for PCI cards based on the Hopper PCI bridge. -diff --git a/drivers/media/dvb/mantis/mantis_input.c b/drivers/media/dvb/mantis/mantis_input.c -index 3d4e466..a99489b 100644 ---- a/drivers/media/dvb/mantis/mantis_input.c -+++ b/drivers/media/dvb/mantis/mantis_input.c -@@ -19,7 +19,7 @@ - */ - - #include --#include -+#include - #include - - #include "dmxdev.h" -@@ -104,7 +104,6 @@ EXPORT_SYMBOL_GPL(ir_mantis); - int mantis_input_init(struct mantis_pci *mantis) - { - struct input_dev *rc; -- struct ir_input_state rc_state; - char name[80], dev[80]; - int err; - -@@ -120,8 +119,6 @@ int mantis_input_init(struct mantis_pci *mantis) - rc->name = name; - rc->phys = dev; - -- ir_input_init(rc, &rc_state, IR_TYPE_OTHER); -- - rc->id.bustype = BUS_PCI; - rc->id.vendor = mantis->vendor_id; - rc->id.product = mantis->device_id; -diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c -index d639186..2014dae 100644 ---- a/drivers/media/video/cx23885/cx23885-cards.c -+++ b/drivers/media/video/cx23885/cx23885-cards.c -@@ -408,10 +408,18 @@ struct cx23885_subid cx23885_subids[] = { - .card = CX23885_BOARD_HAUPPAUGE_HVR1275, - }, { - .subvendor = 0x0070, -+ .subdevice = 0x221d, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1275, -+ }, { -+ .subvendor = 0x0070, - .subdevice = 0x2251, - .card = CX23885_BOARD_HAUPPAUGE_HVR1255, - }, { - .subvendor = 0x0070, -+ .subdevice = 0x2259, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1255, -+ }, { -+ .subvendor = 0x0070, - .subdevice = 0x2291, - .card = CX23885_BOARD_HAUPPAUGE_HVR1210, - }, { -@@ -419,6 +427,38 @@ struct cx23885_subid cx23885_subids[] = { - .subdevice = 0x2295, - .card = CX23885_BOARD_HAUPPAUGE_HVR1210, - }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x2299, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1210, -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x229d, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1210, /* HVR1215 */ -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x22f0, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1210, -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x22f1, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1255, -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x22f2, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1275, -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x22f3, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1210, /* HVR1215 */ -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x22f4, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1210, -+ }, { -+ .subvendor = 0x0070, -+ .subdevice = 0x22f5, -+ .card = CX23885_BOARD_HAUPPAUGE_HVR1210, /* HVR1215 */ -+ }, { - .subvendor = 0x14f1, - .subdevice = 0x8651, - .card = CX23885_BOARD_MYGICA_X8506, -diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c -index 0dde57e..ff76f64 100644 ---- a/drivers/media/video/cx23885/cx23885-core.c -+++ b/drivers/media/video/cx23885/cx23885-core.c -@@ -1142,7 +1142,7 @@ void cx23885_free_buffer(struct videobuf_queue *q, struct cx23885_buffer *buf) - - BUG_ON(in_interrupt()); - videobuf_waiton(&buf->vb, 0, 0); -- videobuf_dma_unmap(q, dma); -+ videobuf_dma_unmap(q->dev, dma); - videobuf_dma_free(dma); - btcx_riscmem_free(to_pci_dev(q->dev), &buf->risc); - buf->vb.state = VIDEOBUF_NEEDS_INIT; -@@ -1953,8 +1953,12 @@ static int __devinit cx23885_initdev(struct pci_dev *pci_dev, - goto fail_irq; - } - -- err = request_irq(pci_dev->irq, cx23885_irq, -- IRQF_SHARED | IRQF_DISABLED, dev->name, dev); -+ if (!pci_enable_msi(pci_dev)) -+ err = request_irq(pci_dev->irq, cx23885_irq, -+ IRQF_DISABLED, dev->name, dev); -+ else -+ err = request_irq(pci_dev->irq, cx23885_irq, -+ IRQF_SHARED | IRQF_DISABLED, dev->name, dev); - if (err < 0) { - printk(KERN_ERR "%s: can't get IRQ %d\n", - dev->name, pci_dev->irq); -@@ -2000,6 +2004,7 @@ static void __devexit cx23885_finidev(struct pci_dev *pci_dev) - - /* unregister stuff */ - free_irq(pci_dev->irq, dev); -+ pci_disable_msi(pci_dev); - - cx23885_dev_unregister(dev); - v4l2_device_unregister(v4l2_dev); -diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c -index 0a199d7..3d70af2 100644 ---- a/drivers/media/video/cx23885/cx23885-dvb.c -+++ b/drivers/media/video/cx23885/cx23885-dvb.c -@@ -991,7 +991,7 @@ static int dvb_register(struct cx23885_tsport *port) - ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port, - &dev->pci->dev, adapter_nr, 0, - cx23885_dvb_fe_ioctl_override); -- if (!ret) -+ if (ret) - return ret; - - /* init CI & MAC */ -diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c -index 5de6ba9..d0b1613 100644 ---- a/drivers/media/video/cx23885/cx23885-input.c -+++ b/drivers/media/video/cx23885/cx23885-input.c -@@ -37,161 +37,55 @@ - - #include - #include --#include -+#include - #include - - #include "cx23885.h" - --#define RC5_BITS 14 --#define RC5_HALF_BITS (2*RC5_BITS) --#define RC5_HALF_BITS_MASK ((1 << RC5_HALF_BITS) - 1) -- --#define RC5_START_BITS_NORMAL 0x3 /* Command range 0 - 63 */ --#define RC5_START_BITS_EXTENDED 0x2 /* Command range 64 - 127 */ -- --#define RC5_EXTENDED_COMMAND_OFFSET 64 -- - #define MODULE_NAME "cx23885" - --static inline unsigned int rc5_command(u32 rc5_baseband) -+static void convert_measurement(u32 x, struct ir_raw_event *y) - { -- return RC5_INSTR(rc5_baseband) + -- ((RC5_START(rc5_baseband) == RC5_START_BITS_EXTENDED) -- ? RC5_EXTENDED_COMMAND_OFFSET : 0); --} -- --static void cx23885_input_process_raw_rc5(struct cx23885_dev *dev) --{ -- struct card_ir *ir_input = dev->ir_input; -- unsigned int code, command; -- u32 rc5; -- -- /* Ignore codes that are too short to be valid RC-5 */ -- if (ir_input->last_bit < (RC5_HALF_BITS - 1)) -- return; -- -- /* The library has the manchester coding backwards; XOR to adapt. */ -- code = (ir_input->code & RC5_HALF_BITS_MASK) ^ RC5_HALF_BITS_MASK; -- rc5 = ir_rc5_decode(code); -- -- switch (RC5_START(rc5)) { -- case RC5_START_BITS_NORMAL: -- break; -- case RC5_START_BITS_EXTENDED: -- /* Don't allow if the remote only emits standard commands */ -- if (ir_input->start == RC5_START_BITS_NORMAL) -- return; -- break; -- default: -+ if (x == V4L2_SUBDEV_IR_PULSE_RX_SEQ_END) { -+ y->pulse = false; -+ y->duration = V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS; - return; - } - -- if (ir_input->addr != RC5_ADDR(rc5)) -- return; -- -- /* Don't generate a keypress for RC-5 auto-repeated keypresses */ -- command = rc5_command(rc5); -- if (RC5_TOGGLE(rc5) != RC5_TOGGLE(ir_input->last_rc5) || -- command != rc5_command(ir_input->last_rc5) || -- /* Catch T == 0, CMD == 0 (e.g. '0') as first keypress after init */ -- RC5_START(ir_input->last_rc5) == 0) { -- /* This keypress is differnet: not an auto repeat */ -- ir_input_nokey(ir_input->dev, &ir_input->ir); -- ir_input_keydown(ir_input->dev, &ir_input->ir, command); -- } -- ir_input->last_rc5 = rc5; -- -- /* Schedule when we should do the key up event: ir_input_nokey() */ -- mod_timer(&ir_input->timer_keyup, -- jiffies + msecs_to_jiffies(ir_input->rc5_key_timeout)); -+ y->pulse = (x & V4L2_SUBDEV_IR_PULSE_LEVEL_MASK) ? true : false; -+ y->duration = x & V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS; - } - --static void cx23885_input_next_pulse_width_rc5(struct cx23885_dev *dev, -- u32 ns_pulse) -+static void cx23885_input_process_measurements(struct cx23885_dev *dev, -+ bool overrun) - { -- const int rc5_quarterbit_ns = 444444; /* 32 cycles/36 kHz/2 = 444 us */ -- struct card_ir *ir_input = dev->ir_input; -- int i, level, quarterbits, halfbits; -- -- if (!ir_input->active) { -- ir_input->active = 1; -- /* assume an initial space that we may not detect or measure */ -- ir_input->code = 0; -- ir_input->last_bit = 0; -- } -+ struct cx23885_kernel_ir *kernel_ir = dev->kernel_ir; -+ struct ir_raw_event kernel_ir_event; - -- if (ns_pulse == V4L2_SUBDEV_IR_PULSE_RX_SEQ_END) { -- ir_input->last_bit++; /* Account for the final space */ -- ir_input->active = 0; -- cx23885_input_process_raw_rc5(dev); -- return; -- } -- -- level = (ns_pulse & V4L2_SUBDEV_IR_PULSE_LEVEL_MASK) ? 1 : 0; -- -- /* Skip any leading space to sync to the start bit */ -- if (ir_input->last_bit == 0 && level == 0) -- return; -- -- /* -- * With valid RC-5 we can get up to two consecutive half-bits in a -- * single pulse measurment. Experiments have shown that the duration -- * of a half-bit can vary. Make sure we always end up with an even -- * number of quarter bits at the same level (mark or space). -- */ -- ns_pulse &= V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS; -- quarterbits = ns_pulse / rc5_quarterbit_ns; -- if (quarterbits & 1) -- quarterbits++; -- halfbits = quarterbits / 2; -- -- for (i = 0; i < halfbits; i++) { -- ir_input->last_bit++; -- ir_input->code |= (level << ir_input->last_bit); -- -- if (ir_input->last_bit >= RC5_HALF_BITS-1) { -- ir_input->active = 0; -- cx23885_input_process_raw_rc5(dev); -- /* -- * If level is 1, a leading mark is invalid for RC5. -- * If level is 0, we scan past extra intial space. -- * Either way we don't want to reactivate collecting -- * marks or spaces here with any left over half-bits. -- */ -- break; -- } -- } --} -- --static void cx23885_input_process_pulse_widths_rc5(struct cx23885_dev *dev, -- bool add_eom) --{ -- struct card_ir *ir_input = dev->ir_input; -- struct ir_input_state *ir_input_state = &ir_input->ir; -- -- u32 ns_pulse[RC5_HALF_BITS+1]; -- ssize_t num = 0; -+ u32 sd_ir_data[64]; -+ ssize_t num; - int count, i; -+ bool handle = false; - - do { -- v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) ns_pulse, -- sizeof(ns_pulse), &num); -+ num = 0; -+ v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) sd_ir_data, -+ sizeof(sd_ir_data), &num); - - count = num / sizeof(u32); - -- /* Append an end of Rx seq, if the caller requested */ -- if (add_eom && count < ARRAY_SIZE(ns_pulse)) { -- ns_pulse[count] = V4L2_SUBDEV_IR_PULSE_RX_SEQ_END; -- count++; -+ for (i = 0; i < count; i++) { -+ convert_measurement(sd_ir_data[i], &kernel_ir_event); -+ ir_raw_event_store(kernel_ir->inp_dev, -+ &kernel_ir_event); -+ handle = true; - } -- -- /* Just drain the Rx FIFO, if we're called, but not RC-5 */ -- if (ir_input_state->ir_type != IR_TYPE_RC5) -- continue; -- -- for (i = 0; i < count; i++) -- cx23885_input_next_pulse_width_rc5(dev, ns_pulse[i]); - } while (num != 0); -+ -+ if (overrun) -+ ir_raw_event_reset(kernel_ir->inp_dev); -+ else if (handle) -+ ir_raw_event_handle(kernel_ir->inp_dev); - } - - void cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events) -@@ -230,7 +124,7 @@ void cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events) - } - - if (data_available) -- cx23885_input_process_pulse_widths_rc5(dev, overrun); -+ cx23885_input_process_measurements(dev, overrun); - - if (overrun) { - /* If there was a FIFO overrun, clear & restart the device */ -@@ -241,34 +135,15 @@ void cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events) - } - } - --static void cx23885_input_ir_start(struct cx23885_dev *dev) -+static int cx23885_input_ir_start(struct cx23885_dev *dev) - { -- struct card_ir *ir_input = dev->ir_input; -- struct ir_input_state *ir_input_state = &ir_input->ir; - struct v4l2_subdev_ir_parameters params; - - if (dev->sd_ir == NULL) -- return; -+ return -ENODEV; - - atomic_set(&dev->ir_input_stopping, 0); - -- /* keyup timer set up, if needed */ -- switch (dev->board) { -- case CX23885_BOARD_HAUPPAUGE_HVR1850: -- case CX23885_BOARD_HAUPPAUGE_HVR1290: -- setup_timer(&ir_input->timer_keyup, -- ir_rc5_timer_keyup, /* Not actually RC-5 specific */ -- (unsigned long) ir_input); -- if (ir_input_state->ir_type == IR_TYPE_RC5) { -- /* -- * RC-5 repeats a held key every -- * 64 bits * (2 * 32/36000) sec/bit = 113.778 ms -- */ -- ir_input->rc5_key_timeout = 115; -- } -- break; -- } -- - v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, ¶ms); - switch (dev->board) { - case CX23885_BOARD_HAUPPAUGE_HVR1850: -@@ -299,11 +174,21 @@ static void cx23885_input_ir_start(struct cx23885_dev *dev) - break; - } - v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, ¶ms); -+ return 0; -+} -+ -+static int cx23885_input_ir_open(void *priv) -+{ -+ struct cx23885_kernel_ir *kernel_ir = priv; -+ -+ if (kernel_ir->cx == NULL) -+ return -ENODEV; -+ -+ return cx23885_input_ir_start(kernel_ir->cx); - } - - static void cx23885_input_ir_stop(struct cx23885_dev *dev) - { -- struct card_ir *ir_input = dev->ir_input; - struct v4l2_subdev_ir_parameters params; - - if (dev->sd_ir == NULL) -@@ -327,21 +212,26 @@ static void cx23885_input_ir_stop(struct cx23885_dev *dev) - } - - flush_scheduled_work(); -+} - -- switch (dev->board) { -- case CX23885_BOARD_HAUPPAUGE_HVR1850: -- case CX23885_BOARD_HAUPPAUGE_HVR1290: -- del_timer_sync(&ir_input->timer_keyup); -- break; -- } -+static void cx23885_input_ir_close(void *priv) -+{ -+ struct cx23885_kernel_ir *kernel_ir = priv; -+ -+ if (kernel_ir->cx != NULL) -+ cx23885_input_ir_stop(kernel_ir->cx); - } - - int cx23885_input_init(struct cx23885_dev *dev) - { -- struct card_ir *ir; -- struct input_dev *input_dev; -- char *ir_codes = NULL; -- int ir_type, ir_addr, ir_start; -+ struct cx23885_kernel_ir *kernel_ir; -+ struct input_dev *inp_dev; -+ struct ir_dev_props *props; -+ -+ char *rc_map; -+ enum rc_driver_type driver_type; -+ unsigned long allowed_protos; -+ - int ret; - - /* -@@ -354,53 +244,59 @@ int cx23885_input_init(struct cx23885_dev *dev) - switch (dev->board) { - case CX23885_BOARD_HAUPPAUGE_HVR1850: - case CX23885_BOARD_HAUPPAUGE_HVR1290: -- /* Parameters for the grey Hauppauge remote for the HVR-1850 */ -- ir_codes = RC_MAP_HAUPPAUGE_NEW; -- ir_type = IR_TYPE_RC5; -- ir_addr = 0x1e; /* RC-5 system bits emitted by the remote */ -- ir_start = RC5_START_BITS_NORMAL; /* A basic RC-5 remote */ -+ /* Integrated CX23888 IR controller */ -+ driver_type = RC_DRIVER_IR_RAW; -+ allowed_protos = IR_TYPE_ALL; -+ /* The grey Hauppauge RC-5 remote */ -+ rc_map = RC_MAP_RC5_HAUPPAUGE_NEW; - break; -- } -- if (ir_codes == NULL) -+ default: - return -ENODEV; -- -- ir = kzalloc(sizeof(*ir), GFP_KERNEL); -- input_dev = input_allocate_device(); -- if (!ir || !input_dev) { -- ret = -ENOMEM; -- goto err_out_free; - } - -- ir->dev = input_dev; -- ir->addr = ir_addr; -- ir->start = ir_start; -+ /* cx23885 board instance kernel IR state */ -+ kernel_ir = kzalloc(sizeof(struct cx23885_kernel_ir), GFP_KERNEL); -+ if (kernel_ir == NULL) -+ return -ENOMEM; - -- /* init input device */ -- snprintf(ir->name, sizeof(ir->name), "cx23885 IR (%s)", -- cx23885_boards[dev->board].name); -- snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(dev->pci)); -+ kernel_ir->cx = dev; -+ kernel_ir->name = kasprintf(GFP_KERNEL, "cx23885 IR (%s)", -+ cx23885_boards[dev->board].name); -+ kernel_ir->phys = kasprintf(GFP_KERNEL, "pci-%s/ir0", -+ pci_name(dev->pci)); - -- ret = ir_input_init(input_dev, &ir->ir, ir_type); -- if (ret < 0) -+ /* input device */ -+ inp_dev = input_allocate_device(); -+ if (inp_dev == NULL) { -+ ret = -ENOMEM; - goto err_out_free; -+ } - -- input_dev->name = ir->name; -- input_dev->phys = ir->phys; -- input_dev->id.bustype = BUS_PCI; -- input_dev->id.version = 1; -+ kernel_ir->inp_dev = inp_dev; -+ inp_dev->name = kernel_ir->name; -+ inp_dev->phys = kernel_ir->phys; -+ inp_dev->id.bustype = BUS_PCI; -+ inp_dev->id.version = 1; - if (dev->pci->subsystem_vendor) { -- input_dev->id.vendor = dev->pci->subsystem_vendor; -- input_dev->id.product = dev->pci->subsystem_device; -+ inp_dev->id.vendor = dev->pci->subsystem_vendor; -+ inp_dev->id.product = dev->pci->subsystem_device; - } else { -- input_dev->id.vendor = dev->pci->vendor; -- input_dev->id.product = dev->pci->device; -+ inp_dev->id.vendor = dev->pci->vendor; -+ inp_dev->id.product = dev->pci->device; - } -- input_dev->dev.parent = &dev->pci->dev; -- -- dev->ir_input = ir; -- cx23885_input_ir_start(dev); -- -- ret = ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME); -+ inp_dev->dev.parent = &dev->pci->dev; -+ -+ /* kernel ir device properties */ -+ props = &kernel_ir->props; -+ props->driver_type = driver_type; -+ props->allowed_protos = allowed_protos; -+ props->priv = kernel_ir; -+ props->open = cx23885_input_ir_open; -+ props->close = cx23885_input_ir_close; -+ -+ /* Go */ -+ dev->kernel_ir = kernel_ir; -+ ret = ir_input_register(inp_dev, rc_map, props, MODULE_NAME); - if (ret) - goto err_out_stop; - -@@ -408,9 +304,12 @@ int cx23885_input_init(struct cx23885_dev *dev) - - err_out_stop: - cx23885_input_ir_stop(dev); -- dev->ir_input = NULL; -+ dev->kernel_ir = NULL; -+ /* TODO: double check clean-up of kernel_ir->inp_dev */ - err_out_free: -- kfree(ir); -+ kfree(kernel_ir->phys); -+ kfree(kernel_ir->name); -+ kfree(kernel_ir); - return ret; - } - -@@ -419,9 +318,11 @@ void cx23885_input_fini(struct cx23885_dev *dev) - /* Always stop the IR hardware from generating interrupts */ - cx23885_input_ir_stop(dev); - -- if (dev->ir_input == NULL) -+ if (dev->kernel_ir == NULL) - return; -- ir_input_unregister(dev->ir_input->dev); -- kfree(dev->ir_input); -- dev->ir_input = NULL; -+ ir_input_unregister(dev->kernel_ir->inp_dev); -+ kfree(dev->kernel_ir->phys); -+ kfree(dev->kernel_ir->name); -+ kfree(dev->kernel_ir); -+ dev->kernel_ir = NULL; - } -diff --git a/drivers/media/video/cx23885/cx23885-ir.c b/drivers/media/video/cx23885/cx23885-ir.c -index 9a677eb..6ceabd4 100644 ---- a/drivers/media/video/cx23885/cx23885-ir.c -+++ b/drivers/media/video/cx23885/cx23885-ir.c -@@ -53,7 +53,7 @@ void cx23885_ir_rx_work_handler(struct work_struct *work) - if (events == 0) - return; - -- if (dev->ir_input) -+ if (dev->kernel_ir) - cx23885_input_rx_work_handler(dev, events); - } - -diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h -index 8d6a55e..a33f2b7 100644 ---- a/drivers/media/video/cx23885/cx23885.h -+++ b/drivers/media/video/cx23885/cx23885.h -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include "btcx-risc.h" - #include "cx23885-reg.h" -@@ -304,6 +305,15 @@ struct cx23885_tsport { - void *port_priv; - }; - -+struct cx23885_kernel_ir { -+ struct cx23885_dev *cx; -+ char *name; -+ char *phys; -+ -+ struct input_dev *inp_dev; -+ struct ir_dev_props props; -+}; -+ - struct cx23885_dev { - atomic_t refcount; - struct v4l2_device v4l2_dev; -@@ -363,7 +373,7 @@ struct cx23885_dev { - struct work_struct ir_tx_work; - unsigned long ir_tx_notifications; - -- struct card_ir *ir_input; -+ struct cx23885_kernel_ir *kernel_ir; - atomic_t ir_input_stopping; - - /* V4l */ -diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c -index 2918a6e..e8416b7 100644 ---- a/drivers/media/video/cx88/cx88-cards.c -+++ b/drivers/media/video/cx88/cx88-cards.c -@@ -45,6 +45,10 @@ static unsigned int latency = UNSET; - module_param(latency,int,0444); - MODULE_PARM_DESC(latency,"pci latency timer"); - -+static int disable_ir; -+module_param(disable_ir, int, 0444); -+MODULE_PARM_DESC(latency, "Disable IR support"); -+ - #define info_printk(core, fmt, arg...) \ - printk(KERN_INFO "%s: " fmt, core->name , ## arg) - -@@ -3498,7 +3502,10 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) - } - - cx88_card_setup(core); -- cx88_ir_init(core, pci); -+ if (!disable_ir) { -+ cx88_i2c_init_ir(core); -+ cx88_ir_init(core, pci); -+ } - - return core; - } -diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c -index fb39f11..375ad53 100644 ---- a/drivers/media/video/cx88/cx88-i2c.c -+++ b/drivers/media/video/cx88/cx88-i2c.c -@@ -181,6 +181,11 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) - } else - printk("%s: i2c register FAILED\n", core->name); - -+ return core->i2c_rc; -+} -+ -+void cx88_i2c_init_ir(struct cx88_core *core) -+{ - /* Instantiate the IR receiver device, if present */ - if (0 == core->i2c_rc) { - struct i2c_board_info info; -@@ -207,7 +212,6 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) - } - } - } -- return core->i2c_rc; - } - - /* ----------------------------------------------------------------------- */ -diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c -index e185289..eccc5e4 100644 ---- a/drivers/media/video/cx88/cx88-input.c -+++ b/drivers/media/video/cx88/cx88-input.c -@@ -30,6 +30,7 @@ - #include - - #include "cx88.h" -+#include - #include - - #define MODULE_NAME "cx88xx" -@@ -39,8 +40,8 @@ - struct cx88_IR { - struct cx88_core *core; - struct input_dev *input; -- struct ir_input_state ir; - struct ir_dev_props props; -+ u64 ir_type; - - int users; - -@@ -51,7 +52,6 @@ struct cx88_IR { - u32 sampling; - u32 samples[16]; - int scount; -- unsigned long release; - - /* poll external decoder */ - int polling; -@@ -125,29 +125,21 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) - - data = (data << 4) | ((gpio_key & 0xf0) >> 4); - -- ir_input_keydown(ir->input, &ir->ir, data); -- ir_input_nokey(ir->input, &ir->ir); -+ ir_keydown(ir->input, data, 0); - - } else if (ir->mask_keydown) { - /* bit set on keydown */ -- if (gpio & ir->mask_keydown) { -- ir_input_keydown(ir->input, &ir->ir, data); -- } else { -- ir_input_nokey(ir->input, &ir->ir); -- } -+ if (gpio & ir->mask_keydown) -+ ir_keydown(ir->input, data, 0); - - } else if (ir->mask_keyup) { - /* bit cleared on keydown */ -- if (0 == (gpio & ir->mask_keyup)) { -- ir_input_keydown(ir->input, &ir->ir, data); -- } else { -- ir_input_nokey(ir->input, &ir->ir); -- } -+ if (0 == (gpio & ir->mask_keyup)) -+ ir_keydown(ir->input, data, 0); - - } else { - /* can't distinguish keydown/up :-/ */ -- ir_input_keydown(ir->input, &ir->ir, data); -- ir_input_nokey(ir->input, &ir->ir); -+ ir_keydown(ir->input, data, 0); - } - } - -@@ -439,9 +431,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) - snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name); - snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); - -- err = ir_input_init(input_dev, &ir->ir, ir_type); -- if (err < 0) -- goto err_out_free; -+ ir->ir_type = ir_type; - - input_dev->name = ir->name; - input_dev->phys = ir->phys; -@@ -516,8 +506,6 @@ void cx88_ir_irq(struct cx88_core *core) - } - if (!ir->scount) { - /* nothing to sample */ -- if (ir->ir.keypressed && time_after(jiffies, ir->release)) -- ir_input_nokey(ir->input, &ir->ir); - return; - } - -@@ -553,7 +541,7 @@ void cx88_ir_irq(struct cx88_core *core) - - if (ircode == 0) { /* key still pressed */ - ir_dprintk("pulse distance decoded repeat code\n"); -- ir->release = jiffies + msecs_to_jiffies(120); -+ ir_repeat(ir->input); - break; - } - -@@ -567,10 +555,8 @@ void cx88_ir_irq(struct cx88_core *core) - break; - } - -- ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0x7f); -- -- ir_input_keydown(ir->input, &ir->ir, (ircode >> 16) & 0x7f); -- ir->release = jiffies + msecs_to_jiffies(120); -+ ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0xff); -+ ir_keydown(ir->input, (ircode >> 16) & 0xff, 0); - break; - case CX88_BOARD_HAUPPAUGE: - case CX88_BOARD_HAUPPAUGE_DVB_T1: -@@ -606,16 +592,16 @@ void cx88_ir_irq(struct cx88_core *core) - if ( dev != 0x1e && dev != 0x1f ) - /* not a hauppauge remote */ - break; -- ir_input_keydown(ir->input, &ir->ir, code); -- ir->release = jiffies + msecs_to_jiffies(120); -+ ir_keydown(ir->input, code, toggle); - break; - case CX88_BOARD_PINNACLE_PCTV_HD_800i: - ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); - ir_dprintk("biphase decoded: %x\n", ircode); - if ((ircode & 0xfffff000) != 0x3000) - break; -- ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f); -- ir->release = jiffies + msecs_to_jiffies(120); -+ /* Note: bit 0x800 being the toggle is assumed, not checked -+ with real hardware */ -+ ir_keydown(ir->input, ircode & 0x3f, ircode & 0x0800 ? 1 : 0); - break; - } - -diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h -index bdb03d3..33d161a 100644 ---- a/drivers/media/video/cx88/cx88.h -+++ b/drivers/media/video/cx88/cx88.h -@@ -636,6 +636,7 @@ extern struct videobuf_queue_ops cx8800_vbi_qops; - /* cx88-i2c.c */ - - extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci); -+extern void cx88_i2c_init_ir(struct cx88_core *core); - - - /* ----------------------------------------------------------- */ -diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c -index 5c3fd94..6759cd5 100644 ---- a/drivers/media/video/em28xx/em28xx-input.c -+++ b/drivers/media/video/em28xx/em28xx-input.c -@@ -65,17 +65,14 @@ struct em28xx_ir_poll_result { - struct em28xx_IR { - struct em28xx *dev; - struct input_dev *input; -- struct ir_input_state ir; - char name[32]; - char phys[32]; - - /* poll external decoder */ - int polling; - struct delayed_work work; -- unsigned int last_toggle:1; - unsigned int full_code:1; - unsigned int last_readcount; -- unsigned int repeat_interval; - - int (*get_key)(struct em28xx_IR *, struct em28xx_ir_poll_result *); - -@@ -291,67 +288,39 @@ static int em2874_polling_getkey(struct em28xx_IR *ir, - static void em28xx_ir_handle_key(struct em28xx_IR *ir) - { - int result; -- int do_sendkey = 0; - struct em28xx_ir_poll_result poll_result; - - /* read the registers containing the IR status */ - result = ir->get_key(ir, &poll_result); -- if (result < 0) { -+ if (unlikely(result < 0)) { - dprintk("ir->get_key() failed %d\n", result); - return; - } - -- dprintk("ir->get_key result tb=%02x rc=%02x lr=%02x data=%02x%02x\n", -- poll_result.toggle_bit, poll_result.read_count, -- ir->last_readcount, poll_result.rc_address, -- poll_result.rc_data[0]); -- -- if (ir->dev->chip_id == CHIP_ID_EM2874) { -- /* The em2874 clears the readcount field every time the -- register is read. The em2860/2880 datasheet says that it -- is supposed to clear the readcount, but it doesn't. So with -- the em2874, we are looking for a non-zero read count as -- opposed to a readcount that is incrementing */ -- ir->last_readcount = 0; -- } -- -- if (poll_result.read_count == 0) { -- /* The button has not been pressed since the last read */ -- } else if (ir->last_toggle != poll_result.toggle_bit) { -- /* A button has been pressed */ -- dprintk("button has been pressed\n"); -- ir->last_toggle = poll_result.toggle_bit; -- ir->repeat_interval = 0; -- do_sendkey = 1; -- } else if (poll_result.toggle_bit == ir->last_toggle && -- poll_result.read_count > 0 && -- poll_result.read_count != ir->last_readcount) { -- /* The button is still being held down */ -- dprintk("button being held down\n"); -- -- /* Debouncer for first keypress */ -- if (ir->repeat_interval++ > 9) { -- /* Start repeating after 1 second */ -- do_sendkey = 1; -- } -- } -- -- if (do_sendkey) { -- dprintk("sending keypress\n"); -- -+ if (unlikely(poll_result.read_count != ir->last_readcount)) { -+ dprintk("%s: toggle: %d, count: %d, key 0x%02x%02x\n", __func__, -+ poll_result.toggle_bit, poll_result.read_count, -+ poll_result.rc_address, poll_result.rc_data[0]); - if (ir->full_code) -- ir_input_keydown(ir->input, &ir->ir, -- poll_result.rc_address << 8 | -- poll_result.rc_data[0]); -+ ir_keydown(ir->input, -+ poll_result.rc_address << 8 | -+ poll_result.rc_data[0], -+ poll_result.toggle_bit); - else -- ir_input_keydown(ir->input, &ir->ir, -- poll_result.rc_data[0]); -- -- ir_input_nokey(ir->input, &ir->ir); -+ ir_keydown(ir->input, -+ poll_result.rc_data[0], -+ poll_result.toggle_bit); -+ -+ if (ir->dev->chip_id == CHIP_ID_EM2874) -+ /* The em2874 clears the readcount field every time the -+ register is read. The em2860/2880 datasheet says that it -+ is supposed to clear the readcount, but it doesn't. So with -+ the em2874, we are looking for a non-zero read count as -+ opposed to a readcount that is incrementing */ -+ ir->last_readcount = 0; -+ else -+ ir->last_readcount = poll_result.read_count; - } -- -- ir->last_readcount = poll_result.read_count; -- return; - } - - static void em28xx_ir_work(struct work_struct *work) -@@ -466,11 +435,6 @@ int em28xx_ir_init(struct em28xx *dev) - usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); - strlcat(ir->phys, "/input0", sizeof(ir->phys)); - -- /* Set IR protocol */ -- err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER); -- if (err < 0) -- goto err_out_free; -- - input_dev->name = ir->name; - input_dev->phys = ir->phys; - input_dev->id.bustype = BUS_USB; -diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c -index 20090e3..7b9ec6e 100644 ---- a/drivers/media/video/em28xx/em28xx-video.c -+++ b/drivers/media/video/em28xx/em28xx-video.c -@@ -654,12 +654,12 @@ static inline int em28xx_isoc_copy_vbi(struct em28xx *dev, struct urb *urb) - } - - if (buf != NULL && dev->capture_type == 2) { -- if (len > 4 && p[0] == 0x88 && p[1] == 0x88 && -+ if (len >= 4 && p[0] == 0x88 && p[1] == 0x88 && - p[2] == 0x88 && p[3] == 0x88) { - p += 4; - len -= 4; - } -- if (len > 4 && p[0] == 0x22 && p[1] == 0x5a) { -+ if (len >= 4 && p[0] == 0x22 && p[1] == 0x5a) { - em28xx_isocdbg("Video frame %d, len=%i, %s\n", - p[2], len, (p[2] & 1) ? - "odd" : "even"); -diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h -index b252d1b..6216786 100644 ---- a/drivers/media/video/em28xx/em28xx.h -+++ b/drivers/media/video/em28xx/em28xx.h -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) - #include - #endif -diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c -index 830d47b..0cae5b8 100644 ---- a/drivers/media/video/hdpvr/hdpvr-core.c -+++ b/drivers/media/video/hdpvr/hdpvr-core.c -@@ -286,6 +286,8 @@ static int hdpvr_probe(struct usb_interface *interface, - goto error; - } - -+ dev->workqueue = 0; -+ - /* register v4l2_device early so it can be used for printks */ - if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) { - err("v4l2_device_register failed"); -@@ -380,6 +382,9 @@ static int hdpvr_probe(struct usb_interface *interface, - - error: - if (dev) { -+ /* Destroy single thread */ -+ if (dev->workqueue) -+ destroy_workqueue(dev->workqueue); - /* this frees allocated memory */ - hdpvr_delete(dev); - } -diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c -index 29d4397..27ae8bb 100644 ---- a/drivers/media/video/ir-kbd-i2c.c -+++ b/drivers/media/video/ir-kbd-i2c.c -@@ -47,7 +47,7 @@ - #include - #include - --#include -+#include - #include - - /* ----------------------------------------------------------------------- */ -@@ -272,11 +272,8 @@ static void ir_key_poll(struct IR_i2c *ir) - return; - } - -- if (0 == rc) { -- ir_input_nokey(ir->input, &ir->ir); -- } else { -- ir_input_keydown(ir->input, &ir->ir, ir_key); -- } -+ if (rc) -+ ir_keydown(ir->input, ir_key, 0); - } - - static void ir_work(struct work_struct *work) -@@ -439,10 +436,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) - dev_name(&client->dev)); - - /* init + register input device */ -- err = ir_input_init(input_dev, &ir->ir, ir_type); -- if (err < 0) -- goto err_out_free; -- -+ ir->ir_type = ir_type; - input_dev->id.bustype = BUS_I2C; - input_dev->name = ir->name; - input_dev->phys = ir->phys; -diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c -index b482478..bba6115 100644 ---- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c -+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c -@@ -223,7 +223,10 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp) - " pvr2_ioread_setup (setup) id=%p",cp); - pvr2_stream_kill(sp); - ret = pvr2_stream_set_buffer_count(sp,BUFFER_COUNT); -- if (ret < 0) return ret; -+ if (ret < 0) { -+ mutex_unlock(&cp->mutex); -+ return ret; -+ } - for (idx = 0; idx < BUFFER_COUNT; idx++) { - bp = pvr2_stream_get_buffer(sp,idx); - pvr2_buffer_set_buffer(bp, -diff --git a/include/linux/input.h b/include/linux/input.h -index 6fcc910..fe2633c 100644 ---- a/include/linux/input.h -+++ b/include/linux/input.h -@@ -34,7 +34,7 @@ struct input_event { - * Protocol version. - */ - --#define EV_VERSION 0x010000 -+#define EV_VERSION 0x010001 - - /* - * IOCTLs (0x00 - 0x7f) -@@ -56,12 +56,22 @@ struct input_absinfo { - __s32 resolution; - }; - -+struct keycode_table_entry { -+ __u32 keycode; /* e.g. KEY_A */ -+ __u32 index; /* Index for the given scan/key table, on EVIOCGKEYCODEBIG */ -+ __u32 len; /* Length of the scancode */ -+ __u32 reserved[2]; /* Reserved for future usage */ -+ char *scancode; /* scancode, in machine-endian */ -+}; -+ - #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ - #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ - #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ - #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ - #define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ - #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ -+#define EVIOCGKEYCODEBIG _IOR('E', 0x04, struct keycode_table_entry) /* get keycode */ -+#define EVIOCSKEYCODEBIG _IOW('E', 0x04, struct keycode_table_entry) /* set keycode */ - - #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ - #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ -@@ -1066,13 +1076,22 @@ struct ff_effect { - * @keycodemax: size of keycode table - * @keycodesize: size of elements in keycode table - * @keycode: map of scancodes to keycodes for this device -- * @setkeycode: optional method to alter current keymap, used to implement -+ * @setkeycode: optional legacy method to alter current keymap, used to -+ * implement sparse keymaps. Shouldn't be used on new drivers -+ * @getkeycode: optional legacy method to retrieve current keymap. -+ * Shouldn't be used on new drivers. -+ * @setkeycodebig: optional method to alter current keymap, used to implement - * sparse keymaps. If not supplied default mechanism will be used. - * The method is being called while holding event_lock and thus must - * not sleep -- * @getkeycode: optional method to retrieve current keymap. If not supplied -- * default mechanism will be used. The method is being called while -- * holding event_lock and thus must not sleep -+ * @getkeycodebig_from_index: optional method to retrieve current keymap from -+ * an array index. If not supplied default mechanism will be used. -+ * The method is being called while holding event_lock and thus must -+ * not sleep -+ * @getkeycodebig_from_scancode: optional method to retrieve current keymap -+ * from an scancode. If not supplied default mechanism will be used. -+ * The method is being called while holding event_lock and thus must -+ * not sleep - * @ff: force feedback structure associated with the device if device - * supports force feedback effects - * @repeat_key: stores key code of the last key pressed; used to implement -@@ -1147,6 +1166,12 @@ struct input_dev { - unsigned int scancode, unsigned int keycode); - int (*getkeycode)(struct input_dev *dev, - unsigned int scancode, unsigned int *keycode); -+ int (*setkeycodebig)(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry); -+ int (*getkeycodebig_from_index)(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry); -+ int (*getkeycodebig_from_scancode)(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry); - - struct ff_device *ff; - -@@ -1422,6 +1447,10 @@ int input_get_keycode(struct input_dev *dev, - unsigned int scancode, unsigned int *keycode); - int input_set_keycode(struct input_dev *dev, - unsigned int scancode, unsigned int keycode); -+int input_get_keycode_big(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry); -+int input_set_keycode_big(struct input_dev *dev, -+ struct keycode_table_entry *kt_entry); - - extern struct class input_class; - -diff --git a/include/media/ir-core.h b/include/media/ir-core.h -index ad1303f..513e60d 100644 ---- a/include/media/ir-core.h -+++ b/include/media/ir-core.h -@@ -47,15 +47,21 @@ enum rc_driver_type { - * is opened. - * @close: callback to allow drivers to disable polling/irq when IR input device - * is opened. -+ * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) -+ * @s_tx_carrier: set transmit carrier frequency -+ * @tx_ir: transmit IR - */ - struct ir_dev_props { - enum rc_driver_type driver_type; - unsigned long allowed_protos; - u32 scanmask; -- void *priv; -+ void *priv; - int (*change_protocol)(void *priv, u64 ir_type); - int (*open)(void *priv); - void (*close)(void *priv); -+ int (*s_tx_mask)(void *priv, u32 mask); -+ int (*s_tx_carrier)(void *priv, u32 carrier); -+ int (*tx_ir)(void *priv, int *txbuf, u32 n); - }; - - struct ir_input_dev { -diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h -index 0506e45..5e96d7a 100644 ---- a/include/media/ir-kbd-i2c.h -+++ b/include/media/ir-kbd-i2c.h -@@ -11,7 +11,7 @@ struct IR_i2c { - struct i2c_client *c; - struct input_dev *input; - struct ir_input_state ir; -- -+ u64 ir_type; - /* Used to avoid fast repeating */ - unsigned char old; - -diff --git a/include/media/lirc.h b/include/media/lirc.h -new file mode 100644 -index 0000000..42c467c ---- /dev/null -+++ b/include/media/lirc.h -@@ -0,0 +1,165 @@ -+/* -+ * lirc.h - linux infrared remote control header file -+ * last modified 2010/07/13 by Jarod Wilson -+ */ -+ -+#ifndef _LINUX_LIRC_H -+#define _LINUX_LIRC_H -+ -+#include -+#include -+ -+#define PULSE_BIT 0x01000000 -+#define PULSE_MASK 0x00FFFFFF -+ -+#define LIRC_MODE2_SPACE 0x00000000 -+#define LIRC_MODE2_PULSE 0x01000000 -+#define LIRC_MODE2_FREQUENCY 0x02000000 -+#define LIRC_MODE2_TIMEOUT 0x03000000 -+ -+#define LIRC_VALUE_MASK 0x00FFFFFF -+#define LIRC_MODE2_MASK 0xFF000000 -+ -+#define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE) -+#define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE) -+#define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY) -+#define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT) -+ -+#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK) -+#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK) -+ -+#define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE) -+#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE) -+#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY) -+#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT) -+ -+/* used heavily by lirc userspace */ -+#define lirc_t int -+ -+/*** lirc compatible hardware features ***/ -+ -+#define LIRC_MODE2SEND(x) (x) -+#define LIRC_SEND2MODE(x) (x) -+#define LIRC_MODE2REC(x) ((x) << 16) -+#define LIRC_REC2MODE(x) ((x) >> 16) -+ -+#define LIRC_MODE_RAW 0x00000001 -+#define LIRC_MODE_PULSE 0x00000002 -+#define LIRC_MODE_MODE2 0x00000004 -+#define LIRC_MODE_LIRCCODE 0x00000010 -+ -+ -+#define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW) -+#define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE) -+#define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2) -+#define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE) -+ -+#define LIRC_CAN_SEND_MASK 0x0000003f -+ -+#define LIRC_CAN_SET_SEND_CARRIER 0x00000100 -+#define LIRC_CAN_SET_SEND_DUTY_CYCLE 0x00000200 -+#define LIRC_CAN_SET_TRANSMITTER_MASK 0x00000400 -+ -+#define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW) -+#define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE) -+#define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2) -+#define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE) -+ -+#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK) -+ -+#define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16) -+#define LIRC_CAN_SET_REC_DUTY_CYCLE (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16) -+ -+#define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000 -+#define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000 -+#define LIRC_CAN_GET_REC_RESOLUTION 0x20000000 -+#define LIRC_CAN_SET_REC_TIMEOUT 0x10000000 -+#define LIRC_CAN_SET_REC_FILTER 0x08000000 -+ -+#define LIRC_CAN_MEASURE_CARRIER 0x02000000 -+ -+#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK) -+#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK) -+ -+#define LIRC_CAN_NOTIFY_DECODE 0x01000000 -+ -+/*** IOCTL commands for lirc driver ***/ -+ -+#define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32) -+ -+#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32) -+#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32) -+#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32) -+#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32) -+#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32) -+#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32) -+#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32) -+ -+#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32) -+#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32) -+ -+#define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32) -+#define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32) -+#define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32) -+#define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32) -+ -+/* code length in bits, currently only for LIRC_MODE_LIRCCODE */ -+#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32) -+ -+#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32) -+#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32) -+/* Note: these can reset the according pulse_width */ -+#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32) -+#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32) -+#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32) -+#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32) -+#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32) -+ -+/* -+ * when a timeout != 0 is set the driver will send a -+ * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is -+ * never sent, timeout is disabled by default -+ */ -+#define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, __u32) -+ -+/* 1 enables, 0 disables timeout reports in MODE2 */ -+#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32) -+ -+/* -+ * pulses shorter than this are filtered out by hardware (software -+ * emulation in lirc_dev?) -+ */ -+#define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32) -+/* -+ * spaces shorter than this are filtered out by hardware (software -+ * emulation in lirc_dev?) -+ */ -+#define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32) -+/* -+ * if filter cannot be set independantly for pulse/space, this should -+ * be used -+ */ -+#define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32) -+ -+/* -+ * if enabled from the next key press on the driver will send -+ * LIRC_MODE2_FREQUENCY packets -+ */ -+#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32) -+ -+/* -+ * to set a range use -+ * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the -+ * lower bound first and later -+ * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound -+ */ -+ -+#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32) -+#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32) -+ -+#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020) -+ -+#define LIRC_SETUP_START _IO('i', 0x00000021) -+#define LIRC_SETUP_END _IO('i', 0x00000022) -+ -+#endif -diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h -new file mode 100644 -index 0000000..b1f6066 ---- /dev/null -+++ b/include/media/lirc_dev.h -@@ -0,0 +1,225 @@ -+/* -+ * LIRC base driver -+ * -+ * by Artur Lipowski -+ * This code is licensed under GNU GPL -+ * -+ */ -+ -+#ifndef _LINUX_LIRC_DEV_H -+#define _LINUX_LIRC_DEV_H -+ -+#define MAX_IRCTL_DEVICES 4 -+#define BUFLEN 16 -+ -+#define mod(n, div) ((n) % (div)) -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct lirc_buffer { -+ wait_queue_head_t wait_poll; -+ spinlock_t fifo_lock; -+ unsigned int chunk_size; -+ unsigned int size; /* in chunks */ -+ /* Using chunks instead of bytes pretends to simplify boundary checking -+ * And should allow for some performance fine tunning later */ -+ struct kfifo fifo; -+ u8 fifo_initialized; -+}; -+ -+static inline void lirc_buffer_clear(struct lirc_buffer *buf) -+{ -+ unsigned long flags; -+ -+ if (buf->fifo_initialized) { -+ spin_lock_irqsave(&buf->fifo_lock, flags); -+ kfifo_reset(&buf->fifo); -+ spin_unlock_irqrestore(&buf->fifo_lock, flags); -+ } else -+ WARN(1, "calling %s on an uninitialized lirc_buffer\n", -+ __func__); -+} -+ -+static inline int lirc_buffer_init(struct lirc_buffer *buf, -+ unsigned int chunk_size, -+ unsigned int size) -+{ -+ int ret; -+ -+ init_waitqueue_head(&buf->wait_poll); -+ spin_lock_init(&buf->fifo_lock); -+ buf->chunk_size = chunk_size; -+ buf->size = size; -+ ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); -+ if (ret == 0) -+ buf->fifo_initialized = 1; -+ -+ return ret; -+} -+ -+static inline void lirc_buffer_free(struct lirc_buffer *buf) -+{ -+ if (buf->fifo_initialized) { -+ kfifo_free(&buf->fifo); -+ buf->fifo_initialized = 0; -+ } else -+ WARN(1, "calling %s on an uninitialized lirc_buffer\n", -+ __func__); -+} -+ -+static inline int lirc_buffer_len(struct lirc_buffer *buf) -+{ -+ int len; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&buf->fifo_lock, flags); -+ len = kfifo_len(&buf->fifo); -+ spin_unlock_irqrestore(&buf->fifo_lock, flags); -+ -+ return len; -+} -+ -+static inline int lirc_buffer_full(struct lirc_buffer *buf) -+{ -+ return lirc_buffer_len(buf) == buf->size * buf->chunk_size; -+} -+ -+static inline int lirc_buffer_empty(struct lirc_buffer *buf) -+{ -+ return !lirc_buffer_len(buf); -+} -+ -+static inline int lirc_buffer_available(struct lirc_buffer *buf) -+{ -+ return buf->size - (lirc_buffer_len(buf) / buf->chunk_size); -+} -+ -+static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, -+ unsigned char *dest) -+{ -+ unsigned int ret = 0; -+ -+ if (lirc_buffer_len(buf) >= buf->chunk_size) -+ ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, -+ &buf->fifo_lock); -+ return ret; -+ -+} -+ -+static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, -+ unsigned char *orig) -+{ -+ unsigned int ret; -+ -+ ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, -+ &buf->fifo_lock); -+ -+ return ret; -+} -+ -+struct lirc_driver { -+ char name[40]; -+ int minor; -+ unsigned long code_length; -+ unsigned int buffer_size; /* in chunks holding one code each */ -+ int sample_rate; -+ unsigned long features; -+ -+ unsigned int chunk_size; -+ -+ void *data; -+ int min_timeout; -+ int max_timeout; -+ int (*add_to_buf) (void *data, struct lirc_buffer *buf); -+ struct lirc_buffer *rbuf; -+ int (*set_use_inc) (void *data); -+ void (*set_use_dec) (void *data); -+ struct file_operations *fops; -+ struct device *dev; -+ struct module *owner; -+}; -+ -+/* name: -+ * this string will be used for logs -+ * -+ * minor: -+ * indicates minor device (/dev/lirc) number for registered driver -+ * if caller fills it with negative value, then the first free minor -+ * number will be used (if available) -+ * -+ * code_length: -+ * length of the remote control key code expressed in bits -+ * -+ * sample_rate: -+ * -+ * data: -+ * it may point to any driver data and this pointer will be passed to -+ * all callback functions -+ * -+ * add_to_buf: -+ * add_to_buf will be called after specified period of the time or -+ * triggered by the external event, this behavior depends on value of -+ * the sample_rate this function will be called in user context. This -+ * routine should return 0 if data was added to the buffer and -+ * -ENODATA if none was available. This should add some number of bits -+ * evenly divisible by code_length to the buffer -+ * -+ * rbuf: -+ * if not NULL, it will be used as a read buffer, you will have to -+ * write to the buffer by other means, like irq's (see also -+ * lirc_serial.c). -+ * -+ * set_use_inc: -+ * set_use_inc will be called after device is opened -+ * -+ * set_use_dec: -+ * set_use_dec will be called after device is closed -+ * -+ * fops: -+ * file_operations for drivers which don't fit the current driver model. -+ * -+ * Some ioctl's can be directly handled by lirc_dev if the driver's -+ * ioctl function is NULL or if it returns -ENOIOCTLCMD (see also -+ * lirc_serial.c). -+ * -+ * owner: -+ * the module owning this struct -+ * -+ */ -+ -+ -+/* following functions can be called ONLY from user context -+ * -+ * returns negative value on error or minor number -+ * of the registered device if success -+ * contents of the structure pointed by p is copied -+ */ -+extern int lirc_register_driver(struct lirc_driver *d); -+ -+/* returns negative value on error or 0 if success -+*/ -+extern int lirc_unregister_driver(int minor); -+ -+/* Returns the private data stored in the lirc_driver -+ * associated with the given device file pointer. -+ */ -+void *lirc_get_pdata(struct file *file); -+ -+/* default file operations -+ * used by drivers if they override only some operations -+ */ -+int lirc_dev_fop_open(struct inode *inode, struct file *file); -+int lirc_dev_fop_close(struct inode *inode, struct file *file); -+unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); -+long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); -+ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, -+ loff_t *ppos); -+ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, -+ loff_t *ppos); -+ -+#endif -diff --git a/include/media/rc-map.h b/include/media/rc-map.h -index c78e99a..a329858 100644 ---- a/include/media/rc-map.h -+++ b/include/media/rc-map.h -@@ -17,8 +17,13 @@ - #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ - #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ - #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ -+#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ - #define IR_TYPE_OTHER (1u << 31) - -+#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ -+ IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ -+ IR_TYPE_OTHER) -+ - struct ir_scancode { - u32 scancode; - u32 keycode; -@@ -87,6 +92,7 @@ void rc_map_init(void); - #define RC_MAP_KAIOMY "rc-kaiomy" - #define RC_MAP_KWORLD_315U "rc-kworld-315u" - #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" -+#define RC_MAP_LIRC "rc-lirc" - #define RC_MAP_MANLI "rc-manli" - #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" - #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" -@@ -107,6 +113,7 @@ void rc_map_init(void); - #define RC_MAP_PV951 "rc-pv951" - #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" - #define RC_MAP_RC5_TV "rc-rc5-tv" -+#define RC_MAP_RC6_MCE "rc-rc6-mce" - #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" - #define RC_MAP_TBS_NEC "rc-tbs-nec" - #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" diff --git a/linux-2.6-v4l-dvb-uvcvideo-update.patch b/linux-2.6-v4l-dvb-uvcvideo-update.patch deleted file mode 100644 index 3251c7fa3..000000000 --- a/linux-2.6-v4l-dvb-uvcvideo-update.patch +++ /dev/null @@ -1,362 +0,0 @@ -From: Martin Rubli -Date: Wed, 19 May 2010 22:51:56 +0000 (+0200) -Subject: uvcvideo: Add support for absolute pan/tilt controls -X-Git-Url: http://git.linuxtv.org/pinchartl/uvcvideo.git?a=commitdiff_plain;h=d3c2f664ec76aff14c3841c99e84cd78d7227f79 - -uvcvideo: Add support for absolute pan/tilt controls - -Signed-off-by: Martin Rubli ---- - -diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c -index aa0720a..5ec2f4a 100644 ---- a/drivers/media/video/uvc/uvc_ctrl.c -+++ b/drivers/media/video/uvc/uvc_ctrl.c -@@ -606,6 +606,26 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = { - .set = uvc_ctrl_set_zoom, - }, - { -+ .id = V4L2_CID_PAN_ABSOLUTE, -+ .name = "Pan (Absolute)", -+ .entity = UVC_GUID_UVC_CAMERA, -+ .selector = UVC_CT_PANTILT_ABSOLUTE_CONTROL, -+ .size = 32, -+ .offset = 0, -+ .v4l2_type = V4L2_CTRL_TYPE_INTEGER, -+ .data_type = UVC_CTRL_DATA_TYPE_UNSIGNED, -+ }, -+ { -+ .id = V4L2_CID_TILT_ABSOLUTE, -+ .name = "Tilt (Absolute)", -+ .entity = UVC_GUID_UVC_CAMERA, -+ .selector = UVC_CT_PANTILT_ABSOLUTE_CONTROL, -+ .size = 32, -+ .offset = 32, -+ .v4l2_type = V4L2_CTRL_TYPE_INTEGER, -+ .data_type = UVC_CTRL_DATA_TYPE_UNSIGNED, -+ }, -+ { - .id = V4L2_CID_PRIVACY, - .name = "Privacy", - .entity = UVC_GUID_UVC_CAMERA, -From: Hans de Goede -Date: Wed, 19 May 2010 23:15:00 +0000 (+0200) -Subject: uvcvideo: Make button controls work properly -X-Git-Url: http://git.linuxtv.org/pinchartl/uvcvideo.git?a=commitdiff_plain;h=2bd47ad4894bfaf1a97660b821cbc46439a614d6 - -uvcvideo: Make button controls work properly - -According to the v4l2 spec, writing any value to a button control should -result in the action belonging to the button control being triggered. -UVC cams however want to see a 1 written, this patch fixes this by -overriding whatever value user space passed in with -1 (0xffffffff) when -the control is a button control. - -Signed-off-by: Hans de Goede ---- - -diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c -index 5ec2f4a..8bb825d 100644 ---- a/drivers/media/video/uvc/uvc_ctrl.c -+++ b/drivers/media/video/uvc/uvc_ctrl.c -@@ -698,6 +698,14 @@ static void uvc_set_le_value(struct uvc_control_mapping *mapping, - int offset = mapping->offset; - __u8 mask; - -+ /* According to the v4l2 spec, writing any value to a button control -+ * should result in the action belonging to the button control being -+ * triggered. UVC devices however want to see a 1 written -> override -+ * value. -+ */ -+ if (mapping->v4l2_type == V4L2_CTRL_TYPE_BUTTON) -+ value = -1; -+ - data += offset / 8; - offset &= 7; - -From: Laurent Pinchart -Date: Thu, 18 Feb 2010 19:38:52 +0000 (+0100) -Subject: uvcvideo: Support menu controls in the control mapping API -X-Git-Url: http://git.linuxtv.org/pinchartl/uvcvideo.git?a=commitdiff_plain;h=4930f2662e47d33e5baedac620da401a225bc3a8 - -uvcvideo: Support menu controls in the control mapping API - -The UVCIOC_CTRL_MAP ioctl doesn't support menu entries for menu -controls. As the uvc_xu_control_mapping structure has no reserved -fields, this can't be fixed while keeping ABI compatibility. - -Modify the UVCIOC_CTRL_MAP ioctl to add menu entries support, and define -UVCIOC_CTRL_MAP_OLD that supports the old ABI without any ability to add -menu controls. - -Signed-off-by: Laurent Pinchart ---- - -diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c -index 8bb825d..c88d72e 100644 ---- a/drivers/media/video/uvc/uvc_ctrl.c -+++ b/drivers/media/video/uvc/uvc_ctrl.c -@@ -1606,6 +1606,28 @@ void uvc_ctrl_cleanup_device(struct uvc_device *dev) - } - } - -+void uvc_ctrl_cleanup(void) -+{ -+ struct uvc_control_info *info; -+ struct uvc_control_info *ni; -+ struct uvc_control_mapping *mapping; -+ struct uvc_control_mapping *nm; -+ -+ list_for_each_entry_safe(info, ni, &uvc_driver.controls, list) { -+ if (!(info->flags & UVC_CONTROL_EXTENSION)) -+ continue; -+ -+ list_for_each_entry_safe(mapping, nm, &info->mappings, list) { -+ list_del(&mapping->list); -+ kfree(mapping->menu_info); -+ kfree(mapping); -+ } -+ -+ list_del(&info->list); -+ kfree(info); -+ } -+} -+ - void uvc_ctrl_init(void) - { - struct uvc_control_info *ctrl = uvc_ctrls; -diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c -index 838b56f..34818c1 100644 ---- a/drivers/media/video/uvc/uvc_driver.c -+++ b/drivers/media/video/uvc/uvc_driver.c -@@ -2261,6 +2261,7 @@ static int __init uvc_init(void) - static void __exit uvc_cleanup(void) - { - usb_deregister(&uvc_driver.driver); -+ uvc_ctrl_cleanup(); - } - - module_init(uvc_init); -diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c -index 7c9ab29..485a899 100644 ---- a/drivers/media/video/uvc/uvc_v4l2.c -+++ b/drivers/media/video/uvc/uvc_v4l2.c -@@ -29,6 +29,71 @@ - #include "uvcvideo.h" - - /* ------------------------------------------------------------------------ -+ * UVC ioctls -+ */ -+static int uvc_ioctl_ctrl_map(struct uvc_xu_control_mapping *xmap, int old) -+{ -+ struct uvc_control_mapping *map; -+ unsigned int size; -+ int ret; -+ -+ map = kzalloc(sizeof *map, GFP_KERNEL); -+ if (map == NULL) -+ return -ENOMEM; -+ -+ map->id = xmap->id; -+ memcpy(map->name, xmap->name, sizeof map->name); -+ memcpy(map->entity, xmap->entity, sizeof map->entity); -+ map->selector = xmap->selector; -+ map->size = xmap->size; -+ map->offset = xmap->offset; -+ map->v4l2_type = xmap->v4l2_type; -+ map->data_type = xmap->data_type; -+ -+ switch (xmap->v4l2_type) { -+ case V4L2_CTRL_TYPE_INTEGER: -+ case V4L2_CTRL_TYPE_BOOLEAN: -+ case V4L2_CTRL_TYPE_BUTTON: -+ break; -+ -+ case V4L2_CTRL_TYPE_MENU: -+ if (old) { -+ ret = -EINVAL; -+ goto done; -+ } -+ -+ size = xmap->menu_count * sizeof(*map->menu_info); -+ map->menu_info = kmalloc(size, GFP_KERNEL); -+ if (map->menu_info == NULL) { -+ ret = -ENOMEM; -+ goto done; -+ } -+ -+ if (copy_from_user(map->menu_info, xmap->menu_info, size)) { -+ ret = -EFAULT; -+ goto done; -+ } -+ -+ map->menu_count = xmap->menu_count; -+ break; -+ -+ default: -+ ret = -EINVAL; -+ goto done; -+ } -+ -+ ret = uvc_ctrl_add_mapping(map); -+ -+done: -+ if (ret < 0) { -+ kfree(map->menu_info); -+ kfree(map); -+ } -+ -+ return ret; -+} -+ -+/* ------------------------------------------------------------------------ - * V4L2 interface - */ - -@@ -974,7 +1039,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) - info->flags = xinfo->flags; - - info->flags |= UVC_CONTROL_GET_MIN | UVC_CONTROL_GET_MAX | -- UVC_CONTROL_GET_RES | UVC_CONTROL_GET_DEF; -+ UVC_CONTROL_GET_RES | UVC_CONTROL_GET_DEF | -+ UVC_CONTROL_EXTENSION; - - ret = uvc_ctrl_add_info(info); - if (ret < 0) -@@ -982,32 +1048,12 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) - break; - } - -+ case UVCIOC_CTRL_MAP_OLD: - case UVCIOC_CTRL_MAP: -- { -- struct uvc_xu_control_mapping *xmap = arg; -- struct uvc_control_mapping *map; -- - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - -- map = kzalloc(sizeof *map, GFP_KERNEL); -- if (map == NULL) -- return -ENOMEM; -- -- map->id = xmap->id; -- memcpy(map->name, xmap->name, sizeof map->name); -- memcpy(map->entity, xmap->entity, sizeof map->entity); -- map->selector = xmap->selector; -- map->size = xmap->size; -- map->offset = xmap->offset; -- map->v4l2_type = xmap->v4l2_type; -- map->data_type = xmap->data_type; -- -- ret = uvc_ctrl_add_mapping(map); -- if (ret < 0) -- kfree(map); -- break; -- } -+ return uvc_ioctl_ctrl_map(arg, cmd == UVCIOC_CTRL_MAP_OLD); - - case UVCIOC_CTRL_GET: - return uvc_xu_ctrl_query(chain, arg, 0); -diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h -index d1f8840..14f77e4 100644 ---- a/drivers/media/video/uvc/uvcvideo.h -+++ b/drivers/media/video/uvc/uvcvideo.h -@@ -27,6 +27,8 @@ - #define UVC_CONTROL_RESTORE (1 << 6) - /* Control can be updated by the camera. */ - #define UVC_CONTROL_AUTO_UPDATE (1 << 7) -+/* Control is an extension unit control. */ -+#define UVC_CONTROL_EXTENSION (1 << 8) - - #define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \ - UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \ -@@ -40,6 +42,15 @@ struct uvc_xu_control_info { - __u32 flags; - }; - -+struct uvc_menu_info { -+ __u32 value; -+ __u8 name[32]; -+}; -+ -+struct uvc_xu_control_mapping_old { -+ __u8 reserved[64]; -+}; -+ - struct uvc_xu_control_mapping { - __u32 id; - __u8 name[32]; -@@ -50,6 +61,11 @@ struct uvc_xu_control_mapping { - __u8 offset; - enum v4l2_ctrl_type v4l2_type; - __u32 data_type; -+ -+ struct uvc_menu_info __user *menu_info; -+ __u32 menu_count; -+ -+ __u32 reserved[4]; - }; - - struct uvc_xu_control { -@@ -60,6 +76,7 @@ struct uvc_xu_control { - }; - - #define UVCIOC_CTRL_ADD _IOW('U', 1, struct uvc_xu_control_info) -+#define UVCIOC_CTRL_MAP_OLD _IOWR('U', 2, struct uvc_xu_control_mapping_old) - #define UVCIOC_CTRL_MAP _IOWR('U', 2, struct uvc_xu_control_mapping) - #define UVCIOC_CTRL_GET _IOWR('U', 3, struct uvc_xu_control) - #define UVCIOC_CTRL_SET _IOW('U', 4, struct uvc_xu_control) -@@ -198,11 +215,6 @@ struct uvc_streaming_control { - __u8 bMaxVersion; - }; - --struct uvc_menu_info { -- __u32 value; -- __u8 name[32]; --}; -- - struct uvc_control_info { - struct list_head list; - struct list_head mappings; -@@ -625,6 +637,7 @@ extern int uvc_ctrl_init_device(struct uvc_device *dev); - extern void uvc_ctrl_cleanup_device(struct uvc_device *dev); - extern int uvc_ctrl_resume_device(struct uvc_device *dev); - extern void uvc_ctrl_init(void); -+extern void uvc_ctrl_cleanup(void); - - extern int uvc_ctrl_begin(struct uvc_video_chain *chain); - extern int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback); -From: Laurent Pinchart -Date: Fri, 25 Jun 2010 07:58:43 +0000 (+0200) -Subject: uvcvideo: Add support for Manta MM-353 Plako -X-Git-Url: http://git.linuxtv.org/pinchartl/uvcvideo.git?a=commitdiff_plain;h=352e661e1f347390a86cf34bc5e41adbdd1caa41 - -uvcvideo: Add support for Manta MM-353 Plako - -The camera requires the PROBE_MINMAX quirk. Add a corresponding entry -in the device IDs list - -Signed-off-by: Laurent Pinchart ---- - -diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c -index 34818c1..1a89384 100644 ---- a/drivers/media/video/uvc/uvc_driver.c -+++ b/drivers/media/video/uvc/uvc_driver.c -@@ -2174,6 +2174,15 @@ static struct usb_device_id uvc_ids[] = { - .bInterfaceSubClass = 1, - .bInterfaceProtocol = 0, - .driver_info = UVC_QUIRK_PROBE_EXTRAFIELDS }, -+ /* Manta MM-353 Plako */ -+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE -+ | USB_DEVICE_ID_MATCH_INT_INFO, -+ .idVendor = 0x18ec, -+ .idProduct = 0x3188, -+ .bInterfaceClass = USB_CLASS_VIDEO, -+ .bInterfaceSubClass = 1, -+ .bInterfaceProtocol = 0, -+ .driver_info = UVC_QUIRK_PROBE_MINMAX }, - /* FSC WebCam V30S */ - { .match_flags = USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, diff --git a/pci-_osc-supported-field-should-contain-supported-features-not-enabled-ones.patch b/pci-_osc-supported-field-should-contain-supported-features-not-enabled-ones.patch deleted file mode 100644 index 0baffd639..000000000 --- a/pci-_osc-supported-field-should-contain-supported-features-not-enabled-ones.patch +++ /dev/null @@ -1,66 +0,0 @@ -commit 885c252ffb059dc493200bdb981bdd21cabe4442 -Author: Matthew Garrett -Date: Thu Dec 9 18:31:59 2010 -0500 - - PCI: _OSC "supported" field should contain supported features, not enabled ones - - From testing with Windows, the call to the PCI root _OSC method includes - the full set of features supported by the operating system even if the - hardware has already indicated that it doesn't support ASPM or MSI. - https://bugzilla.redhat.com/show_bug.cgi?id=638912 is a case where making - the _OSC call will incorrectly configure the chipset unless the supported - field has bits 1, 2 and 4 set. Rework the functionality to ensure that - we match this behaviour. - - Signed-off-by: Matthew Garrett - -diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c -index 96668ad..afb5d08 100644 ---- a/drivers/acpi/pci_root.c -+++ b/drivers/acpi/pci_root.c -@@ -450,7 +450,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) - struct acpi_pci_root *root; - acpi_handle handle; - struct acpi_device *child; -- u32 flags, base_flags; -+ u32 flags; - - root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); - if (!root) -@@ -498,10 +498,15 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) - device->driver_data = root; - - /* -- * All supported architectures that use ACPI have support for -- * PCI domains, so we indicate this in _OSC support capabilities. -+ * Indicate support for various _OSC capabilities. These match -+ * what the operating system supports, not what the hardware supports, -+ * so they shouldn't be conditional on functionality that's been -+ * blacklisted - */ -- flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; -+ flags = OSC_EXT_PCI_CONFIG_SUPPORT | OSC_ACTIVE_STATE_PWR_SUPPORT | -+ OSC_CLOCK_PWR_CAPABILITY_SUPPORT | -+ OSC_PCI_SEGMENT_GROUPS_SUPPORT | OSC_MSI_SUPPORT; -+ - acpi_pci_osc_support(root, flags); - - /* -@@ -555,17 +560,6 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) - list_for_each_entry(child, &device->children, node) - acpi_pci_bridge_scan(child); - -- /* Indicate support for various _OSC capabilities. */ -- if (pci_ext_cfg_avail(root->bus->self)) -- flags |= OSC_EXT_PCI_CONFIG_SUPPORT; -- if (pcie_aspm_enabled()) -- flags |= OSC_ACTIVE_STATE_PWR_SUPPORT | -- OSC_CLOCK_PWR_CAPABILITY_SUPPORT; -- if (pci_msi_enabled()) -- flags |= OSC_MSI_SUPPORT; -- if (flags != base_flags) -- acpi_pci_osc_support(root, flags); -- - pci_acpi_add_bus_pm_notifier(device, root->bus); - if (device->wakeup.flags.run_wake) - device_set_run_wake(root->bus->bridge, true); diff --git a/pci-enable-aspm-state-clearing-regardless-of-policy.patch b/pci-enable-aspm-state-clearing-regardless-of-policy.patch new file mode 100644 index 000000000..afc977623 --- /dev/null +++ b/pci-enable-aspm-state-clearing-regardless-of-policy.patch @@ -0,0 +1,29 @@ +From: Alex Williamson +Date: Thu, 10 Mar 2011 18:54:16 +0000 (-0700) +Subject: PCI: Enable ASPM state clearing regardless of policy +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjbarnes%2Fpci-2.6.git;a=commitdiff_plain;h=1a4e6a3c049bba1574c2a80af44f0ceb5c1abf83 + +PCI: Enable ASPM state clearing regardless of policy + +Commit 2f671e2d allowed us to clear ASPM state when the FADT +tells us it isn't supported, but we don't put this into effect +if the aspm_policy is set to POLICY_POWERSAVE. Enable the +state to be cleared regardless of policy. + +Signed-off-by: Alex Williamson +Signed-off-by: Jesse Barnes +--- + +diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c +index eee09f7..3eb667b 100644 +--- a/drivers/pci/pcie/aspm.c ++++ b/drivers/pci/pcie/aspm.c +@@ -608,7 +608,7 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev) + * the BIOS's expectation, we'll do so once pci_enable_device() is + * called. + */ +- if (aspm_policy != POLICY_POWERSAVE) { ++ if (aspm_policy != POLICY_POWERSAVE || aspm_clear_state) { + pcie_config_aspm_path(link); + pcie_set_clkpm(link, policy_to_clkpm_state(link)); + } diff --git a/perf-gcc460-build-fixes.patch b/perf-gcc460-build-fixes.patch deleted file mode 100644 index 074ab6f20..000000000 --- a/perf-gcc460-build-fixes.patch +++ /dev/null @@ -1,227 +0,0 @@ -From linux-kernel-owner@vger.kernel.org Mon Jan 24 11:13:12 2011 -Date: Mon, 24 Jan 2011 11:13:04 -0500 -From: Kyle McMartin -To: mingo@redhat.com -Cc: linux-kernel@vger.kernel.org, acme@redhat.com -Subject: [PATCH] perf: fix gcc 4.6.0 issues with tools/perf -Message-ID: <20110124161304.GK27353@bombadil.infradead.org> - -Hi Ingo, - -GCC 4.6.0 in Fedora rawhide turned up some compile errors in tools/perf -due to the -Werror=unused-but-set-variable flag. - -I've gone through and annotated some of the assignments that had side -effects (ie: return value from a function) with the __used annotation, -and in some cases, just removed unused code. - -In a few cases, we were assigning something useful, but not using it in -later parts of the function. - -regards, Kyle - -kyle@dreadnought:~/src% gcc --version -gcc (GCC) 4.6.0 20110122 (Red Hat 4.6.0-0.3) - ---- - - bench/sched-pipe.c | 2 +- - builtin-sched.c | 12 +++--------- - builtin-top.c | 5 +---- - util/header.c | 2 +- - util/hist.c | 3 --- - util/scripting-engines/trace-event-python.c | 3 +-- - util/symbol.c | 4 ++-- - util/trace-event-parse.c | 2 +- - util/ui/browsers/map.c | 2 +- - 9 files changed, 11 insertions(+), 24 deletions(-) - -diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c -index d9ab3ce..0c7454f 100644 ---- a/tools/perf/bench/sched-pipe.c -+++ b/tools/perf/bench/sched-pipe.c -@@ -55,7 +55,7 @@ int bench_sched_pipe(int argc, const char **argv, - * discarding returned value of read(), write() - * causes error in building environment for perf - */ -- int ret, wait_stat; -+ int __used ret, wait_stat; - pid_t pid, retpid; - - argc = parse_options(argc, argv, options, -diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c -index 29e7ffd..f9e304f 100644 ---- a/tools/perf/builtin-sched.c -+++ b/tools/perf/builtin-sched.c -@@ -369,11 +369,6 @@ static void - process_sched_event(struct task_desc *this_task __used, struct sched_atom *atom) - { - int ret = 0; -- u64 now; -- long long delta; -- -- now = get_nsecs(); -- delta = start_time + atom->timestamp - now; - - switch (atom->type) { - case SCHED_EVENT_RUN: -@@ -562,7 +557,7 @@ static void wait_for_tasks(void) - - static void run_one_test(void) - { -- u64 T0, T1, delta, avg_delta, fluct, std_dev; -+ u64 T0, T1, delta, avg_delta, fluct; - - T0 = get_nsecs(); - wait_for_tasks(); -@@ -578,7 +573,6 @@ static void run_one_test(void) - else - fluct = delta - avg_delta; - sum_fluct += fluct; -- std_dev = sum_fluct / nr_runs / sqrt(nr_runs); - if (!run_avg) - run_avg = delta; - run_avg = (run_avg*9 + delta)/10; -@@ -799,7 +793,7 @@ replay_switch_event(struct trace_switch_event *switch_event, - u64 timestamp, - struct thread *thread __used) - { -- struct task_desc *prev, *next; -+ struct task_desc *prev, __used *next; - u64 timestamp0; - s64 delta; - -@@ -1404,7 +1398,7 @@ map_switch_event(struct trace_switch_event *switch_event, - u64 timestamp, - struct thread *thread __used) - { -- struct thread *sched_out, *sched_in; -+ struct thread *sched_out __used, *sched_in; - int new_shortname; - u64 timestamp0; - s64 delta; -diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c -index 05344c6..373cfc0 100644 ---- a/tools/perf/builtin-top.c -+++ b/tools/perf/builtin-top.c -@@ -182,7 +182,6 @@ static int parse_source(struct sym_entry *syme) - FILE *file; - char command[PATH_MAX*2]; - const char *path; -- u64 len; - - if (!syme) - return -1; -@@ -211,8 +210,6 @@ static int parse_source(struct sym_entry *syme) - } - path = map->dso->long_name; - -- len = sym->end - sym->start; -- - sprintf(command, - "objdump --start-address=%#0*" PRIx64 " --stop-address=%#0*" PRIx64 " -dS %s", - BITS_PER_LONG / 4, map__rip_2objdump(map, sym->start), -@@ -1295,7 +1292,7 @@ static int __cmd_top(void) - { - pthread_t thread; - struct perf_evsel *counter; -- int i, ret; -+ int i, ret __used; - /* - * FIXME: perf_session__new should allow passing a O_MMAP, so that all this - * mmap reading, etc is encapsulated in it. Use O_WRONLY for now. -diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c -index 989fa2d..c0e5019 100644 ---- a/tools/perf/util/header.c -+++ b/tools/perf/util/header.c -@@ -1139,7 +1139,7 @@ int event__synthesize_tracing_data(int fd, struct list_head *pattrs, - { - event_t ev; - ssize_t size = 0, aligned_size = 0, padding; -- int err = 0; -+ int err __used = 0; - - memset(&ev, 0, sizeof(ev)); - -diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c -index c749ba6..a01a33d 100644 ---- a/tools/perf/util/hist.c -+++ b/tools/perf/util/hist.c -@@ -1091,7 +1091,6 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head, - char command[PATH_MAX * 2]; - FILE *file; - int err = 0; -- u64 len; - char symfs_filename[PATH_MAX]; - - if (filename) { -@@ -1136,8 +1135,6 @@ fallback: - filename, sym->name, map->unmap_ip(map, sym->start), - map->unmap_ip(map, sym->end)); - -- len = sym->end - sym->start; -- - pr_debug("annotating [%p] %30s : [%p] %30s\n", - dso, dso->long_name, sym, sym->name); - -diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c -index c6d9933..2040b85 100644 ---- a/tools/perf/util/scripting-engines/trace-event-python.c -+++ b/tools/perf/util/scripting-engines/trace-event-python.c -@@ -248,8 +248,7 @@ static void python_process_event(int cpu, void *data, - context = PyCObject_FromVoidPtr(scripting_context, NULL); - - PyTuple_SetItem(t, n++, PyString_FromString(handler_name)); -- PyTuple_SetItem(t, n++, -- PyCObject_FromVoidPtr(scripting_context, NULL)); -+ PyTuple_SetItem(t, n++, context); - - if (handler) { - PyTuple_SetItem(t, n++, PyInt_FromLong(cpu)); -diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c -index 15ccfba..52e82cf 100644 ---- a/tools/perf/util/symbol.c -+++ b/tools/perf/util/symbol.c -@@ -1517,8 +1517,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) - symbol_conf.symfs, self->long_name); - break; - case DSO__ORIG_GUEST_KMODULE: -- if (map->groups && map->groups->machine) -- root_dir = map->groups->machine->root_dir; -+ if (map->groups && machine) -+ root_dir = machine->root_dir; - else - root_dir = ""; - snprintf(name, size, "%s%s%s", symbol_conf.symfs, -diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c -index 73a0222..d8e622d 100644 ---- a/tools/perf/util/trace-event-parse.c -+++ b/tools/perf/util/trace-event-parse.c -@@ -153,7 +153,7 @@ void parse_proc_kallsyms(char *file, unsigned int size __unused) - char *next = NULL; - char *addr_str; - char ch; -- int ret; -+ int ret __used; - int i; - - line = strtok_r(file, "\n", &next); -diff --git a/tools/perf/util/ui/browsers/map.c b/tools/perf/util/ui/browsers/map.c -index e35437d..3788cad 100644 ---- a/tools/perf/util/ui/browsers/map.c -+++ b/tools/perf/util/ui/browsers/map.c -@@ -40,7 +40,7 @@ static int ui_entry__read(const char *title, char *bf, size_t size, int width) - out_free_form: - newtPopWindow(); - newtFormDestroy(form); -- return 0; -+ return err; - } - - struct map_browser { --- -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Please read the FAQ at http://www.tux.org/lkml/ - diff --git a/prevent-runtime-conntrack-changes.patch b/prevent-runtime-conntrack-changes.patch deleted file mode 100644 index 59d62f3de..000000000 --- a/prevent-runtime-conntrack-changes.patch +++ /dev/null @@ -1,74 +0,0 @@ -Jon Masters correctly points out that conntrack hash sizes -(nf_conntrack_htable_size) are global (not per-netns) and -modifiable at runtime via /sys/module/nf_conntrack/hashsize . - -Steps to reproduce: - clone(CLONE_NEWNET) - [grow /sys/module/nf_conntrack/hashsize] - exit() - -At netns exit we are going to scan random memory for conntracks to be killed. - -Apparently there is a code which deals with hashtable resize for -init_net (and it was there befode netns conntrack code), so prohibit -hashsize modification if there is more than one netns exists. - -To change hashtable sizes, you need to reload module. - -Expectation hashtable size was simply glued to a variable with no code -to rehash expectations, so it was a bug to allow writing to it. -Make "expect_hashsize" readonly. - -This is temporarily until we figure out what to do. - -Signed-off-by: Alexey Dobriyan -Cc: stable@kernel.org ---- - - net/netfilter/nf_conntrack_core.c | 15 +++++++++++++++ - net/netfilter/nf_conntrack_expect.c | 2 +- - 2 files changed, 16 insertions(+), 1 deletion(-) - ---- a/net/netfilter/nf_conntrack_core.c -+++ b/net/netfilter/nf_conntrack_core.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1198,6 +1199,20 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) - if (!nf_conntrack_htable_size) - return param_set_uint(val, kp); - -+ { -+ struct net *net; -+ unsigned int nr; -+ -+ nr = 0; -+ rtnl_lock(); -+ for_each_net(net) -+ nr++; -+ rtnl_unlock(); -+ /* init_net always exists */ -+ if (nr != 1) -+ return -EINVAL; -+ } -+ - hashsize = simple_strtoul(val, NULL, 0); - if (!hashsize) - return -EINVAL; ---- a/net/netfilter/nf_conntrack_expect.c -+++ b/net/netfilter/nf_conntrack_expect.c -@@ -569,7 +569,7 @@ static void exp_proc_remove(struct net *net) - #endif /* CONFIG_PROC_FS */ - } - --module_param_named(expect_hashsize, nf_ct_expect_hsize, uint, 0600); -+module_param_named(expect_hashsize, nf_ct_expect_hsize, uint, 0400); - - int nf_conntrack_expect_init(struct net *net) - { - diff --git a/revert-hid-magicmouse-ignore-ivalid-report-id-while-switching.patch b/revert-hid-magicmouse-ignore-ivalid-report-id-while-switching.patch new file mode 100644 index 000000000..96be7fdd8 --- /dev/null +++ b/revert-hid-magicmouse-ignore-ivalid-report-id-while-switching.patch @@ -0,0 +1,43 @@ +From: Jiri Kosina +Date: Thu, 16 Jun 2011 10:21:34 +0000 (+0200) +Subject: Revert "HID: magicmouse: ignore 'ivalid report id' while switching modes" +X-Git-Tag: v3.0-rc4~20^2 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=c3a4924565e2eecf2539871abd123d35be6d76d5 + +Revert "HID: magicmouse: ignore 'ivalid report id' while switching modes" + +This reverts commit 23746a66d7d9e73402c68ef00d708796b97ebd72. + +It turned out that the actual reason for failure is not the device +firmware, but bug in Bluetooth stack, which will be fixed by +patch by Ville Tervo which corrects the mask handling for CSR 1.1 +Dongles. + +Reported-and-tested-by: Ed Tomlinson +Reported-and-tested-by: Chase Douglas +Signed-off-by: Jiri Kosina +--- + +diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c +index a5eda4c..0ec91c1 100644 +--- a/drivers/hid/hid-magicmouse.c ++++ b/drivers/hid/hid-magicmouse.c +@@ -501,17 +501,9 @@ static int magicmouse_probe(struct hid_device *hdev, + } + report->size = 6; + +- /* +- * The device reponds with 'invalid report id' when feature +- * report switching it into multitouch mode is sent to it. +- * +- * This results in -EIO from the _raw low-level transport callback, +- * but there seems to be no other way of switching the mode. +- * Thus the super-ugly hacky success check below. +- */ + ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature), + HID_FEATURE_REPORT); +- if (ret != -EIO) { ++ if (ret != sizeof(feature)) { + hid_err(hdev, "unable to request touch data (%d)\n", ret); + goto err_stop_hw; + } diff --git a/runtime_pm_fixups.patch b/runtime_pm_fixups.patch deleted file mode 100644 index 1be6149d6..000000000 --- a/runtime_pm_fixups.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 141d0d01ab292d4ea3a6d5e96b4048e10e68c1d3 Mon Sep 17 00:00:00 2001 -From: Kyle McMartin -Date: Mon, 24 Jan 2011 13:01:57 -0500 -Subject: [PATCH] runtime_pm_fixups - ---- - drivers/acpi/bus.c | 3 ++- - drivers/acpi/pci_bind.c | 6 ++++++ - drivers/acpi/power.c | 5 ++++- - drivers/acpi/sleep.c | 2 +- - drivers/acpi/wakeup.c | 2 +- - drivers/pci/pci-acpi.c | 2 +- - include/acpi/acpi_bus.h | 2 +- - 7 files changed, 16 insertions(+), 6 deletions(-) - -diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c -index 7ced61f..e4e0114 100644 ---- a/drivers/acpi/bus.c -+++ b/drivers/acpi/bus.c -@@ -256,7 +256,8 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) - * a lower-powered state. - */ - if (state < device->power.state) { -- if (device->power.flags.power_resources) { -+ if (device->power.flags.power_resources && -+ !device->wakeup.run_wake_count) { - result = acpi_power_transition(device, state); - if (result) - goto end; -diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c -index 2ef0409..4b0bb68 100644 ---- a/drivers/acpi/pci_bind.c -+++ b/drivers/acpi/pci_bind.c -@@ -32,6 +32,8 @@ - #include - #include - -+#include "internal.h" -+ - #define _COMPONENT ACPI_PCI_COMPONENT - ACPI_MODULE_NAME("pci_bind"); - -@@ -65,6 +67,7 @@ static int acpi_pci_bind(struct acpi_device *device) - acpi_handle handle; - struct pci_bus *bus; - struct pci_dev *dev; -+ int state; - - dev = acpi_get_pci_dev(device->handle); - if (!dev) -@@ -87,6 +90,9 @@ static int acpi_pci_bind(struct acpi_device *device) - device->ops.unbind = acpi_pci_unbind; - } - -+ acpi_power_get_inferred_state(device, &state); -+ acpi_power_transition(device, state); -+ - /* - * Evaluate and parse _PRT, if exists. This code allows parsing of - * _PRT objects within the scope of non-bridge devices. Note that -diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c -index 9ac2a9f..cd6a8df 100644 ---- a/drivers/acpi/power.c -+++ b/drivers/acpi/power.c -@@ -412,7 +412,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state) - * State Wake) for the device, if present - * 2. Shutdown down the power resources - */ --int acpi_disable_wakeup_device_power(struct acpi_device *dev) -+int acpi_disable_wakeup_device_power(struct acpi_device *dev, int sleep_state) - { - int i, err = 0; - -@@ -435,6 +435,9 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev) - if (err) - goto out; - -+ if (sleep_state == ACPI_STATE_S0) -+ goto out; -+ - /* Close power resource */ - for (i = 0; i < dev->wakeup.resources.count; i++) { - int ret = acpi_power_off(dev->wakeup.resources.handles[i]); -diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c -index d6a8cd1..5d68dc0 100644 ---- a/drivers/acpi/sleep.c -+++ b/drivers/acpi/sleep.c -@@ -697,7 +697,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) - - error = enable ? - acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) : -- acpi_disable_wakeup_device_power(adev); -+ acpi_disable_wakeup_device_power(adev, acpi_target_sleep_state); - if (!error) - dev_info(dev, "wake-up capability %s by ACPI\n", - enable ? "enabled" : "disabled"); -diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c -index ed65014..a0cabc3 100644 ---- a/drivers/acpi/wakeup.c -+++ b/drivers/acpi/wakeup.c -@@ -73,7 +73,7 @@ void acpi_disable_wakeup_devices(u8 sleep_state) - ACPI_GPE_DISABLE); - - if (device_may_wakeup(&dev->dev)) -- acpi_disable_wakeup_device_power(dev); -+ acpi_disable_wakeup_device_power(dev, sleep_state); - } - } - -diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c -index 6fe0772..819fa7a 100644 ---- a/drivers/pci/pci-acpi.c -+++ b/drivers/pci/pci-acpi.c -@@ -302,7 +302,7 @@ static int acpi_dev_run_wake(struct device *phys_dev, bool enable) - if (!--dev->wakeup.run_wake_count) { - acpi_disable_gpe(dev->wakeup.gpe_device, - dev->wakeup.gpe_number); -- acpi_disable_wakeup_device_power(dev); -+ acpi_disable_wakeup_device_power(dev, ACPI_STATE_S0); - } - } else { - error = -EALREADY; -diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index 78ca429..92d6e86 100644 ---- a/include/acpi/acpi_bus.h -+++ b/include/acpi/acpi_bus.h -@@ -379,7 +379,7 @@ struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); - #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) - - int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); --int acpi_disable_wakeup_device_power(struct acpi_device *dev); -+int acpi_disable_wakeup_device_power(struct acpi_device *dev, int state); - - #ifdef CONFIG_PM_OPS - int acpi_pm_device_sleep_state(struct device *, int *); --- -1.7.3.5 - diff --git a/scsi-sd-downgrade-caching-printk-from-error-to-notice.patch b/scsi-sd-downgrade-caching-printk-from-error-to-notice.patch new file mode 100644 index 000000000..c082fe05f --- /dev/null +++ b/scsi-sd-downgrade-caching-printk-from-error-to-notice.patch @@ -0,0 +1,28 @@ +diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c +index e567302..261638a 100644 +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -1956,12 +1956,12 @@ sd_read_cache_type(struct scsi_disk *sdk + int offset = data.header_length + data.block_descriptor_length; + + if (offset >= SD_BUF_SIZE - 2) { +- sd_printk(KERN_ERR, sdkp, "Malformed MODE SENSE response\n"); ++ sd_printk(KERN_NOTICE, sdkp, "Malformed MODE SENSE response\n"); + goto defaults; + } + + if ((buffer[offset] & 0x3f) != modepage) { +- sd_printk(KERN_ERR, sdkp, "Got wrong page\n"); ++ sd_printk(KERN_NOTICE, sdkp, "Got wrong page\n"); + goto defaults; + } + +@@ -2033,7 +2033,7 @@ bad_sense: + sd_printk(KERN_ERR, sdkp, "Asking for cache data failed\n"); + + defaults: +- sd_printk(KERN_ERR, sdkp, "Assuming drive cache: write through\n"); ++ sd_printk(KERN_NOTICE, sdkp, "Assuming drive cache: write through\n"); + sdkp->WCE = 0; + sdkp->RCD = 0; + sdkp->DPOFUA = 0; diff --git a/sources b/sources index a051716d2..a37c0a01a 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -7d471477bfa67546f902da62227fa976 linux-2.6.38.tar.bz2 +1aab7a741abe08d42e8eccf20de61e05 linux-2.6.39.tar.bz2 +06b858e8f81600038129afe7bcd4e162 patch-2.6.39.3.bz2 diff --git a/sparc64_fix_build_errors_with_gcc460.patch b/sparc64_fix_build_errors_with_gcc460.patch deleted file mode 100644 index 807032c83..000000000 --- a/sparc64_fix_build_errors_with_gcc460.patch +++ /dev/null @@ -1,305 +0,0 @@ -From dbb988cf34a62e69c8863f212be212c6841004ba Mon Sep 17 00:00:00 2001 -From: David S. Miller -Date: Sat, 26 Feb 2011 23:40:02 -0800 -Subject: [PATCH] sparc64: Fix build errors with gcc-4.6.0 - -Most of the warnings emitted (we fail arch/sparc file -builds with -Werror) were legitimate but harmless, however -one case (n2_pcr_write) was a genuine bug. - -Based almost entirely upon a patch by Sam Ravnborg. - -Reported-by: Dennis Gilmore -Signed-off-by: David S. Miller ---- - arch/sparc/kernel/iommu.c | 3 --- - arch/sparc/kernel/ldc.c | 28 ++++++++++++++++++---------- - arch/sparc/kernel/pci.c | 1 + - arch/sparc/kernel/pci_common.c | 11 +++++++---- - arch/sparc/kernel/pci_fire.c | 2 -- - arch/sparc/kernel/pci_schizo.c | 4 +--- - arch/sparc/kernel/pci_sun4v.c | 3 +-- - arch/sparc/kernel/pcr.c | 2 +- - arch/sparc/kernel/ptrace_64.c | 3 ++- - arch/sparc/kernel/smp_64.c | 11 ++++------- - arch/sparc/kernel/traps_64.c | 3 +-- - 11 files changed, 36 insertions(+), 35 deletions(-) - -diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c -index 72509d0..6f01e8c 100644 ---- a/arch/sparc/kernel/iommu.c -+++ b/arch/sparc/kernel/iommu.c -@@ -333,13 +333,10 @@ static void dma_4u_free_coherent(struct device *dev, size_t size, - void *cpu, dma_addr_t dvma) - { - struct iommu *iommu; -- iopte_t *iopte; - unsigned long flags, order, npages; - - npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT; - iommu = dev->archdata.iommu; -- iopte = iommu->page_table + -- ((dvma - iommu->page_table_map_base) >> IO_PAGE_SHIFT); - - spin_lock_irqsave(&iommu->lock, flags); - -diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c -index df39a0f..732b0bc 100644 ---- a/arch/sparc/kernel/ldc.c -+++ b/arch/sparc/kernel/ldc.c -@@ -790,16 +790,20 @@ static void send_events(struct ldc_channel *lp, unsigned int event_mask) - static irqreturn_t ldc_rx(int irq, void *dev_id) - { - struct ldc_channel *lp = dev_id; -- unsigned long orig_state, hv_err, flags; -+ unsigned long orig_state, flags; - unsigned int event_mask; - - spin_lock_irqsave(&lp->lock, flags); - - orig_state = lp->chan_state; -- hv_err = sun4v_ldc_rx_get_state(lp->id, -- &lp->rx_head, -- &lp->rx_tail, -- &lp->chan_state); -+ -+ /* We should probably check for hypervisor errors here and -+ * reset the LDC channel if we get one. -+ */ -+ sun4v_ldc_rx_get_state(lp->id, -+ &lp->rx_head, -+ &lp->rx_tail, -+ &lp->chan_state); - - ldcdbg(RX, "RX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n", - orig_state, lp->chan_state, lp->rx_head, lp->rx_tail); -@@ -904,16 +908,20 @@ out: - static irqreturn_t ldc_tx(int irq, void *dev_id) - { - struct ldc_channel *lp = dev_id; -- unsigned long flags, hv_err, orig_state; -+ unsigned long flags, orig_state; - unsigned int event_mask = 0; - - spin_lock_irqsave(&lp->lock, flags); - - orig_state = lp->chan_state; -- hv_err = sun4v_ldc_tx_get_state(lp->id, -- &lp->tx_head, -- &lp->tx_tail, -- &lp->chan_state); -+ -+ /* We should probably check for hypervisor errors here and -+ * reset the LDC channel if we get one. -+ */ -+ sun4v_ldc_tx_get_state(lp->id, -+ &lp->tx_head, -+ &lp->tx_tail, -+ &lp->chan_state); - - ldcdbg(TX, " TX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n", - orig_state, lp->chan_state, lp->tx_head, lp->tx_tail); -diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c -index 4137579..f255382 100644 ---- a/arch/sparc/kernel/pci.c -+++ b/arch/sparc/kernel/pci.c -@@ -675,6 +675,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) - * humanoid. - */ - err = sysfs_create_file(&dev->dev.kobj, &dev_attr_obppath.attr); -+ (void) err; - } - list_for_each_entry(child_bus, &bus->children, node) - pci_bus_register_of_sysfs(child_bus); -diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c -index 6c7a33a..6e3874b 100644 ---- a/arch/sparc/kernel/pci_common.c -+++ b/arch/sparc/kernel/pci_common.c -@@ -295,14 +295,17 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, - unsigned int bus = bus_dev->number; - unsigned int device = PCI_SLOT(devfn); - unsigned int func = PCI_FUNC(devfn); -- unsigned long ret; - - if (config_out_of_range(pbm, bus, devfn, where)) { - /* Do nothing. */ - } else { -- ret = pci_sun4v_config_put(devhandle, -- HV_PCI_DEVICE_BUILD(bus, device, func), -- where, size, value); -+ /* We don't check for hypervisor errors here, but perhaps -+ * we should and influence our return value depending upon -+ * what kind of error is thrown. -+ */ -+ pci_sun4v_config_put(devhandle, -+ HV_PCI_DEVICE_BUILD(bus, device, func), -+ where, size, value); - } - return PCIBIOS_SUCCESSFUL; - } -diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c -index efb896d..75dfeb6 100644 ---- a/arch/sparc/kernel/pci_fire.c -+++ b/arch/sparc/kernel/pci_fire.c -@@ -214,11 +214,9 @@ static int pci_fire_msi_setup(struct pci_pbm_info *pbm, unsigned long msiqid, - - static int pci_fire_msi_teardown(struct pci_pbm_info *pbm, unsigned long msi) - { -- unsigned long msiqid; - u64 val; - - val = upa_readq(pbm->pbm_regs + MSI_MAP(msi)); -- msiqid = (val & MSI_MAP_EQNUM); - - val &= ~MSI_MAP_VALID; - -diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c -index 445a47a..4620eb7 100644 ---- a/arch/sparc/kernel/pci_schizo.c -+++ b/arch/sparc/kernel/pci_schizo.c -@@ -1313,7 +1313,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, - const struct linux_prom64_registers *regs; - struct device_node *dp = op->dev.of_node; - const char *chipset_name; -- int is_pbm_a, err; -+ int err; - - switch (chip_type) { - case PBM_CHIP_TYPE_TOMATILLO: -@@ -1343,8 +1343,6 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, - */ - regs = of_get_property(dp, "reg", NULL); - -- is_pbm_a = ((regs[0].phys_addr & 0x00700000) == 0x00600000); -- - pbm->next = pci_pbm_root; - pci_pbm_root = pbm; - -diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c -index 743344a..859abfd 100644 ---- a/arch/sparc/kernel/pci_sun4v.c -+++ b/arch/sparc/kernel/pci_sun4v.c -@@ -580,7 +580,7 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) - { - static const u32 vdma_default[] = { 0x80000000, 0x80000000 }; - struct iommu *iommu = pbm->iommu; -- unsigned long num_tsb_entries, sz, tsbsize; -+ unsigned long num_tsb_entries, sz; - u32 dma_mask, dma_offset; - const u32 *vdma; - -@@ -596,7 +596,6 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) - - dma_mask = (roundup_pow_of_two(vdma[1]) - 1UL); - num_tsb_entries = vdma[1] / IO_PAGE_SIZE; -- tsbsize = num_tsb_entries * sizeof(iopte_t); - - dma_offset = vdma[0]; - -diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c -index 7c2ced6..8ac23e6 100644 ---- a/arch/sparc/kernel/pcr.c -+++ b/arch/sparc/kernel/pcr.c -@@ -81,7 +81,7 @@ static void n2_pcr_write(u64 val) - unsigned long ret; - - ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val); -- if (val != HV_EOK) -+ if (ret != HV_EOK) - write_pcr(val); - } - -diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c -index 9ccc812..96ee50a 100644 ---- a/arch/sparc/kernel/ptrace_64.c -+++ b/arch/sparc/kernel/ptrace_64.c -@@ -1086,6 +1086,7 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) - - asmlinkage void syscall_trace_leave(struct pt_regs *regs) - { -+#ifdef CONFIG_AUDITSYSCALL - if (unlikely(current->audit_context)) { - unsigned long tstate = regs->tstate; - int result = AUDITSC_SUCCESS; -@@ -1095,7 +1096,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs) - - audit_syscall_exit(result, regs->u_regs[UREG_I0]); - } -- -+#endif - if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) - trace_sys_exit(regs, regs->u_regs[UREG_G1]); - -diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c -index 555a76d..3e94a8c 100644 ---- a/arch/sparc/kernel/smp_64.c -+++ b/arch/sparc/kernel/smp_64.c -@@ -189,7 +189,7 @@ static inline long get_delta (long *rt, long *master) - void smp_synchronize_tick_client(void) - { - long i, delta, adj, adjust_latency = 0, done = 0; -- unsigned long flags, rt, master_time_stamp, bound; -+ unsigned long flags, rt, master_time_stamp; - #if DEBUG_TICK_SYNC - struct { - long rt; /* roundtrip time */ -@@ -208,10 +208,8 @@ void smp_synchronize_tick_client(void) - { - for (i = 0; i < NUM_ROUNDS; i++) { - delta = get_delta(&rt, &master_time_stamp); -- if (delta == 0) { -+ if (delta == 0) - done = 1; /* let's lock on to this... */ -- bound = rt; -- } - - if (!done) { - if (i > 0) { -@@ -933,13 +931,12 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) - void flush_dcache_page_all(struct mm_struct *mm, struct page *page) - { - void *pg_addr; -- int this_cpu; - u64 data0; - - if (tlb_type == hypervisor) - return; - -- this_cpu = get_cpu(); -+ preempt_disable(); - - #ifdef CONFIG_DEBUG_DCFLUSH - atomic_inc(&dcpage_flushes); -@@ -964,7 +961,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) - } - __local_flush_dcache_page(page); - -- put_cpu(); -+ preempt_enable(); - } - - void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) -diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c -index 42ad2ba..9456472 100644 ---- a/arch/sparc/kernel/traps_64.c -+++ b/arch/sparc/kernel/traps_64.c -@@ -2152,7 +2152,7 @@ static void user_instruction_dump(unsigned int __user *pc) - - void show_stack(struct task_struct *tsk, unsigned long *_ksp) - { -- unsigned long fp, thread_base, ksp; -+ unsigned long fp, ksp; - struct thread_info *tp; - int count = 0; - #ifdef CONFIG_FUNCTION_GRAPH_TRACER -@@ -2173,7 +2173,6 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) - flushw_all(); - - fp = ksp + STACK_BIAS; -- thread_base = (unsigned long) tp; - - printk("Call Trace:\n"); - do { --- -1.7.4.1 - diff --git a/thinkpad-acpi-fix-backlight.patch b/thinkpad-acpi-fix-backlight.patch deleted file mode 100644 index 5ed2544fe..000000000 --- a/thinkpad-acpi-fix-backlight.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -up linux-2.6.34.noarch/drivers/platform/x86/thinkpad_acpi.c.orig linux-2.6.34.noarch/drivers/platform/x86/thinkpad_acpi.c ---- linux-2.6.34.noarch/drivers/platform/x86/thinkpad_acpi.c.orig 2010-05-17 16:28:13.254200070 -0400 -+++ linux-2.6.34.noarch/drivers/platform/x86/thinkpad_acpi.c 2010-05-17 16:29:56.471200083 -0400 -@@ -3397,7 +3397,7 @@ static int __init hotkey_init(struct ibm - /* update bright_acpimode... */ - tpacpi_check_std_acpi_brightness_support(); - -- if (tp_features.bright_acpimode && acpi_video_backlight_support()) { -+ if (acpi_video_backlight_support()) { - printk(TPACPI_INFO - "This ThinkPad has standard ACPI backlight " - "brightness control, supported by the ACPI " -@@ -6189,26 +6189,24 @@ static int __init brightness_init(struct - * going to publish a backlight interface - */ - b = tpacpi_check_std_acpi_brightness_support(); -- if (b > 0) { - -- if (acpi_video_backlight_support()) { -- if (brightness_enable > 1) { -- printk(TPACPI_NOTICE -- "Standard ACPI backlight interface " -- "available, not loading native one.\n"); -- return 1; -- } else if (brightness_enable == 1) { -- printk(TPACPI_NOTICE -- "Backlight control force enabled, even if standard " -- "ACPI backlight interface is available\n"); -- } -- } else { -- if (brightness_enable > 1) { -- printk(TPACPI_NOTICE -- "Standard ACPI backlight interface not " -- "available, thinkpad_acpi native " -- "brightness control enabled\n"); -- } -+ if (acpi_video_backlight_support()) { -+ if (brightness_enable > 1) { -+ printk(TPACPI_NOTICE -+ "Standard ACPI backlight interface " -+ "available, not loading native one.\n"); -+ return 1; -+ } else if (brightness_enable == 1) { -+ printk(TPACPI_NOTICE -+ "Backlight control force enabled, even if standard " -+ "ACPI backlight interface is available\n"); -+ } -+ } else { -+ if (brightness_enable > 1) { -+ printk(TPACPI_NOTICE -+ "Standard ACPI backlight interface not " -+ "available, thinkpad_acpi native " -+ "brightness control enabled\n"); - } - } - diff --git a/x86-pci-preserve-existing-pci-bfsort-whitelist-for-dell-systems.patch b/x86-pci-preserve-existing-pci-bfsort-whitelist-for-dell-systems.patch new file mode 100644 index 000000000..9cedbadf9 --- /dev/null +++ b/x86-pci-preserve-existing-pci-bfsort-whitelist-for-dell-systems.patch @@ -0,0 +1,55 @@ +From: Narendra K +Subject: [PATCH] x86/PCI: Preserve existing pci=bfsort whitelist for Dell systems. + +Commit 6e8af08dfa40b747002207d3ce8e8b43a050d99f enables pci=bfsort on +future Dell systems. But the identification string 'Dell System' matches +on already existing whitelist, which do not have SMBIOS type 0xB1, +causing pci=bfsort not being set on existing whitelist. + +This patch fixes the regression by moving the type 0xB1 check beyond the +existing whitelist so that existing whitelist is walked before. + +Signed-off-by: Shyam Iyer +Signed-off-by: Narendra K +--- +RHBZ #702740 +http://marc.info/?l=linux-pci&m=130046899115205&q=raw + + arch/x86/pci/common.c | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c +index 5fe7502..92df322 100644 +--- a/arch/x86/pci/common.c ++++ b/arch/x86/pci/common.c +@@ -247,13 +247,6 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = { + }, + #endif /* __i386__ */ + { +- .callback = find_sort_method, +- .ident = "Dell System", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), +- }, +- }, +- { + .callback = set_bf_sort, + .ident = "Dell PowerEdge 1950", + .matches = { +@@ -294,6 +287,13 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = { + }, + }, + { ++ .callback = find_sort_method, ++ .ident = "Dell System", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), ++ }, ++ }, ++ { + .callback = set_bf_sort, + .ident = "HP ProLiant BL20p G3", + .matches = { +-- +1.7.3.1 +