From 7c947ddd34de31ac067323aa48ed81f478b662d1 Mon Sep 17 00:00:00 2001 From: Emmanuel Bretelle Date: Mon, 17 Jan 2011 14:17:01 +0100 Subject: [PATCH] Compile against kernel 2.6.32 Works fine on Dell E4310 with kernel 2.6.32-27-generic-pae Signed-off-by: Emmanuel Bretelle --- appletouch.c | 1 + bcm5974.c | 4 +++- compat.h | 14 ++++++++++++++ pc110pad.c | 1 + psmouse-base.c | 11 ++++++++++- synaptics.c | 1 + 6 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 compat.h diff --git a/appletouch.c b/appletouch.c index b77f999..848615a 100644 --- a/appletouch.c +++ b/appletouch.c @@ -34,6 +34,7 @@ #include #include #include +#include "compat.h" /* * Note: We try to keep the touchpad aspect ratio while still doing only diff --git a/bcm5974.c b/bcm5974.c index b952317..bc60291 100644 --- a/bcm5974.c +++ b/bcm5974.c @@ -40,7 +40,7 @@ #include #include #include - +#include "compat.h" #define USB_VENDOR_ID_APPLE 0x05ac /* MacbookAir, aka wellspring */ @@ -313,7 +313,9 @@ static void setup_events_to_report(struct input_dev *input_dev, __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); __set_bit(BTN_LEFT, input_dev->keybit); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) input_set_events_per_packet(input_dev, 60); +#endif } /* report button data as logical button state */ diff --git a/compat.h b/compat.h new file mode 100644 index 0000000..14c937b --- /dev/null +++ b/compat.h @@ -0,0 +1,14 @@ +#ifndef __COMPAT_H +#define __COMPAT_H + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) +#define usb_alloc_coherent(a, b, c, d) usb_buffer_alloc(a, b, c, d) +#define usb_free_coherent(a, b, c, d) usb_buffer_free(a, b, c, d) +#define input_abs_set_max(dev, t, max) dev->absmax[t] = max +#define input_abs_set_res(dev, t, res) dev->absres[t] = res +#endif + +#endif + diff --git a/pc110pad.c b/pc110pad.c index 7b02b65..b36d37b 100644 --- a/pc110pad.c +++ b/pc110pad.c @@ -41,6 +41,7 @@ #include #include +#include "compat.h" MODULE_AUTHOR("Vojtech Pavlik "); MODULE_DESCRIPTION("IBM PC110 touchpad driver"); diff --git a/psmouse-base.c b/psmouse-base.c index cd9d0c9..3009ab7 100644 --- a/psmouse-base.c +++ b/psmouse-base.c @@ -31,7 +31,7 @@ #include "touchkit_ps2.h" #include "elantech.h" #include "sentelic.h" - +#include "compat.h" #define DRIVER_DESC "PS/2 mouse driver" MODULE_AUTHOR("Vojtech Pavlik "); @@ -41,10 +41,15 @@ MODULE_LICENSE("GPL"); static unsigned int psmouse_max_proto = PSMOUSE_AUTO; static int psmouse_set_maxproto(const char *val, const struct kernel_param *); static int psmouse_get_maxproto(char *buffer, const struct kernel_param *kp); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) +#define param_set_proto_abbrev psmouse_set_maxproto +#define param_get_proto_abbrev psmouse_get_maxproto +#else static struct kernel_param_ops param_ops_proto_abbrev = { .set = psmouse_set_maxproto, .get = psmouse_get_maxproto, }; +#endif #define param_check_proto_abbrev(name, p) __param_check(name, p, unsigned int) module_param_named(proto, psmouse_max_proto, proto_abbrev, 0644); MODULE_PARM_DESC(proto, "Highest protocol extension to probe (bare, imps, exps, any). Useful for KVM switches."); @@ -1584,7 +1589,11 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co if (!new_dev) return -ENOMEM; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) + while (serio->child) { +#else while (!list_empty(&serio->children)) { +#endif if (++retry > 3) { printk(KERN_WARNING "psmouse: failed to destroy children ports, " diff --git a/synaptics.c b/synaptics.c index 2e300a4..efd3d10 100644 --- a/synaptics.c +++ b/synaptics.c @@ -31,6 +31,7 @@ #include #include "psmouse.h" #include "synaptics.h" +#include "compat.h" /* * The x/y limits are taken from the Synaptics TouchPad interfacing Guide, -- 1.7.0.4