Lines Matching +full:mode +full:- +full:bootloader
1 // SPDX-License-Identifier: GPL-2.0-or-later
185 .addr = ts->client->addr, in mip4_i2c_xfer()
190 .addr = ts->client->addr, in mip4_i2c_xfer()
201 res = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in mip4_i2c_xfer()
205 error = res < 0 ? res : -EIO; in mip4_i2c_xfer()
206 dev_err(&ts->client->dev, in mip4_i2c_xfer()
207 "%s - i2c_transfer failed: %d (%d)\n", in mip4_i2c_xfer()
209 } while (--retry); in mip4_i2c_xfer()
216 v->boot = get_unaligned_le16(buf + 0); in mip4_parse_fw_version()
217 v->core = get_unaligned_le16(buf + 2); in mip4_parse_fw_version()
218 v->app = get_unaligned_le16(buf + 4); in mip4_parse_fw_version()
219 v->param = get_unaligned_le16(buf + 6); in mip4_parse_fw_version()
228 u8 buf[sizeof(ts->fw_version)]; in mip4_get_fw_version()
233 memset(&ts->fw_version, 0xff, sizeof(ts->fw_version)); in mip4_get_fw_version()
237 mip4_parse_fw_version(buf, &ts->fw_version); in mip4_get_fw_version()
256 if (i2c_smbus_xfer(ts->client->adapter, ts->client->addr, in mip4_query_device()
258 dev_err(&ts->client->dev, "nothing at this address\n"); in mip4_query_device()
259 return -ENXIO; in mip4_query_device()
266 ts->product_name, sizeof(ts->product_name)); in mip4_query_device()
268 dev_warn(&ts->client->dev, in mip4_query_device()
271 dev_dbg(&ts->client->dev, "product name: %.*s\n", in mip4_query_device()
272 (int)sizeof(ts->product_name), ts->product_name); in mip4_query_device()
279 dev_warn(&ts->client->dev, in mip4_query_device()
282 ts->product_id = get_unaligned_le16(&buf[0]); in mip4_query_device()
283 dev_dbg(&ts->client->dev, "product id: %04X\n", ts->product_id); in mip4_query_device()
287 snprintf(ts->fw_name, sizeof(ts->fw_name), in mip4_query_device()
288 "melfas_mip4_%04X.fw", ts->product_id); in mip4_query_device()
289 dev_dbg(&ts->client->dev, "firmware name: %s\n", ts->fw_name); in mip4_query_device()
295 ts->ic_name, sizeof(ts->ic_name)); in mip4_query_device()
297 dev_warn(&ts->client->dev, in mip4_query_device()
300 dev_dbg(&ts->client->dev, "IC name: %.*s\n", in mip4_query_device()
301 (int)sizeof(ts->ic_name), ts->ic_name); in mip4_query_device()
306 dev_warn(&ts->client->dev, in mip4_query_device()
309 dev_dbg(&ts->client->dev, "F/W Version: %04X %04X %04X %04X\n", in mip4_query_device()
310 ts->fw_version.boot, ts->fw_version.core, in mip4_query_device()
311 ts->fw_version.app, ts->fw_version.param); in mip4_query_device()
318 dev_warn(&ts->client->dev, in mip4_query_device()
322 ts->max_x = get_unaligned_le16(&buf[0]); in mip4_query_device()
323 ts->max_y = get_unaligned_le16(&buf[2]); in mip4_query_device()
324 dev_dbg(&ts->client->dev, "max_x: %d, max_y: %d\n", in mip4_query_device()
325 ts->max_x, ts->max_y); in mip4_query_device()
327 ts->node_x = buf[4]; in mip4_query_device()
328 ts->node_y = buf[5]; in mip4_query_device()
329 ts->node_key = buf[6]; in mip4_query_device()
330 dev_dbg(&ts->client->dev, in mip4_query_device()
332 ts->node_x, ts->node_y, ts->node_key); in mip4_query_device()
334 ts->ppm_x = buf[12]; in mip4_query_device()
335 ts->ppm_y = buf[13]; in mip4_query_device()
336 dev_dbg(&ts->client->dev, "ppm_x: %d, ppm_y: %d\n", in mip4_query_device()
337 ts->ppm_x, ts->ppm_y); in mip4_query_device()
340 if (ts->node_key > 0) in mip4_query_device()
341 ts->key_num = ts->node_key; in mip4_query_device()
349 dev_warn(&ts->client->dev, in mip4_query_device()
351 ts->event_format = 0xff; in mip4_query_device()
353 ts->event_format = get_unaligned_le16(&buf[4]); in mip4_query_device()
354 ts->event_size = buf[6]; in mip4_query_device()
355 dev_dbg(&ts->client->dev, "event_format: %d, event_size: %d\n", in mip4_query_device()
356 ts->event_format, ts->event_size); in mip4_query_device()
358 if (ts->event_format == 2 || ts->event_format > 3) in mip4_query_device()
359 dev_warn(&ts->client->dev, in mip4_query_device()
360 "Unknown event format %d\n", ts->event_format); in mip4_query_device()
368 if (ts->gpio_ce) { in mip4_power_on()
369 gpiod_set_value_cansleep(ts->gpio_ce, 1); in mip4_power_on()
380 if (ts->gpio_ce) in mip4_power_off()
381 gpiod_set_value_cansleep(ts->gpio_ce, 0); in mip4_power_off()
393 input_mt_slot(ts->input, i); in mip4_clear_input()
394 input_mt_report_slot_inactive(ts->input); in mip4_clear_input()
398 for (i = 0; i < ts->key_num; i++) in mip4_clear_input()
399 input_report_key(ts->input, ts->key_code[i], 0); in mip4_clear_input()
401 input_sync(ts->input); in mip4_clear_input()
412 enable_irq(ts->client->irq); in mip4_enable()
419 disable_irq(ts->client->irq); in mip4_disable()
435 switch (ts->event_format) { in mip4_report_keys()
450 if (key >= 1 && key <= ts->key_num) { in mip4_report_keys()
451 unsigned short keycode = ts->key_code[key - 1]; in mip4_report_keys()
453 dev_dbg(&ts->client->dev, in mip4_report_keys()
454 "Key - ID: %d, keycode: %d, state: %d\n", in mip4_report_keys()
457 input_event(ts->input, EV_MSC, MSC_SCAN, keycode); in mip4_report_keys()
458 input_report_key(ts->input, keycode, down); in mip4_report_keys()
461 dev_err(&ts->client->dev, "Unknown key: %d\n", key); in mip4_report_keys()
478 switch (ts->event_format) { in mip4_report_touch()
485 id = (packet[0] & 0x0F) - 1; in mip4_report_touch()
491 if (ts->event_format == 0) { in mip4_report_touch()
503 id = (packet[0] & 0x0F) - 1; in mip4_report_touch()
519 dev_dbg(&ts->client->dev, in mip4_report_touch()
520 "Screen - Slot: %d State: %d X: %04d Y: %04d Z: %d\n", in mip4_report_touch()
524 dev_err(&ts->client->dev, "Screen - invalid slot ID: %d\n", id); in mip4_report_touch()
528 input_mt_slot(ts->input, id); in mip4_report_touch()
529 if (input_mt_report_slot_state(ts->input, in mip4_report_touch()
532 input_report_abs(ts->input, ABS_MT_POSITION_X, x); in mip4_report_touch()
533 input_report_abs(ts->input, ABS_MT_POSITION_Y, y); in mip4_report_touch()
534 input_report_abs(ts->input, ABS_MT_PRESSURE, pressure); in mip4_report_touch()
535 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, touch_major); in mip4_report_touch()
536 input_report_abs(ts->input, ABS_MT_TOUCH_MINOR, touch_minor); in mip4_report_touch()
540 input_mt_sync_frame(ts->input); in mip4_report_touch()
547 switch (ts->event_format) { in mip4_handle_packet()
559 return -EINVAL; in mip4_handle_packet()
562 dev_dbg(&ts->client->dev, "Type: %d\n", type); in mip4_handle_packet()
575 dev_err(&ts->client->dev, "Unknown event type: %d\n", type); in mip4_handle_packet()
585 struct i2c_client *client = ts->client; in mip4_interrupt()
595 error = mip4_i2c_xfer(ts, cmd, sizeof(cmd), ts->buf, 1); in mip4_interrupt()
597 dev_err(&client->dev, in mip4_interrupt()
602 size = ts->buf[0] & 0x7F; in mip4_interrupt()
603 alert = ts->buf[0] & BIT(7); in mip4_interrupt()
604 dev_dbg(&client->dev, "packet size: %d, alert: %d\n", size, alert); in mip4_interrupt()
608 dev_err(&client->dev, "Empty packet\n"); in mip4_interrupt()
615 error = mip4_i2c_xfer(ts, cmd, sizeof(cmd), ts->buf, size); in mip4_interrupt()
617 dev_err(&client->dev, in mip4_interrupt()
623 dev_dbg(&client->dev, "Alert: %d\n", ts->buf[0]); in mip4_interrupt()
625 for (i = 0; i < size; i += ts->event_size) { in mip4_interrupt()
626 error = mip4_handle_packet(ts, &ts->buf[i]); in mip4_interrupt()
631 input_sync(ts->input); in mip4_interrupt()
704 * Bootloader - Read status
712 .addr = ts->client->addr, in mip4_bl_read_status()
717 .addr = ts->client->addr, in mip4_bl_read_status()
728 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in mip4_bl_read_status()
730 error = ret < 0 ? ret : -EIO; in mip4_bl_read_status()
731 dev_err(&ts->client->dev, in mip4_bl_read_status()
732 "Failed to read bootloader status: %d\n", in mip4_bl_read_status()
739 dev_dbg(&ts->client->dev, "%s - done\n", __func__); in mip4_bl_read_status()
743 dev_err(&ts->client->dev, "Bootloader failure\n"); in mip4_bl_read_status()
744 return -EIO; in mip4_bl_read_status()
747 dev_dbg(&ts->client->dev, "%s - Busy\n", __func__); in mip4_bl_read_status()
748 error = -EBUSY; in mip4_bl_read_status()
752 dev_err(&ts->client->dev, in mip4_bl_read_status()
753 "Unexpected bootloader status: %#02x\n", in mip4_bl_read_status()
755 error = -EINVAL; in mip4_bl_read_status()
760 } while (--retry); in mip4_bl_read_status()
766 * Bootloader - Change mode
768 static int mip4_bl_change_mode(struct mip4_ts *ts, u8 mode) in mip4_bl_change_mode() argument
770 u8 mode_chg_cmd[] = { MIP4_R0_BOOT, MIP4_R1_BOOT_MODE, mode }; in mip4_bl_change_mode()
775 .addr = ts->client->addr, in mip4_bl_change_mode()
780 .addr = ts->client->addr, in mip4_bl_change_mode()
791 /* Send mode change command */ in mip4_bl_change_mode()
792 ret = i2c_master_send(ts->client, in mip4_bl_change_mode()
795 error = ret < 0 ? ret : -EIO; in mip4_bl_change_mode()
796 dev_err(&ts->client->dev, in mip4_bl_change_mode()
797 "Failed to send %d mode change: %d (%d)\n", in mip4_bl_change_mode()
798 mode, error, ret); in mip4_bl_change_mode()
802 dev_dbg(&ts->client->dev, in mip4_bl_change_mode()
803 "Sent mode change request (mode: %d)\n", mode); in mip4_bl_change_mode()
808 /* Verify target mode */ in mip4_bl_change_mode()
809 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in mip4_bl_change_mode()
811 error = ret < 0 ? ret : -EIO; in mip4_bl_change_mode()
812 dev_err(&ts->client->dev, in mip4_bl_change_mode()
813 "Failed to read device mode: %d\n", error); in mip4_bl_change_mode()
817 dev_dbg(&ts->client->dev, in mip4_bl_change_mode()
818 "Current device mode: %d, want: %d\n", result, mode); in mip4_bl_change_mode()
820 if (result == mode) in mip4_bl_change_mode()
823 } while (--retry); in mip4_bl_change_mode()
825 return -EIO; in mip4_bl_change_mode()
829 * Bootloader - Start bootloader mode
837 * Bootloader - Exit bootloader mode
850 .addr = ts->client->addr, in mip4_bl_get_address()
855 .addr = ts->client->addr, in mip4_bl_get_address()
864 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in mip4_bl_get_address()
866 error = ret < 0 ? ret : -EIO; in mip4_bl_get_address()
867 dev_err(&ts->client->dev, in mip4_bl_get_address()
868 "Failed to retrieve bootloader buffer address: %d\n", in mip4_bl_get_address()
874 dev_dbg(&ts->client->dev, in mip4_bl_get_address()
875 "Bootloader buffer address %#04x\n", *buf_addr); in mip4_bl_get_address()
889 dev_dbg(&ts->client->dev, "Writing page @%#06x (%d)\n", in mip4_bl_program_page()
893 dev_err(&ts->client->dev, in mip4_bl_program_page()
895 return -EINVAL; in mip4_bl_program_page()
900 return -ENOMEM; in mip4_bl_program_page()
906 ret = i2c_master_send(ts->client, cmd, 6); in mip4_bl_program_page()
908 error = ret < 0 ? ret : -EIO; in mip4_bl_program_page()
909 dev_err(&ts->client->dev, in mip4_bl_program_page()
918 ret = i2c_master_send(ts->client, cmd, 6); in mip4_bl_program_page()
920 error = ret < 0 ? ret : -EIO; in mip4_bl_program_page()
921 dev_err(&ts->client->dev, in mip4_bl_program_page()
930 dev_dbg(&ts->client->dev, in mip4_bl_program_page()
935 ret = i2c_master_send(ts->client, in mip4_bl_program_page()
938 error = ret < 0 ? ret : -EIO; in mip4_bl_program_page()
939 dev_err(&ts->client->dev, in mip4_bl_program_page()
950 ret = i2c_master_send(ts->client, cmd, 3); in mip4_bl_program_page()
952 error = ret < 0 ? ret : -EIO; in mip4_bl_program_page()
953 dev_err(&ts->client->dev, in mip4_bl_program_page()
974 .addr = ts->client->addr, in mip4_bl_verify_page()
979 .addr = ts->client->addr, in mip4_bl_verify_page()
987 dev_dbg(&ts->client->dev, "Validating page @%#06x (%d)\n", in mip4_bl_verify_page()
994 ret = i2c_master_send(ts->client, cmd, 6); in mip4_bl_verify_page()
996 error = ret < 0 ? ret : -EIO; in mip4_bl_verify_page()
997 dev_err(&ts->client->dev, in mip4_bl_verify_page()
1006 ret = i2c_master_send(ts->client, cmd, 6); in mip4_bl_verify_page()
1008 error = ret < 0 ? ret : -EIO; in mip4_bl_verify_page()
1009 dev_err(&ts->client->dev, in mip4_bl_verify_page()
1018 ret = i2c_master_send(ts->client, cmd, 3); in mip4_bl_verify_page()
1020 error = ret < 0 ? ret : -EIO; in mip4_bl_verify_page()
1021 dev_err(&ts->client->dev, in mip4_bl_verify_page()
1034 return -ENOMEM; in mip4_bl_verify_page()
1039 dev_dbg(&ts->client->dev, in mip4_bl_verify_page()
1043 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg)); in mip4_bl_verify_page()
1045 error = ret < 0 ? ret : -EIO; in mip4_bl_verify_page()
1046 dev_err(&ts->client->dev, in mip4_bl_verify_page()
1053 dev_err(&ts->client->dev, in mip4_bl_verify_page()
1067 error = -EINVAL; in mip4_bl_verify_page()
1082 struct i2c_client *client = ts->client; in mip4_flash_fw()
1087 /* Enter bootloader mode */ in mip4_flash_fw()
1088 dev_dbg(&client->dev, "Entering bootloader mode\n"); in mip4_flash_fw()
1092 dev_err(&client->dev, in mip4_flash_fw()
1093 "Failed to enter bootloader mode: %d\n", in mip4_flash_fw()
1104 dev_dbg(&client->dev, in mip4_flash_fw()
1125 /* Exit bootloader mode */ in mip4_flash_fw()
1126 dev_dbg(&client->dev, "Exiting bootloader mode\n"); in mip4_flash_fw()
1130 dev_err(&client->dev, in mip4_flash_fw()
1131 "Failed to exit bootloader mode: %d\n", error2); in mip4_flash_fw()
1143 input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0); in mip4_flash_fw()
1144 input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0); in mip4_flash_fw()
1145 input_set_abs_params(ts->input, ABS_X, 0, ts->max_x, 0, 0); in mip4_flash_fw()
1146 input_set_abs_params(ts->input, ABS_Y, 0, ts->max_y, 0, 0); in mip4_flash_fw()
1147 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->ppm_x); in mip4_flash_fw()
1148 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->ppm_y); in mip4_flash_fw()
1149 input_abs_set_res(ts->input, ABS_X, ts->ppm_x); in mip4_flash_fw()
1150 input_abs_set_res(ts->input, ABS_Y, ts->ppm_y); in mip4_flash_fw()
1163 if (fw->size < MIP4_BIN_TAIL_SIZE) { in mip4_parse_firmware()
1164 dev_err(&ts->client->dev, in mip4_parse_firmware()
1166 MIP4_BIN_TAIL_SIZE, fw->size); in mip4_parse_firmware()
1167 return -EINVAL; in mip4_parse_firmware()
1170 fw_info = (const void *)&fw->data[fw->size - MIP4_BIN_TAIL_SIZE]; in mip4_parse_firmware()
1177 tail_size = get_unaligned_le16(&fw_info->tail_size); in mip4_parse_firmware()
1179 dev_err(&ts->client->dev, in mip4_parse_firmware()
1182 return -EINVAL; in mip4_parse_firmware()
1186 if (memcmp(fw_info->tail_mark, MIP4_BIN_TAIL_MARK, in mip4_parse_firmware()
1187 sizeof(fw_info->tail_mark))) { in mip4_parse_firmware()
1188 dev_err(&ts->client->dev, in mip4_parse_firmware()
1190 (int)sizeof(fw_info->tail_mark), fw_info->tail_mark, in mip4_parse_firmware()
1191 (int)sizeof(fw_info->tail_mark), MIP4_BIN_TAIL_MARK); in mip4_parse_firmware()
1192 return -EINVAL; in mip4_parse_firmware()
1195 *fw_offset_start = get_unaligned_le32(&fw_info->bin_start_addr); in mip4_parse_firmware()
1196 *fw_size = get_unaligned_le32(&fw_info->bin_length); in mip4_parse_firmware()
1198 dev_dbg(&ts->client->dev, in mip4_parse_firmware()
1203 dev_err(&ts->client->dev, in mip4_parse_firmware()
1206 return -EINVAL; in mip4_parse_firmware()
1209 if (fw->size != *fw_offset_start + *fw_size) { in mip4_parse_firmware()
1210 dev_err(&ts->client->dev, in mip4_parse_firmware()
1212 *fw_offset_start + *fw_size, fw->size); in mip4_parse_firmware()
1213 return -EINVAL; in mip4_parse_firmware()
1216 mip4_parse_fw_version((const u8 *)&fw_info->ver_boot, &fw_version); in mip4_parse_firmware()
1218 dev_dbg(&ts->client->dev, in mip4_parse_firmware()
1223 dev_dbg(&ts->client->dev, "F/W chip version: %04X %04X %04X %04X\n", in mip4_parse_firmware()
1224 ts->fw_version.boot, ts->fw_version.core, in mip4_parse_firmware()
1225 ts->fw_version.app, ts->fw_version.param); in mip4_parse_firmware()
1232 dev_dbg(&ts->client->dev, "F/W type: Bootloader\n"); in mip4_parse_firmware()
1237 dev_dbg(&ts->client->dev, "F/W type: Main\n"); in mip4_parse_firmware()
1239 dev_err(&ts->client->dev, "Wrong firmware type\n"); in mip4_parse_firmware()
1240 return -EINVAL; in mip4_parse_firmware()
1259 if (input_device_enabled(ts->input)) { in mip4_execute_fw_update()
1260 disable_irq(ts->client->irq); in mip4_execute_fw_update()
1269 error = mip4_flash_fw(ts, fw->data, fw_size, fw_start_offset); in mip4_execute_fw_update()
1272 } while (--retires); in mip4_execute_fw_update()
1275 dev_err(&ts->client->dev, in mip4_execute_fw_update()
1279 if (input_device_enabled(ts->input)) in mip4_execute_fw_update()
1280 enable_irq(ts->client->irq); in mip4_execute_fw_update()
1296 error = request_firmware(&fw, ts->fw_name, dev); in mip4_sysfs_fw_update()
1298 dev_err(&ts->client->dev, in mip4_sysfs_fw_update()
1300 ts->fw_name, error); in mip4_sysfs_fw_update()
1309 mutex_lock(&ts->input->mutex); in mip4_sysfs_fw_update()
1313 mutex_unlock(&ts->input->mutex); in mip4_sysfs_fw_update()
1318 dev_err(&ts->client->dev, in mip4_sysfs_fw_update()
1337 mutex_lock(&ts->input->mutex); in mip4_sysfs_read_fw_version()
1340 ts->fw_version.boot, ts->fw_version.core, in mip4_sysfs_read_fw_version()
1341 ts->fw_version.app, ts->fw_version.param); in mip4_sysfs_read_fw_version()
1343 mutex_unlock(&ts->input->mutex); in mip4_sysfs_read_fw_version()
1359 mutex_lock(&ts->input->mutex); in mip4_sysfs_read_hw_version()
1366 (int)sizeof(ts->product_name), ts->product_name); in mip4_sysfs_read_hw_version()
1368 mutex_unlock(&ts->input->mutex); in mip4_sysfs_read_hw_version()
1383 mutex_lock(&ts->input->mutex); in mip4_sysfs_read_product_id()
1385 count = sysfs_emit(buf, "%04X\n", ts->product_id); in mip4_sysfs_read_product_id()
1387 mutex_unlock(&ts->input->mutex); in mip4_sysfs_read_product_id()
1402 mutex_lock(&ts->input->mutex); in mip4_sysfs_read_ic_name()
1405 (int)sizeof(ts->ic_name), ts->ic_name); in mip4_sysfs_read_ic_name()
1407 mutex_unlock(&ts->input->mutex); in mip4_sysfs_read_ic_name()
1430 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { in mip4_probe()
1431 dev_err(&client->dev, "Not supported I2C adapter\n"); in mip4_probe()
1432 return -ENXIO; in mip4_probe()
1435 ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); in mip4_probe()
1437 return -ENOMEM; in mip4_probe()
1439 input = devm_input_allocate_device(&client->dev); in mip4_probe()
1441 return -ENOMEM; in mip4_probe()
1443 ts->client = client; in mip4_probe()
1444 ts->input = input; in mip4_probe()
1446 snprintf(ts->phys, sizeof(ts->phys), in mip4_probe()
1447 "%s/input0", dev_name(&client->dev)); in mip4_probe()
1449 ts->gpio_ce = devm_gpiod_get_optional(&client->dev, in mip4_probe()
1451 if (IS_ERR(ts->gpio_ce)) in mip4_probe()
1452 return dev_err_probe(&client->dev, PTR_ERR(ts->gpio_ce), "Failed to get gpio\n"); in mip4_probe()
1462 input->name = "MELFAS MIP4 Touchscreen"; in mip4_probe()
1463 input->phys = ts->phys; in mip4_probe()
1465 input->id.bustype = BUS_I2C; in mip4_probe()
1466 input->id.vendor = 0x13c5; in mip4_probe()
1467 input->id.product = ts->product_id; in mip4_probe()
1469 input->open = mip4_input_open; in mip4_probe()
1470 input->close = mip4_input_close; in mip4_probe()
1474 input->keycode = ts->key_code; in mip4_probe()
1475 input->keycodesize = sizeof(*ts->key_code); in mip4_probe()
1476 input->keycodemax = ts->key_num; in mip4_probe()
1479 input_set_abs_params(input, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0); in mip4_probe()
1480 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0); in mip4_probe()
1487 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->ppm_x); in mip4_probe()
1488 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->ppm_y); in mip4_probe()
1496 error = devm_request_threaded_irq(&client->dev, client->irq, in mip4_probe()
1501 dev_err(&client->dev, in mip4_probe()
1503 client->irq, error); in mip4_probe()
1509 dev_err(&client->dev, in mip4_probe()
1521 struct input_dev *input = ts->input; in mip4_suspend()
1523 mutex_lock(&input->mutex); in mip4_suspend()
1526 ts->wake_irq_enabled = enable_irq_wake(client->irq) == 0; in mip4_suspend()
1530 mutex_unlock(&input->mutex); in mip4_suspend()
1539 struct input_dev *input = ts->input; in mip4_resume()
1541 mutex_lock(&input->mutex); in mip4_resume()
1543 if (ts->wake_irq_enabled) in mip4_resume()
1544 disable_irq_wake(client->irq); in mip4_resume()
1548 mutex_unlock(&input->mutex); in mip4_resume()