Input: add touchscreen driver for MELFAS MCS-5000 controller
Subsystems (2)
PATCH v4 1/1 Input: add touchscreen driver for MELFAS MCS-5000 controller
The MELPAS MCS-5000 is the touchscreen controller. The overview of this controller can see at the following website:
http://www.melfas.com/product/product01.asp?k_r=eng_
This driver is tested on s3c6410 NCP board and supports only the i2c interface.
---
Hi, Dmitry.
This patch v4 adds threaded IRQ support from the patch you send before.
The Kconfig and Makefile of driver/input/touchscreen/ are not ordered, so i add the contents at the last.
Change log:
v2: updated as per feedback for v1
v3: add platform_data checking before call set_pin() on probe function
change #ifdef CONFIG_PM position
v4: support threaded irq from the patch of Dmitry.
drivers/input/touchscreen/Kconfig | 12 ++ drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/mcs5000_ts.c | 327 ++++++++++++++++++++++++++++++++ include/linux/i2c/mcs5000_ts.h | 11 + 4 files changed, 351 insertions(+), 0 deletions(-) create mode 100644 drivers/input/touchscreen/mcs5000_ts.c create mode 100644 include/linux/i2c/mcs5000_ts.h
drivers/input/touchscreen/Kconfig +12 -0
@@ -510,4 +510,16 @@ config TOUCHSCREEN_W90X900 To compile this driver as a module, choose M here: the module will be called w90p910_ts. +config TOUCHSCREEN_MCS5000 + tristate "MELFAS MCS-5000 touchscreen" + depends on I2C + help + Say Y here if you have the MELFAS MCS-5000 touchscreen controller + chip in your system. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called mcs5000_ts. + endif
drivers/input/touchscreen/Makefile +1 -0
@@ -40,3 +40,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL) += atmel-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o +obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o
drivers/input/touchscreen/mcs5000_ts.c new file +327 -0
327 lines not on this page · raw message
include/linux/i2c/mcs5000_ts.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef __LINUX_MCS5000_TS_H +#define __LINUX_MCS5000_TS_H + +/* platform data for the MELFAS MCS-5000 touchscreen driver */ +struct mcs5000_ts_platform_data { +void (*cfg_pin)(void ); +int x_size; +int y_size; +}; + +#endif /* __LINUX_MCS5000_TS_H */
Signature · 1 line
1.6.0.4
Dmitry Torokhov
maintainerHi Joonyoung,
drivers/input/touchscreen/mcs5000_ts.c line 120
Quoted 12 lines · Joonyoung Shim
drivers/input/touchscreen/mcs5000_ts.c new file +12
-0+ +static irqreturn_t mcs5000_ts_interrupt (int irq,void *dev_id) +{ +struct mcs5000_ts_data *data = dev_id; +struct i2c_client *client = data->client; +u8 buffer[READ_BLOCK_SIZE ]; +int err; +int x; +int y; + +disable_irq_nosync (irq); +
I don't think we need to disable IRQ in the threaded handler - it should be masked off until we return...
drivers/input/touchscreen/mcs5000_ts.c line 170
Quoted 5 lines
drivers/input/touchscreen/mcs5000_ts.c new file +5
-0+ +static irqreturn_t mcs5000_ts_hardirq (int irq,void *dev_id) +{ +return IRQ_WAKE_THREAD ; +}
This is not needed, just pass NULL to request_threaded_irq().
Thanks.
Signature · 1 line
Dmitry
Quoted 19 lines · Dmitry Torokhov
Hi Joonyoung,
drivers/input/touchscreen/mcs5000_ts.c line 120
Quoted 12 lines · Joonyoung Shim
drivers/input/touchscreen/mcs5000_ts.c new file +12
-0+ +static irqreturn_t mcs5000_ts_interrupt (int irq,void *dev_id) +{ +struct mcs5000_ts_data *data = dev_id; +struct i2c_client *client = data->client; +u8 buffer[READ_BLOCK_SIZE ]; +int err; +int x; +int y; + +disable_irq_nosync (irq); +I don't think we need to disable IRQ in the threaded handler - it should be masked off until we return...
Yor're right. It is unnecessary.
Quoted 8 lines
drivers/input/touchscreen/mcs5000_ts.c line 170
Quoted 5 lines
drivers/input/touchscreen/mcs5000_ts.c new file +5
-0+ +static irqreturn_t mcs5000_ts_hardirq (int irq,void *dev_id) +{ +return IRQ_WAKE_THREAD ; +}This is not needed, just pass NULL to
request_threaded_irq().
OK, this is unnecessary too.
I will resend the patch after fix.
Thanks.
Quoted 30 lines · Joonyoung Shim
Quoted 18 lines · Dmitry Torokhov
Hi Joonyoung,
Review
Quoted 12 lines · Joonyoung Shim
(quoted diff) +12
-0+ +static irqreturn_t mcs5000_ts_interrupt(int irq, void *dev_id) +{ + struct mcs5000_ts_data *data = dev_id; + struct i2c_client *client = data->client; + u8 buffer[READ_BLOCK_SIZE]; + int err; + int x; + int y; + + disable_irq_nosync(irq); +I don't think we need to disable IRQ in the threaded handler - it should be masked off until we return...
Yor're right. It is unnecessary.
Quoted 7 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ +static irqreturn_t mcs5000_ts_hardirq(int irq, void *dev_id) +{ + return IRQ_WAKE_THREAD; +}This is not needed, just pass NULL to
request_threaded_irq().
Quoted 4 lines
OK, this is unnecessary too.
I will resend the patch after fix.
Thanks.
Hi, Dmitry.
I send the patch v5. This is the patch fixed from v4 feedback, and i added a copyright in header file.
Quoted 1 line
From
a6e3cc9a7c94a156ad76e00f82e490e175b8f45bMon Sep 17 00:00:00 2001
From: Joonyoung Shim <[email protected]>
Date: Wed, 16 Sep 2009 15:34:46 +0900
Subject: [PATCH v5] Input: add touchscreen driver for MELFAS MCS-5000 controller
The MELPAS MCS-5000 is the touchscreen controller. The overview of this controller can see at the following website:
http://www.melfas.com/product/product01.asp?k_r=eng_
This driver is tested on s3c6410 NCP board and supports only the i2c interface.
--- drivers/input/touchscreen/Kconfig | 12 ++ drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/mcs5000_ts.c | 318 ++++++++++++++++++++++++++++++++ include/linux/i2c/mcs5000_ts.h | 24 +++ 4 files changed, 355 insertions(+), 0 deletions(-) create mode 100644 drivers/input/touchscreen/mcs5000_ts.c create mode 100644 include/linux/i2c/mcs5000_ts.h
drivers/input/touchscreen/Kconfig +12 -0
@@ -510,4 +510,16 @@ config TOUCHSCREEN_W90X900 To compile this driver as a module, choose M here: the module will be called w90p910_ts. +config TOUCHSCREEN_MCS5000 + tristate "MELFAS MCS-5000 touchscreen" + depends on I2C + help + Say Y here if you have the MELFAS MCS-5000 touchscreen controller + chip in your system. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called mcs5000_ts. + endif
drivers/input/touchscreen/Makefile +1 -0
@@ -40,3 +40,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL) += atmel-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o +obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o
drivers/input/touchscreen/mcs5000_ts.c new file +318 -0
318 lines not on this page · raw message
include/linux/i2c/mcs5000_ts.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* mcs5000_ts.h +* +* Copyright (C) 2009 Samsung Electronics Co.Ltd +* Author: Joonyoung Shim <[email protected]> +* +* 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. +* +*/ + +#ifndef __LINUX_MCS5000_TS_H +#define __LINUX_MCS5000_TS_H + +/* platform data for the MELFAS MCS-5000 touchscreen driver */ +struct mcs5000_ts_platform_data { +void (*cfg_pin)(void ); +int x_size; +int y_size; +}; + +#endif /* __LINUX_MCS5000_TS_H */
Signature · 1 line
1.6.0.4
Dmitry Torokhov
maintainerQuoted 6 lines · Joonyoung Shim
Hi, Dmitry.
I send the patch v5. This is the patch fixed from v4 feedback, and i added a copyright in header file.
Looks good, thanks. It will be included in my next pull request.
Signature · 1 line
Dmitry
Quoted 9 lines · Dmitry Torokhov
Quoted 5 lines · Joonyoung Shim
Hi, Dmitry.
I send the patch v5. This is the patch fixed from v4 feedback, and i added a copyright in header file.
Looks good, thanks. It will be included in my next pull request.
Thanks.
However, i saw a commit for MCS-5000 on for-linux branch of your git repository, and the driver was a old thing, maybe patch v3. Please apply the patch v5 posted yesterday.
Dmitry Torokhov
maintainerQuoted 8 lines · Joonyoung Shim
Quoted 7 lines · Dmitry Torokhov
Quoted 5 lines · Joonyoung Shim
Hi, Dmitry.
I send the patch v5. This is the patch fixed from v4 feedback, and i added a copyright in header file.
Quoted 8 lines
Quoted 2 lines
Looks good, thanks. It will be included in my next pull request.
Thanks.
However, i saw a commit for MCS-5000 on for-linux branch of your git repository, and the driver was a old thing, maybe patch v3. Please apply the patch v5 posted yesterday.
Hm, not sure what happened, will fix in a moment...
Signature · 1 line
Dmitry