Lines Matching +full:res +full:- +full:cpi
4 * SPDX-License-Identifier: Apache-2.0
82 const struct paw32xx_config *cfg = dev->config; in paw32xx_read_reg()
108 return spi_transceive_dt(&cfg->spi, &tx, &rx); in paw32xx_read_reg()
113 const struct paw32xx_config *cfg = dev->config; in paw32xx_write_reg()
125 return spi_write_dt(&cfg->spi, &tx); in paw32xx_write_reg()
150 const struct paw32xx_config *cfg = dev->config; in paw32xx_read_xy()
181 ret = spi_transceive_dt(&cfg->spi, &tx, &rx); in paw32xx_read_xy()
189 *x = sign_extend(*x, PAW32XX_DATA_SIZE_BITS - 1); in paw32xx_read_xy()
190 *y = sign_extend(*y, PAW32XX_DATA_SIZE_BITS - 1); in paw32xx_read_xy()
199 const struct device *dev = data->dev; in paw32xx_motion_work_handler()
200 const struct paw32xx_config *cfg = dev->config; in paw32xx_motion_work_handler()
221 input_report_rel(data->dev, cfg->axis_x, x, false, K_FOREVER); in paw32xx_motion_work_handler()
222 input_report_rel(data->dev, cfg->axis_y, y, true, K_FOREVER); in paw32xx_motion_work_handler()
225 if (gpio_pin_get_dt(&cfg->motion_gpio)) { in paw32xx_motion_work_handler()
226 k_work_submit(&data->motion_work); in paw32xx_motion_work_handler()
237 k_work_submit(&data->motion_work); in paw32xx_motion_handler()
247 return -EINVAL; in paw32xx_set_resolution()
301 const struct paw32xx_config *cfg = dev->config; in paw32xx_configure()
312 return -ENOTSUP; in paw32xx_configure()
323 if (cfg->invert_x || cfg->invert_y) { in paw32xx_configure()
334 WRITE_BIT(val, MOUSE_OPTION_MOVX_INV_BIT, cfg->invert_x); in paw32xx_configure()
335 WRITE_BIT(val, MOUSE_OPTION_MOVY_INV_BIT, cfg->invert_y); in paw32xx_configure()
348 if (cfg->res_cpi > 0) { in paw32xx_configure()
349 paw32xx_set_resolution(dev, cfg->res_cpi); in paw32xx_configure()
352 paw32xx_force_awake(dev, cfg->force_awake); in paw32xx_configure()
359 const struct paw32xx_config *cfg = dev->config; in paw32xx_init()
360 struct paw32xx_data *data = dev->data; in paw32xx_init()
363 if (!spi_is_ready_dt(&cfg->spi)) { in paw32xx_init()
364 LOG_ERR("%s is not ready", cfg->spi.bus->name); in paw32xx_init()
365 return -ENODEV; in paw32xx_init()
368 data->dev = dev; in paw32xx_init()
370 k_work_init(&data->motion_work, paw32xx_motion_work_handler); in paw32xx_init()
372 if (!gpio_is_ready_dt(&cfg->motion_gpio)) { in paw32xx_init()
373 LOG_ERR("%s is not ready", cfg->motion_gpio.port->name); in paw32xx_init()
374 return -ENODEV; in paw32xx_init()
377 ret = gpio_pin_configure_dt(&cfg->motion_gpio, GPIO_INPUT); in paw32xx_init()
383 gpio_init_callback(&data->motion_cb, paw32xx_motion_handler, in paw32xx_init()
384 BIT(cfg->motion_gpio.pin)); in paw32xx_init()
386 ret = gpio_add_callback_dt(&cfg->motion_gpio, &data->motion_cb); in paw32xx_init()
398 ret = gpio_pin_interrupt_configure_dt(&cfg->motion_gpio, in paw32xx_init()
429 return -ENOTSUP; in paw32xx_pm_action()
447 RES_MIN, RES_MAX), "invalid res-cpi"); \
454 .res_cpi = DT_INST_PROP_OR(n, res_cpi, -1), \