Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

Pull input updates from Dmitry Torokhov:
 "Assorted fixes and cleanups to the existing drivers plus a new driver
  for IMS Passenger Control Unit device they use for ther in-flight
  entertainment system."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (44 commits)
  Input: trackpoint - Optimize trackpoint init to use power-on reset
  Input: apbps2 - convert to devm_ioremap_resource()
  Input: ALPS - use %ph to print buffers
  ARM - shmobile: Armadillo800EVA: Move st1232 reset pin handling
  Input: st1232 - add reset pin handling
  Input: st1232 - convert to devm_* infrastructure
  Input: MT - handle semi-mt devices in core
  Input: adxl34x - use spi_get_drvdata()
  Input: ad7877 - use spi_get_drvdata() and spi_set_drvdata()
  Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata()
  Input: ims-pcu - fix a memory leak on error
  Input: sysrq - supplement reset sequence with timeout functionality
  Input: tegra-kbc - support for defining row/columns based on SoC
  Input: imx_keypad - switch to using managed resources
  Input: arc_ps2 - add support for device tree
  Input: mma8450 - fix signed 12bits to 32bits conversion
  Input: eeti_ts - remove redundant null check
  Input: edt-ft5x06 - remove redundant null check before kfree
  Input: ad714x - add CONFIG_PM_SLEEP to suspend/resume functions
  Input: adxl34x - add CONFIG_PM_SLEEP to suspend/resume functions
  ...
  • Loading branch information
Linus Torvalds committed May 1, 2013
2 parents 8a72f38 + bf61c88 commit 251df49
Show file tree
Hide file tree
Showing 49 changed files with 2,917 additions and 444 deletions.
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/input/ps2keyb-mouse-apbps2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Aeroflex Gaisler APBPS2 PS/2 Core, supporting Keyboard or Mouse.

The APBPS2 PS/2 core is available in the GRLIB VHDL IP core library.

Note: In the ordinary environment for the APBPS2 core, a LEON SPARC system,
these properties are built from information in the AMBA plug&play and from
bootloader settings.

Required properties:

- name : Should be "GAISLER_APBPS2" or "01_060"
- reg : Address and length of the register set for the device
- interrupts : Interrupt numbers for this device

For further information look in the documentation for the GLIB IP core library:
http://www.gaisler.com/products/grlib/grip.pdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
* AUO in-cell touchscreen controller using Pixcir sensors

Required properties:
- compatible: must be "auo,auo_pixcir_ts"
- reg: I2C address of the chip
- interrupts: interrupt to which the chip is connected
- gpios: gpios the chip is connected to
first one is the interrupt gpio and second one the reset gpio
- x-size: horizontal resolution of touchscreen
- y-size: vertical resolution of touchscreen

Example:

i2c@00000000 {
/* ... */

auo_pixcir_ts@5c {
compatible = "auo,auo_pixcir_ts";
reg = <0x5c>;
interrupts = <2 0>;

gpios = <&gpf 2 0 2>, /* INT */
<&gpf 5 1 0>; /* RST */

x-size = <800>;
y-size = <600>;
};

/* ... */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
* Sitronix st1232 touchscreen controller

Required properties:
- compatible: must be "sitronix,st1232"
- reg: I2C address of the chip
- interrupts: interrupt to which the chip is connected

Optional properties:
- gpios: a phandle to the reset GPIO

Example:

i2c@00000000 {
/* ... */

touchscreen@55 {
compatible = "sitronix,st1232";
reg = <0x55>;
interrupts = <2 0>;
gpios = <&gpio1 166 0>;
};

/* ... */
};
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/serio/snps-arc_ps2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* ARC PS/2 driver: PS/2 block used in some ARC FPGA's & nSIM OSCI model

Required properties:
- compatible : "snps,arc_ps2"
- reg : offset and length (always 0x14) of registers
- interrupts : interrupt
- interrupt-names : name of interrupt, must be "arc_ps2_irq"

Example:

serio@c9000400 {
compatible = "snps,arc_ps2";
reg = <0xc9000400 0x14>;
interrupts = <13>;
interrupt-names = "arc_ps2_irq";
}
7 changes: 6 additions & 1 deletion arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/input.h>
#include <linux/platform_data/st1232_pdata.h>
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
Expand Down Expand Up @@ -882,10 +883,15 @@ static struct platform_device i2c_gpio_device = {
};

/* I2C */
static struct st1232_pdata st1232_i2c0_pdata = {
.reset_gpio = 166,
};

static struct i2c_board_info i2c0_devices[] = {
{
I2C_BOARD_INFO("st1232-ts", 0x55),
.irq = evt2irq(0x0340),
.platform_data = &st1232_i2c0_pdata,
},
{
I2C_BOARD_INFO("wm8978", 0x1a),
Expand Down Expand Up @@ -1009,7 +1015,6 @@ static void __init eva_init(void)

/* Touchscreen */
gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
gpio_request_one(GPIO_PORT166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */

/* GETHER */
gpio_request(GPIO_FN_ET_CRS, NULL);
Expand Down
74 changes: 74 additions & 0 deletions drivers/base/devres.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,80 @@ int devres_release_group(struct device *dev, void *id)
}
EXPORT_SYMBOL_GPL(devres_release_group);

/*
* Custom devres actions allow inserting a simple function call
* into the teadown sequence.
*/

struct action_devres {
void *data;
void (*action)(void *);
};

static int devm_action_match(struct device *dev, void *res, void *p)
{
struct action_devres *devres = res;
struct action_devres *target = p;

return devres->action == target->action &&
devres->data == target->data;
}

static void devm_action_release(struct device *dev, void *res)
{
struct action_devres *devres = res;

devres->action(devres->data);
}

/**
* devm_add_action() - add a custom action to list of managed resources
* @dev: Device that owns the action
* @action: Function that should be called
* @data: Pointer to data passed to @action implementation
*
* This adds a custom action to the list of managed resources so that
* it gets executed as part of standard resource unwinding.
*/
int devm_add_action(struct device *dev, void (*action)(void *), void *data)
{
struct action_devres *devres;

devres = devres_alloc(devm_action_release,
sizeof(struct action_devres), GFP_KERNEL);
if (!devres)
return -ENOMEM;

devres->data = data;
devres->action = action;

devres_add(dev, devres);
return 0;
}
EXPORT_SYMBOL_GPL(devm_add_action);

/**
* devm_remove_action() - removes previously added custom action
* @dev: Device that owns the action
* @action: Function implementing the action
* @data: Pointer to data passed to @action implementation
*
* Removes instance of @action previously added by devm_add_action().
* Both action and data should match one of the existing entries.
*/
void devm_remove_action(struct device *dev, void (*action)(void *), void *data)
{
struct action_devres devres = {
.data = data,
.action = action,
};

WARN_ON(devres_destroy(dev, devm_action_release, devm_action_match,
&devres));

}
EXPORT_SYMBOL_GPL(devm_remove_action);

/*
* Managed kzalloc/kfree
*/
Expand Down
8 changes: 7 additions & 1 deletion drivers/input/input-mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
}
if (flags & INPUT_MT_DIRECT)
__set_bit(INPUT_PROP_DIRECT, dev->propbit);
if (flags & INPUT_MT_SEMI_MT)
__set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
if (flags & INPUT_MT_TRACK) {
unsigned int n2 = num_slots * num_slots;
mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL);
Expand Down Expand Up @@ -246,6 +248,7 @@ void input_mt_sync_frame(struct input_dev *dev)
{
struct input_mt *mt = dev->mt;
struct input_mt_slot *s;
bool use_count = false;

if (!mt)
return;
Expand All @@ -259,7 +262,10 @@ void input_mt_sync_frame(struct input_dev *dev)
}
}

input_mt_report_pointer_emulation(dev, (mt->flags & INPUT_MT_POINTER));
if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))
use_count = true;

input_mt_report_pointer_emulation(dev, use_count);

mt->frame++;
}
Expand Down
14 changes: 1 addition & 13 deletions drivers/input/keyboard/amikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,6 @@ static struct platform_driver amikbd_driver = {
},
};

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_probe(amikbd_driver, amikbd_probe);

MODULE_ALIAS("platform:amiga-keyboard");
12 changes: 1 addition & 11 deletions drivers/input/keyboard/davinci_keyscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,7 @@ static struct platform_driver davinci_ks_driver = {
.remove = 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_probe(davinci_ks_driver, davinci_ks_probe);

MODULE_AUTHOR("Miguel Aguilar");
MODULE_DESCRIPTION("Texas Instruments DaVinci Key Scan Driver");
Expand Down
Loading

0 comments on commit 251df49

Please sign in to comment.