summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoshni Shah <roshni.shah@timesys.com>2014-01-05 10:23:02 -0500
committerRoshni Shah <roshni.shah@timesys.com>2014-01-05 13:12:54 -0500
commit81d90159c6aa14b6c713a1280d19a7ba6f8b9e0c (patch)
tree312d54d3ac7044d725f50517c4f08ae51a85c2cf
parentf2a0b753bc57f2d40119762879071cbdd0a215fe (diff)
Quartz: Added Resistive Touch Screen support
-rw-r--r--arch/arm/mach-mvf/board-quartz.c6
-rw-r--r--drivers/input/touchscreen/crtouch_ts.c6
-rw-r--r--include/linux/fsl_devices.h4
3 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/mach-mvf/board-quartz.c b/arch/arm/mach-mvf/board-quartz.c
index bd98345645c3..7a916f6d5992 100644
--- a/arch/arm/mach-mvf/board-quartz.c
+++ b/arch/arm/mach-mvf/board-quartz.c
@@ -88,6 +88,7 @@
#define MVF600_SD1_WP 98
#define MVF600_LVDS_TS 119
#define MVF600_RTC_INT 127
+#define MVF600_CRTOUCH_INT 68
/* GPIO definitions */
#define GPIO_LED_1 65
#define GPIO_LED_2 64
@@ -303,6 +304,10 @@ static const struct esdhc_platform_data mvfa5_sd1_data __initconst = {
.wp_gpio = MVF600_SD1_WP,
};
+static struct crtouch_platform_data crtouch_pdata = {
+ .irq_gpio = MVF600_CRTOUCH_INT,
+};
+
static struct imxi2c_platform_data mvf600_i2c_data = {
.bitrate = 100000,
};
@@ -310,6 +315,7 @@ static struct imxi2c_platform_data mvf600_i2c_data = {
static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
{
I2C_BOARD_INFO("crtouch_ts", 0x49),
+ .platform_data = &crtouch_pdata,
},
{
I2C_BOARD_INFO("sgtl5000", 0x0a),
diff --git a/drivers/input/touchscreen/crtouch_ts.c b/drivers/input/touchscreen/crtouch_ts.c
index e5e23b8d5d78..9d6357be278b 100644
--- a/drivers/input/touchscreen/crtouch_ts.c
+++ b/drivers/input/touchscreen/crtouch_ts.c
@@ -19,6 +19,7 @@
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/gpio.h>
+#include <linux/fsl_devices.h>
/* Resistive touch sense status registers */
#define RES_STA_ERROR 0x00
@@ -171,6 +172,7 @@ static int __devinit crtouch_ts_probe(struct i2c_client *client,
struct crtouch_ts_data *data;
struct input_dev *input_dev;
int error;
+ struct crtouch_platform_data *crtouch_pdata = client->dev.platform_data;
data = kzalloc(sizeof(struct crtouch_ts_data), GFP_KERNEL);
input_dev = input_allocate_device();
@@ -204,13 +206,13 @@ static int __devinit crtouch_ts_probe(struct i2c_client *client,
crtouch_ts_reg_init(data);
- error = gpio_request_one(21, GPIOF_IN, "TS_IRQ");
+ error = gpio_request_one(crtouch_pdata->irq_gpio, GPIOF_IN, "TS_IRQ");
if (error) {
dev_err(&client->dev, "Failed to request gpio\n");
goto err_free_mem;
}
- error = request_threaded_irq(gpio_to_irq(21), NULL,
+ error = request_threaded_irq(gpio_to_irq(crtouch_pdata->irq_gpio), NULL,
crtouch_ts_interrupt, IRQF_TRIGGER_FALLING, "crtouch_ts", data);
if (error) {
dev_err(&client->dev, "Failed to register interrupt\n");
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index dd8e4cd3c15b..9143ec1976bf 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -188,6 +188,10 @@ struct mxc_mlb_platform_data {
struct cdev cdev;
};
+struct crtouch_platform_data {
+ u32 irq_gpio;
+};
+
struct spi_device;
struct fsl_spi_platform_data {