This patch-set forward ports Nick Dyer's work in ndyer/linux github repository
as long as some other features and fixes
Balasubramani Vivekanandan (2):
Input: atmel_mxt_ts: Limit the max bytes transferred in an i2c
transaction
Input: atmel_mxt_ts: use gpiod_set_value_cansleep for reset pin
Dean Jenkins (1):
Input: atmel_mxt_ts: return error from
mxt_process_messages_until_invalid()
Deepak Das (6):
Input: Atmel: improve error handling in mxt_start()
Input: Atmel: improve error handling in mxt_initialize()
Input: Atmel: improve error handling in mxt_update_cfg()
Input: Atmel: Improve error handling in mxt_initialize_input_device()
Input: Atmel: handle ReportID "0x00" while processing T5 messages
Input: Atmel: use T44 object to process T5 messages
George G. Davis (1):
input: atmel_mxt_ts: export GPIO reset line via sysfs
Jiada Wang (3):
Input: introduce input_mt_report_slot_inactive
Input: atmel_mxt_ts - eliminate data->raw_info_block
Input: atmel_mxt_ts - Fix compilation warning
Karl Tsou (1):
Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
Kautuk Consul (2):
Input: atmel_mxt_ts - Change call-points of mxt_free_* functions
Input: atmel_mxt_ts - rely on calculated_crc rather than file
config_crc
Naveen Chakka (2):
input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen
status
input: atmel_mxt_ts: added sysfs interface to update atmel T38 data
Nick Dyer (26):
Input: atmel_mxt_ts - rework sysfs init/remove
Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when
necessary
Input: atmel_mxt_ts - split large i2c transfers into blocks
Input: atmel_mxt_ts - output status from T48 Noise Supression
Input: atmel_mxt_ts - output status from T42 Touch Suppression
Input: atmel_mxt_ts - implement T9 vector/orientation support
Input: atmel_mxt_ts - implement T15 Key Array support
Input: atmel_mxt_ts - handle reports from T47 Stylus object
Input: atmel_mxt_ts - implement support for T107 active stylus
Input: atmel_mxt_ts - release touch state during suspend
Input: atmel_mxt_ts - add regulator control support
Input: atmel_mxt_ts - report failures in suspend/resume
Input: atmel_mxt_ts - allow specification of firmware file name
Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs
Input: atmel_mxt_ts - allow input name to be specified in platform
data
Input: atmel_mxt_ts - refactor firmware flash to extract context into
struct
Input: atmel_mxt_ts - refactor code to enter bootloader into separate
func
Input: atmel_mxt_ts - combine bootloader version query with probe
Input: atmel_mxt_ts - improve bootloader state machine handling
Input: atmel_mxt_ts - rename bl_completion to chg_completion
Input: atmel_mxt_ts - make bootloader interrupt driven
Input: atmel_mxt_ts - delay enabling IRQ when not using regulators
Input: atmel_mxt_ts - implement I2C retries
Input: atmel_mxt_ts - orientation is not present in hover
Input: atmel_mxt_ts - implement debug output for messages
Input: atmel_mxt_ts - implement improved debug message interface
Nikhil Ravindran (1):
Input: atmel_mxt_ts: Add support for run self-test routine.
Sanjeev Chugh (1):
Input: atmel_mxt_ts: Implement synchronization during various
operation
karl tsou (1):
Input: atmel_mxt_ts - add config checksum attribute to sysfs
keerthikumarp (1):
input: atmel_mxt_ts: Add Missing Delay for reset handling of Atmel
touch panel controller in detachable displays.
---
v7:
Fix regression found when updating firmware
Following commits have been updated to fix regression found when
updating firmware
Input: atmel_mxt_ts - improve bootloader state machine handling
Input: atmel_mxt_ts - make bootloader interrupt driven
input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen status
Input: atmel_mxt_ts: Implement synchronization during various operation
v6:
Fix issue in commit ("Input: introduce input_mt_report_slot_inactive")
reported by kernel test robot
v5:
Following commits have been updated to address warnings & errors
reported by kbuild test robot
Input: atmel_mxt_ts - make bootloader interrupt driven
Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
Following commit has been updated
Input: introduce input_mt_report_slot_inactive
v4:
Following commit in v3 patch-set has been removed
Input: switch to use return value of input_mt_report_slot_state
Following commit has been updated to address checkpatch warning
Input: atmel_mxt_ts: Implement synchronization during various operation
v3:
Following commits have been updated compared to v2 patchset
Input: atmel_mxt_ts - implement debug output for messages
- added inline comment
Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msg
- changed dev_info() to dev_dbg()
v2:
Following commit in v1 patchset has been split into two commits
Input: introduce input_mt_report_slot_inactive
Following commits have been updated compared to v1 patchset
Input: atmel_mxt_ts - split large i2c transfers into blocks
Input: atmel_mxt_ts - output status from T42 Touch Suppression
Following commits in v1 patchset have been squashed
Input: touchscreen: Atmel: Add device tree support for T15 key array
objects
Input: atmel_mxt_ts - check data->input_dev is not null in
mxt_input_sync()
Input: atmel_mxt_ts - check firmware format before entering bootloader
Input: atmel_mxt_ts: update stale use_retrigen_workaround flag
input: atmel_mxt_ts: move bootloader probe from mxt_initialize()
input: Atmel: limit the max bytes transferred while reading T5 messages
Input: atmel_mxt_ts: Use msecs_to_jiffies() instead of HZ
Input: atmel_mxt_ts: Use complete when in_bootloader true
Input: atmel_mxt_ts: Prevent crash due to freeing of input device
input: atmel_mxt_ts: Add NULL check for sysfs attribute debug_msg_attr
Following commits in v1 patchset have been dropped:
Input: atmel_mxt_ts - configure and use gpios as real gpios
Input: touchscreen: Atmel: Enable IRQ_DISABLE_UNLAZY flag for interrupt
Input: atmel_mxt_ts - add memory access interface via sysfs
Input: atmel_mxt_ts: Remove sysfs attributes during driver detach
Input: atmel_mxt_ts: Avoid race condition in freeing of input device
v1: initial version
---
.../bindings/input/atmel,maxtouch.txt | 14 +
MAINTAINERS | 1 +
drivers/hid/hid-alps.c | 3 +-
drivers/hid/hid-multitouch.c | 6 +-
drivers/input/misc/xen-kbdfront.c | 2 +-
drivers/input/mouse/elan_i2c_core.c | 2 +-
drivers/input/touchscreen/atmel_mxt_ts.c | 2270 ++++++++++++++---
drivers/input/touchscreen/cyttsp4_core.c | 5 +-
drivers/input/touchscreen/cyttsp_core.c | 2 +-
drivers/input/touchscreen/melfas_mip4.c | 4 +-
drivers/input/touchscreen/mms114.c | 2 +-
drivers/input/touchscreen/raspberrypi-ts.c | 2 +-
drivers/input/touchscreen/stmfts.c | 2 +-
include/dt-bindings/input/atmel_mxt_ts.h | 22 +
include/linux/input/mt.h | 5 +
15 files changed, 1985 insertions(+), 357 deletions(-)
create mode 100644 include/dt-bindings/input/atmel_mxt_ts.h
--
2.17.1
From: Nick Dyer <[email protected]>
Signed-off-by: Nick Dyer <[email protected]>
Acked-by: Benson Leung <[email protected]>
Acked-by: Yufeng Shen <[email protected]>
(cherry picked from ndyer/linux/for-upstream commit ab95b5a309999d2c098daaa9f88d9fcfae7eb516)
Signed-off-by: George G. Davis <[email protected]>
[jiada: Replace dev_info() with dev_dbg()]
Signed-off-by: Jiada Wang <[email protected]>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 25 ++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 59ee743ec8d7..fe58bffda224 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -155,6 +155,9 @@ struct t37_debug {
#define MXT_RESET_VALUE 0x01
#define MXT_BACKUP_VALUE 0x55
+/* Define for MXT_PROCI_TOUCHSUPPRESSION_T42 */
+#define MXT_T42_MSG_TCHSUP BIT(0)
+
/* T100 Multiple Touch Touchscreen */
#define MXT_T100_CTRL 0
#define MXT_T100_CFG1 1
@@ -323,6 +326,8 @@ struct mxt_data {
u8 T9_reportid_max;
u16 T18_address;
u8 T19_reportid;
+ u8 T42_reportid_min;
+ u8 T42_reportid_max;
u16 T44_address;
u8 T48_reportid;
u8 T100_reportid_min;
@@ -979,6 +984,17 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message)
data->update_input = true;
}
+static void mxt_proc_t42_messages(struct mxt_data *data, u8 *msg)
+{
+ struct device *dev = &data->client->dev;
+ u8 status = msg[1];
+
+ if (status & MXT_T42_MSG_TCHSUP)
+ dev_dbg(dev, "T42 suppress\n");
+ else
+ dev_dbg(dev, "T42 normal\n");
+}
+
static int mxt_proc_t48_messages(struct mxt_data *data, u8 *msg)
{
struct device *dev = &data->client->dev;
@@ -1006,6 +1022,9 @@ static int mxt_proc_message(struct mxt_data *data, u8 *message)
if (report_id == data->T6_reportid) {
mxt_proc_t6_messages(data, message);
+ } else if (report_id >= data->T42_reportid_min
+ && report_id <= data->T42_reportid_max) {
+ mxt_proc_t42_messages(data, message);
} else if (report_id == data->T48_reportid) {
mxt_proc_t48_messages(data, message);
} else if (!data->input_dev) {
@@ -1686,6 +1705,8 @@ static void mxt_free_object_table(struct mxt_data *data)
data->T9_reportid_max = 0;
data->T18_address = 0;
data->T19_reportid = 0;
+ data->T42_reportid_min = 0;
+ data->T42_reportid_max = 0;
data->T44_address = 0;
data->T48_reportid = 0;
data->T100_reportid_min = 0;
@@ -1763,6 +1784,10 @@ static int mxt_parse_object_table(struct mxt_data *data,
case MXT_SPT_COMMSCONFIG_T18:
data->T18_address = object->start_address;
break;
+ case MXT_PROCI_TOUCHSUPPRESSION_T42:
+ data->T42_reportid_min = min_id;
+ data->T42_reportid_max = max_id;
+ break;
case MXT_SPT_MESSAGECOUNT_T44:
data->T44_address = object->start_address;
break;
--
2.17.1
From: Nick Dyer <[email protected]>
If fingers are down as the MXT chip goes into suspend it does not send a
lift message. In addition, it may not complete its final measurement cycle
immediately, which means touch messages may be received by the interrupt
handler after mxt_stop() has completed.
So:
- disable irq during suspend
- flush any messages created after suspend
- tell app layer that slots were released at suspend
Signed-off-by: Nick Dyer <[email protected]>
Acked-by: Benson Leung <[email protected]>
Acked-by: Yufeng Shen <[email protected]>
(cherry picked from ndyer/linux/for-upstream commit 26794433086dbc7dea18d2f6a1c8d61ab25bcfda)
[gdavis: Resolve forward port conflicts due to applying upstream
commit 96a938aa214e ("Input: atmel_mxt_ts - remove platform
data support").]
Signed-off-by: George G. Davis <[email protected]>
[gdavis: Squash fix from Dirk Behme:
- Input: atmel_mxt_ts - remove superfluous data->suspended]
Signed-off-by: Dirk Behme <[email protected]>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 52 ++++++++++++++++++++++--
1 file changed, 49 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index b6286b1f4a1a..2bc34c14dbbf 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -372,6 +372,9 @@ struct mxt_data {
unsigned int t19_num_keys;
enum mxt_suspend_mode suspend_mode;
+
+ /* Indicates whether device is in suspend */
+ bool suspended;
};
struct mxt_vb2_buffer {
@@ -1151,10 +1154,10 @@ static int mxt_proc_message(struct mxt_data *data, u8 *message)
mxt_proc_t42_messages(data, message);
} else if (report_id == data->T48_reportid) {
mxt_proc_t48_messages(data, message);
- } else if (!data->input_dev) {
+ } else if (!data->input_dev || data->suspended) {
/*
- * Do not report events if input device
- * is not yet registered.
+ * Do not report events if input device is not
+ * yet registered or returning from suspend
*/
mxt_dump_message(data, message);
} else if (report_id >= data->T9_reportid_min &&
@@ -3135,6 +3138,11 @@ static int mxt_load_fw(struct device *dev, const char *fn)
if (ret)
goto release_firmware;
+ if (data->suspended) {
+ enable_irq(data->irq);
+ data->suspended = false;
+ }
+
if (!data->in_bootloader) {
/* Change to the bootloader mode */
data->in_bootloader = true;
@@ -3306,8 +3314,27 @@ static void mxt_sysfs_remove(struct mxt_data *data)
sysfs_remove_group(&client->dev.kobj, &mxt_attr_group);
}
+static void mxt_reset_slots(struct mxt_data *data)
+{
+ struct input_dev *input_dev = data->input_dev;
+ int id;
+
+ if (!input_dev)
+ return;
+
+ for (id = 0; id < data->num_touchids; id++) {
+ input_mt_slot(input_dev, id);
+ input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, 0);
+ }
+
+ mxt_input_sync(data);
+}
+
static void mxt_start(struct mxt_data *data)
{
+ if (!data->suspended || data->in_bootloader)
+ return;
+
switch (data->suspend_mode) {
case MXT_SUSPEND_T9_CTRL:
mxt_soft_reset(data);
@@ -3320,16 +3347,29 @@ static void mxt_start(struct mxt_data *data)
case MXT_SUSPEND_DEEP_SLEEP:
default:
+ /*
+ * Discard any touch messages still in message buffer
+ * from before chip went to sleep
+ */
+ mxt_process_messages_until_invalid(data);
+
mxt_set_t7_power_cfg(data, MXT_POWER_CFG_RUN);
/* Recalibrate since chip has been in deep sleep */
mxt_t6_command(data, MXT_COMMAND_CALIBRATE, 1, false);
+
+ mxt_acquire_irq(data);
break;
}
+
+ data->suspended = false;
}
static void mxt_stop(struct mxt_data *data)
{
+ if (data->suspended || data->in_bootloader)
+ return;
+
switch (data->suspend_mode) {
case MXT_SUSPEND_T9_CTRL:
/* Touch disable */
@@ -3339,9 +3379,15 @@ static void mxt_stop(struct mxt_data *data)
case MXT_SUSPEND_DEEP_SLEEP:
default:
+ disable_irq(data->irq);
+
mxt_set_t7_power_cfg(data, MXT_POWER_CFG_DEEPSLEEP);
+
+ mxt_reset_slots(data);
break;
}
+
+ data->suspended = true;
}
static int mxt_input_open(struct input_dev *dev)
--
2.17.1
From: Nick Dyer <[email protected]>
The atmel touch messages contain orientation information as a byte in a
packed format which can be passed straight on to Android if the input
device configuration is correct.
This requires vector reports to be enabled in maXTouch config (zero
DISVECT bit 3 in T9 CTRL field)
Android converts the format in InputReader.cpp, search for
ORIENTATION_CALIBRATION_VECTOR.
Signed-off-by: Nick Dyer <[email protected]>
Acked-by: Benson Leung <[email protected]>
Acked-by: Yufeng Shen <[email protected]>
(cherry picked from ndyer/linux/for-upstream commit a6f0ee919d2631678169b23fb18f55b6dbabcd4c)
Signed-off-by: George G. Davis <[email protected]>
Signed-off-by: Jiada Wang <[email protected]>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index fe58bffda224..d36f4df0c425 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -817,6 +817,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
int y;
int area;
int amplitude;
+ u8 vector;
id = message[0] - data->T9_reportid_min;
status = message[1];
@@ -831,9 +832,10 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
area = message[5];
amplitude = message[6];
+ vector = message[7];
dev_dbg(dev,
- "[%u] %c%c%c%c%c%c%c%c x: %5u y: %5u area: %3u amp: %3u\n",
+ "[%u] %c%c%c%c%c%c%c%c x: %5u y: %5u area: %3u amp: %3u vector: %02X\n",
id,
(status & MXT_T9_DETECT) ? 'D' : '.',
(status & MXT_T9_PRESS) ? 'P' : '.',
@@ -843,7 +845,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
(status & MXT_T9_AMP) ? 'A' : '.',
(status & MXT_T9_SUPPRESS) ? 'S' : '.',
(status & MXT_T9_UNGRIP) ? 'U' : '.',
- x, y, area, amplitude);
+ x, y, area, amplitude, vector);
input_mt_slot(input_dev, id);
@@ -868,6 +870,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
input_report_abs(input_dev, ABS_MT_POSITION_Y, y);
input_report_abs(input_dev, ABS_MT_PRESSURE, amplitude);
input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, area);
+ input_report_abs(input_dev, ABS_MT_ORIENTATION, vector);
} else {
/* Touch no longer active, close out slot */
input_mt_report_slot_inactive(input_dev);
@@ -2180,8 +2183,9 @@ static int mxt_initialize_input_device(struct mxt_data *data)
0, 255, 0, 0);
}
- if (data->multitouch == MXT_TOUCH_MULTITOUCHSCREEN_T100 &&
- data->t100_aux_vect) {
+ if (data->multitouch == MXT_TOUCH_MULTI_T9 ||
+ (data->multitouch == MXT_TOUCH_MULTITOUCHSCREEN_T100 &&
+ data->t100_aux_vect)) {
input_set_abs_params(input_dev, ABS_MT_ORIENTATION,
0, 255, 0, 0);
}
--
2.17.1
From: Nick Dyer <[email protected]>
There is a key array object in many maXTouch chips which allows some X/Y
lines to be used as a key array. This patch maps them to a series of keys
which may be configured in a platform data array.
Signed-off-by: Nick Dyer <[email protected]>
Acked-by: Benson Leung <[email protected]>
Acked-by: Yufeng Shen <[email protected]>
(cherry picked from ndyer/linux/for-upstream commit 15bb074b5abf3a101f7b79544213f1c110ea4cab)
[gdavis: Resolve forward port conflicts due to applying upstream
commit 96a938aa214e ("Input: atmel_mxt_ts - remove platform
data support").]
Signed-off-by: George G. Davis <[email protected]>
[jiada: Fix compilation warning]
Signed-off-by: Jiada Wang <[email protected]>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 85 ++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index d36f4df0c425..e0e9e6770bc5 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -314,6 +314,9 @@ struct mxt_data {
struct mxt_dbg dbg;
struct gpio_desc *reset_gpio;
bool use_retrigen_workaround;
+ unsigned long t15_keystatus;
+ int t15_num_keys;
+ const unsigned int *t15_keymap;
/* Cached parameters from object table */
u16 T5_address;
@@ -324,6 +327,8 @@ struct mxt_data {
u16 T71_address;
u8 T9_reportid_min;
u8 T9_reportid_max;
+ u8 T15_reportid_min;
+ u8 T15_reportid_max;
u16 T18_address;
u8 T19_reportid;
u8 T42_reportid_min;
@@ -987,6 +992,38 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message)
data->update_input = true;
}
+static void mxt_proc_t15_messages(struct mxt_data *data, u8 *msg)
+{
+ struct input_dev *input_dev = data->input_dev;
+ struct device *dev = &data->client->dev;
+ int key;
+ bool curr_state, new_state;
+ bool sync = false;
+ unsigned long keystates = le32_to_cpu((__force __le32)msg[2]);
+
+ for (key = 0; key < data->t15_num_keys; key++) {
+ curr_state = test_bit(key, &data->t15_keystatus);
+ new_state = test_bit(key, &keystates);
+
+ if (!curr_state && new_state) {
+ dev_dbg(dev, "T15 key press: %u\n", key);
+ __set_bit(key, &data->t15_keystatus);
+ input_event(input_dev, EV_KEY,
+ data->t15_keymap[key], 1);
+ sync = true;
+ } else if (curr_state && !new_state) {
+ dev_dbg(dev, "T15 key release: %u\n", key);
+ __clear_bit(key, &data->t15_keystatus);
+ input_event(input_dev, EV_KEY,
+ data->t15_keymap[key], 0);
+ sync = true;
+ }
+ }
+
+ if (sync)
+ input_sync(input_dev);
+}
+
static void mxt_proc_t42_messages(struct mxt_data *data, u8 *msg)
{
struct device *dev = &data->client->dev;
@@ -1045,6 +1082,9 @@ static int mxt_proc_message(struct mxt_data *data, u8 *message)
} else if (report_id == data->T19_reportid) {
mxt_input_button(data, message);
data->update_input = true;
+ } else if (report_id >= data->T15_reportid_min
+ && report_id <= data->T15_reportid_max) {
+ mxt_proc_t15_messages(data, message);
} else {
mxt_dump_message(data, message);
}
@@ -1706,6 +1746,8 @@ static void mxt_free_object_table(struct mxt_data *data)
data->T71_address = 0;
data->T9_reportid_min = 0;
data->T9_reportid_max = 0;
+ data->T15_reportid_min = 0;
+ data->T15_reportid_max = 0;
data->T18_address = 0;
data->T19_reportid = 0;
data->T42_reportid_min = 0;
@@ -1784,6 +1826,10 @@ static int mxt_parse_object_table(struct mxt_data *data,
object->num_report_ids - 1;
data->num_touchids = object->num_report_ids;
break;
+ case MXT_TOUCH_KEYARRAY_T15:
+ data->T15_reportid_min = min_id;
+ data->T15_reportid_max = max_id;
+ break;
case MXT_SPT_COMMSCONFIG_T18:
data->T18_address = object->start_address;
break;
@@ -2077,6 +2123,7 @@ static int mxt_initialize_input_device(struct mxt_data *data)
int error;
unsigned int num_mt_slots;
unsigned int mt_flags = 0;
+ int i;
switch (data->multitouch) {
case MXT_TOUCH_MULTI_T9:
@@ -2190,6 +2237,15 @@ static int mxt_initialize_input_device(struct mxt_data *data)
0, 255, 0, 0);
}
+ /* For T15 Key Array */
+ if (data->T15_reportid_min) {
+ data->t15_keystatus = 0;
+
+ for (i = 0; i < data->t15_num_keys; i++)
+ input_set_capability(input_dev, EV_KEY,
+ data->t15_keymap[i]);
+ }
+
input_set_drvdata(input_dev, data);
error = input_register_device(input_dev);
@@ -3148,8 +3204,10 @@ static void mxt_input_close(struct input_dev *dev)
static int mxt_parse_device_properties(struct mxt_data *data)
{
static const char keymap_property[] = "linux,gpio-keymap";
+ static const char buttons_property[] = "atmel,key-buttons";
struct device *dev = &data->client->dev;
u32 *keymap;
+ u32 *buttonmap;
int n_keys;
int error;
@@ -3179,6 +3237,33 @@ static int mxt_parse_device_properties(struct mxt_data *data)
data->t19_num_keys = n_keys;
}
+ if (device_property_present(dev, buttons_property)) {
+ n_keys = device_property_read_u32_array(dev, buttons_property,
+ NULL, 0);
+ if (n_keys <= 0) {
+ error = n_keys < 0 ? n_keys : -EINVAL;
+ dev_err(dev, "invalid/malformed '%s' property: %d\n",
+ buttons_property, error);
+ return error;
+ }
+
+ buttonmap = devm_kmalloc_array(dev, n_keys, sizeof(*buttonmap),
+ GFP_KERNEL);
+ if (!buttonmap)
+ return -ENOMEM;
+
+ error = device_property_read_u32_array(dev, buttons_property,
+ buttonmap, n_keys);
+ if (error) {
+ dev_err(dev, "failed to parse '%s' property: %d\n",
+ buttons_property, error);
+ return error;
+ }
+
+ data->t15_keymap = buttonmap;
+ data->t15_num_keys = n_keys;
+ }
+
return 0;
}
--
2.17.1
Hello Dmitry and all
Kind reminder on this v7 patch-set
Thanks,
Jiada
On 2020/02/12 17:41, Jiada Wang wrote:
> This patch-set forward ports Nick Dyer's work in ndyer/linux github repository
> as long as some other features and fixes
>
> Balasubramani Vivekanandan (2):
> Input: atmel_mxt_ts: Limit the max bytes transferred in an i2c
> transaction
> Input: atmel_mxt_ts: use gpiod_set_value_cansleep for reset pin
>
> Dean Jenkins (1):
> Input: atmel_mxt_ts: return error from
> mxt_process_messages_until_invalid()
>
> Deepak Das (6):
> Input: Atmel: improve error handling in mxt_start()
> Input: Atmel: improve error handling in mxt_initialize()
> Input: Atmel: improve error handling in mxt_update_cfg()
> Input: Atmel: Improve error handling in mxt_initialize_input_device()
> Input: Atmel: handle ReportID "0x00" while processing T5 messages
> Input: Atmel: use T44 object to process T5 messages
>
> George G. Davis (1):
> input: atmel_mxt_ts: export GPIO reset line via sysfs
>
> Jiada Wang (3):
> Input: introduce input_mt_report_slot_inactive
> Input: atmel_mxt_ts - eliminate data->raw_info_block
> Input: atmel_mxt_ts - Fix compilation warning
>
> Karl Tsou (1):
> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>
> Kautuk Consul (2):
> Input: atmel_mxt_ts - Change call-points of mxt_free_* functions
> Input: atmel_mxt_ts - rely on calculated_crc rather than file
> config_crc
>
> Naveen Chakka (2):
> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen
> status
> input: atmel_mxt_ts: added sysfs interface to update atmel T38 data
>
> Nick Dyer (26):
> Input: atmel_mxt_ts - rework sysfs init/remove
> Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when
> necessary
> Input: atmel_mxt_ts - split large i2c transfers into blocks
> Input: atmel_mxt_ts - output status from T48 Noise Supression
> Input: atmel_mxt_ts - output status from T42 Touch Suppression
> Input: atmel_mxt_ts - implement T9 vector/orientation support
> Input: atmel_mxt_ts - implement T15 Key Array support
> Input: atmel_mxt_ts - handle reports from T47 Stylus object
> Input: atmel_mxt_ts - implement support for T107 active stylus
> Input: atmel_mxt_ts - release touch state during suspend
> Input: atmel_mxt_ts - add regulator control support
> Input: atmel_mxt_ts - report failures in suspend/resume
> Input: atmel_mxt_ts - allow specification of firmware file name
> Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs
> Input: atmel_mxt_ts - allow input name to be specified in platform
> data
> Input: atmel_mxt_ts - refactor firmware flash to extract context into
> struct
> Input: atmel_mxt_ts - refactor code to enter bootloader into separate
> func
> Input: atmel_mxt_ts - combine bootloader version query with probe
> Input: atmel_mxt_ts - improve bootloader state machine handling
> Input: atmel_mxt_ts - rename bl_completion to chg_completion
> Input: atmel_mxt_ts - make bootloader interrupt driven
> Input: atmel_mxt_ts - delay enabling IRQ when not using regulators
> Input: atmel_mxt_ts - implement I2C retries
> Input: atmel_mxt_ts - orientation is not present in hover
> Input: atmel_mxt_ts - implement debug output for messages
> Input: atmel_mxt_ts - implement improved debug message interface
>
> Nikhil Ravindran (1):
> Input: atmel_mxt_ts: Add support for run self-test routine.
>
> Sanjeev Chugh (1):
> Input: atmel_mxt_ts: Implement synchronization during various
> operation
>
> karl tsou (1):
> Input: atmel_mxt_ts - add config checksum attribute to sysfs
>
> keerthikumarp (1):
> input: atmel_mxt_ts: Add Missing Delay for reset handling of Atmel
> touch panel controller in detachable displays.
>
> ---
> v7:
> Fix regression found when updating firmware
> Following commits have been updated to fix regression found when
> updating firmware
> Input: atmel_mxt_ts - improve bootloader state machine handling
> Input: atmel_mxt_ts - make bootloader interrupt driven
> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen status
> Input: atmel_mxt_ts: Implement synchronization during various operation
>
> v6:
> Fix issue in commit ("Input: introduce input_mt_report_slot_inactive")
> reported by kernel test robot
>
> v5:
> Following commits have been updated to address warnings & errors
> reported by kbuild test robot
> Input: atmel_mxt_ts - make bootloader interrupt driven
> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>
> Following commit has been updated
> Input: introduce input_mt_report_slot_inactive
>
> v4:
> Following commit in v3 patch-set has been removed
> Input: switch to use return value of input_mt_report_slot_state
>
> Following commit has been updated to address checkpatch warning
> Input: atmel_mxt_ts: Implement synchronization during various operation
>
> v3:
> Following commits have been updated compared to v2 patchset
> Input: atmel_mxt_ts - implement debug output for messages
> - added inline comment
> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msg
> - changed dev_info() to dev_dbg()
>
> v2:
> Following commit in v1 patchset has been split into two commits
> Input: introduce input_mt_report_slot_inactive
>
> Following commits have been updated compared to v1 patchset
> Input: atmel_mxt_ts - split large i2c transfers into blocks
> Input: atmel_mxt_ts - output status from T42 Touch Suppression
>
> Following commits in v1 patchset have been squashed
> Input: touchscreen: Atmel: Add device tree support for T15 key array
> objects
> Input: atmel_mxt_ts - check data->input_dev is not null in
> mxt_input_sync()
> Input: atmel_mxt_ts - check firmware format before entering bootloader
> Input: atmel_mxt_ts: update stale use_retrigen_workaround flag
> input: atmel_mxt_ts: move bootloader probe from mxt_initialize()
> input: Atmel: limit the max bytes transferred while reading T5 messages
> Input: atmel_mxt_ts: Use msecs_to_jiffies() instead of HZ
> Input: atmel_mxt_ts: Use complete when in_bootloader true
> Input: atmel_mxt_ts: Prevent crash due to freeing of input device
> input: atmel_mxt_ts: Add NULL check for sysfs attribute debug_msg_attr
>
> Following commits in v1 patchset have been dropped:
> Input: atmel_mxt_ts - configure and use gpios as real gpios
> Input: touchscreen: Atmel: Enable IRQ_DISABLE_UNLAZY flag for interrupt
> Input: atmel_mxt_ts - add memory access interface via sysfs
> Input: atmel_mxt_ts: Remove sysfs attributes during driver detach
> Input: atmel_mxt_ts: Avoid race condition in freeing of input device
>
>
> v1: initial version
> ---
> .../bindings/input/atmel,maxtouch.txt | 14 +
> MAINTAINERS | 1 +
> drivers/hid/hid-alps.c | 3 +-
> drivers/hid/hid-multitouch.c | 6 +-
> drivers/input/misc/xen-kbdfront.c | 2 +-
> drivers/input/mouse/elan_i2c_core.c | 2 +-
> drivers/input/touchscreen/atmel_mxt_ts.c | 2270 ++++++++++++++---
> drivers/input/touchscreen/cyttsp4_core.c | 5 +-
> drivers/input/touchscreen/cyttsp_core.c | 2 +-
> drivers/input/touchscreen/melfas_mip4.c | 4 +-
> drivers/input/touchscreen/mms114.c | 2 +-
> drivers/input/touchscreen/raspberrypi-ts.c | 2 +-
> drivers/input/touchscreen/stmfts.c | 2 +-
> include/dt-bindings/input/atmel_mxt_ts.h | 22 +
> include/linux/input/mt.h | 5 +
> 15 files changed, 1985 insertions(+), 357 deletions(-)
> create mode 100644 include/dt-bindings/input/atmel_mxt_ts.h
>
12.02.2020 11:41, Jiada Wang пишет:
> This patch-set forward ports Nick Dyer's work in ndyer/linux github repository
> as long as some other features and fixes
>
> Balasubramani Vivekanandan (2):
> Input: atmel_mxt_ts: Limit the max bytes transferred in an i2c
> transaction
> Input: atmel_mxt_ts: use gpiod_set_value_cansleep for reset pin
>
> Dean Jenkins (1):
> Input: atmel_mxt_ts: return error from
> mxt_process_messages_until_invalid()
>
> Deepak Das (6):
> Input: Atmel: improve error handling in mxt_start()
> Input: Atmel: improve error handling in mxt_initialize()
> Input: Atmel: improve error handling in mxt_update_cfg()
> Input: Atmel: Improve error handling in mxt_initialize_input_device()
> Input: Atmel: handle ReportID "0x00" while processing T5 messages
> Input: Atmel: use T44 object to process T5 messages
>
> George G. Davis (1):
> input: atmel_mxt_ts: export GPIO reset line via sysfs
>
> Jiada Wang (3):
> Input: introduce input_mt_report_slot_inactive
> Input: atmel_mxt_ts - eliminate data->raw_info_block
> Input: atmel_mxt_ts - Fix compilation warning
>
> Karl Tsou (1):
> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>
> Kautuk Consul (2):
> Input: atmel_mxt_ts - Change call-points of mxt_free_* functions
> Input: atmel_mxt_ts - rely on calculated_crc rather than file
> config_crc
>
> Naveen Chakka (2):
> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen
> status
> input: atmel_mxt_ts: added sysfs interface to update atmel T38 data
>
> Nick Dyer (26):
> Input: atmel_mxt_ts - rework sysfs init/remove
> Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when
> necessary
> Input: atmel_mxt_ts - split large i2c transfers into blocks
> Input: atmel_mxt_ts - output status from T48 Noise Supression
> Input: atmel_mxt_ts - output status from T42 Touch Suppression
> Input: atmel_mxt_ts - implement T9 vector/orientation support
> Input: atmel_mxt_ts - implement T15 Key Array support
> Input: atmel_mxt_ts - handle reports from T47 Stylus object
> Input: atmel_mxt_ts - implement support for T107 active stylus
> Input: atmel_mxt_ts - release touch state during suspend
> Input: atmel_mxt_ts - add regulator control support
> Input: atmel_mxt_ts - report failures in suspend/resume
> Input: atmel_mxt_ts - allow specification of firmware file name
> Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs
> Input: atmel_mxt_ts - allow input name to be specified in platform
> data
> Input: atmel_mxt_ts - refactor firmware flash to extract context into
> struct
> Input: atmel_mxt_ts - refactor code to enter bootloader into separate
> func
> Input: atmel_mxt_ts - combine bootloader version query with probe
> Input: atmel_mxt_ts - improve bootloader state machine handling
> Input: atmel_mxt_ts - rename bl_completion to chg_completion
> Input: atmel_mxt_ts - make bootloader interrupt driven
> Input: atmel_mxt_ts - delay enabling IRQ when not using regulators
> Input: atmel_mxt_ts - implement I2C retries
> Input: atmel_mxt_ts - orientation is not present in hover
> Input: atmel_mxt_ts - implement debug output for messages
> Input: atmel_mxt_ts - implement improved debug message interface
>
> Nikhil Ravindran (1):
> Input: atmel_mxt_ts: Add support for run self-test routine.
>
> Sanjeev Chugh (1):
> Input: atmel_mxt_ts: Implement synchronization during various
> operation
>
> karl tsou (1):
> Input: atmel_mxt_ts - add config checksum attribute to sysfs
>
> keerthikumarp (1):
> input: atmel_mxt_ts: Add Missing Delay for reset handling of Atmel
> touch panel controller in detachable displays.
>
> ---
> v7:
> Fix regression found when updating firmware
> Following commits have been updated to fix regression found when
> updating firmware
> Input: atmel_mxt_ts - improve bootloader state machine handling
> Input: atmel_mxt_ts - make bootloader interrupt driven
> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen status
> Input: atmel_mxt_ts: Implement synchronization during various operation
>
> v6:
> Fix issue in commit ("Input: introduce input_mt_report_slot_inactive")
> reported by kernel test robot
>
> v5:
> Following commits have been updated to address warnings & errors
> reported by kbuild test robot
> Input: atmel_mxt_ts - make bootloader interrupt driven
> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>
> Following commit has been updated
> Input: introduce input_mt_report_slot_inactive
>
> v4:
> Following commit in v3 patch-set has been removed
> Input: switch to use return value of input_mt_report_slot_state
>
> Following commit has been updated to address checkpatch warning
> Input: atmel_mxt_ts: Implement synchronization during various operation
>
> v3:
> Following commits have been updated compared to v2 patchset
> Input: atmel_mxt_ts - implement debug output for messages
> - added inline comment
> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msg
> - changed dev_info() to dev_dbg()
>
> v2:
> Following commit in v1 patchset has been split into two commits
> Input: introduce input_mt_report_slot_inactive
>
> Following commits have been updated compared to v1 patchset
> Input: atmel_mxt_ts - split large i2c transfers into blocks
> Input: atmel_mxt_ts - output status from T42 Touch Suppression
>
> Following commits in v1 patchset have been squashed
> Input: touchscreen: Atmel: Add device tree support for T15 key array
> objects
> Input: atmel_mxt_ts - check data->input_dev is not null in
> mxt_input_sync()
> Input: atmel_mxt_ts - check firmware format before entering bootloader
> Input: atmel_mxt_ts: update stale use_retrigen_workaround flag
> input: atmel_mxt_ts: move bootloader probe from mxt_initialize()
> input: Atmel: limit the max bytes transferred while reading T5 messages
> Input: atmel_mxt_ts: Use msecs_to_jiffies() instead of HZ
> Input: atmel_mxt_ts: Use complete when in_bootloader true
> Input: atmel_mxt_ts: Prevent crash due to freeing of input device
> input: atmel_mxt_ts: Add NULL check for sysfs attribute debug_msg_attr
>
> Following commits in v1 patchset have been dropped:
> Input: atmel_mxt_ts - configure and use gpios as real gpios
> Input: touchscreen: Atmel: Enable IRQ_DISABLE_UNLAZY flag for interrupt
> Input: atmel_mxt_ts - add memory access interface via sysfs
> Input: atmel_mxt_ts: Remove sysfs attributes during driver detach
> Input: atmel_mxt_ts: Avoid race condition in freeing of input device
>
>
> v1: initial version
> ---
> .../bindings/input/atmel,maxtouch.txt | 14 +
> MAINTAINERS | 1 +
> drivers/hid/hid-alps.c | 3 +-
> drivers/hid/hid-multitouch.c | 6 +-
> drivers/input/misc/xen-kbdfront.c | 2 +-
> drivers/input/mouse/elan_i2c_core.c | 2 +-
> drivers/input/touchscreen/atmel_mxt_ts.c | 2270 ++++++++++++++---
> drivers/input/touchscreen/cyttsp4_core.c | 5 +-
> drivers/input/touchscreen/cyttsp_core.c | 2 +-
> drivers/input/touchscreen/melfas_mip4.c | 4 +-
> drivers/input/touchscreen/mms114.c | 2 +-
> drivers/input/touchscreen/raspberrypi-ts.c | 2 +-
> drivers/input/touchscreen/stmfts.c | 2 +-
> include/dt-bindings/input/atmel_mxt_ts.h | 22 +
> include/linux/input/mt.h | 5 +
> 15 files changed, 1985 insertions(+), 357 deletions(-)
> create mode 100644 include/dt-bindings/input/atmel_mxt_ts.h
>
Hello Jiada,
Please run all the patches through `scripts/checkpatch.pl --strict` and
fix all the reported problems.
Otherwise this is a very good series, it makes MXT1386 to work because
I2C retying is indeed required for that controller.
Hello Dmitry
On 2020/03/13 0:21, Dmitry Osipenko wrote:
> 12.02.2020 11:41, Jiada Wang пишет:
>> This patch-set forward ports Nick Dyer's work in ndyer/linux github repository
>> as long as some other features and fixes
>>
>> Balasubramani Vivekanandan (2):
>> Input: atmel_mxt_ts: Limit the max bytes transferred in an i2c
>> transaction
>> Input: atmel_mxt_ts: use gpiod_set_value_cansleep for reset pin
>>
>> Dean Jenkins (1):
>> Input: atmel_mxt_ts: return error from
>> mxt_process_messages_until_invalid()
>>
>> Deepak Das (6):
>> Input: Atmel: improve error handling in mxt_start()
>> Input: Atmel: improve error handling in mxt_initialize()
>> Input: Atmel: improve error handling in mxt_update_cfg()
>> Input: Atmel: Improve error handling in mxt_initialize_input_device()
>> Input: Atmel: handle ReportID "0x00" while processing T5 messages
>> Input: Atmel: use T44 object to process T5 messages
>>
>> George G. Davis (1):
>> input: atmel_mxt_ts: export GPIO reset line via sysfs
>>
>> Jiada Wang (3):
>> Input: introduce input_mt_report_slot_inactive
>> Input: atmel_mxt_ts - eliminate data->raw_info_block
>> Input: atmel_mxt_ts - Fix compilation warning
>>
>> Karl Tsou (1):
>> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>>
>> Kautuk Consul (2):
>> Input: atmel_mxt_ts - Change call-points of mxt_free_* functions
>> Input: atmel_mxt_ts - rely on calculated_crc rather than file
>> config_crc
>>
>> Naveen Chakka (2):
>> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen
>> status
>> input: atmel_mxt_ts: added sysfs interface to update atmel T38 data
>>
>> Nick Dyer (26):
>> Input: atmel_mxt_ts - rework sysfs init/remove
>> Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when
>> necessary
>> Input: atmel_mxt_ts - split large i2c transfers into blocks
>> Input: atmel_mxt_ts - output status from T48 Noise Supression
>> Input: atmel_mxt_ts - output status from T42 Touch Suppression
>> Input: atmel_mxt_ts - implement T9 vector/orientation support
>> Input: atmel_mxt_ts - implement T15 Key Array support
>> Input: atmel_mxt_ts - handle reports from T47 Stylus object
>> Input: atmel_mxt_ts - implement support for T107 active stylus
>> Input: atmel_mxt_ts - release touch state during suspend
>> Input: atmel_mxt_ts - add regulator control support
>> Input: atmel_mxt_ts - report failures in suspend/resume
>> Input: atmel_mxt_ts - allow specification of firmware file name
>> Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs
>> Input: atmel_mxt_ts - allow input name to be specified in platform
>> data
>> Input: atmel_mxt_ts - refactor firmware flash to extract context into
>> struct
>> Input: atmel_mxt_ts - refactor code to enter bootloader into separate
>> func
>> Input: atmel_mxt_ts - combine bootloader version query with probe
>> Input: atmel_mxt_ts - improve bootloader state machine handling
>> Input: atmel_mxt_ts - rename bl_completion to chg_completion
>> Input: atmel_mxt_ts - make bootloader interrupt driven
>> Input: atmel_mxt_ts - delay enabling IRQ when not using regulators
>> Input: atmel_mxt_ts - implement I2C retries
>> Input: atmel_mxt_ts - orientation is not present in hover
>> Input: atmel_mxt_ts - implement debug output for messages
>> Input: atmel_mxt_ts - implement improved debug message interface
>>
>> Nikhil Ravindran (1):
>> Input: atmel_mxt_ts: Add support for run self-test routine.
>>
>> Sanjeev Chugh (1):
>> Input: atmel_mxt_ts: Implement synchronization during various
>> operation
>>
>> karl tsou (1):
>> Input: atmel_mxt_ts - add config checksum attribute to sysfs
>>
>> keerthikumarp (1):
>> input: atmel_mxt_ts: Add Missing Delay for reset handling of Atmel
>> touch panel controller in detachable displays.
>>
>> ---
>> v7:
>> Fix regression found when updating firmware
>> Following commits have been updated to fix regression found when
>> updating firmware
>> Input: atmel_mxt_ts - improve bootloader state machine handling
>> Input: atmel_mxt_ts - make bootloader interrupt driven
>> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen status
>> Input: atmel_mxt_ts: Implement synchronization during various operation
>>
>> v6:
>> Fix issue in commit ("Input: introduce input_mt_report_slot_inactive")
>> reported by kernel test robot
>>
>> v5:
>> Following commits have been updated to address warnings & errors
>> reported by kbuild test robot
>> Input: atmel_mxt_ts - make bootloader interrupt driven
>> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>>
>> Following commit has been updated
>> Input: introduce input_mt_report_slot_inactive
>>
>> v4:
>> Following commit in v3 patch-set has been removed
>> Input: switch to use return value of input_mt_report_slot_state
>>
>> Following commit has been updated to address checkpatch warning
>> Input: atmel_mxt_ts: Implement synchronization during various operation
>>
>> v3:
>> Following commits have been updated compared to v2 patchset
>> Input: atmel_mxt_ts - implement debug output for messages
>> - added inline comment
>> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msg
>> - changed dev_info() to dev_dbg()
>>
>> v2:
>> Following commit in v1 patchset has been split into two commits
>> Input: introduce input_mt_report_slot_inactive
>>
>> Following commits have been updated compared to v1 patchset
>> Input: atmel_mxt_ts - split large i2c transfers into blocks
>> Input: atmel_mxt_ts - output status from T42 Touch Suppression
>>
>> Following commits in v1 patchset have been squashed
>> Input: touchscreen: Atmel: Add device tree support for T15 key array
>> objects
>> Input: atmel_mxt_ts - check data->input_dev is not null in
>> mxt_input_sync()
>> Input: atmel_mxt_ts - check firmware format before entering bootloader
>> Input: atmel_mxt_ts: update stale use_retrigen_workaround flag
>> input: atmel_mxt_ts: move bootloader probe from mxt_initialize()
>> input: Atmel: limit the max bytes transferred while reading T5 messages
>> Input: atmel_mxt_ts: Use msecs_to_jiffies() instead of HZ
>> Input: atmel_mxt_ts: Use complete when in_bootloader true
>> Input: atmel_mxt_ts: Prevent crash due to freeing of input device
>> input: atmel_mxt_ts: Add NULL check for sysfs attribute debug_msg_attr
>>
>> Following commits in v1 patchset have been dropped:
>> Input: atmel_mxt_ts - configure and use gpios as real gpios
>> Input: touchscreen: Atmel: Enable IRQ_DISABLE_UNLAZY flag for interrupt
>> Input: atmel_mxt_ts - add memory access interface via sysfs
>> Input: atmel_mxt_ts: Remove sysfs attributes during driver detach
>> Input: atmel_mxt_ts: Avoid race condition in freeing of input device
>>
>>
>> v1: initial version
>> ---
>> .../bindings/input/atmel,maxtouch.txt | 14 +
>> MAINTAINERS | 1 +
>> drivers/hid/hid-alps.c | 3 +-
>> drivers/hid/hid-multitouch.c | 6 +-
>> drivers/input/misc/xen-kbdfront.c | 2 +-
>> drivers/input/mouse/elan_i2c_core.c | 2 +-
>> drivers/input/touchscreen/atmel_mxt_ts.c | 2270 ++++++++++++++---
>> drivers/input/touchscreen/cyttsp4_core.c | 5 +-
>> drivers/input/touchscreen/cyttsp_core.c | 2 +-
>> drivers/input/touchscreen/melfas_mip4.c | 4 +-
>> drivers/input/touchscreen/mms114.c | 2 +-
>> drivers/input/touchscreen/raspberrypi-ts.c | 2 +-
>> drivers/input/touchscreen/stmfts.c | 2 +-
>> include/dt-bindings/input/atmel_mxt_ts.h | 22 +
>> include/linux/input/mt.h | 5 +
>> 15 files changed, 1985 insertions(+), 357 deletions(-)
>> create mode 100644 include/dt-bindings/input/atmel_mxt_ts.h
>>
>
> Hello Jiada,
>
> Please run all the patches through `scripts/checkpatch.pl --strict` and
> fix all the reported problems.
>
Thanks, I will try to address checkpatch issues in v8 patch-set
Thanks,
Jiada
> Otherwise this is a very good series, it makes MXT1386 to work because
> I2C retying is indeed required for that controller.
>
Hello Dmitry
I have submitted v8 patch-set to address your comments towards v7 patch-set,
most of checkpatch warnings and errors have been addressed,
But I didn't update for following two types of warnings
since I want to keep consistency with legacy code
WARNING: DEVICE_ATTR unusual permissions '0600' used
#290: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3761:
+static DEVICE_ATTR(debug_v2_enable, 0600, NULL,
WARNING: Consider renaming function(s) 'mxt_debug_notify_show' to
'debug_notify_show'
#292: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3763:
+static DEVICE_ATTR(debug_notify, 0444, mxt_debug_notify_show, NULL);
please let me know if you have different view on this
Thanks,
Jiada
On 2020/03/13 0:21, Dmitry Osipenko wrote:
> 12.02.2020 11:41, Jiada Wang пишет:
>> This patch-set forward ports Nick Dyer's work in ndyer/linux github repository
>> as long as some other features and fixes
>>
>> Balasubramani Vivekanandan (2):
>> Input: atmel_mxt_ts: Limit the max bytes transferred in an i2c
>> transaction
>> Input: atmel_mxt_ts: use gpiod_set_value_cansleep for reset pin
>>
>> Dean Jenkins (1):
>> Input: atmel_mxt_ts: return error from
>> mxt_process_messages_until_invalid()
>>
>> Deepak Das (6):
>> Input: Atmel: improve error handling in mxt_start()
>> Input: Atmel: improve error handling in mxt_initialize()
>> Input: Atmel: improve error handling in mxt_update_cfg()
>> Input: Atmel: Improve error handling in mxt_initialize_input_device()
>> Input: Atmel: handle ReportID "0x00" while processing T5 messages
>> Input: Atmel: use T44 object to process T5 messages
>>
>> George G. Davis (1):
>> input: atmel_mxt_ts: export GPIO reset line via sysfs
>>
>> Jiada Wang (3):
>> Input: introduce input_mt_report_slot_inactive
>> Input: atmel_mxt_ts - eliminate data->raw_info_block
>> Input: atmel_mxt_ts - Fix compilation warning
>>
>> Karl Tsou (1):
>> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>>
>> Kautuk Consul (2):
>> Input: atmel_mxt_ts - Change call-points of mxt_free_* functions
>> Input: atmel_mxt_ts - rely on calculated_crc rather than file
>> config_crc
>>
>> Naveen Chakka (2):
>> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen
>> status
>> input: atmel_mxt_ts: added sysfs interface to update atmel T38 data
>>
>> Nick Dyer (26):
>> Input: atmel_mxt_ts - rework sysfs init/remove
>> Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when
>> necessary
>> Input: atmel_mxt_ts - split large i2c transfers into blocks
>> Input: atmel_mxt_ts - output status from T48 Noise Supression
>> Input: atmel_mxt_ts - output status from T42 Touch Suppression
>> Input: atmel_mxt_ts - implement T9 vector/orientation support
>> Input: atmel_mxt_ts - implement T15 Key Array support
>> Input: atmel_mxt_ts - handle reports from T47 Stylus object
>> Input: atmel_mxt_ts - implement support for T107 active stylus
>> Input: atmel_mxt_ts - release touch state during suspend
>> Input: atmel_mxt_ts - add regulator control support
>> Input: atmel_mxt_ts - report failures in suspend/resume
>> Input: atmel_mxt_ts - allow specification of firmware file name
>> Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs
>> Input: atmel_mxt_ts - allow input name to be specified in platform
>> data
>> Input: atmel_mxt_ts - refactor firmware flash to extract context into
>> struct
>> Input: atmel_mxt_ts - refactor code to enter bootloader into separate
>> func
>> Input: atmel_mxt_ts - combine bootloader version query with probe
>> Input: atmel_mxt_ts - improve bootloader state machine handling
>> Input: atmel_mxt_ts - rename bl_completion to chg_completion
>> Input: atmel_mxt_ts - make bootloader interrupt driven
>> Input: atmel_mxt_ts - delay enabling IRQ when not using regulators
>> Input: atmel_mxt_ts - implement I2C retries
>> Input: atmel_mxt_ts - orientation is not present in hover
>> Input: atmel_mxt_ts - implement debug output for messages
>> Input: atmel_mxt_ts - implement improved debug message interface
>>
>> Nikhil Ravindran (1):
>> Input: atmel_mxt_ts: Add support for run self-test routine.
>>
>> Sanjeev Chugh (1):
>> Input: atmel_mxt_ts: Implement synchronization during various
>> operation
>>
>> karl tsou (1):
>> Input: atmel_mxt_ts - add config checksum attribute to sysfs
>>
>> keerthikumarp (1):
>> input: atmel_mxt_ts: Add Missing Delay for reset handling of Atmel
>> touch panel controller in detachable displays.
>>
>> ---
>> v7:
>> Fix regression found when updating firmware
>> Following commits have been updated to fix regression found when
>> updating firmware
>> Input: atmel_mxt_ts - improve bootloader state machine handling
>> Input: atmel_mxt_ts - make bootloader interrupt driven
>> input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen status
>> Input: atmel_mxt_ts: Implement synchronization during various operation
>>
>> v6:
>> Fix issue in commit ("Input: introduce input_mt_report_slot_inactive")
>> reported by kernel test robot
>>
>> v5:
>> Following commits have been updated to address warnings & errors
>> reported by kbuild test robot
>> Input: atmel_mxt_ts - make bootloader interrupt driven
>> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msgs
>>
>> Following commit has been updated
>> Input: introduce input_mt_report_slot_inactive
>>
>> v4:
>> Following commit in v3 patch-set has been removed
>> Input: switch to use return value of input_mt_report_slot_state
>>
>> Following commit has been updated to address checkpatch warning
>> Input: atmel_mxt_ts: Implement synchronization during various operation
>>
>> v3:
>> Following commits have been updated compared to v2 patchset
>> Input: atmel_mxt_ts - implement debug output for messages
>> - added inline comment
>> Input: atmel_mxt_ts - add debug for T92 gesture and T93 touch seq msg
>> - changed dev_info() to dev_dbg()
>>
>> v2:
>> Following commit in v1 patchset has been split into two commits
>> Input: introduce input_mt_report_slot_inactive
>>
>> Following commits have been updated compared to v1 patchset
>> Input: atmel_mxt_ts - split large i2c transfers into blocks
>> Input: atmel_mxt_ts - output status from T42 Touch Suppression
>>
>> Following commits in v1 patchset have been squashed
>> Input: touchscreen: Atmel: Add device tree support for T15 key array
>> objects
>> Input: atmel_mxt_ts - check data->input_dev is not null in
>> mxt_input_sync()
>> Input: atmel_mxt_ts - check firmware format before entering bootloader
>> Input: atmel_mxt_ts: update stale use_retrigen_workaround flag
>> input: atmel_mxt_ts: move bootloader probe from mxt_initialize()
>> input: Atmel: limit the max bytes transferred while reading T5 messages
>> Input: atmel_mxt_ts: Use msecs_to_jiffies() instead of HZ
>> Input: atmel_mxt_ts: Use complete when in_bootloader true
>> Input: atmel_mxt_ts: Prevent crash due to freeing of input device
>> input: atmel_mxt_ts: Add NULL check for sysfs attribute debug_msg_attr
>>
>> Following commits in v1 patchset have been dropped:
>> Input: atmel_mxt_ts - configure and use gpios as real gpios
>> Input: touchscreen: Atmel: Enable IRQ_DISABLE_UNLAZY flag for interrupt
>> Input: atmel_mxt_ts - add memory access interface via sysfs
>> Input: atmel_mxt_ts: Remove sysfs attributes during driver detach
>> Input: atmel_mxt_ts: Avoid race condition in freeing of input device
>>
>>
>> v1: initial version
>> ---
>> .../bindings/input/atmel,maxtouch.txt | 14 +
>> MAINTAINERS | 1 +
>> drivers/hid/hid-alps.c | 3 +-
>> drivers/hid/hid-multitouch.c | 6 +-
>> drivers/input/misc/xen-kbdfront.c | 2 +-
>> drivers/input/mouse/elan_i2c_core.c | 2 +-
>> drivers/input/touchscreen/atmel_mxt_ts.c | 2270 ++++++++++++++---
>> drivers/input/touchscreen/cyttsp4_core.c | 5 +-
>> drivers/input/touchscreen/cyttsp_core.c | 2 +-
>> drivers/input/touchscreen/melfas_mip4.c | 4 +-
>> drivers/input/touchscreen/mms114.c | 2 +-
>> drivers/input/touchscreen/raspberrypi-ts.c | 2 +-
>> drivers/input/touchscreen/stmfts.c | 2 +-
>> include/dt-bindings/input/atmel_mxt_ts.h | 22 +
>> include/linux/input/mt.h | 5 +
>> 15 files changed, 1985 insertions(+), 357 deletions(-)
>> create mode 100644 include/dt-bindings/input/atmel_mxt_ts.h
>>
>
> Hello Jiada,
>
> Please run all the patches through `scripts/checkpatch.pl --strict` and
> fix all the reported problems.
>
> Otherwise this is a very good series, it makes MXT1386 to work because
> I2C retying is indeed required for that controller.
>
Hello Jiada,
20.03.2020 06:37, Wang, Jiada пишет:
> Hello Dmitry
>
> I have submitted v8 patch-set to address your comments towards v7
> patch-set,
> most of checkpatch warnings and errors have been addressed,
>
> But I didn't update for following two types of warnings
> since I want to keep consistency with legacy code
>
> WARNING: DEVICE_ATTR unusual permissions '0600' used
> #290: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3761:
> +static DEVICE_ATTR(debug_v2_enable, 0600, NULL,
What will happen if you'll use 0644? Will an empty line be returned or
driver will crash?
> WARNING: Consider renaming function(s) 'mxt_debug_notify_show' to
> 'debug_notify_show'
> #292: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3763:
> +static DEVICE_ATTR(debug_notify, 0444, mxt_debug_notify_show, NULL);
Perhaps this should be fine to ignore, although the prefix is indeed a
bit superfluous.
> please let me know if you have different view on this
Thank you very much, I'll test v8 during the weekend.
Hello Dmitry
On 2020/03/21 0:53, Dmitry Osipenko wrote:
> Hello Jiada,
>
> 20.03.2020 06:37, Wang, Jiada пишет:
>> Hello Dmitry
>>
>> I have submitted v8 patch-set to address your comments towards v7
>> patch-set,
>> most of checkpatch warnings and errors have been addressed,
>>
>> But I didn't update for following two types of warnings
>> since I want to keep consistency with legacy code
>>
>> WARNING: DEVICE_ATTR unusual permissions '0600' used
>> #290: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3761:
>> +static DEVICE_ATTR(debug_v2_enable, 0600, NULL,
>
> What will happen if you'll use 0644? Will an empty line be returned or
> driver will crash?
>
debug_v2_enable doesn't have .show callback implemented, so after change
permission to 644, read of it results in an I/O error,
for other 0600 permission interfaces (t38_data, t25 and debug_enable)
added in this series,
change to 644 can return expected information when read.
Do you think it's better to change debug_v2_enable to 0200,
and others to 0644?
Thanks,
Jiada
>> WARNING: Consider renaming function(s) 'mxt_debug_notify_show' to
>> 'debug_notify_show'
>> #292: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3763:
>> +static DEVICE_ATTR(debug_notify, 0444, mxt_debug_notify_show, NULL);
>
> Perhaps this should be fine to ignore, although the prefix is indeed a
> bit superfluous.
>
>> please let me know if you have different view on this
>
> Thank you very much, I'll test v8 during the weekend.
>
23.03.2020 05:25, Wang, Jiada пишет:
> Hello Dmitry
>
> On 2020/03/21 0:53, Dmitry Osipenko wrote:
>> Hello Jiada,
>>
>> 20.03.2020 06:37, Wang, Jiada пишет:
>>> Hello Dmitry
>>>
>>> I have submitted v8 patch-set to address your comments towards v7
>>> patch-set,
>>> most of checkpatch warnings and errors have been addressed,
>>>
>>> But I didn't update for following two types of warnings
>>> since I want to keep consistency with legacy code
>>>
>>> WARNING: DEVICE_ATTR unusual permissions '0600' used
>>> #290: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3761:
>>> +static DEVICE_ATTR(debug_v2_enable, 0600, NULL,
>>
>> What will happen if you'll use 0644? Will an empty line be returned or
>> driver will crash?
>>
> debug_v2_enable doesn't have .show callback implemented, so after change
> permission to 644, read of it results in an I/O error,
>
> for other 0600 permission interfaces (t38_data, t25 and debug_enable)
> added in this series,
> change to 644 can return expected information when read.
>
> Do you think it's better to change debug_v2_enable to 0200,
> and others to 0644?
Since the debug_enable has mxt_debug_enable_show(), the same should be
done for debug_v2_enable, for consistency.
The permissions should be 0644 for everything that is read/write.
The 0200 should be used for everything that is root-only and write-only.
24.03.2020 17:54, Dmitry Osipenko пишет:
> 23.03.2020 05:25, Wang, Jiada пишет:
>> Hello Dmitry
>>
>> On 2020/03/21 0:53, Dmitry Osipenko wrote:
>>> Hello Jiada,
>>>
>>> 20.03.2020 06:37, Wang, Jiada пишет:
>>>> Hello Dmitry
>>>>
>>>> I have submitted v8 patch-set to address your comments towards v7
>>>> patch-set,
>>>> most of checkpatch warnings and errors have been addressed,
>>>>
>>>> But I didn't update for following two types of warnings
>>>> since I want to keep consistency with legacy code
>>>>
>>>> WARNING: DEVICE_ATTR unusual permissions '0600' used
>>>> #290: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3761:
>>>> +static DEVICE_ATTR(debug_v2_enable, 0600, NULL,
>>>
>>> What will happen if you'll use 0644? Will an empty line be returned or
>>> driver will crash?
>>>
>> debug_v2_enable doesn't have .show callback implemented, so after change
>> permission to 644, read of it results in an I/O error,
>>
>> for other 0600 permission interfaces (t38_data, t25 and debug_enable)
>> added in this series,
>> change to 644 can return expected information when read.
>>
>> Do you think it's better to change debug_v2_enable to 0200,
>> and others to 0644?
>
> Since the debug_enable has mxt_debug_enable_show(), the same should be
> done for debug_v2_enable, for consistency.
>
> The permissions should be 0644 for everything that is read/write.
>
> The 0200 should be used for everything that is root-only and write-only.
>
Also, please take a look at [1], see DEVICE_ATTR_WO() and
DEVICE_BOOL_ATTR() macros, which should be handy.
[1]
https://elixir.bootlin.com/linux/v5.6-rc7/source/include/linux/device.h#L125
Hi Dmitry
On 2020/03/24 23:54, Dmitry Osipenko wrote:
> 23.03.2020 05:25, Wang, Jiada пишет:
>> Hello Dmitry
>>
>> On 2020/03/21 0:53, Dmitry Osipenko wrote:
>>> Hello Jiada,
>>>
>>> 20.03.2020 06:37, Wang, Jiada пишет:
>>>> Hello Dmitry
>>>>
>>>> I have submitted v8 patch-set to address your comments towards v7
>>>> patch-set,
>>>> most of checkpatch warnings and errors have been addressed,
>>>>
>>>> But I didn't update for following two types of warnings
>>>> since I want to keep consistency with legacy code
>>>>
>>>> WARNING: DEVICE_ATTR unusual permissions '0600' used
>>>> #290: FILE: drivers/input/touchscreen/atmel_mxt_ts.c:3761:
>>>> +static DEVICE_ATTR(debug_v2_enable, 0600, NULL,
>>>
>>> What will happen if you'll use 0644? Will an empty line be returned or
>>> driver will crash?
>>>
>> debug_v2_enable doesn't have .show callback implemented, so after change
>> permission to 644, read of it results in an I/O error,
>>
>> for other 0600 permission interfaces (t38_data, t25 and debug_enable)
>> added in this series,
>> change to 644 can return expected information when read.
>>
>> Do you think it's better to change debug_v2_enable to 0200,
>> and others to 0644?
>
> Since the debug_enable has mxt_debug_enable_show(), the same should be
> done for debug_v2_enable, for consistency.
>
> The permissions should be 0644 for everything that is read/write.
>
> The 0200 should be used for everything that is root-only and write-only.
Thanks for your comments and suggestion in another email,
I will submit v9 patch-set to address these warnings
Thanks,
Jiada
>