/*****************************************************************
* Protocol
- * Version : MIP 4.0 Rev 4.4
+ * Version : MIP 4.0 Rev 4.6
*****************************************************************/
/* Address */
#define MIP4_R1_INFO_NODE_NUM_X 0x14
#define MIP4_R1_INFO_NODE_NUM_Y 0x15
#define MIP4_R1_INFO_KEY_NUM 0x16
+#define MIP4_R1_INFO_PRESSURE_NUM 0x17
+#define MIP4_R1_INFO_LENGTH_X 0x18
+#define MIP4_R1_INFO_LENGTH_Y 0x1A
+#define MIP4_R1_INFO_PPM_X 0x1C
+#define MIP4_R1_INFO_PPM_Y 0x1D
#define MIP4_R1_INFO_VERSION_BOOT 0x20
#define MIP4_R1_INFO_VERSION_CORE 0x22
#define MIP4_R1_INFO_VERSION_APP 0x24
u8 node_x;
u8 node_y;
u8 node_key;
+ unsigned int ppm_x;
+ unsigned int ppm_y;
struct mip4_fw_version fw_version;
{
int error;
u8 cmd[2];
- u8 buf[8];
+ u8 buf[14];
/* Product name */
cmd[0] = MIP4_R0_INFO;
/* Resolution */
cmd[0] = MIP4_R0_INFO;
cmd[1] = MIP4_R1_INFO_RESOLUTION_X;
- error = mip4_i2c_xfer(ts, cmd, sizeof(cmd), buf, 7);
+ error = mip4_i2c_xfer(ts, cmd, sizeof(cmd), buf, 14);
if (error) {
dev_warn(&ts->client->dev,
"Failed to retrieve touchscreen parameters: %d\n",
"node_x: %d, node_y: %d, node_key: %d\n",
ts->node_x, ts->node_y, ts->node_key);
+ ts->ppm_x = buf[12];
+ ts->ppm_y = buf[13];
+ dev_dbg(&ts->client->dev, "ppm_x: %d, ppm_y: %d\n",
+ ts->ppm_x, ts->ppm_y);
+
/* Key ts */
if (ts->node_key > 0)
ts->key_num = ts->node_key;
input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0);
input_set_abs_params(ts->input, ABS_X, 0, ts->max_x, 0, 0);
input_set_abs_params(ts->input, ABS_Y, 0, ts->max_y, 0, 0);
+ input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->ppm_x);
+ input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->ppm_y);
+ input_abs_set_res(ts->input, ABS_X, ts->ppm_x);
+ input_abs_set_res(ts->input, ABS_Y, ts->ppm_y);
return error ? error : 0;
}
MIP4_TOUCH_MAJOR_MIN, MIP4_TOUCH_MAJOR_MAX, 0, 0);
input_set_abs_params(input, ABS_MT_TOUCH_MINOR,
MIP4_TOUCH_MINOR_MIN, MIP4_TOUCH_MINOR_MAX, 0, 0);
+ input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->ppm_x);
+ input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->ppm_y);
error = input_mt_init_slots(input, MIP4_MAX_FINGERS, INPUT_MT_DIRECT);
if (error)
module_i2c_driver(mip4_driver);
MODULE_DESCRIPTION("MELFAS MIP4 Touchscreen");
-MODULE_VERSION("2016.01.13");
+MODULE_VERSION("2016.03.03");
MODULE_AUTHOR("Sangwon Jee <jeesw@melfas.com>");
MODULE_LICENSE("GPL");