Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186525
b: refs/heads/master
c: 8d4ecdd
h: refs/heads/master
i:
  186523: 8a87ee3
v: v3
  • Loading branch information
Ameya Palande authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent eb9714d commit abccc80
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c6211606dafaeec51e471cd6aa277fbf45fe80c
refs/heads/master: 8d4ecdda9870d0999ebb8ed59293f420b5d244fd
96 changes: 51 additions & 45 deletions trunk/drivers/staging/mimio/mimio.c
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
/*
* Hardware event => input event mapping:
*
* BTN_TOOL_PEN 0x140 black
* BTN_TOOL_RUBBER 0x141 blue
* BTN_TOOL_BRUSH 0x142 green
* BTN_TOOL_PENCIL 0x143 red
* BTN_TOOL_AIRBRUSH 0x144 eraser
* BTN_TOOL_FINGER 0x145 small eraser
* BTN_TOOL_MOUSE 0x146 mimio interactive
* BTN_TOOL_LENS 0x147 mimio interactive but1
* LOCALBTN_TOOL_EXTRA1 0x14a mimio interactive but2 == BTN_TOUCH
* LOCALBTN_TOOL_EXTRA2 0x14b mimio extra pens (orange, brown, yellow,
* purple) == BTN_STYLUS
* LOCALBTN_TOOL_EXTRA3 0x14c unused == BTN_STYLUS2
* BTN_TOOL_DOUBLETAP 0x14d unused
* BTN_TOOL_TRIPLETAP 0x14e unused
*
*
input.h:#define BTN_TOOL_PEN 0x140 black
input.h:#define BTN_TOOL_RUBBER 0x141 blue
input.h:#define BTN_TOOL_BRUSH 0x142 green
input.h:#define BTN_TOOL_PENCIL 0x143 red
input.h:#define BTN_TOOL_AIRBRUSH 0x144 eraser
input.h:#define BTN_TOOL_FINGER 0x145 small eraser
input.h:#define BTN_TOOL_MOUSE 0x146 mimio interactive
input.h:#define BTN_TOOL_LENS 0x147 mimio interactive but1
input.h:#define LOCALBTN_TOOL_EXTRA1 0x14a mimio interactive but2 == BTN_TOUCH
input.h:#define LOCALBTN_TOOL_EXTRA2 0x14b mimio extra pens (orange, brown, yellow, purple) == BTN_STYLUS
input.h:#define LOCALBTN_TOOL_EXTRA3 0x14c unused == BTN_STYLUS2
input.h:#define BTN_TOOL_DOUBLETAP 0x14d unused
input.h:#define BTN_TOOL_TRIPLETAP 0x14e unused
*
* MIMIO_EV_PENDOWN(MIMIO_PEN_K) => EV_KEY BIT(BTN_TOOL_PEN)
* MIMIO_EV_PENDOWN(MIMIO_PEN_B) => EV_KEY BIT(BTN_TOOL_RUBBER)
* MIMIO_EV_PENDOWN(MIMIO_PEN_G) => EV_KEY BIT(BTN_TOOL_BRUSH)
* MIMIO_EV_PENDOWN(MIMIO_PEN_R) => EV_KEY BIT(BTN_TOOL_PENCIL)
* MIMIO_EV_PENDOWN(MIMIO_PEN_E) => EV_KEY BIT(BTN_TOOL_AIRBRUSH)
* MIMIO_EV_PENDOWN(MIMIO_PEN_ES) => EV_KEY BIT(BTN_TOOL_FINGER)
* MIMIO_EV_PENDOWN(MIMIO_PEN_I) => EV_KEY BIT(BTN_TOOL_MOUSE)
* MIMIO_EV_PENDOWN(MIMIO_PEN_IL) => EV_KEY BIT(BTN_TOOL_LENS)
* MIMIO_EV_PENDOWN(MIMIO_PEN_IR) => EV_KEY BIT(BTN_TOOL_DOUBLETAP)
* MIMIO_EV_PENDOWN(MIMIO_PEN_EX) => EV_KEY BIT(BTN_TOOL_TRIPLETAP)
* MIMIO_EV_PENDATA => EV_ABS BIT(ABS_X), BIT(ABS_Y)
* MIMIO_EV_MEMRESET => EV_KEY BIT(BTN_0)
* MIMIO_EV_ACC(ACC_NEWPAGE) => EV_KEY BIT(BTN_1)
* MIMIO_EV_ACC(ACC_TAGPAGE) => EV_KEY BIT(BTN_2)
* MIMIO_EV_ACC(ACC_PRINTPAGE) => EV_KEY BIT(BTN_3)
* MIMIO_EV_ACC(ACC_MAXIMIZE) => EV_KEY BIT(BTN_4)
* MIMIO_EV_ACC(ACC_FINDCTLPNL) => EV_KEY BIT(BTN_5)
*
* MIMIO_EV_PENDOWN(MIMIO_PEN_K) => EV_KEY BIT(BTN_TOOL_PEN)
* MIMIO_EV_PENDOWN(MIMIO_PEN_B) => EV_KEY BIT(BTN_TOOL_RUBBER)
* MIMIO_EV_PENDOWN(MIMIO_PEN_G) => EV_KEY BIT(BTN_TOOL_BRUSH)
* MIMIO_EV_PENDOWN(MIMIO_PEN_R) => EV_KEY BIT(BTN_TOOL_PENCIL)
* MIMIO_EV_PENDOWN(MIMIO_PEN_E) => EV_KEY BIT(BTN_TOOL_AIRBRUSH)
* MIMIO_EV_PENDOWN(MIMIO_PEN_ES) => EV_KEY BIT(BTN_TOOL_FINGER)
* MIMIO_EV_PENDOWN(MIMIO_PEN_I) => EV_KEY BIT(BTN_TOOL_MOUSE)
* MIMIO_EV_PENDOWN(MIMIO_PEN_IL) => EV_KEY BIT(BTN_TOOL_LENS)
* MIMIO_EV_PENDOWN(MIMIO_PEN_IR) => EV_KEY BIT(BTN_TOOL_DOUBLETAP)
* MIMIO_EV_PENDOWN(MIMIO_PEN_EX) => EV_KEY BIT(BTN_TOOL_TRIPLETAP)
* MIMIO_EV_PENDATA => EV_ABS BIT(ABS_X), BIT(ABS_Y)
* MIMIO_EV_MEMRESET => EV_KEY BIT(BTN_0)
* MIMIO_EV_ACC(ACC_NEWPAGE) => EV_KEY BIT(BTN_1)
* MIMIO_EV_ACC(ACC_TAGPAGE) => EV_KEY BIT(BTN_2)
* MIMIO_EV_ACC(ACC_PRINTPAGE) => EV_KEY BIT(BTN_3)
* MIMIO_EV_ACC(ACC_MAXIMIZE) => EV_KEY BIT(BTN_4)
* MIMIO_EV_ACC(ACC_FINDCTLPNL) => EV_KEY BIT(BTN_5)
*
* open issues:
* - cold-load of data captured when mimio in standalone mode not yet
* supported; need to snoop Win32 box to see datastream for this.
* - mimio mouse not yet supported; need to snoop Win32 box to see the
* datastream for this.
* - cold-load of data captured when mimio in standalone mode not yet
* supported; need to snoop Win32 box to see datastream for this.
* - mimio mouse not yet supported; need to snoop Win32 box to see the
* datastream for this.
*/

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -357,14 +356,21 @@ static int mimio_open(struct input_dev *idev)
rslt = usb_submit_urb(mimio->in.urb, GFP_KERNEL);
if (rslt) {
dev_err(&idev->dev, "usb_submit_urb failure "
"(res = %d: %s). Not greeting.\n",
rslt,
(!urb ? "urb is NULL" :
(urb->hcpriv ? "urb->hcpriv is non-NULL" :
(!urb->complete ? "urb is not complete" :
(urb->number_of_packets <= 0 ? "urb has no packets" :
(urb->interval <= 0 ? "urb interval too small" :
"urb interval too large or some other error"))))));
"(res = %d: ", rslt);
if (!urb)
dev_err(&idev->dev, "urb is NULL");
else if (urb->hcpriv)
dev_err(&idev->dev, "urb->hcpriv is non-NULL");
else if (!urb->complete)
dev_err(&idev->dev, "urb is not complete");
else if (urb->number_of_packets <= 0)
dev_err(&idev->dev, "urb has no packets");
else if (urb->interval <= 0)
dev_err(&idev->dev, "urb interval too small");
else
dev_err(&idev->dev, "urb interval too large " \
"or some other error");
dev_err(&idev->dev, "). Not greeting.\n");
rslt = -EIO;
goto exit;
}
Expand Down

0 comments on commit abccc80

Please sign in to comment.