Skip to contentSkip to conversation

Input: Add MELFAS MIP4 Touchscreen driver

PATCH In review Sangwon Jee 2 participants 2 messages Feb 15, 2016 – Feb 23, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Input: Add MELFAS MIP4 Touchscreen driver

This is an input driver for MELFAS MIP4 Touchscreen devices, made by the original vendor, MELFAS.

MIP4 means MELFAS Interface Protocol Version 4.
MELFAS MMS400, MMS500, MCS8000, MIT200, MIT300, MIT400, MFS10 and other recent touchscreen devices are using MIP4 and supported by this driver.

There are two MELFAS touchscreen drivers(mcs5000_ts, mms114) in the kernel. But those drivers are for discontinued models and not supported by MELFAS.

---
 drivers/input/touchscreen/Kconfig       |   11 +
 drivers/input/touchscreen/Makefile      |    1 +
 drivers/input/touchscreen/melfas_mip4.c | 1511 +++++++++++++++++++++++++++++++
 3 files changed, 1523 insertions(+)
 create mode 100644 drivers/input/touchscreen/melfas_mip4.c
drivers/input/touchscreen/Kconfig +11 -0
index f4e53b4..309951d 100644
@@ -491,6 +491,17 @@ config TOUCHSCREEN_MMS114
 	  To compile this driver as a module, choose M here: the
 	  module will be called mms114.
 
+config TOUCHSCREEN_MELFAS_MIP4
+	tristate "MELFAS MIP4 Touchscreen"
+	depends on I2C
+	help
+	  Say Y here if you have a MELFAS MIP4 Touchscreen device.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here:
+	  the module will be called melfas_mip4.
+
 config TOUCHSCREEN_MTOUCH
 	tristate "MicroTouch serial touchscreens"
 	select SERIO
drivers/input/touchscreen/Makefile +1 -0
index 968ff12..4b518c7 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_TOUCHSCREEN_LPC32XX)	+= lpc32xx_ts.o
 obj-$(CONFIG_TOUCHSCREEN_MAX11801)	+= max11801_ts.o
 obj-$(CONFIG_TOUCHSCREEN_MC13783)	+= mc13783_ts.o
 obj-$(CONFIG_TOUCHSCREEN_MCS5000)	+= mcs5000_ts.o
+obj-$(CONFIG_TOUCHSCREEN_MELFAS_MIP4)	+= melfas_mip4.o
 obj-$(CONFIG_TOUCHSCREEN_MIGOR)		+= migor_ts.o
 obj-$(CONFIG_TOUCHSCREEN_MMS114)	+= mms114.o
 obj-$(CONFIG_TOUCHSCREEN_MTOUCH)	+= mtouch.o
drivers/input/touchscreen/melfas_mip4.c new file +1511 -0

1,511 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#1 lore raw

Hi,

Quoted 11 lines · Sangwon Jee

This is an input driver for MELFAS MIP4 Touchscreen devices, made by the original vendor, MELFAS.

MIP4 means MELFAS Interface Protocol Version 4.
MELFAS MMS400, MMS500, MCS8000, MIT200, MIT300, MIT400, MFS10 and other recent touchscreen devices are using MIP4 and supported by this driver.

There are two MELFAS touchscreen drivers(mcs5000_ts, mms114) in the kernel. But those drivers are for discontinued models and not supported by MELFAS.

As you may have noticed I ended up applying the previous version of the driver. Any additional changes should be made against the version in my 'next' branch or linux-next.

Quoted 7 lines
drivers/input/touchscreen/melfas_mip4.c new file +7 -0
+static ssize_t mip4_sysfs_read_hw_version(struct device *dev,
+					  struct device_attribute *attr,
+					  char *buf)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct mip4_ts *ts = i2c_get_clientdata(client);
+	size_t count;

drivers/input/touchscreen/melfas_mip4.c line 1313

Quoted 10 lines
drivers/input/touchscreen/melfas_mip4.c new file +10 -0
+
+	/* Take lock to prevent racing with firmware update */
+	mutex_lock(&ts->input->mutex);
+
+	count = snprintf(buf, PAGE_SIZE, "%s\n", "MIT400");
+
+	mutex_unlock(&ts->input->mutex);
+
+	return count;
+}

It is unclear why we need basically a constant attribute.

Thanks.

Signature · 1 line
Dmitry