Lines Matching +full:proximity +full:- +full:gain
1 /* sensor_sx9500.c - Driver for Semtech SX9500 SAR proximity chip */
6 * SPDX-License-Identifier: Apache-2.0
28 * auto-increments the address for subsequent values in a single
34 0x77, /* x8 gain, 167kHz frequency, finest resolution. */
40 0x0e, /* Proximity detection threshold: 280 */
42 * independently, proximity hysteresis: 32, close
51 struct sx9500_data *data = dev->data; in sx9500_sample_fetch()
52 const struct sx9500_config *cfg = dev->config; in sx9500_sample_fetch()
56 return i2c_reg_read_byte_dt(&cfg->i2c, SX9500_REG_STAT, &data->prox_stat); in sx9500_sample_fetch()
63 struct sx9500_data *data = (struct sx9500_data *) dev->data; in sx9500_channel_get()
68 return -ENOTSUP; in sx9500_channel_get()
71 val->val1 = !!(data->prox_stat & in sx9500_channel_get()
73 val->val2 = 0; in sx9500_channel_get()
88 const struct sx9500_config *cfg = dev->config; in sx9500_init_chip()
91 if (i2c_write_dt(&cfg->i2c, sx9500_reg_defaults, in sx9500_init_chip()
94 return -EIO; in sx9500_init_chip()
100 if (i2c_reg_write_byte_dt(&cfg->i2c, SX9500_REG_IRQ_MSK, 0) < 0) { in sx9500_init_chip()
101 return -EIO; in sx9500_init_chip()
105 if (i2c_reg_read_byte_dt(&cfg->i2c, SX9500_REG_IRQ_SRC, &val) < 0) { in sx9500_init_chip()
106 return -EIO; in sx9500_init_chip()
109 return i2c_reg_write_byte_dt(&cfg->i2c, SX9500_REG_PROX_CTRL0, in sx9500_init_chip()
115 const struct sx9500_config *cfg = dev->config; in sx9500_init()
117 if (!device_is_ready(cfg->i2c.bus)) { in sx9500_init()
119 return -ENODEV; in sx9500_init()
124 return -EINVAL; in sx9500_init()
128 if (cfg->int_gpio.port) { in sx9500_init()
131 return -EINVAL; in sx9500_init()