diff options
author | Nick Dyer <nick.dyer@itdev.co.uk> | 2012-06-01 17:55:28 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:37:48 -0700 |
commit | 1f4344e15156bfabe685ecbca66a65fbd0e8c586 (patch) | |
tree | c45955834b0b8ca002cd090f2caa9911a4dc4087 /drivers/input/touchscreen/atmel_mxt_ts.c | |
parent | a2f38ff1e14a28f139ad8201ee973a013ce7eb37 (diff) |
Input: atmel_mxt_ts - Implement vector/orientation support
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, see
http://source.android.com/tech/input/touch-devices.html#touchorientationcalibration
This requires vector reports to be enabled in maXTouch config (zero DISVECT
bit in T9 CTRL field)
Android converts the format in frameworks/base/services/input/Input.cpp,
search for ORIENTATION_CALIBRATION_VECTOR.
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Rebase-Id: Rfe3baba34d896f6af27a4201fe7be9a1b172570d
Diffstat (limited to 'drivers/input/touchscreen/atmel_mxt_ts.c')
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 4ccef6c030c1..40bd0988a674 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -672,6 +672,7 @@ static void mxt_proc_t9_messages(struct mxt_data *data, u8 *message) int y; int area; int amplitude; + u8 vector; int id; if (!input_dev || data->driver_paused) @@ -695,9 +696,10 @@ static void mxt_proc_t9_messages(struct mxt_data *data, u8 *message) y >>= 2; area = message[5]; amplitude = message[6]; + vector = message[7]; dev_dbg(dev, - "[%d] %c%c%c%c%c%c%c%c x: %d y: %d area: %d amp: %d\n", + "[%d] %c%c%c%c%c%c%c%c x: %d y: %d area: %d amp: %d vector: %02X\n", id, (status & MXT_T9_DETECT) ? 'D' : '.', (status & MXT_T9_PRESS) ? 'P' : '.', @@ -707,7 +709,7 @@ static void mxt_proc_t9_messages(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); @@ -726,6 +728,7 @@ static void mxt_proc_t9_messages(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 in detect, so close out slot */ mxt_input_sync(data); @@ -2013,6 +2016,8 @@ static int mxt_initialize_input_device(struct mxt_data *data) 0, data->max_y, 0, 0); input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0); + input_set_abs_params(input_dev, ABS_MT_ORIENTATION, + 0, 255, 0, 0); input_set_drvdata(input_dev, data); i2c_set_clientdata(data->client, data); |