You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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 ...
This commit is contained in:
@@ -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
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
/* ... */
|
||||
};
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
/* ... */
|
||||
};
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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),
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -448,24 +448,17 @@ static int imx_keypad_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
res = request_mem_region(res->start, resource_size(res), pdev->name);
|
||||
if (res == NULL) {
|
||||
dev_err(&pdev->dev, "failed to request I/O memory\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
input_dev = input_allocate_device();
|
||||
input_dev = devm_input_allocate_device(&pdev->dev);
|
||||
if (!input_dev) {
|
||||
dev_err(&pdev->dev, "failed to allocate the input device\n");
|
||||
error = -ENOMEM;
|
||||
goto failed_rel_mem;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
keypad = kzalloc(sizeof(struct imx_keypad), GFP_KERNEL);
|
||||
keypad = devm_kzalloc(&pdev->dev, sizeof(struct imx_keypad),
|
||||
GFP_KERNEL);
|
||||
if (!keypad) {
|
||||
dev_err(&pdev->dev, "not enough memory for driver data\n");
|
||||
error = -ENOMEM;
|
||||
goto failed_free_input;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
keypad->input_dev = input_dev;
|
||||
@@ -475,18 +468,14 @@ static int imx_keypad_probe(struct platform_device *pdev)
|
||||
setup_timer(&keypad->check_matrix_timer,
|
||||
imx_keypad_check_for_events, (unsigned long) keypad);
|
||||
|
||||
keypad->mmio_base = ioremap(res->start, resource_size(res));
|
||||
if (keypad->mmio_base == NULL) {
|
||||
dev_err(&pdev->dev, "failed to remap I/O memory\n");
|
||||
error = -ENOMEM;
|
||||
goto failed_free_priv;
|
||||
}
|
||||
keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(keypad->mmio_base))
|
||||
return PTR_ERR(keypad->mmio_base);
|
||||
|
||||
keypad->clk = clk_get(&pdev->dev, NULL);
|
||||
keypad->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(keypad->clk)) {
|
||||
dev_err(&pdev->dev, "failed to get keypad clock\n");
|
||||
error = PTR_ERR(keypad->clk);
|
||||
goto failed_unmap;
|
||||
return PTR_ERR(keypad->clk);
|
||||
}
|
||||
|
||||
/* Init the Input device */
|
||||
@@ -502,7 +491,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
|
||||
keypad->keycodes, input_dev);
|
||||
if (error) {
|
||||
dev_err(&pdev->dev, "failed to build keymap\n");
|
||||
goto failed_clock_put;
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Search for rows and cols enabled */
|
||||
@@ -527,60 +516,23 @@ static int imx_keypad_probe(struct platform_device *pdev)
|
||||
imx_keypad_inhibit(keypad);
|
||||
clk_disable_unprepare(keypad->clk);
|
||||
|
||||
error = request_irq(irq, imx_keypad_irq_handler, 0,
|
||||
error = devm_request_irq(&pdev->dev, irq, imx_keypad_irq_handler, 0,
|
||||
pdev->name, keypad);
|
||||
if (error) {
|
||||
dev_err(&pdev->dev, "failed to request IRQ\n");
|
||||
goto failed_clock_put;
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Register the input device */
|
||||
error = input_register_device(input_dev);
|
||||
if (error) {
|
||||
dev_err(&pdev->dev, "failed to register input device\n");
|
||||
goto failed_free_irq;
|
||||
return error;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, keypad);
|
||||
device_init_wakeup(&pdev->dev, 1);
|
||||
|
||||
return 0;
|
||||
|
||||
failed_free_irq:
|
||||
free_irq(irq, pdev);
|
||||
failed_clock_put:
|
||||
clk_put(keypad->clk);
|
||||
failed_unmap:
|
||||
iounmap(keypad->mmio_base);
|
||||
failed_free_priv:
|
||||
kfree(keypad);
|
||||
failed_free_input:
|
||||
input_free_device(input_dev);
|
||||
failed_rel_mem:
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
return error;
|
||||
}
|
||||
|
||||
static int imx_keypad_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct imx_keypad *keypad = platform_get_drvdata(pdev);
|
||||
struct resource *res;
|
||||
|
||||
dev_dbg(&pdev->dev, ">%s\n", __func__);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
input_unregister_device(keypad->input_dev);
|
||||
|
||||
free_irq(keypad->irq, keypad);
|
||||
clk_put(keypad->clk);
|
||||
|
||||
iounmap(keypad->mmio_base);
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
|
||||
kfree(keypad);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -640,7 +592,6 @@ static struct platform_driver imx_keypad_driver = {
|
||||
.of_match_table = of_match_ptr(imx_keypad_of_match),
|
||||
},
|
||||
.probe = imx_keypad_probe,
|
||||
.remove = imx_keypad_remove,
|
||||
};
|
||||
module_platform_driver(imx_keypad_driver);
|
||||
|
||||
|
||||
@@ -430,17 +430,7 @@ static struct platform_driver ske_keypad_driver = {
|
||||
.remove = 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_probe(ske_keypad_driver, ske_keypad_probe);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_AUTHOR("Naveen Kumar <naveen.gaddipati@stericsson.com> / Sundar Iyer <sundar.iyer@stericsson.com>");
|
||||
|
||||
@@ -27,17 +27,19 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/input/matrix_keypad.h>
|
||||
#include <linux/clk/tegra.h>
|
||||
#include <linux/err.h>
|
||||
|
||||
#define KBC_MAX_GPIO 24
|
||||
#define KBC_MAX_KPENT 8
|
||||
|
||||
#define KBC_MAX_ROW 16
|
||||
#define KBC_MAX_COL 8
|
||||
#define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL)
|
||||
/* Maximum row/column supported by Tegra KBC yet is 16x8 */
|
||||
#define KBC_MAX_GPIO 24
|
||||
/* Maximum keys supported by Tegra KBC yet is 16 x 8*/
|
||||
#define KBC_MAX_KEY (16 * 8)
|
||||
|
||||
#define KBC_MAX_DEBOUNCE_CNT 0x3ffu
|
||||
|
||||
@@ -80,6 +82,12 @@ enum tegra_pin_type {
|
||||
PIN_CFG_ROW,
|
||||
};
|
||||
|
||||
/* Tegra KBC hw support */
|
||||
struct tegra_kbc_hw_support {
|
||||
int max_rows;
|
||||
int max_columns;
|
||||
};
|
||||
|
||||
struct tegra_kbc_pin_cfg {
|
||||
enum tegra_pin_type type;
|
||||
unsigned char num;
|
||||
@@ -108,6 +116,9 @@ struct tegra_kbc {
|
||||
u32 wakeup_key;
|
||||
struct timer_list timer;
|
||||
struct clk *clk;
|
||||
const struct tegra_kbc_hw_support *hw_support;
|
||||
int max_keys;
|
||||
int num_rows_and_columns;
|
||||
};
|
||||
|
||||
static void tegra_kbc_report_released_keys(struct input_dev *input,
|
||||
@@ -204,11 +215,11 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc)
|
||||
|
||||
/*
|
||||
* If the platform uses Fn keymaps, translate keys on a Fn keypress.
|
||||
* Function keycodes are KBC_MAX_KEY apart from the plain keycodes.
|
||||
* Function keycodes are max_keys apart from the plain keycodes.
|
||||
*/
|
||||
if (fn_keypress) {
|
||||
for (i = 0; i < num_down; i++) {
|
||||
scancodes[i] += KBC_MAX_KEY;
|
||||
scancodes[i] += kbc->max_keys;
|
||||
keycodes[i] = kbc->keycode[scancodes[i]];
|
||||
}
|
||||
}
|
||||
@@ -315,7 +326,7 @@ static void tegra_kbc_setup_wakekeys(struct tegra_kbc *kbc, bool filter)
|
||||
/* Either mask all keys or none. */
|
||||
rst_val = (filter && !kbc->wakeup) ? ~0 : 0;
|
||||
|
||||
for (i = 0; i < KBC_MAX_ROW; i++)
|
||||
for (i = 0; i < kbc->hw_support->max_rows; i++)
|
||||
writel(rst_val, kbc->mmio + KBC_ROW0_MASK_0 + i * 4);
|
||||
}
|
||||
|
||||
@@ -452,7 +463,7 @@ static bool tegra_kbc_check_pin_cfg(const struct tegra_kbc *kbc,
|
||||
|
||||
switch (pin_cfg->type) {
|
||||
case PIN_CFG_ROW:
|
||||
if (pin_cfg->num >= KBC_MAX_ROW) {
|
||||
if (pin_cfg->num >= kbc->hw_support->max_rows) {
|
||||
dev_err(kbc->dev,
|
||||
"pin_cfg[%d]: invalid row number %d\n",
|
||||
i, pin_cfg->num);
|
||||
@@ -462,7 +473,7 @@ static bool tegra_kbc_check_pin_cfg(const struct tegra_kbc *kbc,
|
||||
break;
|
||||
|
||||
case PIN_CFG_COL:
|
||||
if (pin_cfg->num >= KBC_MAX_COL) {
|
||||
if (pin_cfg->num >= kbc->hw_support->max_columns) {
|
||||
dev_err(kbc->dev,
|
||||
"pin_cfg[%d]: invalid column number %d\n",
|
||||
i, pin_cfg->num);
|
||||
@@ -520,6 +531,18 @@ static int tegra_kbc_parse_dt(struct tegra_kbc *kbc)
|
||||
}
|
||||
num_cols = proplen / sizeof(u32);
|
||||
|
||||
if (num_rows > kbc->hw_support->max_rows) {
|
||||
dev_err(kbc->dev,
|
||||
"Number of rows is more than supported by hardware\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (num_cols > kbc->hw_support->max_columns) {
|
||||
dev_err(kbc->dev,
|
||||
"Number of cols is more than supported by hardware\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!of_get_property(np, "linux,keymap", &proplen)) {
|
||||
dev_err(kbc->dev, "property linux,keymap not found\n");
|
||||
return -ENOENT;
|
||||
@@ -532,7 +555,7 @@ static int tegra_kbc_parse_dt(struct tegra_kbc *kbc)
|
||||
}
|
||||
|
||||
/* Set all pins as non-configured */
|
||||
for (i = 0; i < KBC_MAX_GPIO; i++)
|
||||
for (i = 0; i < kbc->num_rows_and_columns; i++)
|
||||
kbc->pin_cfg[i].type = PIN_CFG_IGNORE;
|
||||
|
||||
ret = of_property_read_u32_array(np, "nvidia,kbc-row-pins",
|
||||
@@ -562,6 +585,24 @@ static int tegra_kbc_parse_dt(struct tegra_kbc *kbc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct tegra_kbc_hw_support tegra20_kbc_hw_support = {
|
||||
.max_rows = 16,
|
||||
.max_columns = 8,
|
||||
};
|
||||
|
||||
static const struct tegra_kbc_hw_support tegra11_kbc_hw_support = {
|
||||
.max_rows = 11,
|
||||
.max_columns = 8,
|
||||
};
|
||||
|
||||
static const struct of_device_id tegra_kbc_of_match[] = {
|
||||
{ .compatible = "nvidia,tegra114-kbc", .data = &tegra11_kbc_hw_support},
|
||||
{ .compatible = "nvidia,tegra30-kbc", .data = &tegra20_kbc_hw_support},
|
||||
{ .compatible = "nvidia,tegra20-kbc", .data = &tegra20_kbc_hw_support},
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, tegra_kbc_of_match);
|
||||
|
||||
static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_kbc *kbc;
|
||||
@@ -570,7 +611,10 @@ static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
int num_rows = 0;
|
||||
unsigned int debounce_cnt;
|
||||
unsigned int scan_time_rows;
|
||||
unsigned int keymap_rows = KBC_MAX_KEY;
|
||||
unsigned int keymap_rows;
|
||||
const struct of_device_id *match;
|
||||
|
||||
match = of_match_device(of_match_ptr(tegra_kbc_of_match), &pdev->dev);
|
||||
|
||||
kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
|
||||
if (!kbc) {
|
||||
@@ -579,6 +623,12 @@ static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
kbc->dev = &pdev->dev;
|
||||
kbc->hw_support = match->data;
|
||||
kbc->max_keys = kbc->hw_support->max_rows *
|
||||
kbc->hw_support->max_columns;
|
||||
kbc->num_rows_and_columns = kbc->hw_support->max_rows +
|
||||
kbc->hw_support->max_columns;
|
||||
keymap_rows = kbc->max_keys;
|
||||
spin_lock_init(&kbc->lock);
|
||||
|
||||
err = tegra_kbc_parse_dt(kbc);
|
||||
@@ -608,11 +658,9 @@ static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
|
||||
setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc);
|
||||
|
||||
kbc->mmio = devm_request_and_ioremap(&pdev->dev, res);
|
||||
if (!kbc->mmio) {
|
||||
dev_err(&pdev->dev, "Cannot request memregion/iomap address\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
kbc->mmio = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(kbc->mmio))
|
||||
return PTR_ERR(kbc->mmio);
|
||||
|
||||
kbc->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(kbc->clk)) {
|
||||
@@ -641,7 +689,8 @@ static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
keymap_rows *= 2;
|
||||
|
||||
err = matrix_keypad_build_keymap(kbc->keymap_data, NULL,
|
||||
keymap_rows, KBC_MAX_COL,
|
||||
keymap_rows,
|
||||
kbc->hw_support->max_columns,
|
||||
kbc->keycode, kbc->idev);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "failed to setup keymap\n");
|
||||
@@ -767,12 +816,6 @@ static int tegra_kbc_resume(struct device *dev)
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops, tegra_kbc_suspend, tegra_kbc_resume);
|
||||
|
||||
static const struct of_device_id tegra_kbc_of_match[] = {
|
||||
{ .compatible = "nvidia,tegra20-kbc", },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, tegra_kbc_of_match);
|
||||
|
||||
static struct platform_driver tegra_kbc_driver = {
|
||||
.probe = tegra_kbc_probe,
|
||||
.driver = {
|
||||
|
||||
@@ -590,6 +590,16 @@ config INPUT_ADXL34X_SPI
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called adxl34x-spi.
|
||||
|
||||
config INPUT_IMS_PCU
|
||||
tristate "IMS Passenger Control Unit driver"
|
||||
depends on USB
|
||||
depends on LEDS_CLASS
|
||||
help
|
||||
Say Y here if you have system with IMS Rave Passenger Control Unit.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will be
|
||||
called ims_pcu.
|
||||
|
||||
config INPUT_CMA3000
|
||||
tristate "VTI CMA3000 Tri-axis accelerometer"
|
||||
help
|
||||
|
||||
@@ -29,6 +29,7 @@ obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o
|
||||
obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o
|
||||
obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o
|
||||
obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o
|
||||
obj-$(CONFIG_INPUT_IMS_PCU) += ims-pcu.o
|
||||
obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o
|
||||
obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o
|
||||
obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <linux/pm.h>
|
||||
#include "ad714x.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int ad714x_i2c_suspend(struct device *dev)
|
||||
{
|
||||
return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define AD714x_SPI_CMD_PREFIX 0xE000 /* bits 15:11 */
|
||||
#define AD714x_SPI_READ BIT(10)
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int ad714x_spi_suspend(struct device *dev)
|
||||
{
|
||||
return ad714x_disable(spi_get_drvdata(to_spi_device(dev)));
|
||||
|
||||
@@ -105,7 +105,7 @@ static int adxl34x_i2c_remove(struct i2c_client *client)
|
||||
return adxl34x_remove(ac);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int adxl34x_i2c_suspend(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
|
||||
@@ -89,16 +89,16 @@ static int adxl34x_spi_probe(struct spi_device *spi)
|
||||
|
||||
static int adxl34x_spi_remove(struct spi_device *spi)
|
||||
{
|
||||
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
|
||||
struct adxl34x *ac = spi_get_drvdata(spi);
|
||||
|
||||
return adxl34x_remove(ac);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int adxl34x_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_device *spi = to_spi_device(dev);
|
||||
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
|
||||
struct adxl34x *ac = spi_get_drvdata(spi);
|
||||
|
||||
adxl34x_suspend(ac);
|
||||
|
||||
@@ -108,7 +108,7 @@ static int adxl34x_spi_suspend(struct device *dev)
|
||||
static int adxl34x_spi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_device *spi = to_spi_device(dev);
|
||||
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
|
||||
struct adxl34x *ac = spi_get_drvdata(spi);
|
||||
|
||||
adxl34x_resume(ac);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -123,9 +123,9 @@ static void mma8450_poll(struct input_polled_dev *dev)
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
x = ((buf[1] << 4) & 0xff0) | (buf[0] & 0xf);
|
||||
y = ((buf[3] << 4) & 0xff0) | (buf[2] & 0xf);
|
||||
z = ((buf[5] << 4) & 0xff0) | (buf[4] & 0xf);
|
||||
x = ((int)(s8)buf[1] << 4) | (buf[0] & 0xf);
|
||||
y = ((int)(s8)buf[3] << 4) | (buf[2] & 0xf);
|
||||
z = ((int)(s8)buf[5] << 4) | (buf[4] & 0xf);
|
||||
|
||||
input_report_abs(dev->input, ABS_X, x);
|
||||
input_report_abs(dev->input, ABS_Y, y);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user