Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1248802 > unrolled thread
| Started by | Franklin S Cooper Jr <fcooper@ti.com> |
|---|---|
| First post | 2015-10-16 16:20 +0200 |
| Last post | 2015-10-17 18:40 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/4] Input: edt-ft5506 - Adding support for FT5506 Franklin S Cooper Jr <fcooper@ti.com> - 2015-10-16 16:20 +0200
[PATCH 2/4] Input: edt-ft5x06 - Add support for different max support points Franklin S Cooper Jr <fcooper@ti.com> - 2015-10-16 16:20 +0200
[PATCH 3/4] Input: edt-ft5x06 - Add support for FT5506 Franklin S Cooper Jr <fcooper@ti.com> - 2015-10-16 16:20 +0200
Re: [PATCH 0/4] Input: edt-ft5506 - Adding support for FT5506 Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-10-17 18:40 +0200
| From | Franklin S Cooper Jr <fcooper@ti.com> |
|---|---|
| Date | 2015-10-16 16:20 +0200 |
| Subject | [PATCH 0/4] Input: edt-ft5506 - Adding support for FT5506 |
| Message-ID | <qke1r-jy-7@gated-at.bofh.it> |
This series adds support for the FT5506 tsc. The biggest difference
between this tsc vs the ones currently supported by the driver is the
ability to handle upto 10 touch points.
The FT5506 tsc that I currently have seems to be based on the M09
firmware which I have documentation for. However, I haven't been able
to find documentation for the tsc that use the M06 firmware. Therefore,
the calculation I made to determine the amount of data to read for the M06
is at best an educated guess.
If anyone has the doc for the old firmware please send it to me if
possible or double check the code I use to determine the amount of bytes
to read.
Also I had to work around a weird bug that I'm only seeing on the FT5506.
I tested this patch set on another board (AM437x SK) that uses the FT5306
and didn't see any problems.
This patchset is built on top of linux-input master
Franklin S Cooper Jr (4):
Input: edt-ft5x06 - Use max support points to determine how much to
read
Input: edt-ft5x06 - Add support for different max support points
Input: edt-ft5x06 - Add support for FT5506
Input: edt-ft5x06 - Work around FT5506 firmware bug
.../bindings/input/touchscreen/edt-ft5x06.txt | 2 +
drivers/input/touchscreen/edt-ft5x06.c | 73 ++++++++++++++++++----
2 files changed, 62 insertions(+), 13 deletions(-)
--
2.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Franklin S Cooper Jr <fcooper@ti.com> |
|---|---|
| Date | 2015-10-16 16:20 +0200 |
| Subject | [PATCH 2/4] Input: edt-ft5x06 - Add support for different max support points |
| Message-ID | <qke1s-jy-27@gated-at.bofh.it> |
| In reply to | #1248802 |
Update the code so that the maximum supported points aren't hard coded but
can be changed.
Set the maximum support points based on the data passed along side the
compatible field.
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
Changes since RFC:
None
drivers/input/touchscreen/edt-ft5x06.c | 56 ++++++++++++++++++++++++++++------
1 file changed, 47 insertions(+), 9 deletions(-)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index e5b0b5d..34a353b 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -38,8 +38,7 @@
#include <linux/gpio/consumer.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
-
-#define MAX_SUPPORT_POINTS 5
+#include <linux/of_device.h>
#define WORK_REGISTER_THRESHOLD 0x00
#define WORK_REGISTER_REPORT_RATE 0x08
@@ -105,6 +104,7 @@ struct edt_ft5x06_ts_data {
int gain;
int offset;
int report_rate;
+ int max_support_points;
char name[EDT_NAME_LEN];
@@ -112,6 +112,10 @@ struct edt_ft5x06_ts_data {
enum edt_ver version;
};
+struct edt_i2c_chip_data {
+ int max_support_points;
+};
+
static int edt_ft5x06_ts_readwrite(struct i2c_client *client,
u16 wr_len, u8 *wr_buf,
u16 rd_len, u8 *rd_buf)
@@ -181,7 +185,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
crclen = 1; /* length of the crc data */
/* how many bytes to listen for */
- datalen = tplen * MAX_SUPPORT_POINTS + offset + crclen;
+ datalen = tplen * tsdata->max_support_points + offset + crclen;
break;
case M09:
@@ -189,7 +193,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
offset = 1;
tplen = 6;
crclen = 0;
- datalen = tplen * MAX_SUPPORT_POINTS + offset + crclen;
+ datalen = tplen * tsdata->max_support_points + offset + crclen;
break;
default:
@@ -221,7 +225,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
goto out;
}
- for (i = 0; i < MAX_SUPPORT_POINTS; i++) {
+ for (i = 0; i < tsdata->max_support_points; i++) {
u8 *buf = &rdbuf[i * tplen + offset];
bool down;
@@ -874,6 +878,32 @@ edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata)
}
}
+#ifdef CONFIG_OF
+
+static const struct of_device_id edt_ft5x06_of_match[];
+
+static void edt_ft5x06_ts_set_max_support_points(struct device *dev,
+ struct edt_ft5x06_ts_data *tsdata)
+{
+ struct edt_i2c_chip_data *chip_data;
+ const struct of_device_id *match;
+
+ match = of_match_device(of_match_ptr(edt_ft5x06_of_match), dev);
+
+ if (match) {
+ chip_data = (struct edt_i2c_chip_data *)match->data;
+ tsdata->max_support_points = chip_data->max_support_points;
+ } else {
+ tsdata->max_support_points = 5;
+ }
+}
+#else
+static void edt_ft5x06_ts_set_max_support_points(struct device *dev,
+ struct edt_ft5x06_ts_data *tsdata)
+{
+}
+#endif
+
static int edt_ft5x06_ts_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -891,6 +921,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
return -ENOMEM;
}
+ edt_ft5x06_ts_set_max_support_points(&client->dev, tsdata);
+
tsdata->reset_gpio = devm_gpiod_get_optional(&client->dev,
"reset", GPIOD_OUT_HIGH);
if (IS_ERR(tsdata->reset_gpio)) {
@@ -956,7 +988,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
touchscreen_parse_properties(input, true);
- error = input_mt_init_slots(input, MAX_SUPPORT_POINTS, INPUT_MT_DIRECT);
+ error = input_mt_init_slots(input, tsdata->max_support_points,
+ INPUT_MT_DIRECT);
if (error) {
dev_err(&client->dev, "Unable to init MT slots.\n");
return error;
@@ -1042,10 +1075,15 @@ static const struct i2c_device_id edt_ft5x06_ts_id[] = {
MODULE_DEVICE_TABLE(i2c, edt_ft5x06_ts_id);
#ifdef CONFIG_OF
+
+static const struct edt_i2c_chip_data edt_ft5x06_data = {
+ .max_support_points = 5,
+};
+
static const struct of_device_id edt_ft5x06_of_match[] = {
- { .compatible = "edt,edt-ft5206", },
- { .compatible = "edt,edt-ft5306", },
- { .compatible = "edt,edt-ft5406", },
+ { .compatible = "edt,edt-ft5206", .data = &edt_ft5x06_data},
+ { .compatible = "edt,edt-ft5306", .data = &edt_ft5x06_data},
+ { .compatible = "edt,edt-ft5406", .data = &edt_ft5x06_data},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match);
--
2.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Franklin S Cooper Jr <fcooper@ti.com> |
|---|---|
| Date | 2015-10-16 16:20 +0200 |
| Subject | [PATCH 3/4] Input: edt-ft5x06 - Add support for FT5506 |
| Message-ID | <qke1t-jy-39@gated-at.bofh.it> |
| In reply to | #1248802 |
FT5506 is essentially the same as other FT5x06 devices other than
supporting 10 support points.
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
Changes since RFC:
Increase rdbuf to accomodate extra 2 bytes being read.
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 2 ++
drivers/input/touchscreen/edt-ft5x06.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
index bedd7dd..f99528d 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
@@ -5,6 +5,7 @@ There are 3 variants of the chip for various touch panel sizes
FT5206GE1 2.8" .. 3.8"
FT5306DE4 4.3" .. 7"
FT5406EE8 7" .. 8.9"
+FT5506EEG 7" .. 8.9"
The software interface is identical for all those chips, so that
currently there is no need for the driver to distinguish between the
@@ -17,6 +18,7 @@ Required properties:
- compatible: "edt,edt-ft5206"
or: "edt,edt-ft5306"
or: "edt,edt-ft5406"
+ or: "edt,edt-ft5506"
- reg: I2C slave address of the chip (0x38)
- interrupt-parent: a phandle pointing to the interrupt controller
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 34a353b..e095838 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -172,7 +172,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
struct edt_ft5x06_ts_data *tsdata = dev_id;
struct device *dev = &tsdata->client->dev;
u8 cmd;
- u8 rdbuf[31];
+ u8 rdbuf[61];
int i, type, x, y, id;
int offset, tplen, datalen, crclen;
int error;
@@ -1076,6 +1076,10 @@ MODULE_DEVICE_TABLE(i2c, edt_ft5x06_ts_id);
#ifdef CONFIG_OF
+static const struct edt_i2c_chip_data edt_ft5506_data = {
+ .max_support_points = 10,
+};
+
static const struct edt_i2c_chip_data edt_ft5x06_data = {
.max_support_points = 5,
};
@@ -1084,6 +1088,7 @@ static const struct of_device_id edt_ft5x06_of_match[] = {
{ .compatible = "edt,edt-ft5206", .data = &edt_ft5x06_data},
{ .compatible = "edt,edt-ft5306", .data = &edt_ft5x06_data},
{ .compatible = "edt,edt-ft5406", .data = &edt_ft5x06_data},
+ { .compatible = "edt,edt-ft5506", .data = &edt_ft5506_data},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match);
--
2.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2015-10-17 18:40 +0200 |
| Message-ID | <qkCGu-31E-11@gated-at.bofh.it> |
| In reply to | #1248802 |
On Fri, Oct 16, 2015 at 09:14:25AM -0500, Franklin S Cooper Jr wrote: > This series adds support for the FT5506 tsc. The biggest difference > between this tsc vs the ones currently supported by the driver is the > ability to handle upto 10 touch points. > > The FT5506 tsc that I currently have seems to be based on the M09 > firmware which I have documentation for. However, I haven't been able > to find documentation for the tsc that use the M06 firmware. Therefore, > the calculation I made to determine the amount of data to read for the M06 > is at best an educated guess. > > If anyone has the doc for the old firmware please send it to me if > possible or double check the code I use to determine the amount of bytes > to read. > > Also I had to work around a weird bug that I'm only seeing on the FT5506. > I tested this patch set on another board (AM437x SK) that uses the FT5306 > and didn't see any problems. > > This patchset is built on top of linux-input master > > Franklin S Cooper Jr (4): > Input: edt-ft5x06 - Use max support points to determine how much to > read > Input: edt-ft5x06 - Add support for different max support points > Input: edt-ft5x06 - Add support for FT5506 > Input: edt-ft5x06 - Work around FT5506 firmware bug Applied with minor changes to the #2. Thanks! -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web