Commit bbdb5c22 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Merge branch 'next' into for-linus

Prepare second round of input updates for 4.3 merge window.
parents e60e063c 5e0baca8
* Texas Instruments tsc2005 touchscreen controller
* Texas Instruments tsc2004 and tsc2005 touchscreen controllers
Required properties:
- compatible : "ti,tsc2005"
- reg : SPI device address
- spi-max-frequency : Maximal SPI speed
- compatible : "ti,tsc2004" or "ti,tsc2005"
- reg : Device address
- interrupts : IRQ specifier
- reset-gpios : GPIO specifier
- vio-supply : Regulator specifier
- spi-max-frequency : Maximum SPI clocking speed of the device
(for tsc2005)
Optional properties:
- vio-supply : Regulator specifier
- reset-gpios : GPIO specifier for the controller reset line
- ti,x-plate-ohms : integer, resistance of the touchscreen's X plates
in ohm (defaults to 280)
- ti,esd-recovery-timeout-ms : integer, if the touchscreen does not respond after
......@@ -18,6 +19,27 @@ Optional properties:
Example:
&i2c3 {
tsc2004@48 {
compatible = "ti,tsc2004";
reg = <0x48>;
vio-supply = <&vio>;
reset-gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>;
interrupts-extended = <&gpio1 27 IRQ_TYPE_EDGE_RISING>;
touchscreen-fuzz-x = <4>;
touchscreen-fuzz-y = <7>;
touchscreen-fuzz-pressure = <2>;
touchscreen-size-x = <4096>;
touchscreen-size-y = <4096>;
touchscreen-max-pressure = <2048>;
ti,x-plate-ohms = <280>;
ti,esd-recovery-timeout-ms = <8000>;
};
}
&mcspi1 {
tsc2005@0 {
compatible = "ti,tsc2005";
......
......@@ -1520,6 +1520,13 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"),
},
},
{
/* Fujitsu LIFEBOOK U745 does not work with crc_enabled == 0 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
},
},
#endif
{ }
};
......
......@@ -164,7 +164,7 @@ static int parkbd_getport(struct parport *pp)
return 0;
}
static struct serio * __init parkbd_allocate_serio(void)
static struct serio *parkbd_allocate_serio(void)
{
struct serio *serio;
......
......@@ -939,10 +939,27 @@ config TOUCHSCREEN_TSC_SERIO
To compile this driver as a module, choose M here: the
module will be called tsc40.
config TOUCHSCREEN_TSC200X_CORE
tristate
config TOUCHSCREEN_TSC2004
tristate "TSC2004 based touchscreens"
depends on I2C
select REGMAP_I2C
select TOUCHSCREEN_TSC200X_CORE
help
Say Y here if you have a TSC2004 based touchscreen.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called tsc2004.
config TOUCHSCREEN_TSC2005
tristate "TSC2005 based touchscreens"
depends on SPI_MASTER
select REGMAP_SPI
select TOUCHSCREEN_TSC200X_CORE
help
Say Y here if you have a TSC2005 based touchscreen.
......
......@@ -69,6 +69,8 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o
obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
obj-$(CONFIG_TOUCHSCREEN_TSC_SERIO) += tsc40.o
obj-$(CONFIG_TOUCHSCREEN_TSC200X_CORE) += tsc200x-core.o
obj-$(CONFIG_TOUCHSCREEN_TSC2004) += tsc2004.o
obj-$(CONFIG_TOUCHSCREEN_TSC2005) += tsc2005.o
obj-$(CONFIG_TOUCHSCREEN_TSC2007) += tsc2007.o
obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
......
/*
* TSC2004 touchscreen driver
*
* Copyright (C) 2015 QWERTY Embedded Design
* Copyright (C) 2015 EMAC Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/module.h>
#include <linux/input.h>
#include <linux/of.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include "tsc200x-core.h"
static int tsc2004_cmd(struct device *dev, u8 cmd)
{
u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd;
s32 data;
struct i2c_client *i2c = to_i2c_client(dev);
data = i2c_smbus_write_byte(i2c, tx);
if (data < 0) {
dev_err(dev, "%s: failed, command: %x i2c error: %d\n",
__func__, cmd, data);
return data;
}
return 0;
}
static int tsc2004_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
return tsc200x_probe(&i2c->dev, i2c->irq, BUS_I2C,
devm_regmap_init_i2c(i2c, &tsc200x_regmap_config),
tsc2004_cmd);
}
static int tsc2004_remove(struct i2c_client *i2c)
{
return tsc200x_remove(&i2c->dev);
}
static const struct i2c_device_id tsc2004_idtable[] = {
{ "tsc2004", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, tsc2004_idtable);
#ifdef CONFIG_OF
static const struct of_device_id tsc2004_of_match[] = {
{ .compatible = "ti,tsc2004" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, tsc2004_of_match);
#endif
static struct i2c_driver tsc2004_driver = {
.driver = {
.name = "tsc2004",
.of_match_table = of_match_ptr(tsc2004_of_match),
.pm = &tsc200x_pm_ops,
},
.id_table = tsc2004_idtable,
.probe = tsc2004_probe,
.remove = tsc2004_remove,
};
module_i2c_driver(tsc2004_driver);
MODULE_AUTHOR("Michael Welling <mwelling@ieee.org>");
MODULE_DESCRIPTION("TSC2004 Touchscreen Driver");
MODULE_LICENSE("GPL");
This diff is collapsed.
This diff is collapsed.
#ifndef _TSC200X_CORE_H
#define _TSC200X_CORE_H
/* control byte 1 */
#define TSC200X_CMD 0x80
#define TSC200X_CMD_NORMAL 0x00
#define TSC200X_CMD_STOP 0x01
#define TSC200X_CMD_12BIT 0x04
/* control byte 0 */
#define TSC200X_REG_READ 0x01 /* R/W access */
#define TSC200X_REG_PND0 0x02 /* Power Not Down Control */
#define TSC200X_REG_X (0x0 << 3)
#define TSC200X_REG_Y (0x1 << 3)
#define TSC200X_REG_Z1 (0x2 << 3)
#define TSC200X_REG_Z2 (0x3 << 3)
#define TSC200X_REG_AUX (0x4 << 3)
#define TSC200X_REG_TEMP1 (0x5 << 3)
#define TSC200X_REG_TEMP2 (0x6 << 3)
#define TSC200X_REG_STATUS (0x7 << 3)
#define TSC200X_REG_AUX_HIGH (0x8 << 3)
#define TSC200X_REG_AUX_LOW (0x9 << 3)
#define TSC200X_REG_TEMP_HIGH (0xA << 3)
#define TSC200X_REG_TEMP_LOW (0xB << 3)
#define TSC200X_REG_CFR0 (0xC << 3)
#define TSC200X_REG_CFR1 (0xD << 3)
#define TSC200X_REG_CFR2 (0xE << 3)
#define TSC200X_REG_CONV_FUNC (0xF << 3)
/* configuration register 0 */
#define TSC200X_CFR0_PRECHARGE_276US 0x0040
#define TSC200X_CFR0_STABTIME_1MS 0x0300
#define TSC200X_CFR0_CLOCK_1MHZ 0x1000
#define TSC200X_CFR0_RESOLUTION12 0x2000
#define TSC200X_CFR0_PENMODE 0x8000
#define TSC200X_CFR0_INITVALUE (TSC200X_CFR0_STABTIME_1MS | \
TSC200X_CFR0_CLOCK_1MHZ | \
TSC200X_CFR0_RESOLUTION12 | \
TSC200X_CFR0_PRECHARGE_276US | \
TSC200X_CFR0_PENMODE)
/* bits common to both read and write of configuration register 0 */
#define TSC200X_CFR0_RW_MASK 0x3fff
/* configuration register 1 */
#define TSC200X_CFR1_BATCHDELAY_4MS 0x0003
#define TSC200X_CFR1_INITVALUE TSC200X_CFR1_BATCHDELAY_4MS
/* configuration register 2 */
#define TSC200X_CFR2_MAVE_Z 0x0004
#define TSC200X_CFR2_MAVE_Y 0x0008
#define TSC200X_CFR2_MAVE_X 0x0010
#define TSC200X_CFR2_AVG_7 0x0800
#define TSC200X_CFR2_MEDIUM_15 0x3000
#define TSC200X_CFR2_INITVALUE (TSC200X_CFR2_MAVE_X | \
TSC200X_CFR2_MAVE_Y | \
TSC200X_CFR2_MAVE_Z | \
TSC200X_CFR2_MEDIUM_15 | \
TSC200X_CFR2_AVG_7)
#define MAX_12BIT 0xfff
#define TSC200X_DEF_X_FUZZ 4
#define TSC200X_DEF_Y_FUZZ 8
#define TSC200X_DEF_P_FUZZ 2
#define TSC200X_DEF_RESISTOR 280
#define TSC2005_SPI_MAX_SPEED_HZ 10000000
#define TSC200X_PENUP_TIME_MS 40
extern const struct regmap_config tsc200x_regmap_config;
extern const struct dev_pm_ops tsc200x_pm_ops;
int tsc200x_probe(struct device *dev, int irq, __u16 bustype,
struct regmap *regmap,
int (*tsc200x_cmd)(struct device *dev, u8 cmd));
int tsc200x_remove(struct device *dev);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment