Lines Matching +full:beta +full:- +full:compensation
1 // SPDX-License-Identifier: GPL-2.0-or-later
116 [IQS7222_REG_GRP_CYCLE] = "cycle-%d",
117 [IQS7222_REG_GRP_CHAN] = "channel-%d",
118 [IQS7222_REG_GRP_SLDR] = "slider-%d",
120 [IQS7222_REG_GRP_GPIO] = "gpio-%d",
150 .name = "event-prox",
155 .name = "event-touch",
162 { .name = "event-press", },
164 .name = "event-tap",
171 .name = "event-swipe-pos",
178 .name = "event-swipe-neg",
185 .name = "event-flick-pos",
192 .name = "event-flick-neg",
202 .name = "event-press",
206 .name = "event-tap",
214 .name = "event-swipe-x-pos",
223 .name = "event-swipe-y-pos",
232 .name = "event-swipe-x-neg",
241 .name = "event-swipe-y-neg",
250 .name = "event-flick-x-pos",
259 .name = "event-flick-y-pos",
268 .name = "event-flick-x-neg",
277 .name = "event-flick-y-neg",
697 .name = "azoteq,conv-period",
705 .name = "azoteq,conv-frac",
713 .name = "azoteq,rx-float-inactive",
721 .name = "azoteq,dead-time-enable",
728 .name = "azoteq,tx-freq-fosc",
735 .name = "azoteq,vbias-enable",
742 .name = "azoteq,sense-mode",
751 .name = "azoteq,iref-enable",
758 .name = "azoteq,iref-level",
766 .name = "azoteq,iref-trim",
774 .name = "azoteq,max-counts",
782 .name = "azoteq,auto-mode",
790 .name = "azoteq,ati-frac-div-fine",
798 .name = "azoteq,ati-frac-div-coarse",
806 .name = "azoteq,ati-comp-select",
811 .label = "ATI compensation selection",
814 .name = "azoteq,ati-band",
822 .name = "azoteq,global-halt",
829 .name = "azoteq,invert-enable",
836 .name = "azoteq,dual-direction",
843 .name = "azoteq,samp-cap-double",
850 .name = "azoteq,vref-half",
857 .name = "azoteq,proj-bias",
865 .name = "azoteq,ati-target",
874 .name = "azoteq,ati-base",
883 .name = "azoteq,ati-mode",
892 .name = "azoteq,ati-frac-div-fine",
900 .name = "azoteq,ati-frac-mult-coarse",
908 .name = "azoteq,ati-frac-div-coarse",
916 .name = "azoteq,ati-comp-div",
921 .label = "ATI compensation divider",
924 .name = "azoteq,ati-comp-select",
929 .label = "ATI compensation selection",
932 .name = "azoteq,debounce-exit",
941 .name = "azoteq,debounce-enter",
978 .name = "azoteq,lta-beta-lp",
983 .label = "low-power mode long-term average beta",
986 .name = "azoteq,lta-beta-np",
991 .label = "normal-power mode long-term average beta",
994 .name = "azoteq,counts-beta-lp",
999 .label = "low-power mode counts beta",
1002 .name = "azoteq,counts-beta-np",
1007 .label = "normal-power mode counts beta",
1010 .name = "azoteq,lta-fast-beta-lp",
1015 .label = "low-power mode long-term average fast beta",
1018 .name = "azoteq,lta-fast-beta-np",
1023 .label = "normal-power mode long-term average fast beta",
1026 .name = "azoteq,lower-cal",
1034 .name = "azoteq,static-beta",
1042 .name = "azoteq,bottom-beta",
1048 .label = "bottom beta",
1051 .name = "azoteq,static-beta",
1059 .name = "azoteq,bottom-beta",
1065 .label = "bottom beta",
1068 .name = "azoteq,bottom-speed",
1076 .name = "azoteq,upper-cal",
1084 .name = "azoteq,gesture-max-ms",
1094 .name = "azoteq,gesture-max-ms",
1104 .name = "azoteq,gesture-min-ms",
1114 .name = "azoteq,gesture-min-ms",
1124 .name = "azoteq,gesture-dist",
1134 .name = "azoteq,gesture-dist",
1144 .name = "azoteq,gesture-max-ms",
1154 .name = "azoteq,gesture-max-ms",
1164 .name = "azoteq,num-rows",
1174 .name = "azoteq,num-cols",
1184 .name = "azoteq,lower-cal-y",
1192 .name = "azoteq,lower-cal-x",
1200 .name = "azoteq,upper-cal-y",
1208 .name = "azoteq,upper-cal-x",
1216 .name = "azoteq,top-speed",
1225 .name = "azoteq,bottom-speed",
1233 .name = "azoteq,gesture-min-ms",
1243 .name = "azoteq,gesture-max-ms",
1253 .name = "azoteq,gesture-max-ms",
1263 .name = "azoteq,gesture-dist",
1272 .name = "azoteq,gesture-dist",
1281 .name = "drive-open-drain",
1288 .name = "azoteq,timeout-ati-ms",
1297 .name = "azoteq,rate-ati-ms",
1305 .name = "azoteq,timeout-np-ms",
1310 .label = "normal-power mode timeout",
1313 .name = "azoteq,rate-np-ms",
1319 .label = "normal-power mode report rate",
1322 .name = "azoteq,timeout-lp-ms",
1327 .label = "low-power mode timeout",
1330 .name = "azoteq,rate-lp-ms",
1336 .label = "low-power mode report rate",
1339 .name = "azoteq,timeout-ulp-ms",
1344 .label = "ultra-low-power mode timeout",
1347 .name = "azoteq,rate-ulp-ms",
1353 .label = "ultra-low-power mode report rate",
1385 return iqs7222->cycle_setup[row]; in iqs7222_setup()
1388 return iqs7222->glbl_setup; in iqs7222_setup()
1391 return iqs7222->btn_setup[row]; in iqs7222_setup()
1394 return iqs7222->chan_setup[row]; in iqs7222_setup()
1397 return iqs7222->filt_setup; in iqs7222_setup()
1400 return iqs7222->sldr_setup[row]; in iqs7222_setup()
1403 return iqs7222->tpad_setup; in iqs7222_setup()
1406 return iqs7222->gpio_setup[row]; in iqs7222_setup()
1409 return iqs7222->sys_setup; in iqs7222_setup()
1424 ret = gpiod_get_value_cansleep(iqs7222->irq_gpio); in iqs7222_irq_poll()
1431 return -EBUSY; in iqs7222_irq_poll()
1436 struct i2c_client *client = iqs7222->client; in iqs7222_hard_reset()
1439 if (!iqs7222->reset_gpio) in iqs7222_hard_reset()
1442 gpiod_set_value_cansleep(iqs7222->reset_gpio, 1); in iqs7222_hard_reset()
1445 gpiod_set_value_cansleep(iqs7222->reset_gpio, 0); in iqs7222_hard_reset()
1449 dev_err(&client->dev, "Failed to reset device: %d\n", error); in iqs7222_hard_reset()
1461 * pin. Attempts to do so while RDY is deasserted return an ACK; how- in iqs7222_force_comms()
1464 * Unsolicited communication must be preceded by a special force com- in iqs7222_force_comms()
1472 ret = gpiod_get_value_cansleep(iqs7222->irq_gpio); in iqs7222_force_comms()
1478 ret = i2c_master_send(iqs7222->client, msg_buf, sizeof(msg_buf)); in iqs7222_force_comms()
1481 ret = -EIO; in iqs7222_force_comms()
1499 struct i2c_client *client = iqs7222->client; in iqs7222_read_burst()
1502 .addr = client->addr, in iqs7222_read_burst()
1508 .addr = client->addr, in iqs7222_read_burst()
1530 ret = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg)); in iqs7222_read_burst()
1533 ret = -EIO; in iqs7222_read_burst()
1540 ret = -ENODATA; in iqs7222_read_burst()
1555 dev_err(&client->dev, in iqs7222_read_burst()
1582 struct i2c_client *client = iqs7222->client; in iqs7222_write_burst()
1587 return -ENOMEM; in iqs7222_write_burst()
1613 ret = -EIO; in iqs7222_write_burst()
1628 dev_err(&client->dev, in iqs7222_write_burst()
1643 struct i2c_client *client = iqs7222->client; in iqs7222_ati_trigger()
1661 * Trigger ATI from streaming and normal-power modes so that in iqs7222_ati_trigger()
1693 * Use stream-in-touch mode if either slider reports in iqs7222_ati_trigger()
1696 sys_setup |= test_bit(EV_ABS, iqs7222->keypad->evbit) in iqs7222_ati_trigger()
1705 dev_err(&client->dev, in iqs7222_ati_trigger()
1711 return -ETIMEDOUT; in iqs7222_ati_trigger()
1716 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_dev_init()
1717 int comms_offset = dev_desc->comms_offset; in iqs7222_dev_init()
1723 * may change the reserved fields of the second filter beta register, in iqs7222_dev_init()
1726 * Writing the second filter beta register, in turn, may clobber the in iqs7222_dev_init()
1727 * system status register. As such, the filter beta register pair is in iqs7222_dev_init()
1731 u16 reg = dev_desc->reg_grps[IQS7222_REG_GRP_FILT].base + 1; in iqs7222_dev_init()
1735 iqs7222->sys_setup[0] | in iqs7222_dev_init()
1744 iqs7222->filt_setup[1] &= GENMASK(7, 0); in iqs7222_dev_init()
1745 iqs7222->filt_setup[1] |= (filt_setup & ~GENMASK(7, 0)); in iqs7222_dev_init()
1749 * Take advantage of the stop-bit disable function, if available, to in iqs7222_dev_init()
1770 int num_row = dev_desc->reg_grps[i].num_row; in iqs7222_dev_init()
1771 int num_col = dev_desc->reg_grps[i].num_col; in iqs7222_dev_init()
1772 u16 reg = dev_desc->reg_grps[i].base; in iqs7222_dev_init()
1785 return -ENOMEM; in iqs7222_dev_init()
1804 error = -EINVAL; in iqs7222_dev_init()
1837 iqs7222->sys_setup[0] &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; in iqs7222_dev_init()
1838 iqs7222->sys_setup[0] &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; in iqs7222_dev_init()
1847 struct i2c_client *client = iqs7222->client; in iqs7222_dev_info()
1869 iqs7222->dev_desc = &iqs7222_devs[i]; in iqs7222_dev_info()
1874 dev_err(&client->dev, "Unsupported firmware revision: %u.%u\n", in iqs7222_dev_info()
1877 dev_err(&client->dev, "Unrecognized product number: %u\n", in iqs7222_dev_info()
1880 return -EINVAL; in iqs7222_dev_info()
1887 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_gpio_select()
1888 struct i2c_client *client = iqs7222->client; in iqs7222_gpio_select()
1889 int num_gpio = dev_desc->reg_grps[IQS7222_REG_GRP_GPIO].num_row; in iqs7222_gpio_select()
1896 if (!fwnode_property_present(child_node, "azoteq,gpio-select")) in iqs7222_gpio_select()
1899 count = fwnode_property_count_u32(child_node, "azoteq,gpio-select"); in iqs7222_gpio_select()
1901 dev_err(&client->dev, "Invalid number of %s GPIOs\n", in iqs7222_gpio_select()
1903 return -EINVAL; in iqs7222_gpio_select()
1905 dev_err(&client->dev, "Failed to count %s GPIOs: %d\n", in iqs7222_gpio_select()
1911 "azoteq,gpio-select", in iqs7222_gpio_select()
1914 dev_err(&client->dev, "Failed to read %s GPIOs: %d\n", in iqs7222_gpio_select()
1923 dev_err(&client->dev, "Invalid %s GPIO: %u\n", in iqs7222_gpio_select()
1925 return -EINVAL; in iqs7222_gpio_select()
1928 gpio_setup = iqs7222->gpio_setup[gpio_sel[i]]; in iqs7222_gpio_select()
1931 dev_err(&client->dev, in iqs7222_gpio_select()
1934 return -EINVAL; in iqs7222_gpio_select()
1952 struct i2c_client *client = iqs7222->client; in iqs7222_parse_props()
2004 dev_err(&client->dev, "Failed to read %s %s: %d\n", in iqs7222_parse_props()
2010 val_max = GENMASK(reg_width - 1, 0) * val_pitch; in iqs7222_parse_props()
2013 dev_err(&client->dev, "Invalid %s %s: %u\n", in iqs7222_parse_props()
2015 return -EINVAL; in iqs7222_parse_props()
2018 setup[reg_offset] &= ~GENMASK(reg_shift + reg_width - 1, in iqs7222_parse_props()
2035 struct i2c_client *client = iqs7222->client; in iqs7222_parse_event()
2049 if (error == -EINVAL) { in iqs7222_parse_event()
2052 dev_err(&client->dev, "Failed to read %s code: %d\n", in iqs7222_parse_event()
2058 input_set_capability(iqs7222->keypad, EV_KEY, *event_code); in iqs7222_parse_event()
2062 error = fwnode_property_read_u32(event_node, "linux,input-type", in iqs7222_parse_event()
2064 if (error == -EINVAL) { in iqs7222_parse_event()
2067 dev_err(&client->dev, "Failed to read %s input type: %d\n", in iqs7222_parse_event()
2071 dev_err(&client->dev, "Invalid %s input type: %d\n", in iqs7222_parse_event()
2073 return -EINVAL; in iqs7222_parse_event()
2076 input_set_capability(iqs7222->keypad, *event_type, *event_code); in iqs7222_parse_event()
2084 u16 *cycle_setup = iqs7222->cycle_setup[cycle_index]; in iqs7222_parse_cycle()
2085 struct i2c_client *client = iqs7222->client; in iqs7222_parse_cycle()
2096 * CTx pins (CTx0-8). in iqs7222_parse_cycle()
2098 if (!fwnode_property_present(cycle_node, "azoteq,tx-enable")) in iqs7222_parse_cycle()
2101 count = fwnode_property_count_u32(cycle_node, "azoteq,tx-enable"); in iqs7222_parse_cycle()
2103 dev_err(&client->dev, "Failed to count %s CTx pins: %d\n", in iqs7222_parse_cycle()
2107 dev_err(&client->dev, "Invalid number of %s CTx pins\n", in iqs7222_parse_cycle()
2109 return -EINVAL; in iqs7222_parse_cycle()
2112 error = fwnode_property_read_u32_array(cycle_node, "azoteq,tx-enable", in iqs7222_parse_cycle()
2115 dev_err(&client->dev, "Failed to read %s CTx pins: %d\n", in iqs7222_parse_cycle()
2120 cycle_setup[1] &= ~GENMASK(7 + ARRAY_SIZE(pins) - 1, 7); in iqs7222_parse_cycle()
2124 dev_err(&client->dev, "Invalid %s CTx pin: %u\n", in iqs7222_parse_cycle()
2126 return -EINVAL; in iqs7222_parse_cycle()
2138 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_parse_chan()
2139 struct i2c_client *client = iqs7222->client; in iqs7222_parse_chan()
2140 int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; in iqs7222_parse_chan()
2143 u16 *chan_setup = iqs7222->chan_setup[chan_index]; in iqs7222_parse_chan()
2144 u16 *sys_setup = iqs7222->sys_setup; in iqs7222_parse_chan()
2147 if (dev_desc->allow_offset && in iqs7222_parse_chan()
2148 fwnode_property_present(chan_node, "azoteq,ulp-allow")) in iqs7222_parse_chan()
2149 sys_setup[dev_desc->allow_offset] &= ~BIT(chan_index); in iqs7222_parse_chan()
2157 if (dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_col > 4 && in iqs7222_parse_chan()
2158 fwnode_property_present(chan_node, "azoteq,ref-select")) { in iqs7222_parse_chan()
2161 error = fwnode_property_read_u32(chan_node, "azoteq,ref-select", in iqs7222_parse_chan()
2164 dev_err(&client->dev, in iqs7222_parse_chan()
2171 dev_err(&client->dev, in iqs7222_parse_chan()
2174 return -EINVAL; in iqs7222_parse_chan()
2177 ref_setup = iqs7222->chan_setup[val]; in iqs7222_parse_chan()
2186 error = fwnode_property_read_u32(chan_node, "azoteq,ref-weight", in iqs7222_parse_chan()
2190 dev_err(&client->dev, in iqs7222_parse_chan()
2193 return -EINVAL; in iqs7222_parse_chan()
2197 } else if (error != -EINVAL) { in iqs7222_parse_chan()
2198 dev_err(&client->dev, in iqs7222_parse_chan()
2211 ref_setup[4] = dev_desc->touch_link; in iqs7222_parse_chan()
2212 if (fwnode_property_present(chan_node, "azoteq,use-prox")) in iqs7222_parse_chan()
2213 ref_setup[4] -= 2; in iqs7222_parse_chan()
2214 } else if (dev_desc->reg_grps[IQS7222_REG_GRP_TPAD].num_row && in iqs7222_parse_chan()
2216 "azoteq,counts-filt-enable")) { in iqs7222_parse_chan()
2224 if (fwnode_property_present(chan_node, "azoteq,rx-enable")) { in iqs7222_parse_chan()
2227 * the channels can use CRx0-3, while the second half can use in iqs7222_parse_chan()
2228 * CRx4-7. in iqs7222_parse_chan()
2234 "azoteq,rx-enable"); in iqs7222_parse_chan()
2236 dev_err(&client->dev, in iqs7222_parse_chan()
2241 dev_err(&client->dev, in iqs7222_parse_chan()
2244 return -EINVAL; in iqs7222_parse_chan()
2248 "azoteq,rx-enable", in iqs7222_parse_chan()
2251 dev_err(&client->dev, in iqs7222_parse_chan()
2257 chan_setup[0] &= ~GENMASK(4 + ARRAY_SIZE(pins) - 1, 4); in iqs7222_parse_chan()
2263 dev_err(&client->dev, in iqs7222_parse_chan()
2266 return -EINVAL; in iqs7222_parse_chan()
2269 chan_setup[0] |= BIT(pins[i] + 4 - min_crx); in iqs7222_parse_chan()
2283 "azoteq,timeout-press-ms", in iqs7222_parse_chan()
2288 * registers as opposed to channel-specific registers. in iqs7222_parse_chan()
2290 u16 *setup = dev_desc->reg_grps in iqs7222_parse_chan()
2292 &iqs7222->btn_setup[chan_index][2] : in iqs7222_parse_chan()
2296 dev_err(&client->dev, in iqs7222_parse_chan()
2300 return -EINVAL; in iqs7222_parse_chan()
2305 } else if (error != -EINVAL) { in iqs7222_parse_chan()
2306 dev_err(&client->dev, in iqs7222_parse_chan()
2317 dev_desc->touch_link - (i ? 0 : 2), in iqs7222_parse_chan()
2318 &iqs7222->kp_type[chan_index][i], in iqs7222_parse_chan()
2319 &iqs7222->kp_code[chan_index][i]); in iqs7222_parse_chan()
2324 if (!dev_desc->event_offset) in iqs7222_parse_chan()
2327 sys_setup[dev_desc->event_offset] |= event_enable; in iqs7222_parse_chan()
2342 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_parse_sldr()
2343 struct i2c_client *client = iqs7222->client; in iqs7222_parse_sldr()
2344 int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; in iqs7222_parse_sldr()
2347 u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset]; in iqs7222_parse_sldr()
2348 u16 *sldr_setup = iqs7222->sldr_setup[sldr_index]; in iqs7222_parse_sldr()
2356 count = fwnode_property_count_u32(sldr_node, "azoteq,channel-select"); in iqs7222_parse_sldr()
2358 dev_err(&client->dev, "Failed to count %s channels: %d\n", in iqs7222_parse_sldr()
2362 dev_err(&client->dev, "Invalid number of %s channels\n", in iqs7222_parse_sldr()
2364 return -EINVAL; in iqs7222_parse_sldr()
2368 "azoteq,channel-select", in iqs7222_parse_sldr()
2371 dev_err(&client->dev, "Failed to read %s channels: %d\n", in iqs7222_parse_sldr()
2379 * the slider-related register addresses are offset by one. in iqs7222_parse_sldr()
2381 reg_offset = dev_desc->sldr_res < U16_MAX ? 0 : 1; in iqs7222_parse_sldr()
2384 sldr_setup[3 + reg_offset] &= ~GENMASK(ext_chan - 1, 0); in iqs7222_parse_sldr()
2392 dev_err(&client->dev, "Invalid %s channel: %u\n", in iqs7222_parse_sldr()
2394 return -EINVAL; in iqs7222_parse_sldr()
2405 sldr_setup[4 + reg_offset] = dev_desc->touch_link; in iqs7222_parse_sldr()
2406 if (fwnode_property_present(sldr_node, "azoteq,use-prox")) in iqs7222_parse_sldr()
2407 sldr_setup[4 + reg_offset] -= 2; in iqs7222_parse_sldr()
2409 error = fwnode_property_read_u32(sldr_node, "azoteq,slider-size", &val); in iqs7222_parse_sldr()
2411 if (val > dev_desc->sldr_res) { in iqs7222_parse_sldr()
2412 dev_err(&client->dev, "Invalid %s size: %u\n", in iqs7222_parse_sldr()
2414 return -EINVAL; in iqs7222_parse_sldr()
2424 } else if (error != -EINVAL) { in iqs7222_parse_sldr()
2425 dev_err(&client->dev, "Failed to read %s size: %d\n", in iqs7222_parse_sldr()
2432 dev_err(&client->dev, "Undefined %s size\n", in iqs7222_parse_sldr()
2434 return -EINVAL; in iqs7222_parse_sldr()
2437 error = fwnode_property_read_u32(sldr_node, "azoteq,top-speed", &val); in iqs7222_parse_sldr()
2440 dev_err(&client->dev, "Invalid %s top speed: %u\n", in iqs7222_parse_sldr()
2442 return -EINVAL; in iqs7222_parse_sldr()
2451 } else if (error != -EINVAL) { in iqs7222_parse_sldr()
2452 dev_err(&client->dev, "Failed to read %s top speed: %d\n", in iqs7222_parse_sldr()
2459 u16 sldr_max = sldr_setup[3] - 1; in iqs7222_parse_sldr()
2467 sldr_max = sldr_max * 16 - 1; in iqs7222_parse_sldr()
2470 input_set_abs_params(iqs7222->keypad, val, 0, sldr_max, 0, 0); in iqs7222_parse_sldr()
2471 iqs7222->sl_axis[sldr_index] = val; in iqs7222_parse_sldr()
2472 } else if (error != -EINVAL) { in iqs7222_parse_sldr()
2473 dev_err(&client->dev, "Failed to read %s axis: %d\n", in iqs7222_parse_sldr()
2478 if (dev_desc->wheel_enable) { in iqs7222_parse_sldr()
2479 sldr_setup[0] &= ~dev_desc->wheel_enable; in iqs7222_parse_sldr()
2480 if (iqs7222->sl_axis[sldr_index] == ABS_WHEEL) in iqs7222_parse_sldr()
2481 sldr_setup[0] |= dev_desc->wheel_enable; in iqs7222_parse_sldr()
2508 else if (dev_desc->legacy_gesture && in iqs7222_parse_sldr()
2511 else if (dev_desc->legacy_gesture && in iqs7222_parse_sldr()
2529 &iqs7222->sl_code[sldr_index][i]); in iqs7222_parse_sldr()
2537 if (!dev_desc->event_offset) in iqs7222_parse_sldr()
2547 else if (sldr_setup[4 + reg_offset] == dev_desc->touch_link) in iqs7222_parse_sldr()
2559 dev_desc->wheel_enable ? in iqs7222_parse_sldr()
2567 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_parse_tpad()
2568 struct touchscreen_properties *prop = &iqs7222->prop; in iqs7222_parse_tpad()
2569 struct i2c_client *client = iqs7222->client; in iqs7222_parse_tpad()
2570 int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; in iqs7222_parse_tpad()
2572 u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset]; in iqs7222_parse_tpad()
2573 u16 *tpad_setup = iqs7222->tpad_setup; in iqs7222_parse_tpad()
2582 count = fwnode_property_count_u32(tpad_node, "azoteq,channel-select"); in iqs7222_parse_tpad()
2584 dev_err(&client->dev, "Failed to count %s channels: %d\n", in iqs7222_parse_tpad()
2588 dev_err(&client->dev, "Invalid number of %s channels\n", in iqs7222_parse_tpad()
2590 return -EINVAL; in iqs7222_parse_tpad()
2594 "azoteq,channel-select", in iqs7222_parse_tpad()
2597 dev_err(&client->dev, "Failed to read %s channels: %d\n", in iqs7222_parse_tpad()
2602 tpad_setup[6] &= ~GENMASK(num_chan - 1, 0); in iqs7222_parse_tpad()
2610 dev_err(&client->dev, "Invalid %s channel: %u\n", in iqs7222_parse_tpad()
2612 return -EINVAL; in iqs7222_parse_tpad()
2623 tpad_setup[7] = dev_desc->touch_link; in iqs7222_parse_tpad()
2624 if (fwnode_property_present(tpad_node, "azoteq,use-prox")) in iqs7222_parse_tpad()
2625 tpad_setup[7] -= 2; in iqs7222_parse_tpad()
2640 "azoteq,gesture-angle-tighten")) in iqs7222_parse_tpad()
2650 &iqs7222->tp_code[i]); in iqs7222_parse_tpad()
2655 if (!dev_desc->event_offset) in iqs7222_parse_tpad()
2665 else if (tpad_setup[7] == dev_desc->touch_link) in iqs7222_parse_tpad()
2671 if (!iqs7222->tp_code[0]) in iqs7222_parse_tpad()
2674 input_set_abs_params(iqs7222->keypad, ABS_X, in iqs7222_parse_tpad()
2675 0, (tpad_setup[4] ? : 1) - 1, 0, 0); in iqs7222_parse_tpad()
2677 input_set_abs_params(iqs7222->keypad, ABS_Y, in iqs7222_parse_tpad()
2678 0, (tpad_setup[5] ? : 1) - 1, 0, 0); in iqs7222_parse_tpad()
2680 touchscreen_parse_properties(iqs7222->keypad, false, prop); in iqs7222_parse_tpad()
2682 if (prop->max_x >= U16_MAX || prop->max_y >= U16_MAX) { in iqs7222_parse_tpad()
2683 dev_err(&client->dev, "Invalid trackpad size: %u*%u\n", in iqs7222_parse_tpad()
2684 prop->max_x, prop->max_y); in iqs7222_parse_tpad()
2685 return -EINVAL; in iqs7222_parse_tpad()
2688 tpad_setup[4] = prop->max_x + 1; in iqs7222_parse_tpad()
2689 tpad_setup[5] = prop->max_y + 1; in iqs7222_parse_tpad()
2708 struct i2c_client *client = iqs7222->client; in iqs7222_parse_reg_grp()
2718 reg_grp_node = device_get_named_child_node(&client->dev, in iqs7222_parse_reg_grp()
2721 reg_grp_node = fwnode_handle_get(dev_fwnode(&client->dev)); in iqs7222_parse_reg_grp()
2741 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_parse_all()
2742 const struct iqs7222_reg_grp_desc *reg_grps = dev_desc->reg_grps; in iqs7222_parse_all()
2743 u16 *sys_setup = iqs7222->sys_setup; in iqs7222_parse_all()
2746 if (dev_desc->allow_offset) in iqs7222_parse_all()
2747 sys_setup[dev_desc->allow_offset] = U16_MAX; in iqs7222_parse_all()
2749 if (dev_desc->event_offset) in iqs7222_parse_all()
2750 sys_setup[dev_desc->event_offset] = IQS7222_EVENT_MASK_ATI; in iqs7222_parse_all()
2753 u16 *gpio_setup = iqs7222->gpio_setup[i]; in iqs7222_parse_all()
2773 u16 *chan_setup = iqs7222->chan_setup[i]; in iqs7222_parse_all()
2782 u16 *sldr_setup = iqs7222->sldr_setup[i]; in iqs7222_parse_all()
2800 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; in iqs7222_report()
2801 struct i2c_client *client = iqs7222->client; in iqs7222_report()
2802 int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; in iqs7222_report()
2803 int num_stat = dev_desc->reg_grps[IQS7222_REG_GRP_STAT].num_col; in iqs7222_report()
2813 dev_err(&client->dev, "Unexpected device reset\n"); in iqs7222_report()
2818 dev_err(&client->dev, "Unexpected ATI error\n"); in iqs7222_report()
2826 u16 *chan_setup = iqs7222->chan_setup[i]; in iqs7222_report()
2842 if (!iqs7222->kp_type[i][j]) in iqs7222_report()
2845 input_event(iqs7222->keypad, in iqs7222_report()
2846 iqs7222->kp_type[i][j], in iqs7222_report()
2847 iqs7222->kp_code[i][j], in iqs7222_report()
2852 for (i = 0; i < dev_desc->reg_grps[IQS7222_REG_GRP_SLDR].num_row; i++) { in iqs7222_report()
2853 u16 *sldr_setup = iqs7222->sldr_setup[i]; in iqs7222_report()
2860 if (sldr_pos < dev_desc->sldr_res) in iqs7222_report()
2861 input_report_abs(iqs7222->keypad, iqs7222->sl_axis[i], in iqs7222_report()
2864 input_report_key(iqs7222->keypad, iqs7222->sl_code[i][0], in iqs7222_report()
2865 sldr_pos < dev_desc->sldr_res); in iqs7222_report()
2871 if (dev_desc->sldr_res == U16_MAX) in iqs7222_report()
2885 input_report_key(iqs7222->keypad, in iqs7222_report()
2886 iqs7222->sl_code[i][j], in iqs7222_report()
2890 input_sync(iqs7222->keypad); in iqs7222_report()
2893 input_report_key(iqs7222->keypad, in iqs7222_report()
2894 iqs7222->sl_code[i][j], 0); in iqs7222_report()
2897 for (i = 0; i < dev_desc->reg_grps[IQS7222_REG_GRP_TPAD].num_row; i++) { in iqs7222_report()
2902 input_report_key(iqs7222->keypad, iqs7222->tp_code[0], in iqs7222_report()
2906 touchscreen_report_pos(iqs7222->keypad, &iqs7222->prop, in iqs7222_report()
2920 input_report_key(iqs7222->keypad, in iqs7222_report()
2921 iqs7222->tp_code[j], in iqs7222_report()
2925 input_sync(iqs7222->keypad); in iqs7222_report()
2928 input_report_key(iqs7222->keypad, in iqs7222_report()
2929 iqs7222->tp_code[j], 0); in iqs7222_report()
2932 input_sync(iqs7222->keypad); in iqs7222_report()
2950 iqs7222 = devm_kzalloc(&client->dev, sizeof(*iqs7222), GFP_KERNEL); in iqs7222_probe()
2952 return -ENOMEM; in iqs7222_probe()
2955 iqs7222->client = client; in iqs7222_probe()
2957 iqs7222->keypad = devm_input_allocate_device(&client->dev); in iqs7222_probe()
2958 if (!iqs7222->keypad) in iqs7222_probe()
2959 return -ENOMEM; in iqs7222_probe()
2961 iqs7222->keypad->name = client->name; in iqs7222_probe()
2962 iqs7222->keypad->id.bustype = BUS_I2C; in iqs7222_probe()
2969 iqs7222->irq_gpio = devm_gpiod_get(&client->dev, "irq", GPIOD_IN); in iqs7222_probe()
2970 if (IS_ERR(iqs7222->irq_gpio)) { in iqs7222_probe()
2971 error = PTR_ERR(iqs7222->irq_gpio); in iqs7222_probe()
2972 dev_err(&client->dev, "Failed to request IRQ GPIO: %d\n", in iqs7222_probe()
2977 iqs7222->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", in iqs7222_probe()
2979 if (IS_ERR(iqs7222->reset_gpio)) { in iqs7222_probe()
2980 error = PTR_ERR(iqs7222->reset_gpio); in iqs7222_probe()
2981 dev_err(&client->dev, "Failed to request reset GPIO: %d\n", in iqs7222_probe()
3010 error = input_register_device(iqs7222->keypad); in iqs7222_probe()
3012 dev_err(&client->dev, "Failed to register device: %d\n", error); in iqs7222_probe()
3016 irq = gpiod_to_irq(iqs7222->irq_gpio); in iqs7222_probe()
3020 irq_flags = gpiod_is_active_low(iqs7222->irq_gpio) ? IRQF_TRIGGER_LOW in iqs7222_probe()
3024 error = devm_request_threaded_irq(&client->dev, irq, NULL, iqs7222_irq, in iqs7222_probe()
3025 irq_flags, client->name, iqs7222); in iqs7222_probe()
3027 dev_err(&client->dev, "Failed to request IRQ: %d\n", error); in iqs7222_probe()