Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maxtouch v3.10 #245

Open
wants to merge 154 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
d9ccd62
Input: use dev_get_platdata()
Dec 6, 2013
efbafbd
Input: delete non-required instances of include <linux/init.h>
Jan 6, 2014
f0039e5
Input: atmel_mxt_ts - remove unnecessary platform data
ndyer Jul 7, 2013
89a8864
Input: atmel_mxt_ts - improve T19 GPIO keys handling
ndyer Jul 7, 2013
c1cdf78
Input: atmel_mxt_ts - return IRQ_NONE when interrupt handler fails
ndyer Jul 7, 2013
a20c2ea
Input: atmel_mxt_ts - define helper functions for size and instances
djkurtz Jul 7, 2013
4f12798
Input: atmel_mxt_ts - wait for CHG assert in mxt_check_bootloader
bleungatchromium Jul 7, 2013
0fd587d
Input: atmel_mxt_ts - wait for CHG after bootloader resets
bleungatchromium Jul 7, 2013
fb3af1c
Input: atmel_mxt_ts - make wait-after-reset period compatible with al…
Jul 7, 2013
61cadc5
Input: atmel_mxt_ts - improve error reporting and debug
ndyer Jul 7, 2013
85c876c
Input: atmel_mxt_ts - implement CRC check for configuration data
ndyer Jul 7, 2013
e4c0272
Input: atmel_mxt_ts - download device config using firmware loader
ndyer Jul 7, 2013
5cbaf24
Input: atmel_mxt_ts - calculate and check CRC in config file
ndyer Jul 7, 2013
80256b4
Input: atmel_mxt_ts - add additional bootloader addresses
ndyer Jul 7, 2013
63a72b2
Input: atmel_mxt_ts - read and report bootloader version
ndyer Jul 7, 2013
84c69b5
Input: atmel_mxt_ts - implement bootloader frame retries
ndyer Jul 7, 2013
f22b3f8
Input: atmel_mxt_ts - improve bootloader progress output
ndyer Jul 7, 2013
3e7625b
Input: atmel_mxt_ts - add check for incorrect firmware file format
ndyer Jul 7, 2013
366b053
Input: atmel_mxt_ts - read screen config from chip
ndyer Jul 7, 2013
8080efd
Input: atmel_mxt_ts - use deep sleep mode when stopped
ndyer Jul 7, 2013
4455814
Input: atmel_mxt_ts - rename pressure to amplitude to match spec
ndyer Jul 7, 2013
0551578
Input: atmel_mxt_ts - rename touchscreen defines to include T9
ndyer Jul 7, 2013
1316ad4
Input: atmel_mxt_ts - handle multiple input reports in one message
ndyer Jul 7, 2013
9f96ab7
Input: atmel_mxt_ts - add Atmel copyright line
ndyer Feb 20, 2014
4c69d6e
Input: atmel_mxt_ts - initialise IRQ before probing
ndyer Feb 28, 2013
5076b2a
Input: atmel_mxt_ts - move input device init into separate function
ndyer Dec 4, 2012
9173c04
Input: atmel_mxt_ts - handle APP_CRC_FAIL on startup
ndyer Feb 28, 2013
649c8d3
Input: atmel_mxt_ts - handle bootloader previously unlocked
ndyer Feb 28, 2013
2744363
Input: atmel_mxt_ts - add bootloader addresses for new chips
ndyer Sep 3, 2012
e576bd5
Input: atmel_mxt_ts - recover from bootloader on probe
ndyer Aug 15, 2012
59b544e
Input: atmel_mxt_ts - add support for dynamic message size
ndyer Dec 5, 2012
86f2ca1
Input: atmel_mxt_ts - decode T6 status messages
ndyer Dec 5, 2012
d81c60b
Input: atmel_mxt_ts - split message handler into separate functions
ndyer Feb 24, 2014
c8fb7fa
Input: atmel_mxt_ts - implement T44 message handling
ndyer Dec 5, 2012
519925e
Input: atmel_mxt_ts - output status from T48 Noise Supression
ndyer Aug 1, 2012
75b744c
Input: atmel_mxt_ts - output status from T42 Touch Suppression
ndyer Aug 1, 2012
35df04b
Input: atmel_mxt_ts - implement vector/orientation support
ndyer Jun 2, 2012
e68fba3
Input: atmel_mxt_ts - implement I2C retries
ndyer Aug 8, 2012
495bf88
Input: atmel_mxt_ts - implement T63 Active Stylus support
ndyer Aug 9, 2012
ba10e06
Input: atmel_mxt_ts - implement support for T15 Key Array
ndyer Aug 9, 2012
4e04c36
Input: atmel_mxt_ts - remove unused defines
ndyer Oct 16, 2012
ba6d107
Input: atmel_mxt_ts - verify Information Block checksum on probe
ndyer Dec 7, 2012
3d1d92f
Input: atmel_mxt_ts - use T18 RETRIGEN to handle IRQF_TRIGGER_LOW
ndyer Dec 10, 2012
6316d4d
Input: atmel_mxt_ts - handle reports from T47 Stylus object
ndyer Dec 10, 2012
a243a67
Input: atmel_mxt_ts - release touch state during suspend
ndyer Dec 10, 2012
9bfdc2b
Input: atmel_mxt_ts - initialize power config before and after downlo…
ndyer Dec 13, 2012
69537da
Input: atmel_mxt_ts - add regulator control support
ndyer Jan 16, 2013
28775ab
Input: atmel_mxt_ts - implement support for T100 touch object
ndyer Feb 12, 2013
9cd32cf
Input: atmel_mxt_ts - allow specification of firmware file name
ndyer Mar 5, 2013
5a27267
Input: atmel_mxt_ts - set default irqflags when there is no pdata
yufengshen May 14, 2012
833521d
Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs
ndyer Mar 5, 2013
31ccad3
Input: atmel_mxt_ts - only use first T9 instance
ndyer Apr 11, 2013
8a7db57
Input: atmel_mxt_ts - allow input name to be specified in platform data
ndyer Oct 1, 2013
a615cb3
Input: atmel_mxt_ts - implement debug output for messages
ndyer Aug 23, 2011
2b33db0
Input: atmel_mxt_ts - add memory access interface via sysfs
ndyer Aug 23, 2011
7720ba6
Input: atmel_mxt_ts - implement improved debug message interface
ndyer May 31, 2013
139b6e3
Input: atmel_mxt_ts - fixed vdd being checked instead of avdd
prajoshpremdas Apr 30, 2014
e4a37de
Input: atmel_mxt_ts - fix build error in mxt_read_t9_resolution
ndyer May 20, 2014
f24ab04
Input: atmel_mxt_ts - address code indentation issues
ndyer May 20, 2014
cff90bf
Input: atmel_mxt_ts - implement device tree support
ndyer May 23, 2014
0158865
Input: atmel_mxt_ts - fix invalid return from mxt_get_bootloader_version
ndyer May 23, 2014
1f6a0fc
Input: atmel_mxt_ts - Set pointer emulation on touchpads
ndyer May 23, 2014
70d553b
Input: atmel_mxt_ts - rename mxt_check_reg_init to mxt_update_cfg
ndyer May 23, 2014
8765349
Input: atmel_mxt_ts - change reset GPIO warning to debug message
ndyer May 23, 2014
0dacc74
Input: atmel_mxt_ts - do not reset slots when input device is null
ndyer May 23, 2014
5a4c198
Add documentation for device tree
ndyer Jun 5, 2014
4eedb0f
Input: atmel_mxt_ts - Initialise input slots with INPUT_MT_DIRECT
ndyer Jun 5, 2014
915c135
Input: atmel_mxt_ts - use async firmware loader interface for config
ndyer Jun 5, 2014
aee662e
Input: atmel_mxt_ts - improve error handling in initialise functions
ndyer Jun 18, 2014
347dff2
Input: atmel_mxt_ts - improve device tree parsing for earlier kernels
ndyer Jun 18, 2014
fcfae57
Input: atmel_mxt_ts - add cfg name and input name to device tree
ndyer Jun 18, 2014
d0c1ce6
Input: atmel_mxt_ts - reorder mxt_free_object_table to improve robust…
ndyer Jun 18, 2014
c70631b
Input: atmel_mxt_ts - move functions in file to improve code layout
ndyer Jun 18, 2014
18596d7
Input: atmel_mxt_ts - check gpio validity in mxt_probe_regulators
ndyer Jun 18, 2014
c438f1c
Input: atmel_mxt_ts - wrap long line
ndyer Jun 18, 2014
4e8a1ab
Input: atmel_mxt_ts - support config checksum attribute in sysfs
Jun 18, 2014
04280ca
Input: atmel_mxt_ts - allocate pdata using devm_kzalloc
ndyer Jun 18, 2014
8d5ef3b
Input: atmel_mxt_ts - use of_match_ptr rather than ifdefs
ndyer Jun 18, 2014
55d857b
Input: atmel_mxt_ts - fix bug with endianness conversion in T100 inti…
ndyer Jun 20, 2014
83040d9
Input: atmel_mxt_ts - leave platform to specify irqflags when using DT
ndyer Jul 3, 2014
fb52903
Input: atmel_mxt_ts - fix bug in info CRC error output
ndyer Jul 4, 2014
7e25850
Input: atmel_mxt_ts - fix interrupt documentation for tegra
ndyer Jul 23, 2014
cf896ab
Input: atmel_mxt_ts - check data->input_dev is not null in mxt_input_…
drxaero Jul 20, 2014
49c0c24
Input: atmel_mxt_ts - simplify mxt_initialize a bit
dtor Jul 23, 2014
8715dc2
Input: atmel_mxt_ts - rework platform data handling
ndyer Jul 24, 2014
97396a0
Input: atmel_mxt_ts - add error check to request_firmware_nowait()
ndyer Jul 24, 2014
d59050a
Input: atmel_mxt_ts - split config update a bit
dtor Jul 23, 2014
5d95437
Input: atmel_mxt_ts - minor tweak to capitalisation in comment
ndyer Jul 24, 2014
1a811c3
Input: atmel_mxt_ts - remove unnecessary blank line
ndyer Jul 24, 2014
c94606f
Input: atmel_mxt_ts - call CRC completion after CRC update
ndyer Jul 28, 2014
1b4c1df
Input: atmel-mxt_ts - use kstrtou8 in sysfs interface rather than scanf
ndyer Jul 28, 2014
01b103d
Input: atmel_mxt_ts - fix checkpatch issue
ndyer Jul 28, 2014
e3e0ef5
Input: atmel_mxt_ts - reorder code due to upstream patch churn
ndyer Jul 29, 2014
88858db
Input: atmel_mxt_ts - mXT224 DMA quirk was fixed in firmware v2.0.AA
ndyer Jul 29, 2014
b99f70b
Input: atmel_mxt_ts - fix a few issues reported by Coverity
dtor Aug 11, 2014
513bb8c
Input: atmel_mxt_ts - don't spam dmesg with warning about empty inter…
ndyer Sep 2, 2014
64c2e0f
Input: atmel_mxt_ts - remove unnecessary 'out of memory' message
ndyer Sep 9, 2014
29c8ab9
Input: atmel_mxt_ts - fix checkpatch warning with bare else
ndyer Sep 9, 2014
b96fee1
Input: atmel_mxt_ts - add guards when sysfs interface called with no …
ndyer Sep 9, 2014
4f1ce8c
Input: atmel_mxt_ts - fix double free of input device
swarren Sep 9, 2014
15fd4c4
Adjust MXT_MAX_BLOCK_WRITE
ndyer Oct 24, 2014
3f712e6
Input: atmel_mxt_ts - implement support for T107 active stylus
ndyer Jun 14, 2013
2764354
Input: atmel_mxt_ts - improve handling of hover
ndyer Nov 26, 2014
44df860
Input: atmel_mxt_ts - handle new T100 touch types
ndyer Oct 24, 2014
2c74f03
Input: touchscreen - use __maybe_unused instead of ifdef around suspe…
ndyer Nov 28, 2014
e646ac0
Input: atmel_mxt_ts - improve indentation by reworking if statements
ndyer Dec 5, 2014
9bc82bb
Input: atmel_mxt_ts - change T100 debug output from status to tool type
ndyer Dec 5, 2014
f017f02
Input: atmel_mxt_ts - disable interrupt for 50ms after reset
ndyer Dec 5, 2014
3a0b91a
Input: atmel_mxt_ts - remove extra blank lines
ndyer Dec 9, 2014
0a2f039
Input: atmel_mxt_ts - remove unnecessary forward declarations
ndyer Dec 9, 2014
0e3b2f5
Input: atmel_mxt_ts - fix merge issue in T100 init code
ndyer Dec 9, 2014
041ef5a
Input: atmel_mxt_ts - remove unnecessary debug on ENOMEM
ndyer Dec 9, 2014
8ed3a0d
Input: atmel_mxt_ts - fix bug in debug output for T100
ndyer Dec 9, 2014
7c09e13
Input: atmel_mxt_ts - Update device tree documentation
ndyer Mar 10, 2015
d9a9f12
Input: atmel_mxt_ts - config CRC may start at T71
ndyer Apr 23, 2015
8c3f7d9
Input: atmel_mxt_ts - add suspend modes
ndyer Mar 10, 2015
2a5851d
Input: atmel_mxt_ts - minor formatting fix
ndyer Mar 10, 2015
c7f8291
Input: atmel_mxt_ts - guard debug interface when in bootloader mode
ndyer Dec 16, 2014
3380b3f
Input: atmel_mxt_ts - refactor firmware flash to extract context into…
ndyer Dec 23, 2014
7d38a7f
Input: atmel_mxt_ts - refactor code to enter bootloader into separate…
ndyer Dec 23, 2014
31b266f
Input: atmel_mxt_ts - combine bootloader version query with probe
ndyer Dec 24, 2014
9c18b74
Input: atmel_mxt_ts - improve bootloader state machine handling
ndyer Dec 24, 2014
81dd63b
Input: atmel_mxt_ts - check firmware format before putting device int…
ndyer Jan 6, 2015
b046fa5
Input: atmel_mxt_ts - rename bl_completion to chg_completion
ndyer Mar 19, 2015
17ef3ea
Input: atmel_mxt_ts - make bootloader interrupt driven
ndyer Mar 19, 2015
c497cf8
Input: atmel_mxt_ts - delay enabling IRQ when not using regulators
ndyer Apr 30, 2015
cb9669c
Input: atmel_mxt_ts - use BIT() macro when reporting button state
dtor Apr 15, 2015
b4a510f
Input: atmel_mxt_ts - use BIT() macro everywhere
ndyer Jun 4, 2015
861c673
Input: atmel_mxt_ts - use get_unaligned_le16
ndyer Jun 16, 2015
bae1dc0
Input: atmel_mxt_ts - move #defines as per upstream
ndyer Jun 16, 2015
81a5c7a
Input: atmel_mxt_ts - Improve reporting of stylus buttons
ndyer Jun 16, 2015
9228e3f
Input: atmel_mxt_ts - update hovering finger support
Apr 6, 2015
90c2778
Input: atmel_mxt_ts - factor out T9 and T100 init functions
Apr 6, 2015
75272ca
Input: atmel_mxt_ts - split out touchpad initialisation logic
sjoerdsimons Apr 6, 2015
1d51930
Input: atmel_mxt_ts - add support for Google Pixel 2
dtor Apr 7, 2015
29336b4
Input: atmel_mxt_ts - rename TOUCH_CTRL to T9_CTRL
ndyer Jun 4, 2015
4a6d6cd
Input: atmel_mxt_ts - reorder init completions to reduce upstream pat…
ndyer Jun 4, 2015
938a1d7
Input: atmel_mxt_ts - fix minor checkpatch errors
ndyer Jun 16, 2015
d4f1244
Input: atmel_mxt_ts - tidy up flow in bootloader retries
ndyer Jun 16, 2015
2c426e1
Input: atmel_mxt_ts - improve formatting
ndyer Jun 16, 2015
8c96398
Input: atmel_mxt_ts - remove guards around inclusion of of_gpio.h
ndyer Jun 16, 2015
5ef9579
Input: atmel_mxt_ts - remove warning on zero T44 count
ndyer Jun 16, 2015
3fafaff
Input: atmel_mxt_ts - remove debug about reset GPIO
ndyer Jun 4, 2015
bf9da7d
Input: atmel_mxt_ts - don't report zero pressure from T9
ndyer Jun 17, 2015
f1b1b7d
Input: atmel_mxt_ts - tool type is ignored when slot is closed
ndyer Jun 22, 2015
17b6341
Input: atmel_mxt_ts - refactor to add np variable in mxt_parse_dt
ndyer Aug 6, 2015
ab440de
Input: atmel_mxt_ts - suspend/resume causes panic if input_dev fails …
Aug 4, 2015
292a138
Input: atmel_mxt_ts - check return values in mxt_start and mxt_stop
ndyer Sep 15, 2015
5aa3c7b
Input: atmel_mxt_ts - reduce debug level for toggling MSG output
ndyer Oct 22, 2015
178ba36
Input: atmel_mxt_ts - split large reads into blocks
ndyer Oct 27, 2015
23f9e98
Input: atmel_mxt_ts - Add debug for T92 gesture and T93 touch seq msgs
Jan 21, 2015
d8462ef
Input: atmel_mxt_ts - avoid null regulator handle
ndyer Oct 27, 2015
4215f8f
Input: atmel_mxt_ts - rename config_csum attribute to config_crc
Jul 2, 2014
aaae600
Input: atmel_mxt_ts - initialise sysfs after object table probed
ndyer Oct 29, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Input: atmel_mxt_ts - define helper functions for size and instances
These two object table entry fields are reported 1 less than their value.
When used, however, we always want the actual size and instances.

To keep the object size and instances 1-byte fields, and thus preserve
the object-table struct's 6-byte packed alignment, add some convenient
accessor functions that do the +1 every time these fields are accessed.

Signed-off-by: Daniel Kurtz <[email protected]>
Signed-off-by: Nick Dyer <[email protected]>
Acked-by: Benson Leung <[email protected]>
Acked-by: Yufeng Shen <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
djkurtz authored and ndyer committed Jul 4, 2014
commit a20c2ea371861e08ebf8d77ef09b7a5b4ee7c4e0
37 changes: 25 additions & 12 deletions drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Atmel maXTouch Touchscreen driver
*
* Copyright (C) 2010 Samsung Electronics Co.Ltd
* Copyright (C) 2012 Google, Inc.
*
* Author: Joonyoung Shim <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -226,8 +228,8 @@ struct mxt_info {
struct mxt_object {
u8 type;
u16 start_address;
u8 size; /* Size of each instance - 1 */
u8 instances; /* Number of instances - 1 */
u8 size_minus_one;
u8 instances_minus_one;
u8 num_report_ids;
} __packed;

Expand Down Expand Up @@ -256,6 +258,16 @@ struct mxt_data {
u8 T19_reportid;
};

static size_t mxt_obj_size(const struct mxt_object *obj)
{
return obj->size_minus_one + 1;
}

static size_t mxt_obj_instances(const struct mxt_object *obj)
{
return obj->instances_minus_one + 1;
}

static bool mxt_object_readable(unsigned int type)
{
switch (type) {
Expand Down Expand Up @@ -498,7 +510,7 @@ static int mxt_write_object(struct mxt_data *data,
u16 reg;

object = mxt_get_object(data, type);
if (!object || offset >= object->size + 1)
if (!object || offset >= mxt_obj_size(object))
return -EINVAL;

reg = object->start_address;
Expand Down Expand Up @@ -640,7 +652,7 @@ static int mxt_check_reg_init(struct mxt_data *data)
if (!mxt_object_writable(object->type))
continue;

size = (object->size + 1) * (object->instances + 1);
size = mxt_obj_size(object) * mxt_obj_instances(object);
if (index + size > pdata->config_length) {
dev_err(dev, "Not enough config data!\n");
return -EINVAL;
Expand Down Expand Up @@ -717,17 +729,18 @@ static int mxt_get_object_table(struct mxt_data *data)
if (object->num_report_ids) {
min_id = reportid;
reportid += object->num_report_ids *
(object->instances + 1);
mxt_obj_instances(object);
max_id = reportid - 1;
} else {
min_id = 0;
max_id = 0;
}

dev_dbg(&data->client->dev,
"Type %2d Start %3d Size %3d Instances %2d ReportIDs %3u : %3u\n",
object->type, object->start_address, object->size + 1,
object->instances + 1, min_id, max_id);
"Type %2d Start %3d Size %3zd Instances %2zd ReportIDs %3u : %3u\n",
object->type, object->start_address,
mxt_obj_size(object), mxt_obj_instances(object),
min_id, max_id);

switch (object->type) {
case MXT_GEN_COMMAND_T6:
Expand Down Expand Up @@ -864,11 +877,11 @@ static ssize_t mxt_show_instance(char *buf, int count,
{
int i;

if (object->instances > 0)
if (mxt_obj_instances(object) > 1)
count += scnprintf(buf + count, PAGE_SIZE - count,
"Instance %u\n", instance);

for (i = 0; i < object->size + 1; i++)
for (i = 0; i < mxt_obj_size(object); i++)
count += scnprintf(buf + count, PAGE_SIZE - count,
"\t[%2u]: %02x (%d)\n", i, val[i], val[i]);
count += scnprintf(buf + count, PAGE_SIZE - count, "\n");
Expand Down Expand Up @@ -901,8 +914,8 @@ static ssize_t mxt_object_show(struct device *dev,
count += scnprintf(buf + count, PAGE_SIZE - count,
"T%u:\n", object->type);

for (j = 0; j < object->instances + 1; j++) {
u16 size = object->size + 1;
for (j = 0; j < mxt_obj_instances(object); j++) {
u16 size = mxt_obj_size(object);
u16 addr = object->start_address + j * size;

error = __mxt_read_reg(data->client, addr, size, obuf);
Expand Down