Lines Matching refs:iqs626

460 iqs626_parse_events(struct iqs626_private *iqs626,  in iqs626_parse_events()  argument
463 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_parse_events()
464 struct i2c_client *client = iqs626->client; in iqs626_parse_events()
518 iqs626->kp_code[ch_id][i] = val; in iqs626_parse_events()
536 iqs626->kp_type[ch_id][i] = val; in iqs626_parse_events()
581 iqs626_parse_ati_target(struct iqs626_private *iqs626, in iqs626_parse_ati_target() argument
584 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_parse_ati_target()
585 struct i2c_client *client = iqs626->client; in iqs626_parse_ati_target()
660 static int iqs626_parse_pins(struct iqs626_private *iqs626, in iqs626_parse_pins() argument
664 struct i2c_client *client = iqs626->client; in iqs626_parse_pins()
708 static int iqs626_parse_trackpad(struct iqs626_private *iqs626, in iqs626_parse_trackpad() argument
712 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_parse_trackpad()
713 struct i2c_client *client = iqs626->client; in iqs626_parse_trackpad()
820 iqs626->tp_code, count); in iqs626_parse_trackpad()
872 iqs626_parse_channel(struct iqs626_private *iqs626, in iqs626_parse_channel() argument
875 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_parse_channel()
876 struct i2c_client *client = iqs626->client; in iqs626_parse_channel()
907 error = iqs626_parse_ati_target(iqs626, ch_node, ch_id); in iqs626_parse_channel()
911 error = iqs626_parse_events(iqs626, ch_node, ch_id); in iqs626_parse_channel()
1054 return iqs626_parse_trackpad(iqs626, ch_node, ch_id); in iqs626_parse_channel()
1125 error = iqs626_parse_pins(iqs626, ch_node, "azoteq,rx-enable", in iqs626_parse_channel()
1130 error = iqs626_parse_pins(iqs626, ch_node, "azoteq,tx-enable", in iqs626_parse_channel()
1223 static int iqs626_parse_prop(struct iqs626_private *iqs626) in iqs626_parse_prop() argument
1225 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_parse_prop()
1226 struct i2c_client *client = iqs626->client; in iqs626_parse_prop()
1239 iqs626->suspend_mode = val; in iqs626_parse_prop()
1242 error = regmap_raw_read(iqs626->regmap, IQS626_SYS_SETTINGS, sys_reg, in iqs626_parse_prop()
1374 error = iqs626_parse_channel(iqs626, ch_node, i); in iqs626_parse_prop()
1397 error = regmap_raw_write(iqs626->regmap, IQS626_SYS_SETTINGS, in iqs626_parse_prop()
1398 &iqs626->sys_reg, sizeof(iqs626->sys_reg)); in iqs626_parse_prop()
1407 static int iqs626_input_init(struct iqs626_private *iqs626) in iqs626_input_init() argument
1409 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_input_init()
1410 struct i2c_client *client = iqs626->client; in iqs626_input_init()
1413 iqs626->keypad = devm_input_allocate_device(&client->dev); in iqs626_input_init()
1414 if (!iqs626->keypad) in iqs626_input_init()
1417 iqs626->keypad->keycodemax = ARRAY_SIZE(iqs626->kp_code); in iqs626_input_init()
1418 iqs626->keypad->keycode = iqs626->kp_code; in iqs626_input_init()
1419 iqs626->keypad->keycodesize = sizeof(**iqs626->kp_code); in iqs626_input_init()
1421 iqs626->keypad->name = "iqs626a_keypad"; in iqs626_input_init()
1422 iqs626->keypad->id.bustype = BUS_I2C; in iqs626_input_init()
1429 if (!iqs626->kp_type[i][j]) in iqs626_input_init()
1432 input_set_capability(iqs626->keypad, in iqs626_input_init()
1433 iqs626->kp_type[i][j], in iqs626_input_init()
1434 iqs626->kp_code[i][j]); in iqs626_input_init()
1441 iqs626->trackpad = devm_input_allocate_device(&client->dev); in iqs626_input_init()
1442 if (!iqs626->trackpad) in iqs626_input_init()
1445 iqs626->trackpad->keycodemax = ARRAY_SIZE(iqs626->tp_code); in iqs626_input_init()
1446 iqs626->trackpad->keycode = iqs626->tp_code; in iqs626_input_init()
1447 iqs626->trackpad->keycodesize = sizeof(*iqs626->tp_code); in iqs626_input_init()
1449 iqs626->trackpad->name = "iqs626a_trackpad"; in iqs626_input_init()
1450 iqs626->trackpad->id.bustype = BUS_I2C; in iqs626_input_init()
1459 input_set_capability(iqs626->trackpad, EV_KEY, BTN_TOUCH); in iqs626_input_init()
1460 input_set_abs_params(iqs626->trackpad, ABS_Y, 0, 255, 0, 0); in iqs626_input_init()
1463 input_set_abs_params(iqs626->trackpad, in iqs626_input_init()
1466 input_set_abs_params(iqs626->trackpad, in iqs626_input_init()
1469 touchscreen_parse_properties(iqs626->trackpad, false, in iqs626_input_init()
1470 &iqs626->prop); in iqs626_input_init()
1473 if (iqs626->tp_code[i] != KEY_RESERVED) in iqs626_input_init()
1474 input_set_capability(iqs626->trackpad, EV_KEY, in iqs626_input_init()
1475 iqs626->tp_code[i]); in iqs626_input_init()
1478 error = input_register_device(iqs626->trackpad); in iqs626_input_init()
1486 static int iqs626_report(struct iqs626_private *iqs626) in iqs626_report() argument
1488 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; in iqs626_report()
1489 struct i2c_client *client = iqs626->client; in iqs626_report()
1496 error = regmap_raw_read(iqs626->regmap, IQS626_SYS_FLAGS, &flags, in iqs626_report()
1512 error = regmap_raw_write(iqs626->regmap, IQS626_SYS_SETTINGS, in iqs626_report()
1530 error = regmap_raw_read(iqs626->regmap, IQS626_HALL_OUTPUT, in iqs626_report()
1548 if (!iqs626->kp_type[i][j]) in iqs626_report()
1556 input_event(iqs626->keypad, iqs626->kp_type[i][j], in iqs626_report()
1557 iqs626->kp_code[i][j], !!state); in iqs626_report()
1561 input_sync(iqs626->keypad); in iqs626_report()
1567 complete_all(&iqs626->ati_done); in iqs626_report()
1576 input_report_key(iqs626->trackpad, BTN_TOUCH, state); in iqs626_report()
1579 touchscreen_report_pos(iqs626->trackpad, &iqs626->prop, in iqs626_report()
1584 input_report_key(iqs626->trackpad, iqs626->tp_code[i], in iqs626_report()
1588 input_sync(iqs626->trackpad); in iqs626_report()
1595 input_report_key(iqs626->trackpad, in iqs626_report()
1596 iqs626->tp_code[i], 0); in iqs626_report()
1600 input_sync(iqs626->trackpad); in iqs626_report()
1607 struct iqs626_private *iqs626 = context; in iqs626_irq() local
1609 if (iqs626_report(iqs626)) in iqs626_irq()
1631 struct iqs626_private *iqs626; in iqs626_probe() local
1634 iqs626 = devm_kzalloc(&client->dev, sizeof(*iqs626), GFP_KERNEL); in iqs626_probe()
1635 if (!iqs626) in iqs626_probe()
1638 i2c_set_clientdata(client, iqs626); in iqs626_probe()
1639 iqs626->client = client; in iqs626_probe()
1641 iqs626->regmap = devm_regmap_init_i2c(client, &iqs626_regmap_config); in iqs626_probe()
1642 if (IS_ERR(iqs626->regmap)) { in iqs626_probe()
1643 error = PTR_ERR(iqs626->regmap); in iqs626_probe()
1649 init_completion(&iqs626->ati_done); in iqs626_probe()
1651 error = regmap_raw_read(iqs626->regmap, IQS626_VER_INFO, &ver_info, in iqs626_probe()
1662 error = iqs626_parse_prop(iqs626); in iqs626_probe()
1666 error = iqs626_input_init(iqs626); in iqs626_probe()
1672 client->name, iqs626); in iqs626_probe()
1678 if (!wait_for_completion_timeout(&iqs626->ati_done, in iqs626_probe()
1688 error = input_register_device(iqs626->keypad); in iqs626_probe()
1697 struct iqs626_private *iqs626 = dev_get_drvdata(dev); in iqs626_suspend() local
1698 struct i2c_client *client = iqs626->client; in iqs626_suspend()
1702 if (!iqs626->suspend_mode) in iqs626_suspend()
1712 error = regmap_update_bits(iqs626->regmap, IQS626_SYS_SETTINGS, in iqs626_suspend()
1721 error = regmap_read_poll_timeout(iqs626->regmap, IQS626_SYS_FLAGS, val, in iqs626_suspend()
1728 error = regmap_update_bits(iqs626->regmap, IQS626_SYS_SETTINGS, in iqs626_suspend()
1730 iqs626->suspend_mode << in iqs626_suspend()
1740 error = regmap_read_poll_timeout(iqs626->regmap, IQS626_SYS_FLAGS, val, in iqs626_suspend()
1742 == (iqs626->suspend_mode << in iqs626_suspend()
1756 struct iqs626_private *iqs626 = dev_get_drvdata(dev); in iqs626_resume() local
1757 struct i2c_client *client = iqs626->client; in iqs626_resume()
1761 if (!iqs626->suspend_mode) in iqs626_resume()
1766 error = regmap_update_bits(iqs626->regmap, IQS626_SYS_SETTINGS, in iqs626_resume()
1775 error = regmap_read_poll_timeout(iqs626->regmap, IQS626_SYS_FLAGS, val, in iqs626_resume()
1782 error = regmap_update_bits(iqs626->regmap, IQS626_SYS_SETTINGS, in iqs626_resume()
1792 error = iqs626_report(iqs626); in iqs626_resume()