drivers: lis2dh: read reference register prior to wakeup
Fixes #71371 Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
This commit is contained in:
parent
9a52efb29e
commit
ca92f96f41
1 changed files with 8 additions and 0 deletions
|
@ -437,9 +437,17 @@ static int lis2dh_pm_action(const struct device *dev,
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
struct lis2dh_data *lis2dh = dev->data;
|
struct lis2dh_data *lis2dh = dev->data;
|
||||||
|
uint8_t regdata;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case PM_DEVICE_ACTION_RESUME:
|
case PM_DEVICE_ACTION_RESUME:
|
||||||
|
/* read REFERENCE register (see datasheet rev 6 section 8.9 footnote 1) */
|
||||||
|
status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_REFERENCE, ®data);
|
||||||
|
if (status < 0) {
|
||||||
|
LOG_ERR("failed to read reg_reference");
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Resume previous mode. */
|
/* Resume previous mode. */
|
||||||
status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1,
|
status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1,
|
||||||
lis2dh->reg_ctrl1_active_val);
|
lis2dh->reg_ctrl1_active_val);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue