Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293997
b: refs/heads/master
c: db3dbd0
h: refs/heads/master
i:
  293995: 9a7cef8
v: v3
  • Loading branch information
Dmitry Torokhov committed Jan 23, 2012
1 parent adc15e7 commit ed4a074
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 235 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: 24e3e5ae1e4c2a3a32f5b1f96b4e3fd721806acd
refs/heads/master: db3dbd093a7cbb201f169ace35f6cdff562e5a77
3 changes: 1 addition & 2 deletions trunk/Documentation/input/alps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Detection

All ALPS touchpads should respond to the "E6 report" command sequence:
E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or
00-00-64 if no buttons are pressed. The bits 0-2 of the first byte will be 1s
if some buttons are pressed.
00-00-64.

If the E6 report is successful, the touchpad model is identified using the "E7
report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is
Expand Down
72 changes: 8 additions & 64 deletions trunk/Documentation/input/event-codes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ reports supported by a device are also provided by sysfs in
class/input/event*/device/capabilities/, and the properties of a device are
provided in class/input/event*/device/properties.

Event types:
===========
Event types are groupings of codes under a logical input construct. Each
type has a set of applicable codes to be used in generating events. See the
Codes section for details on valid codes for each type.
Types:
==========
Types are groupings of codes under a logical input construct. Each type has a
set of applicable codes to be used in generating events. See the Codes section
for details on valid codes for each type.

* EV_SYN:
- Used as markers to separate events. Events may be separated in time or in
Expand Down Expand Up @@ -63,9 +63,9 @@ Codes section for details on valid codes for each type.
* EV_FF_STATUS:
- Used to receive force feedback device status.

Event codes:
===========
Event codes define the precise type of event.
Codes:
==========
Codes define the precise type of event.

EV_SYN:
----------
Expand Down Expand Up @@ -220,56 +220,6 @@ EV_PWR:
EV_PWR events are a special type of event used specifically for power
mangement. Its usage is not well defined. To be addressed later.

Device properties:
=================
Normally, userspace sets up an input device based on the data it emits,
i.e., the event types. In the case of two devices emitting the same event
types, additional information can be provided in the form of device
properties.

INPUT_PROP_DIRECT + INPUT_PROP_POINTER:
--------------------------------------
The INPUT_PROP_DIRECT property indicates that device coordinates should be
directly mapped to screen coordinates (not taking into account trivial
transformations, such as scaling, flipping and rotating). Non-direct input
devices require non-trivial transformation, such as absolute to relative
transformation for touchpads. Typical direct input devices: touchscreens,
drawing tablets; non-direct devices: touchpads, mice.

The INPUT_PROP_POINTER property indicates that the device is not transposed
on the screen and thus requires use of an on-screen pointer to trace user's
movements. Typical pointer devices: touchpads, tablets, mice; non-pointer
device: touchscreen.

If neither INPUT_PROP_DIRECT or INPUT_PROP_POINTER are set, the property is
considered undefined and the device type should be deduced in the
traditional way, using emitted event types.

INPUT_PROP_BUTTONPAD:
--------------------
For touchpads where the button is placed beneath the surface, such that
pressing down on the pad causes a button click, this property should be
set. Common in clickpad notebooks and macbooks from 2009 and onwards.

Originally, the buttonpad property was coded into the bcm5974 driver
version field under the name integrated button. For backwards
compatibility, both methods need to be checked in userspace.

INPUT_PROP_SEMI_MT:
------------------
Some touchpads, most common between 2008 and 2011, can detect the presence
of multiple contacts without resolving the individual positions; only the
number of contacts and a rectangular shape is known. For such
touchpads, the semi-mt property should be set.

Depending on the device, the rectangle may enclose all touches, like a
bounding box, or just some of them, for instance the two most recent
touches. The diversity makes the rectangle of limited use, but some
gestures can normally be extracted from it.

If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT
device.

Guidelines:
==========
The guidelines below ensure proper single-touch and multi-finger functionality.
Expand All @@ -290,8 +240,6 @@ used to report when a touch is active on the screen.
BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch
contact. BTN_TOOL_<name> events should be reported where possible.

For new hardware, INPUT_PROP_DIRECT should be set.

Trackpads:
----------
Legacy trackpads that only provide relative position information must report
Expand All @@ -302,8 +250,6 @@ location of the touch. BTN_TOUCH should be used to report when a touch is active
on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should
be used to report the number of touches active on the trackpad.

For new hardware, INPUT_PROP_POINTER should be set.

Tablets:
----------
BTN_TOOL_<name> events must be reported when a stylus or other tool is active on
Expand All @@ -314,5 +260,3 @@ button may be used for buttons on the tablet except BTN_{MOUSE,LEFT}.
BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use
meaningful buttons, like BTN_FORWARD, unless the button is labeled for that
purpose on the device.

For new hardware, both INPUT_PROP_DIRECT and INPUT_PROP_POINTER should be set.
4 changes: 2 additions & 2 deletions trunk/drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
struct evdev_client *client = file->private_data;
struct evdev *evdev = client->evdev;
struct input_event event;
int retval = 0;
int retval;

if (count < input_event_size())
return -EINVAL;
Expand Down Expand Up @@ -386,7 +386,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
struct evdev_client *client = file->private_data;
struct evdev *evdev = client->evdev;
struct input_event event;
int retval = 0;
int retval;

if (count < input_event_size())
return -EINVAL;
Expand Down
15 changes: 1 addition & 14 deletions trunk/drivers/input/keyboard/amikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,6 @@ static struct platform_driver amikbd_driver = {
.owner = THIS_MODULE,
},
};

static int __init amikbd_init(void)
{
return platform_driver_probe(&amikbd_driver, amikbd_probe);
}

module_init(amikbd_init);

static void __exit amikbd_exit(void)
{
platform_driver_unregister(&amikbd_driver);
}

module_exit(amikbd_exit);
module_platform_driver(amikbd_driver);

MODULE_ALIAS("platform:amiga-keyboard");
13 changes: 1 addition & 12 deletions trunk/drivers/input/keyboard/davinci_keyscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,7 @@ static struct platform_driver davinci_ks_driver = {
},
.remove = __devexit_p(davinci_ks_remove),
};

static int __init davinci_ks_init(void)
{
return platform_driver_probe(&davinci_ks_driver, davinci_ks_probe);
}
module_init(davinci_ks_init);

static void __exit davinci_ks_exit(void)
{
platform_driver_unregister(&davinci_ks_driver);
}
module_exit(davinci_ks_exit);
module_platform_driver(davinci_ks_driver);

MODULE_AUTHOR("Miguel Aguilar");
MODULE_DESCRIPTION("Texas Instruments DaVinci Key Scan Driver");
Expand Down
18 changes: 3 additions & 15 deletions trunk/drivers/input/keyboard/nomadik-ske-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void ske_keypad_set_bits(struct ske_keypad *keypad, u16 addr,
*
* Enable Multi key press detection, auto scan mode
*/
static int __devinit ske_keypad_chip_init(struct ske_keypad *keypad)
static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
{
u32 value;
int timeout = 50;
Expand Down Expand Up @@ -198,7 +198,7 @@ static irqreturn_t ske_keypad_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}

static int __devinit ske_keypad_probe(struct platform_device *pdev)
static int __init ske_keypad_probe(struct platform_device *pdev)
{
const struct ske_keypad_platform_data *plat = pdev->dev.platform_data;
struct ske_keypad *keypad;
Expand Down Expand Up @@ -387,21 +387,9 @@ static struct platform_driver ske_keypad_driver = {
.pm = &ske_keypad_dev_pm_ops,
#endif
},
.probe = ske_keypad_probe,
.remove = __devexit_p(ske_keypad_remove),
};

static int __init ske_keypad_init(void)
{
return platform_driver_probe(&ske_keypad_driver, ske_keypad_probe);
}
module_init(ske_keypad_init);

static void __exit ske_keypad_exit(void)
{
platform_driver_unregister(&ske_keypad_driver);
}
module_exit(ske_keypad_exit);
module_platform_driver(ske_keypad_driver);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Naveen Kumar <naveen.gaddipati@stericsson.com> / Sundar Iyer <sundar.iyer@stericsson.com>");
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/input/keyboard/twl4030_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/i2c/twl.h>
#include <linux/slab.h>


/*
* The TWL4030 family chips include a keypad controller that supports
* up to an 8x8 switch matrix. The controller can issue system wakeup
Expand Down Expand Up @@ -301,7 +302,7 @@ static int __devinit twl4030_kp_program(struct twl4030_keypad *kp)
if (twl4030_kpwrite_u8(kp, i, KEYP_DEB) < 0)
return -EIO;

/* Set timeout period to 200 ms */
/* Set timeout period to 100 ms */
i = KEYP_PERIOD_US(200000, PTV_PRESCALER);
if (twl4030_kpwrite_u8(kp, (i & 0xFF), KEYP_TIMEOUT_L) < 0)
return -EIO;
Expand Down Expand Up @@ -465,3 +466,4 @@ MODULE_AUTHOR("Texas Instruments");
MODULE_DESCRIPTION("TWL4030 Keypad Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:twl4030_keypad");

4 changes: 2 additions & 2 deletions trunk/drivers/input/misc/cma3000_d0x.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ static void decode_mg(struct cma3000_accl_data *data, int *datax,
static irqreturn_t cma3000_thread_irq(int irq, void *dev_id)
{
struct cma3000_accl_data *data = dev_id;
int datax, datay, dataz, intr_status;
u8 ctrl, mode, range;
int datax, datay, dataz;
u8 ctrl, mode, range, intr_status;

intr_status = CMA3000_READ(data, CMA3000_INTSTATUS, "interrupt status");
if (intr_status < 0)
Expand Down
15 changes: 2 additions & 13 deletions trunk/drivers/input/misc/twl4030-pwrbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,14 @@ static int __exit twl4030_pwrbutton_remove(struct platform_device *pdev)
}

static struct platform_driver twl4030_pwrbutton_driver = {
.probe = twl4030_pwrbutton_probe,
.remove = __exit_p(twl4030_pwrbutton_remove),
.driver = {
.name = "twl4030_pwrbutton",
.owner = THIS_MODULE,
},
};

static int __init twl4030_pwrbutton_init(void)
{
return platform_driver_probe(&twl4030_pwrbutton_driver,
twl4030_pwrbutton_probe);
}
module_init(twl4030_pwrbutton_init);

static void __exit twl4030_pwrbutton_exit(void)
{
platform_driver_unregister(&twl4030_pwrbutton_driver);
}
module_exit(twl4030_pwrbutton_exit);
module_platform_driver(twl4030_pwrbutton_driver);

MODULE_ALIAS("platform:twl4030_pwrbutton");
MODULE_DESCRIPTION("Triton2 Power Button");
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/input/misc/twl4030-vibra.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static void twl4030_vibra_close(struct input_dev *input)
}

/*** Module ***/
#ifdef CONFIG_PM_SLEEP
#if CONFIG_PM
static int twl4030_vibra_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
Expand All @@ -189,10 +189,10 @@ static int twl4030_vibra_resume(struct device *dev)
vibra_disable_leds();
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
twl4030_vibra_suspend, twl4030_vibra_resume);
#endif

static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
{
Expand Down Expand Up @@ -273,7 +273,9 @@ static struct platform_driver twl4030_vibra_driver = {
.driver = {
.name = "twl4030-vibra",
.owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &twl4030_vibra_pm_ops,
#endif
},
};
module_platform_driver(twl4030_vibra_driver);
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/input/mouse/alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int

/*
* First try "E6 report".
* ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
* The bits 0-2 of the first byte will be 1s if some buttons are
* pressed.
* ALPS should return 0,0,10 or 0,0,100
*/
param[0] = 0;
if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
Expand All @@ -970,8 +968,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
param[0], param[1], param[2]);

if ((param[0] & 0xf8) != 0 || param[1] != 0 ||
(param[2] != 10 && param[2] != 100))
if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100))
return NULL;

/*
Expand Down
16 changes: 2 additions & 14 deletions trunk/drivers/input/mouse/amimouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,13 @@ static int __exit amimouse_remove(struct platform_device *pdev)
}

static struct platform_driver amimouse_driver = {
.probe = amimouse_probe,
.remove = __exit_p(amimouse_remove),
.driver = {
.name = "amiga-mouse",
.owner = THIS_MODULE,
},
};

static int __init amimouse_init(void)
{
return platform_driver_probe(&amimouse_driver, amimouse_probe);
}

module_init(amimouse_init);

static void __exit amimouse_exit(void)
{
platform_driver_unregister(&amimouse_driver);
}

module_exit(amimouse_exit);
module_platform_driver(amimouse_driver);

MODULE_ALIAS("platform:amiga-mouse");
3 changes: 0 additions & 3 deletions trunk/drivers/input/mouse/bcm5974.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,6 @@ 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 (cfg->caps & HAS_INTEGRATED_BUTTON)
__set_bit(INPUT_PROP_BUTTONPAD, input_dev->propbit);

input_set_events_per_packet(input_dev, 60);
}

Expand Down
Loading

0 comments on commit ed4a074

Please sign in to comment.