Skip to content

Commit a673871

Browse files
Kampinashif
authored andcommitted
drivers: sensor: Remove broken reset from apds9306 driver
The reset may cause initialization issues because of a missing ACK from the sensor. The error check for the I2C communication is removed to avoid issues during the initialization. Closes #89850 Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
1 parent 62ea066 commit a673871

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/sensor/apds9306/apds9306.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,19 +302,12 @@ static int apds9306_sensor_setup(const struct device *dev)
302302
}
303303

304304
/* Reset the sensor. */
305-
if (i2c_reg_write_byte_dt(&config->i2c, APDS9306_REGISTER_MAIN_CTRL,
306-
APDS9306_BIT_SW_RESET)) {
307-
LOG_ERR("Can not reset the sensor!");
308-
return -EFAULT;
309-
}
305+
i2c_reg_write_byte_dt(&config->i2c, APDS9306_REGISTER_MAIN_CTRL, APDS9306_BIT_SW_RESET);
310306
k_msleep(10);
311307

312308
/* Perform a dummy read to avoid bus errors after the reset. See */
313309
/* https://lore.kernel.org/lkml/ab1d9746-4d23-efcc-0ee1-d2b8c634becd@tweaklogic.com/ */
314-
if (i2c_reg_read_byte_dt(&config->i2c, APDS9306_REGISTER_PART_ID, &temp)) {
315-
LOG_ERR("Failed reading chip id!");
316-
return -EFAULT;
317-
}
310+
i2c_reg_read_byte_dt(&config->i2c, APDS9306_REGISTER_PART_ID, &temp);
318311

319312
return 0;
320313
}

0 commit comments

Comments
 (0)