diff options
author | David Howells <dhowells@redhat.com> | 2006-10-05 17:55:46 +0400 |
---|---|---|
committer | David Howells <dhowells@warthog.cambridge.redhat.com> | 2006-10-05 18:10:12 +0400 |
commit | 7d12e780e003f93433d49ce78cfedf4b4c52adc5 (patch) | |
tree | 6748550400445c11a306b132009f3001e3525df8 /drivers/usb/input | |
parent | da482792a6d1a3fbaaa25fae867b343fb4db3246 (diff) | |
download | linux-7d12e780e003f93433d49ce78cfedf4b4c52adc5.tar.xz |
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.
Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/acecad.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/aiptek.c | 13 | ||||
-rw-r--r-- | drivers/usb/input/appletouch.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote.c | 17 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote2.c | 14 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 28 | ||||
-rw-r--r-- | drivers/usb/input/hid-input.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 4 | ||||
-rw-r--r-- | drivers/usb/input/hiddev.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/itmtouch.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/kbtab.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/keyspan_remote.c | 7 | ||||
-rw-r--r-- | drivers/usb/input/mtouchusb.c | 3 | ||||
-rw-r--r-- | drivers/usb/input/powermate.c | 7 | ||||
-rw-r--r-- | drivers/usb/input/touchkitusb.c | 15 | ||||
-rw-r--r-- | drivers/usb/input/usbkbd.c | 6 | ||||
-rw-r--r-- | drivers/usb/input/usbmouse.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/usbtouchscreen.c | 15 | ||||
-rw-r--r-- | drivers/usb/input/wacom.h | 4 | ||||
-rw-r--r-- | drivers/usb/input/wacom_sys.c | 9 | ||||
-rw-r--r-- | drivers/usb/input/wacom_wac.c | 9 | ||||
-rw-r--r-- | drivers/usb/input/xpad.c | 8 | ||||
-rw-r--r-- | drivers/usb/input/yealink.c | 9 |
23 files changed, 67 insertions, 121 deletions
diff --git a/drivers/usb/input/acecad.c b/drivers/usb/input/acecad.c index d83603ba40ae..0096373b5f98 100644 --- a/drivers/usb/input/acecad.c +++ b/drivers/usb/input/acecad.c @@ -58,7 +58,7 @@ struct usb_acecad { dma_addr_t data_dma; }; -static void usb_acecad_irq(struct urb *urb, struct pt_regs *regs) +static void usb_acecad_irq(struct urb *urb) { struct usb_acecad *acecad = urb->context; unsigned char *data = acecad->data; diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index b138dae2b055..bf428184608f 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c @@ -396,7 +396,7 @@ static int aiptek_convert_from_2s_complement(unsigned char c) * replaced with the input_sync() method (which emits EV_SYN.) */ -static void aiptek_irq(struct urb *urb, struct pt_regs *regs) +static void aiptek_irq(struct urb *urb) { struct aiptek *aiptek = urb->context; unsigned char *data = aiptek->data; @@ -442,8 +442,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs) aiptek->diagnostic = AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE; } else { - input_regs(inputdev, regs); - x = aiptek_convert_from_2s_complement(data[2]); y = aiptek_convert_from_2s_complement(data[3]); @@ -488,8 +486,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs) (aiptek->curSetting.pointerMode)) { aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; } else { - input_regs(inputdev, regs); - x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); z = le16_to_cpu(get_unaligned((__le16 *) (data + 6))); @@ -568,7 +564,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs) (aiptek->curSetting.pointerMode)) { aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; } else { - input_regs(inputdev, regs); x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); @@ -631,8 +626,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs) z = le16_to_cpu(get_unaligned((__le16 *) (data + 4))); if (dv != 0) { - input_regs(inputdev, regs); - /* If we've not already sent a tool_button_?? code, do * so now. Then set FIRED_BIT so it won't be resent unless * the user forces FIRED_BIT off. @@ -681,8 +674,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs) macro = data[3]; if (dv != 0) { - input_regs(inputdev, regs); - /* If we've not already sent a tool_button_?? code, do * so now. Then set FIRED_BIT so it won't be resent unless * the user forces FIRED_BIT off. @@ -726,8 +717,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs) */ else if (data[0] == 6) { macro = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); - input_regs(inputdev, regs); - if (macro > 0) { input_report_key(inputdev, macroKeyEvents[macro - 1], 0); diff --git a/drivers/usb/input/appletouch.c b/drivers/usb/input/appletouch.c index 0aa9cc2bfd69..4c213513484d 100644 --- a/drivers/usb/input/appletouch.c +++ b/drivers/usb/input/appletouch.c @@ -210,7 +210,7 @@ static inline void atp_report_fingers(struct input_dev *input, int fingers) input_report_key(input, BTN_TOOL_TRIPLETAP, fingers > 2); } -static void atp_complete(struct urb* urb, struct pt_regs* regs) +static void atp_complete(struct urb* urb) { int x, y, x_z, y_z, x_f, y_f; int retval, i, j; diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index 3558d7ed99b9..f659f3028ad2 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c @@ -283,9 +283,9 @@ static void ati_remote_dump (unsigned char *data, unsigned int actual_length); static int ati_remote_open (struct input_dev *inputdev); static void ati_remote_close (struct input_dev *inputdev); static int ati_remote_sendpacket (struct ati_remote *ati_remote, u16 cmd, unsigned char *data); -static void ati_remote_irq_out (struct urb *urb, struct pt_regs *regs); -static void ati_remote_irq_in (struct urb *urb, struct pt_regs *regs); -static void ati_remote_input_report (struct urb *urb, struct pt_regs *regs); +static void ati_remote_irq_out (struct urb *urb); +static void ati_remote_irq_in (struct urb *urb); +static void ati_remote_input_report (struct urb *urb); static int ati_remote_initialize (struct ati_remote *ati_remote); static int ati_remote_probe (struct usb_interface *interface, const struct usb_device_id *id); static void ati_remote_disconnect (struct usb_interface *interface); @@ -344,7 +344,7 @@ static void ati_remote_close(struct input_dev *inputdev) /* * ati_remote_irq_out */ -static void ati_remote_irq_out(struct urb *urb, struct pt_regs *regs) +static void ati_remote_irq_out(struct urb *urb) { struct ati_remote *ati_remote = urb->context; @@ -453,7 +453,7 @@ static int ati_remote_compute_accel(struct ati_remote *ati_remote) /* * ati_remote_report_input */ -static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) +static void ati_remote_input_report(struct urb *urb) { struct ati_remote *ati_remote = urb->context; unsigned char *data= ati_remote->inbuf; @@ -491,7 +491,6 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) remote_num, data[1], data[2], index, ati_remote_tbl[index].code); if (ati_remote_tbl[index].kind == KIND_LITERAL) { - input_regs(dev, regs); input_event(dev, ati_remote_tbl[index].type, ati_remote_tbl[index].code, ati_remote_tbl[index].value); @@ -520,7 +519,6 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) return; - input_regs(dev, regs); input_event(dev, ati_remote_tbl[index].type, ati_remote_tbl[index].code, 1); input_sync(dev); @@ -537,7 +535,6 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) */ acc = ati_remote_compute_accel(ati_remote); - input_regs(dev, regs); switch (ati_remote_tbl[index].kind) { case KIND_ACCEL: input_event(dev, ati_remote_tbl[index].type, @@ -575,14 +572,14 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) /* * ati_remote_irq_in */ -static void ati_remote_irq_in(struct urb *urb, struct pt_regs *regs) +static void ati_remote_irq_in(struct urb *urb) { struct ati_remote *ati_remote = urb->context; int retval; switch (urb->status) { case 0: /* success */ - ati_remote_input_report(urb, regs); + ati_remote_input_report(urb); break; case -ECONNRESET: /* unlink */ case -ENOENT: diff --git a/drivers/usb/input/ati_remote2.c b/drivers/usb/input/ati_remote2.c index ea71de81ca6b..f982a2b4a7f9 100644 --- a/drivers/usb/input/ati_remote2.c +++ b/drivers/usb/input/ati_remote2.c @@ -142,7 +142,7 @@ static void ati_remote2_close(struct input_dev *idev) usb_kill_urb(ar2->urb[1]); } -static void ati_remote2_input_mouse(struct ati_remote2 *ar2, struct pt_regs *regs) +static void ati_remote2_input_mouse(struct ati_remote2 *ar2) { struct input_dev *idev = ar2->idev; u8 *data = ar2->buf[0]; @@ -157,7 +157,6 @@ static void ati_remote2_input_mouse(struct ati_remote2 *ar2, struct pt_regs *reg if (!((1 << data[0]) & mode_mask)) return; - input_regs(idev, regs); input_event(idev, EV_REL, REL_X, (s8) data[1]); input_event(idev, EV_REL, REL_Y, (s8) data[2]); input_sync(idev); @@ -174,7 +173,7 @@ static int ati_remote2_lookup(unsigned int hw_code) return -1; } -static void ati_remote2_input_key(struct ati_remote2 *ar2, struct pt_regs *regs) +static void ati_remote2_input_key(struct ati_remote2 *ar2) { struct input_dev *idev = ar2->idev; u8 *data = ar2->buf[1]; @@ -245,19 +244,18 @@ static void ati_remote2_input_key(struct ati_remote2 *ar2, struct pt_regs *regs) return; } - input_regs(idev, regs); input_event(idev, EV_KEY, ati_remote2_key_table[index].key_code, data[1]); input_sync(idev); } -static void ati_remote2_complete_mouse(struct urb *urb, struct pt_regs *regs) +static void ati_remote2_complete_mouse(struct urb *urb) { struct ati_remote2 *ar2 = urb->context; int r; switch (urb->status) { case 0: - ati_remote2_input_mouse(ar2, regs); + ati_remote2_input_mouse(ar2); break; case -ENOENT: case -EILSEQ: @@ -277,14 +275,14 @@ static void ati_remote2_complete_mouse(struct urb *urb, struct pt_regs *regs) "%s(): usb_submit_urb() = %d\n", __FUNCTION__, r); } -static void ati_remote2_complete_key(struct urb *urb, struct pt_regs *regs) +static void ati_remote2_complete_key(struct urb *urb) { struct ati_remote2 *ar2 = urb->context; int r; switch (urb->status) { case 0: - ati_remote2_input_key(ar2, regs); + ati_remote2_input_key(ar2); break; case -ENOENT: case -EILSEQ: diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index e0fd11605b43..a6738a83ff5b 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -780,13 +780,13 @@ static __inline__ int search(__s32 *array, __s32 value, unsigned n) return -1; } -static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, int interrupt, struct pt_regs *regs) +static void hid_process_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, int interrupt) { hid_dump_input(usage, value); if (hid->claimed & HID_CLAIMED_INPUT) - hidinput_hid_event(hid, field, usage, value, regs); + hidinput_hid_event(hid, field, usage, value); if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt) - hiddev_hid_event(hid, field, usage, value, regs); + hiddev_hid_event(hid, field, usage, value); } /* @@ -795,7 +795,7 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, s * reporting to the layer). */ -static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt, struct pt_regs *regs) +static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; @@ -822,19 +822,19 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u for (n = 0; n < count; n++) { if (HID_MAIN_ITEM_VARIABLE & field->flags) { - hid_process_event(hid, field, &field->usage[n], value[n], interrupt, regs); + hid_process_event(hid, field, &field->usage[n], value[n], interrupt); continue; } if (field->value[n] >= min && field->value[n] <= max && field->usage[field->value[n] - min].hid && search(value, field->value[n], count)) - hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt, regs); + hid_process_event(hid, field, &field->usage[field->value[n] - min], 0, interrupt); if (value[n] >= min && value[n] <= max && field->usage[value[n] - min].hid && search(field->value, value[n], count)) - hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt, regs); + hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt); } memcpy(field->value, value, count * sizeof(__s32)); @@ -842,7 +842,7 @@ exit: kfree(value); } -static int hid_input_report(int type, struct urb *urb, int interrupt, struct pt_regs *regs) +static int hid_input_report(int type, struct urb *urb, int interrupt) { struct hid_device *hid = urb->context; struct hid_report_enum *report_enum = hid->report_enum + type; @@ -892,7 +892,7 @@ static int hid_input_report(int type, struct urb *urb, int interrupt, struct pt_ hiddev_report_event(hid, report); for (n = 0; n < report->maxfield; n++) - hid_input_field(hid, report->field[n], data, interrupt, regs); + hid_input_field(hid, report->field[n], data, interrupt); if (hid->claimed & HID_CLAIMED_INPUT) hidinput_report_event(hid, report); @@ -1004,7 +1004,7 @@ done: * Input interrupt completion handler. */ -static void hid_irq_in(struct urb *urb, struct pt_regs *regs) +static void hid_irq_in(struct urb *urb) { struct hid_device *hid = urb->context; int status; @@ -1012,7 +1012,7 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs) switch (urb->status) { case 0: /* success */ hid->retry_delay = 0; - hid_input_report(HID_INPUT_REPORT, urb, 1, regs); + hid_input_report(HID_INPUT_REPORT, urb, 1); break; case -ECONNRESET: /* unlink */ case -ENOENT: @@ -1193,7 +1193,7 @@ static int hid_submit_ctrl(struct hid_device *hid) * Output interrupt completion handler. */ -static void hid_irq_out(struct urb *urb, struct pt_regs *regs) +static void hid_irq_out(struct urb *urb) { struct hid_device *hid = urb->context; unsigned long flags; @@ -1238,7 +1238,7 @@ static void hid_irq_out(struct urb *urb, struct pt_regs *regs) * Control pipe completion handler. */ -static void hid_ctrl(struct urb *urb, struct pt_regs *regs) +static void hid_ctrl(struct urb *urb) { struct hid_device *hid = urb->context; unsigned long flags; @@ -1249,7 +1249,7 @@ static void hid_ctrl(struct urb *urb, struct pt_regs *regs) switch (urb->status) { case 0: /* success */ if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) - hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, 0, regs); + hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, 0); break; case -ESHUTDOWN: /* unplug */ unplug = 1; diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index 4c62afbeb430..9a808a3b4d37 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c @@ -613,7 +613,7 @@ ignore: return; } -void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) +void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) { struct input_dev *input; int *quirks = &hid->quirks; @@ -623,8 +623,6 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct input = field->hidinput->input; - input_regs(input, regs); - if (!usage->type) return; diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index b03fd9b075df..9b50effef758 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h @@ -499,13 +499,13 @@ struct hid_descriptor { /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ /* We ignore a few input applications that are not widely used */ #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) -extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32, struct pt_regs *regs); +extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); extern int hidinput_connect(struct hid_device *); extern void hidinput_disconnect(struct hid_device *); #else #define IS_INPUT_APPLICATION(a) (0) -static inline void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) { } +static inline void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) { } static inline void hidinput_report_event(struct hid_device *hid, struct hid_report *report) { } static inline int hidinput_connect(struct hid_device *hid) { return -ENODEV; } static inline void hidinput_disconnect(struct hid_device *hid) { } diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index a2b419d13740..7dc14d0cacc1 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c @@ -179,7 +179,7 @@ static void hiddev_send_event(struct hid_device *hid, * the interrupt pipe */ void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, - struct hid_usage *usage, __s32 value, struct pt_regs *regs) + struct hid_usage *usage, __s32 value) { unsigned type = field->report_type; struct hiddev_usage_ref uref; diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index f3e3080de5b5..aac968aab860 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c @@ -80,7 +80,7 @@ static struct usb_device_id itmtouch_ids [] = { { } }; -static void itmtouch_irq(struct urb *urb, struct pt_regs *regs) +static void itmtouch_irq(struct urb *urb) { struct itmtouch_dev *itmtouch = urb->context; unsigned char *data = urb->transfer_buffer; @@ -109,8 +109,6 @@ static void itmtouch_irq(struct urb *urb, struct pt_regs *regs) goto exit; } - input_regs(dev, regs); - /* if pressure has been released, then don't report X/Y */ if (!(data[7] & 0x20)) { input_report_abs(dev, ABS_X, (data[0] & 0x1F) << 7 | (data[3] & 0x7F)); diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c index 604ade356ead..fedbcb127c21 100644 --- a/drivers/usb/input/kbtab.c +++ b/drivers/usb/input/kbtab.c @@ -41,7 +41,7 @@ struct kbtab { char phys[32]; }; -static void kbtab_irq(struct urb *urb, struct pt_regs *regs) +static void kbtab_irq(struct urb *urb) { struct kbtab *kbtab = urb->context; unsigned char *data = kbtab->data; diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c index a90359551575..50aa8108a50b 100644 --- a/drivers/usb/input/keyspan_remote.c +++ b/drivers/usb/input/keyspan_remote.c @@ -176,7 +176,7 @@ static int keyspan_load_tester(struct usb_keyspan* dev, int bits_needed) /* * Routine that handles all the logic needed to parse out the message from the remote. */ -static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs) +static void keyspan_check_data(struct usb_keyspan *remote) { int i; int found = 0; @@ -311,7 +311,6 @@ static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs) __FUNCTION__, message.system, message.button, message.toggle); if (message.toggle != remote->toggle) { - input_regs(remote->input, regs); input_report_key(remote->input, keyspan_key_table[message.button], 1); input_report_key(remote->input, keyspan_key_table[message.button], 0); input_sync(remote->input); @@ -361,7 +360,7 @@ static int keyspan_setup(struct usb_device* dev) /* * Routine used to handle a new message that has come in. */ -static void keyspan_irq_recv(struct urb *urb, struct pt_regs *regs) +static void keyspan_irq_recv(struct urb *urb) { struct usb_keyspan *dev = urb->context; int retval; @@ -385,7 +384,7 @@ static void keyspan_irq_recv(struct urb *urb, struct pt_regs *regs) if (debug) keyspan_print(dev); - keyspan_check_data(dev, regs); + keyspan_check_data(dev); resubmit: retval = usb_submit_urb(urb, GFP_ATOMIC); diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index 5dce951f2751..79a85d46cb13 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -98,7 +98,7 @@ static struct usb_device_id mtouchusb_devices[] = { { } }; -static void mtouchusb_irq(struct urb *urb, struct pt_regs *regs) +static void mtouchusb_irq(struct urb *urb) { struct mtouch_usb *mtouch = urb->context; int retval; @@ -125,7 +125,6 @@ static void mtouchusb_irq(struct urb *urb, struct pt_regs *regs) goto exit; } - input_regs(mtouch->input, regs); input_report_key(mtouch->input, BTN_TOUCH, MTOUCHUSB_GET_TOUCHED(mtouch->data)); input_report_abs(mtouch->input, ABS_X, MTOUCHUSB_GET_XC(mtouch->data)); diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c index f0f8db6810a2..0bf91778c40d 100644 --- a/drivers/usb/input/powermate.c +++ b/drivers/usb/input/powermate.c @@ -80,10 +80,10 @@ struct powermate_device { static char pm_name_powermate[] = "Griffin PowerMate"; static char pm_name_soundknob[] = "Griffin SoundKnob"; -static void powermate_config_complete(struct urb *urb, struct pt_regs *regs); +static void powermate_config_complete(struct urb *urb); /* Callback for data arriving from the PowerMate over the USB interrupt pipe */ -static void powermate_irq(struct urb *urb, struct pt_regs *regs) +static void powermate_irq(struct urb *urb) { struct powermate_device *pm = urb->context; int retval; @@ -104,7 +104,6 @@ static void powermate_irq(struct urb *urb, struct pt_regs *regs) } /* handle updates to device state */ - input_regs(pm->input, regs); input_report_key(pm->input, BTN_0, pm->data[0] & 0x01); input_report_rel(pm->input, REL_DIAL, pm->data[1]); input_sync(pm->input); @@ -191,7 +190,7 @@ static void powermate_sync_state(struct powermate_device *pm) } /* Called when our asynchronous control message completes. We may need to issue another immediately */ -static void powermate_config_complete(struct urb *urb, struct pt_regs *regs) +static void powermate_config_complete(struct urb *urb) { struct powermate_device *pm = urb->context; unsigned long flags; diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index 30b9f820e7a8..05c0d1ca39ab 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c @@ -92,8 +92,7 @@ static inline int touchkit_get_y(char *data) /* processes one input packet. */ -static void touchkit_process_pkt(struct touchkit_usb *touchkit, - struct pt_regs *regs, char *pkt) +static void touchkit_process_pkt(struct touchkit_usb *touchkit, char *pkt) { int x, y; @@ -109,7 +108,6 @@ static void touchkit_process_pkt(struct touchkit_usb *touchkit, y = touchkit_get_y(pkt); } - input_regs(touchkit->input, regs); input_report_key(touchkit->input, BTN_TOUCH, touchkit_get_touched(pkt)); input_report_abs(touchkit->input, ABS_X, x); input_report_abs(touchkit->input, ABS_Y, y); @@ -130,8 +128,7 @@ static int touchkit_get_pkt_len(char *buf) return 0; } -static void touchkit_process(struct touchkit_usb *touchkit, int len, - struct pt_regs *regs) +static void touchkit_process(struct touchkit_usb *touchkit, int len) { char *buffer; int pkt_len, buf_len, pos; @@ -153,7 +150,7 @@ static void touchkit_process(struct touchkit_usb *touchkit, int len, /* append, process */ tmp = pkt_len - touchkit->buf_len; memcpy(touchkit->buffer + touchkit->buf_len, touchkit->data, tmp); - touchkit_process_pkt(touchkit, regs, touchkit->buffer); + touchkit_process_pkt(touchkit, touchkit->buffer); buffer = touchkit->data + tmp; buf_len = len - tmp; @@ -181,7 +178,7 @@ static void touchkit_process(struct touchkit_usb *touchkit, int len, /* full packet: process */ if (likely(pkt_len <= buf_len)) { - touchkit_process_pkt(touchkit, regs, buffer + pos); + touchkit_process_pkt(touchkit, buffer + pos); } else { /* incomplete packet: save in buffer */ memcpy(touchkit->buffer, buffer + pos, buf_len - pos); @@ -192,7 +189,7 @@ static void touchkit_process(struct touchkit_usb *touchkit, int len, } -static void touchkit_irq(struct urb *urb, struct pt_regs *regs) +static void touchkit_irq(struct urb *urb) { struct touchkit_usb *touchkit = urb->context; int retval; @@ -219,7 +216,7 @@ static void touchkit_irq(struct urb *urb, struct pt_regs *regs) goto exit; } - touchkit_process(touchkit, urb->actual_length, regs); + touchkit_process(touchkit, urb->actual_length); exit: retval = usb_submit_urb(urb, GFP_ATOMIC); diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index 5067a6ae650f..c73285cf8558 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c @@ -80,7 +80,7 @@ struct usb_kbd { dma_addr_t leds_dma; }; -static void usb_kbd_irq(struct urb *urb, struct pt_regs *regs) +static void usb_kbd_irq(struct urb *urb) { struct usb_kbd *kbd = urb->context; int i; @@ -97,8 +97,6 @@ static void usb_kbd_irq(struct urb *urb, struct pt_regs *regs) goto resubmit; } - input_regs(kbd->dev, regs); - for (i = 0; i < 8; i++) input_report_key(kbd->dev, usb_kbd_keycode[i + 224], (kbd->new[0] >> i) & 1); @@ -158,7 +156,7 @@ static int usb_kbd_event(struct input_dev *dev, unsigned int type, return 0; } -static void usb_kbd_led(struct urb *urb, struct pt_regs *regs) +static void usb_kbd_led(struct urb *urb) { struct usb_kbd *kbd = urb->context; diff --git a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c index 0fb792be95ef..cbbbea332ed7 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c @@ -55,7 +55,7 @@ struct usb_mouse { dma_addr_t data_dma; }; -static void usb_mouse_irq(struct urb *urb, struct pt_regs *regs) +static void usb_mouse_irq(struct urb *urb) { struct usb_mouse *mouse = urb->context; signed char *data = mouse->data; @@ -74,8 +74,6 @@ static void usb_mouse_irq(struct urb *urb, struct pt_regs *regs) goto resubmit; } - input_regs(dev, regs); - input_report_key(dev, BTN_LEFT, data[0] & 0x01); input_report_key(dev, BTN_RIGHT, data[0] & 0x02); input_report_key(dev, BTN_MIDDLE, data[0] & 0x04); diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c index 923e22db18d4..f26c1cd1129f 100644 --- a/drivers/usb/input/usbtouchscreen.c +++ b/drivers/usb/input/usbtouchscreen.c @@ -61,7 +61,7 @@ struct usbtouch_device_info { int rept_size; int flags; - void (*process_pkt) (struct usbtouch_usb *usbtouch, struct pt_regs *regs, unsigned char *pkt, int len); + void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); int (*get_pkt_len) (unsigned char *pkt, int len); int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press); int (*init) (struct usbtouch_usb *usbtouch); @@ -91,7 +91,6 @@ struct usbtouch_usb { #ifdef MULTI_PACKET static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, - struct pt_regs *regs, unsigned char *pkt, int len); #endif @@ -397,7 +396,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { * Generic Part */ static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, - struct pt_regs *regs, unsigned char *pkt, int len) + unsigned char *pkt, int len) { int x, y, touch, press; struct usbtouch_device_info *type = usbtouch->type; @@ -405,7 +404,6 @@ static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, if (!type->read_data(pkt, &x, &y, &touch, &press)) return; - input_regs(usbtouch->input, regs); input_report_key(usbtouch->input, BTN_TOUCH, touch); if (swap_xy) { @@ -423,7 +421,6 @@ static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, #ifdef MULTI_PACKET static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, - struct pt_regs *regs, unsigned char *pkt, int len) { unsigned char *buffer; @@ -460,7 +457,7 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, if (usbtouch->buf_len + tmp >= usbtouch->type->rept_size) goto out_flush_buf; memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, tmp); - usbtouch_process_pkt(usbtouch, regs, usbtouch->buffer, pkt_len); + usbtouch_process_pkt(usbtouch, usbtouch->buffer, pkt_len); buffer = pkt + tmp; buf_len = len - tmp; @@ -481,7 +478,7 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, /* full packet: process */ if (likely((pkt_len > 0) && (pkt_len <= buf_len - pos))) { - usbtouch_process_pkt(usbtouch, regs, buffer + pos, pkt_len); + usbtouch_process_pkt(usbtouch, buffer + pos, pkt_len); } else { /* incomplete packet: save in buffer */ memcpy(usbtouch->buffer, buffer + pos, buf_len - pos); @@ -498,7 +495,7 @@ out_flush_buf: #endif -static void usbtouch_irq(struct urb *urb, struct pt_regs *regs) +static void usbtouch_irq(struct urb *urb) { struct usbtouch_usb *usbtouch = urb->context; int retval; @@ -525,7 +522,7 @@ static void usbtouch_irq(struct urb *urb, struct pt_regs *regs) goto exit; } - usbtouch->type->process_pkt(usbtouch, regs, usbtouch->data, urb->actual_length); + usbtouch->type->process_pkt(usbtouch, usbtouch->data, urb->actual_length); exit: retval = usb_submit_urb(urb, GFP_ATOMIC); diff --git a/drivers/usb/input/wacom.h b/drivers/usb/input/wacom.h index 832737b658cf..7b3840e378a8 100644 --- a/drivers/usb/input/wacom.h +++ b/drivers/usb/input/wacom.h @@ -106,16 +106,14 @@ struct wacom { struct wacom_combo { struct wacom * wacom; struct urb * urb; - struct pt_regs *regs; }; extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); -extern void wacom_sys_irq(struct urb *urb, struct pt_regs *regs); +extern void wacom_sys_irq(struct urb *urb); extern void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data); extern void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data); extern void wacom_report_key(void *wcombo, unsigned int key_type, int key_data); extern void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value); -extern void wacom_input_regs(void *wcombo); extern void wacom_input_sync(void *wcombo); extern void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac); diff --git a/drivers/usb/input/wacom_sys.c b/drivers/usb/input/wacom_sys.c index 7c3b52bdd9d6..d233c37bd533 100644 --- a/drivers/usb/input/wacom_sys.c +++ b/drivers/usb/input/wacom_sys.c @@ -42,7 +42,7 @@ static struct input_dev * get_input_dev(struct wacom_combo *wcombo) return wcombo->wacom->dev; } -void wacom_sys_irq(struct urb *urb, struct pt_regs *regs) +void wacom_sys_irq(struct urb *urb) { struct wacom *wacom = urb->context; struct wacom_combo wcombo; @@ -65,7 +65,6 @@ void wacom_sys_irq(struct urb *urb, struct pt_regs *regs) wcombo.wacom = wacom; wcombo.urb = urb; - wcombo.regs = regs; if (wacom_wac_irq(wacom->wacom_wac, (void *)&wcombo)) input_sync(get_input_dev(&wcombo)); @@ -115,12 +114,6 @@ __u16 wacom_le16_to_cpu(unsigned char *data) return value; } -void wacom_input_regs(void *wcombo) -{ - input_regs(get_input_dev((struct wacom_combo *)wcombo), ((struct wacom_combo *)wcombo)->regs); - return; -} - void wacom_input_sync(void *wcombo) { input_sync(get_input_dev((struct wacom_combo *)wcombo)); diff --git a/drivers/usb/input/wacom_wac.c b/drivers/usb/input/wacom_wac.c index 85d458c98b6e..aa31d22d4f05 100644 --- a/drivers/usb/input/wacom_wac.c +++ b/drivers/usb/input/wacom_wac.c @@ -20,7 +20,6 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom, void *wcombo) switch (data[0]) { case 1: - wacom_input_regs(wcombo); if (data[5] & 0x80) { wacom->tool[0] = (data[5] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; wacom->id[0] = (data[5] & 0x20) ? ERASER_DEVICE_ID : STYLUS_DEVICE_ID; @@ -39,7 +38,6 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom, void *wcombo) } break; case 2: - wacom_input_regs(wcombo); wacom_report_key(wcombo, BTN_TOOL_PEN, 1); wacom_report_abs(wcombo, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */ wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1])); @@ -67,8 +65,6 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) prox = data[1] & 0x40; - wacom_input_regs(wcombo); - id = ERASER_DEVICE_ID; if (prox) { @@ -138,7 +134,6 @@ static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) return 0; } - wacom_input_regs(wcombo); if (data[1] & 0x04) { wacom_report_key(wcombo, BTN_TOOL_RUBBER, data[1] & 0x20); wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x08); @@ -167,8 +162,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) return 0; } - wacom_input_regs(wcombo); - id = STYLUS_DEVICE_ID; if (data[1] & 0x10) { /* in prox */ @@ -369,8 +362,6 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo) return 0; } - wacom_input_regs(wcombo); - /* tool number */ idx = data[1] & 0x01; diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c index 9889b1cda05b..cebb6c463bfb 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c @@ -120,12 +120,10 @@ struct usb_xpad { * http://euc.jp/periphs/xbox-controller.ja.html */ -static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *data, struct pt_regs *regs) +static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *data) { struct input_dev *dev = xpad->dev; - input_regs(dev, regs); - /* left stick */ input_report_abs(dev, ABS_X, (__s16) (((__s16)data[13] << 8) | data[12])); input_report_abs(dev, ABS_Y, (__s16) (((__s16)data[15] << 8) | data[14])); @@ -161,7 +159,7 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d input_sync(dev); } -static void xpad_irq_in(struct urb *urb, struct pt_regs *regs) +static void xpad_irq_in(struct urb *urb) { struct usb_xpad *xpad = urb->context; int retval; @@ -181,7 +179,7 @@ static void xpad_irq_in(struct urb *urb, struct pt_regs *regs) goto exit; } - xpad_process_packet(xpad, 0, xpad->idata, regs); + xpad_process_packet(xpad, 0, xpad->idata); exit: retval = usb_submit_urb (urb, GFP_ATOMIC); diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 7291e7a2717b..905bf6398257 100644 --- a/drivers/usb/input/yealink.c +++ b/drivers/usb/input/yealink.c @@ -233,11 +233,10 @@ static int map_p1k_to_key(int scancode) * * The key parameter can be cascaded: key2 << 8 | key1 */ -static void report_key(struct yealink_dev *yld, int key, struct pt_regs *regs) +static void report_key(struct yealink_dev *yld, int key) { struct input_dev *idev = yld->idev; - input_regs(idev, regs); if (yld->key_code >= 0) { /* old key up */ input_report_key(idev, yld->key_code & 0xff, 0); @@ -422,7 +421,7 @@ send_update: * error,start * */ -static void urb_irq_callback(struct urb *urb, struct pt_regs *regs) +static void urb_irq_callback(struct urb *urb) { struct yealink_dev *yld = urb->context; int ret; @@ -439,7 +438,7 @@ static void urb_irq_callback(struct urb *urb, struct pt_regs *regs) case CMD_SCANCODE: dbg("get scancode %x", yld->irq_data->data[0]); - report_key(yld, map_p1k_to_key(yld->irq_data->data[0]), regs); + report_key(yld, map_p1k_to_key(yld->irq_data->data[0])); break; default: @@ -453,7 +452,7 @@ static void urb_irq_callback(struct urb *urb, struct pt_regs *regs) err("%s - usb_submit_urb failed %d", __FUNCTION__, ret); } -static void urb_ctl_callback(struct urb *urb, struct pt_regs *regs) +static void urb_ctl_callback(struct urb *urb) { struct yealink_dev *yld = urb->context; int ret; |