Lines Matching +full:proj +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0+
8 * inductive keys as well as Hall-effect switches, and one for each of the two
193 .name = "event-prox",
199 .name = "event-prox-alt",
206 .name = "event-touch",
212 .name = "event-touch-alt",
219 .name = "event-deep",
225 .name = "event-deep-alt",
301 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in iqs269_ati_mode_set()
305 return -EINVAL; in iqs269_ati_mode_set()
308 return -EINVAL; in iqs269_ati_mode_set()
310 mutex_lock(&iqs269->lock); in iqs269_ati_mode_set()
318 iqs269->ati_current = false; in iqs269_ati_mode_set()
320 mutex_unlock(&iqs269->lock); in iqs269_ati_mode_set()
328 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in iqs269_ati_mode_get()
332 return -EINVAL; in iqs269_ati_mode_get()
334 mutex_lock(&iqs269->lock); in iqs269_ati_mode_get()
336 mutex_unlock(&iqs269->lock); in iqs269_ati_mode_get()
347 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in iqs269_ati_base_set()
351 return -EINVAL; in iqs269_ati_base_set()
371 return -EINVAL; in iqs269_ati_base_set()
374 mutex_lock(&iqs269->lock); in iqs269_ati_base_set()
382 iqs269->ati_current = false; in iqs269_ati_base_set()
384 mutex_unlock(&iqs269->lock); in iqs269_ati_base_set()
392 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in iqs269_ati_base_get()
396 return -EINVAL; in iqs269_ati_base_get()
398 mutex_lock(&iqs269->lock); in iqs269_ati_base_get()
400 mutex_unlock(&iqs269->lock); in iqs269_ati_base_get()
420 return -EINVAL; in iqs269_ati_base_get()
427 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in iqs269_ati_target_set()
431 return -EINVAL; in iqs269_ati_target_set()
434 return -EINVAL; in iqs269_ati_target_set()
436 mutex_lock(&iqs269->lock); in iqs269_ati_target_set()
444 iqs269->ati_current = false; in iqs269_ati_target_set()
446 mutex_unlock(&iqs269->lock); in iqs269_ati_target_set()
454 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in iqs269_ati_target_get()
458 return -EINVAL; in iqs269_ati_target_get()
460 mutex_lock(&iqs269->lock); in iqs269_ati_target_get()
462 mutex_unlock(&iqs269->lock); in iqs269_ati_target_get()
480 return -EINVAL; in iqs269_parse_mask()
490 return -EINVAL; in iqs269_parse_mask()
501 struct i2c_client *client = iqs269->client; in iqs269_parse_chan()
510 dev_err(&client->dev, "Failed to read channel number: %d\n", in iqs269_parse_chan()
514 dev_err(&client->dev, "Invalid channel number: %u\n", reg); in iqs269_parse_chan()
515 return -EINVAL; in iqs269_parse_chan()
518 iqs269->sys_reg.active |= BIT(reg); in iqs269_parse_chan()
519 if (!fwnode_property_present(ch_node, "azoteq,reseed-disable")) in iqs269_parse_chan()
520 iqs269->sys_reg.reseed |= BIT(reg); in iqs269_parse_chan()
522 if (fwnode_property_present(ch_node, "azoteq,blocking-enable")) in iqs269_parse_chan()
523 iqs269->sys_reg.blocking |= BIT(reg); in iqs269_parse_chan()
525 if (fwnode_property_present(ch_node, "azoteq,slider0-select")) in iqs269_parse_chan()
526 iqs269->sys_reg.slider_select[0] |= BIT(reg); in iqs269_parse_chan()
528 if (fwnode_property_present(ch_node, "azoteq,slider1-select")) in iqs269_parse_chan()
529 iqs269->sys_reg.slider_select[1] |= BIT(reg); in iqs269_parse_chan()
531 ch_reg = &iqs269->sys_reg.ch_reg[reg]; in iqs269_parse_chan()
533 error = iqs269_parse_mask(ch_node, "azoteq,rx-enable", in iqs269_parse_chan()
534 &ch_reg->rx_enable); in iqs269_parse_chan()
536 dev_err(&client->dev, "Invalid channel %u RX enable mask: %d\n", in iqs269_parse_chan()
541 error = iqs269_parse_mask(ch_node, "azoteq,tx-enable", in iqs269_parse_chan()
542 &ch_reg->tx_enable); in iqs269_parse_chan()
544 dev_err(&client->dev, "Invalid channel %u TX enable mask: %d\n", in iqs269_parse_chan()
549 engine_a = be16_to_cpu(ch_reg->engine_a); in iqs269_parse_chan()
550 engine_b = be16_to_cpu(ch_reg->engine_b); in iqs269_parse_chan()
553 if (fwnode_property_present(ch_node, "azoteq,meas-cap-decrease")) in iqs269_parse_chan()
557 if (fwnode_property_present(ch_node, "azoteq,rx-float-inactive")) in iqs269_parse_chan()
562 if (!fwnode_property_read_u32(ch_node, "azoteq,local-cap-size", &val)) { in iqs269_parse_chan()
576 dev_err(&client->dev, in iqs269_parse_chan()
579 return -EINVAL; in iqs269_parse_chan()
584 if (fwnode_property_present(ch_node, "azoteq,invert-enable")) in iqs269_parse_chan()
587 if (!fwnode_property_read_u32(ch_node, "azoteq,proj-bias", &val)) { in iqs269_parse_chan()
589 dev_err(&client->dev, in iqs269_parse_chan()
592 return -EINVAL; in iqs269_parse_chan()
599 if (!fwnode_property_read_u32(ch_node, "azoteq,sense-mode", &val)) { in iqs269_parse_chan()
601 dev_err(&client->dev, in iqs269_parse_chan()
604 return -EINVAL; in iqs269_parse_chan()
611 if (!fwnode_property_read_u32(ch_node, "azoteq,sense-freq", &val)) { in iqs269_parse_chan()
613 dev_err(&client->dev, in iqs269_parse_chan()
616 return -EINVAL; in iqs269_parse_chan()
624 if (fwnode_property_present(ch_node, "azoteq,static-enable")) in iqs269_parse_chan()
627 ch_reg->engine_a = cpu_to_be16(engine_a); in iqs269_parse_chan()
628 ch_reg->engine_b = cpu_to_be16(engine_b); in iqs269_parse_chan()
630 if (!fwnode_property_read_u32(ch_node, "azoteq,ati-mode", &val)) { in iqs269_parse_chan()
633 dev_err(&client->dev, in iqs269_parse_chan()
639 if (!fwnode_property_read_u32(ch_node, "azoteq,ati-base", &val)) { in iqs269_parse_chan()
642 dev_err(&client->dev, in iqs269_parse_chan()
648 if (!fwnode_property_read_u32(ch_node, "azoteq,ati-target", &val)) { in iqs269_parse_chan()
651 dev_err(&client->dev, in iqs269_parse_chan()
658 error = iqs269_parse_mask(ch_node, "azoteq,assoc-select", in iqs269_parse_chan()
659 &ch_reg->assoc_select); in iqs269_parse_chan()
661 dev_err(&client->dev, "Invalid channel %u association: %d\n", in iqs269_parse_chan()
666 if (!fwnode_property_read_u32(ch_node, "azoteq,assoc-weight", &val)) { in iqs269_parse_chan()
668 dev_err(&client->dev, in iqs269_parse_chan()
671 return -EINVAL; in iqs269_parse_chan()
674 ch_reg->assoc_weight = val; in iqs269_parse_chan()
685 dev_err(&client->dev, in iqs269_parse_chan()
689 return -EINVAL; in iqs269_parse_chan()
692 ch_reg->thresh[iqs269_events[i].th_offs] = val; in iqs269_parse_chan()
696 u8 *hyst = &ch_reg->hyst; in iqs269_parse_chan()
699 dev_err(&client->dev, in iqs269_parse_chan()
703 return -EINVAL; in iqs269_parse_chan()
719 if (error == -EINVAL) { in iqs269_parse_chan()
722 dev_err(&client->dev, in iqs269_parse_chan()
730 if (iqs269->hall_enable) { in iqs269_parse_chan()
731 iqs269->switches[i].code = val; in iqs269_parse_chan()
732 iqs269->switches[i].enabled = true; in iqs269_parse_chan()
737 if (iqs269->hall_enable) in iqs269_parse_chan()
742 iqs269->keycode[i * IQS269_NUM_CH + reg] = val; in iqs269_parse_chan()
745 iqs269->sys_reg.event_mask &= ~iqs269_events[i].mask; in iqs269_parse_chan()
753 struct iqs269_sys_reg *sys_reg = &iqs269->sys_reg; in iqs269_parse_prop()
754 struct i2c_client *client = iqs269->client; in iqs269_parse_prop()
760 iqs269->hall_enable = device_property_present(&client->dev, in iqs269_parse_prop()
761 "azoteq,hall-enable"); in iqs269_parse_prop()
763 error = regmap_raw_read(iqs269->regmap, IQS269_SYS_SETTINGS, sys_reg, in iqs269_parse_prop()
768 if (!device_property_read_u32(&client->dev, "azoteq,filt-str-lp-lta", in iqs269_parse_prop()
771 dev_err(&client->dev, "Invalid filter strength: %u\n", in iqs269_parse_prop()
773 return -EINVAL; in iqs269_parse_prop()
776 sys_reg->filter &= ~IQS269_FILT_STR_LP_LTA_MASK; in iqs269_parse_prop()
777 sys_reg->filter |= (val << IQS269_FILT_STR_LP_LTA_SHIFT); in iqs269_parse_prop()
780 if (!device_property_read_u32(&client->dev, "azoteq,filt-str-lp-cnt", in iqs269_parse_prop()
783 dev_err(&client->dev, "Invalid filter strength: %u\n", in iqs269_parse_prop()
785 return -EINVAL; in iqs269_parse_prop()
788 sys_reg->filter &= ~IQS269_FILT_STR_LP_CNT_MASK; in iqs269_parse_prop()
789 sys_reg->filter |= (val << IQS269_FILT_STR_LP_CNT_SHIFT); in iqs269_parse_prop()
792 if (!device_property_read_u32(&client->dev, "azoteq,filt-str-np-lta", in iqs269_parse_prop()
795 dev_err(&client->dev, "Invalid filter strength: %u\n", in iqs269_parse_prop()
797 return -EINVAL; in iqs269_parse_prop()
800 sys_reg->filter &= ~IQS269_FILT_STR_NP_LTA_MASK; in iqs269_parse_prop()
801 sys_reg->filter |= (val << IQS269_FILT_STR_NP_LTA_SHIFT); in iqs269_parse_prop()
804 if (!device_property_read_u32(&client->dev, "azoteq,filt-str-np-cnt", in iqs269_parse_prop()
807 dev_err(&client->dev, "Invalid filter strength: %u\n", in iqs269_parse_prop()
809 return -EINVAL; in iqs269_parse_prop()
812 sys_reg->filter &= ~IQS269_FILT_STR_NP_CNT_MASK; in iqs269_parse_prop()
813 sys_reg->filter |= val; in iqs269_parse_prop()
816 if (!device_property_read_u32(&client->dev, "azoteq,rate-np-ms", in iqs269_parse_prop()
819 dev_err(&client->dev, "Invalid report rate: %u\n", val); in iqs269_parse_prop()
820 return -EINVAL; in iqs269_parse_prop()
823 sys_reg->rate_np = val; in iqs269_parse_prop()
826 if (!device_property_read_u32(&client->dev, "azoteq,rate-lp-ms", in iqs269_parse_prop()
829 dev_err(&client->dev, "Invalid report rate: %u\n", val); in iqs269_parse_prop()
830 return -EINVAL; in iqs269_parse_prop()
833 sys_reg->rate_lp = val; in iqs269_parse_prop()
836 if (!device_property_read_u32(&client->dev, "azoteq,rate-ulp-ms", in iqs269_parse_prop()
839 dev_err(&client->dev, "Invalid report rate: %u\n", val); in iqs269_parse_prop()
840 return -EINVAL; in iqs269_parse_prop()
843 sys_reg->rate_ulp = val / 16; in iqs269_parse_prop()
846 if (!device_property_read_u32(&client->dev, "azoteq,timeout-pwr-ms", in iqs269_parse_prop()
849 dev_err(&client->dev, "Invalid timeout: %u\n", val); in iqs269_parse_prop()
850 return -EINVAL; in iqs269_parse_prop()
853 sys_reg->timeout_pwr = val / 512; in iqs269_parse_prop()
856 if (!device_property_read_u32(&client->dev, "azoteq,timeout-lta-ms", in iqs269_parse_prop()
859 dev_err(&client->dev, "Invalid timeout: %u\n", val); in iqs269_parse_prop()
860 return -EINVAL; in iqs269_parse_prop()
863 sys_reg->timeout_lta = val / 512; in iqs269_parse_prop()
866 misc_a = be16_to_cpu(sys_reg->misc_a); in iqs269_parse_prop()
867 misc_b = be16_to_cpu(sys_reg->misc_b); in iqs269_parse_prop()
870 if (device_property_present(&client->dev, "azoteq,ati-band-disable")) in iqs269_parse_prop()
874 if (device_property_present(&client->dev, "azoteq,ati-lp-only")) in iqs269_parse_prop()
878 if (device_property_present(&client->dev, "azoteq,ati-band-tighten")) in iqs269_parse_prop()
882 if (device_property_present(&client->dev, "azoteq,filt-disable")) in iqs269_parse_prop()
885 if (!device_property_read_u32(&client->dev, "azoteq,gpio3-select", in iqs269_parse_prop()
888 dev_err(&client->dev, "Invalid GPIO3 selection: %u\n", in iqs269_parse_prop()
890 return -EINVAL; in iqs269_parse_prop()
898 if (device_property_present(&client->dev, "azoteq,dual-direction")) in iqs269_parse_prop()
901 if (!device_property_read_u32(&client->dev, "azoteq,tx-freq", &val)) { in iqs269_parse_prop()
903 dev_err(&client->dev, in iqs269_parse_prop()
905 return -EINVAL; in iqs269_parse_prop()
913 if (device_property_present(&client->dev, "azoteq,global-cap-increase")) in iqs269_parse_prop()
916 if (!device_property_read_u32(&client->dev, "azoteq,reseed-select", in iqs269_parse_prop()
919 dev_err(&client->dev, "Invalid reseed selection: %u\n", in iqs269_parse_prop()
921 return -EINVAL; in iqs269_parse_prop()
929 if (device_property_present(&client->dev, "azoteq,tracking-enable")) in iqs269_parse_prop()
932 if (!device_property_read_u32(&client->dev, "azoteq,filt-str-slider", in iqs269_parse_prop()
935 dev_err(&client->dev, "Invalid filter strength: %u\n", in iqs269_parse_prop()
937 return -EINVAL; in iqs269_parse_prop()
944 sys_reg->misc_a = cpu_to_be16(misc_a); in iqs269_parse_prop()
945 sys_reg->misc_b = cpu_to_be16(misc_b); in iqs269_parse_prop()
947 sys_reg->active = 0; in iqs269_parse_prop()
948 sys_reg->reseed = 0; in iqs269_parse_prop()
950 sys_reg->blocking = 0; in iqs269_parse_prop()
952 sys_reg->slider_select[0] = 0; in iqs269_parse_prop()
953 sys_reg->slider_select[1] = 0; in iqs269_parse_prop()
955 sys_reg->event_mask = ~((u8)IQS269_EVENT_MASK_SYS); in iqs269_parse_prop()
957 device_for_each_child_node(&client->dev, ch_node) { in iqs269_parse_prop()
966 * Volunteer all active channels to participate in ATI when REDO-ATI is in iqs269_parse_prop()
969 sys_reg->redo_ati = sys_reg->active; in iqs269_parse_prop()
971 general = be16_to_cpu(sys_reg->general); in iqs269_parse_prop()
973 if (device_property_present(&client->dev, "azoteq,clk-div")) in iqs269_parse_prop()
977 * Configure the device to automatically switch between normal and low- in iqs269_parse_prop()
978 * power modes as a function of sensing activity. Ultra-low-power mode, in iqs269_parse_prop()
985 if (!device_property_read_u32(&client->dev, "azoteq,suspend-mode", in iqs269_parse_prop()
988 dev_err(&client->dev, "Invalid suspend mode: %u\n", in iqs269_parse_prop()
990 return -EINVAL; in iqs269_parse_prop()
996 if (!device_property_read_u32(&client->dev, "azoteq,ulp-update", in iqs269_parse_prop()
999 dev_err(&client->dev, "Invalid update rate: %u\n", val); in iqs269_parse_prop()
1000 return -EINVAL; in iqs269_parse_prop()
1008 if (device_property_present(&client->dev, "azoteq,reseed-offset")) in iqs269_parse_prop()
1014 * As per the datasheet, enable streaming during normal-power mode if in iqs269_parse_prop()
1016 * mode during low-power mode. in iqs269_parse_prop()
1018 if (sys_reg->slider_select[0] || sys_reg->slider_select[1]) in iqs269_parse_prop()
1024 sys_reg->general = cpu_to_be16(general); in iqs269_parse_prop()
1033 mutex_lock(&iqs269->lock); in iqs269_dev_init()
1035 error = regmap_update_bits(iqs269->regmap, IQS269_HALL_UI, in iqs269_dev_init()
1037 iqs269->hall_enable ? ~0 : 0); in iqs269_dev_init()
1041 error = regmap_raw_write(iqs269->regmap, IQS269_SYS_SETTINGS, in iqs269_dev_init()
1042 &iqs269->sys_reg, sizeof(iqs269->sys_reg)); in iqs269_dev_init()
1052 iqs269->ati_current = true; in iqs269_dev_init()
1055 mutex_unlock(&iqs269->lock); in iqs269_dev_init()
1062 struct i2c_client *client = iqs269->client; in iqs269_input_init()
1066 iqs269->keypad = devm_input_allocate_device(&client->dev); in iqs269_input_init()
1067 if (!iqs269->keypad) in iqs269_input_init()
1068 return -ENOMEM; in iqs269_input_init()
1070 iqs269->keypad->keycodemax = ARRAY_SIZE(iqs269->keycode); in iqs269_input_init()
1071 iqs269->keypad->keycode = iqs269->keycode; in iqs269_input_init()
1072 iqs269->keypad->keycodesize = sizeof(*iqs269->keycode); in iqs269_input_init()
1074 iqs269->keypad->name = "iqs269a_keypad"; in iqs269_input_init()
1075 iqs269->keypad->id.bustype = BUS_I2C; in iqs269_input_init()
1078 sw_code = iqs269->switches[i].code; in iqs269_input_init()
1081 keycode = iqs269->keycode[i * IQS269_NUM_CH + j]; in iqs269_input_init()
1084 * Hall-effect sensing repurposes a pair of dedicated in iqs269_input_init()
1089 if (iqs269->hall_enable && in iqs269_input_init()
1090 iqs269->switches[i].enabled) in iqs269_input_init()
1091 input_set_capability(iqs269->keypad, in iqs269_input_init()
1096 if (iqs269->hall_enable) in iqs269_input_init()
1102 input_set_capability(iqs269->keypad, in iqs269_input_init()
1109 if (!iqs269->sys_reg.slider_select[i]) in iqs269_input_init()
1112 iqs269->slider[i] = devm_input_allocate_device(&client->dev); in iqs269_input_init()
1113 if (!iqs269->slider[i]) in iqs269_input_init()
1114 return -ENOMEM; in iqs269_input_init()
1116 iqs269->slider[i]->name = i ? "iqs269a_slider_1" in iqs269_input_init()
1118 iqs269->slider[i]->id.bustype = BUS_I2C; in iqs269_input_init()
1120 input_set_capability(iqs269->slider[i], EV_KEY, BTN_TOUCH); in iqs269_input_init()
1121 input_set_abs_params(iqs269->slider[i], ABS_X, 0, 255, 0, 0); in iqs269_input_init()
1123 error = input_register_device(iqs269->slider[i]); in iqs269_input_init()
1125 dev_err(&client->dev, in iqs269_input_init()
1136 struct i2c_client *client = iqs269->client; in iqs269_report()
1143 error = regmap_raw_read(iqs269->regmap, IQS269_SYS_FLAGS, &flags, in iqs269_report()
1146 dev_err(&client->dev, "Failed to read device status: %d\n", in iqs269_report()
1157 dev_err(&client->dev, "Unexpected device reset\n"); in iqs269_report()
1161 dev_err(&client->dev, in iqs269_report()
1162 "Failed to re-initialize device: %d\n", error); in iqs269_report()
1170 error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, slider_x, in iqs269_report()
1173 dev_err(&client->dev, "Failed to read slider position: %d\n", in iqs269_report()
1179 if (!iqs269->sys_reg.slider_select[i]) in iqs269_report()
1187 iqs269->sys_reg.slider_select[i]) { in iqs269_report()
1188 input_report_key(iqs269->slider[i], BTN_TOUCH, 1); in iqs269_report()
1189 input_report_abs(iqs269->slider[i], ABS_X, slider_x[i]); in iqs269_report()
1191 input_report_key(iqs269->slider[i], BTN_TOUCH, 0); in iqs269_report()
1194 input_sync(iqs269->slider[i]); in iqs269_report()
1204 sw_code = iqs269->switches[i].code; in iqs269_report()
1207 keycode = iqs269->keycode[i * IQS269_NUM_CH + j]; in iqs269_report()
1211 if (iqs269->hall_enable && in iqs269_report()
1212 iqs269->switches[i].enabled) in iqs269_report()
1213 input_report_switch(iqs269->keypad, in iqs269_report()
1219 if (iqs269->hall_enable) in iqs269_report()
1224 input_report_key(iqs269->keypad, keycode, in iqs269_report()
1230 input_sync(iqs269->keypad); in iqs269_report()
1236 complete_all(&iqs269->ati_done); in iqs269_report()
1262 struct i2c_client *client = iqs269->client; in counts_show()
1266 if (!iqs269->ati_current || iqs269->hall_enable) in counts_show()
1267 return -EPERM; in counts_show()
1269 if (!completion_done(&iqs269->ati_done)) in counts_show()
1270 return -EBUSY; in counts_show()
1277 disable_irq(client->irq); in counts_show()
1279 error = regmap_raw_read(iqs269->regmap, in counts_show()
1280 IQS269_CHx_COUNTS + iqs269->ch_num * 2, in counts_show()
1284 enable_irq(client->irq); in counts_show()
1296 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in hall_bin_show()
1297 struct i2c_client *client = iqs269->client; in hall_bin_show()
1301 disable_irq(client->irq); in hall_bin_show()
1303 error = regmap_read(iqs269->regmap, IQS269_CAL_DATA_A, &val); in hall_bin_show()
1306 enable_irq(client->irq); in hall_bin_show()
1324 return -EINVAL; in hall_bin_show()
1335 return scnprintf(buf, PAGE_SIZE, "%u\n", iqs269->hall_enable); in hall_enable_show()
1350 mutex_lock(&iqs269->lock); in hall_enable_store()
1352 iqs269->hall_enable = val; in hall_enable_store()
1353 iqs269->ati_current = false; in hall_enable_store()
1355 mutex_unlock(&iqs269->lock); in hall_enable_store()
1365 return scnprintf(buf, PAGE_SIZE, "%u\n", iqs269->ch_num); in ch_number_show()
1381 return -EINVAL; in ch_number_store()
1383 iqs269->ch_num = val; in ch_number_store()
1392 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in rx_enable_show()
1395 ch_reg[iqs269->ch_num].rx_enable); in rx_enable_show()
1403 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; in rx_enable_store()
1412 return -EINVAL; in rx_enable_store()
1414 mutex_lock(&iqs269->lock); in rx_enable_store()
1416 ch_reg[iqs269->ch_num].rx_enable = val; in rx_enable_store()
1417 iqs269->ati_current = false; in rx_enable_store()
1419 mutex_unlock(&iqs269->lock); in rx_enable_store()
1431 error = iqs269_ati_mode_get(iqs269, iqs269->ch_num, &val); in ati_mode_show()
1450 error = iqs269_ati_mode_set(iqs269, iqs269->ch_num, val); in ati_mode_store()
1464 error = iqs269_ati_base_get(iqs269, iqs269->ch_num, &val); in ati_base_show()
1483 error = iqs269_ati_base_set(iqs269, iqs269->ch_num, val); in ati_base_store()
1497 error = iqs269_ati_target_get(iqs269, iqs269->ch_num, &val); in ati_target_show()
1516 error = iqs269_ati_target_set(iqs269, iqs269->ch_num, val); in ati_target_store()
1529 iqs269->ati_current && in ati_trigger_show()
1530 completion_done(&iqs269->ati_done)); in ati_trigger_show()
1538 struct i2c_client *client = iqs269->client; in ati_trigger_store()
1549 disable_irq(client->irq); in ati_trigger_store()
1550 reinit_completion(&iqs269->ati_done); in ati_trigger_store()
1555 enable_irq(client->irq); in ati_trigger_store()
1560 if (!wait_for_completion_timeout(&iqs269->ati_done, in ati_trigger_store()
1562 return -ETIMEDOUT; in ati_trigger_store()
1606 iqs269 = devm_kzalloc(&client->dev, sizeof(*iqs269), GFP_KERNEL); in iqs269_probe()
1608 return -ENOMEM; in iqs269_probe()
1611 iqs269->client = client; in iqs269_probe()
1613 iqs269->regmap = devm_regmap_init_i2c(client, &iqs269_regmap_config); in iqs269_probe()
1614 if (IS_ERR(iqs269->regmap)) { in iqs269_probe()
1615 error = PTR_ERR(iqs269->regmap); in iqs269_probe()
1616 dev_err(&client->dev, "Failed to initialize register map: %d\n", in iqs269_probe()
1621 mutex_init(&iqs269->lock); in iqs269_probe()
1622 init_completion(&iqs269->ati_done); in iqs269_probe()
1624 error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &ver_info, in iqs269_probe()
1630 dev_err(&client->dev, "Unrecognized product number: 0x%02X\n", in iqs269_probe()
1632 return -EINVAL; in iqs269_probe()
1641 dev_err(&client->dev, "Failed to initialize device: %d\n", in iqs269_probe()
1650 error = devm_request_threaded_irq(&client->dev, client->irq, in iqs269_probe()
1652 client->name, iqs269); in iqs269_probe()
1654 dev_err(&client->dev, "Failed to request IRQ: %d\n", error); in iqs269_probe()
1658 if (!wait_for_completion_timeout(&iqs269->ati_done, in iqs269_probe()
1660 dev_err(&client->dev, "Failed to complete ATI\n"); in iqs269_probe()
1661 return -ETIMEDOUT; in iqs269_probe()
1668 error = input_register_device(iqs269->keypad); in iqs269_probe()
1670 dev_err(&client->dev, "Failed to register keypad: %d\n", error); in iqs269_probe()
1674 error = devm_device_add_group(&client->dev, &iqs269_attr_group); in iqs269_probe()
1676 dev_err(&client->dev, "Failed to add attributes: %d\n", error); in iqs269_probe()
1683 u16 general = be16_to_cpu(iqs269->sys_reg.general); in iqs269_general_get()
1694 struct i2c_client *client = iqs269->client; in iqs269_suspend()
1701 disable_irq(client->irq); in iqs269_suspend()
1703 error = regmap_write(iqs269->regmap, IQS269_SYS_SETTINGS, general); in iqs269_suspend()
1706 enable_irq(client->irq); in iqs269_suspend()
1714 struct i2c_client *client = iqs269->client; in iqs269_resume()
1721 disable_irq(client->irq); in iqs269_resume()
1723 error = regmap_write(iqs269->regmap, IQS269_SYS_SETTINGS, in iqs269_resume()
1726 error = regmap_write(iqs269->regmap, IQS269_SYS_SETTINGS, in iqs269_resume()
1730 enable_irq(client->irq); in iqs269_resume()