@ -439,9 +439,8 @@ int lis2dh_init_chip(const struct device *dev)
( uint8_t ) LIS2DH_LP_EN_BIT , lis2dh - > scale ) ;
( uint8_t ) LIS2DH_LP_EN_BIT , lis2dh - > scale ) ;
/* enable accel measurements and set power mode and data rate */
/* enable accel measurements and set power mode and data rate */
return lis2dh - > hw_tf - > write_reg ( dev , LIS2DH_REG_CTRL1 ,
lis2dh - > reg_ctrl1_active_val = LIS2DH_ACCEL_EN_BITS | LIS2DH_LP_EN_BIT | LIS2DH_ODR_BITS ;
LIS2DH_ACCEL_EN_BITS | LIS2DH_LP_EN_BIT |
return lis2dh - > hw_tf - > write_reg ( dev , LIS2DH_REG_CTRL1 , lis2dh - > reg_ctrl1_active_val ) ;
LIS2DH_ODR_BITS ) ;
}
}
static int lis2dh_pm_action ( const struct device * dev ,
static int lis2dh_pm_action ( const struct device * dev ,
@ -467,7 +466,7 @@ static int lis2dh_pm_action(const struct device *dev,
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 ) ;
if ( status < 0 ) {
if ( status < 0 ) {
LOG_ERR ( " failed to write reg_cr tl1 " ) ;
LOG_ERR ( " failed to write reg_ctr l1 " ) ;
return status ;
return status ;
}
}
break ;
break ;
@ -476,13 +475,13 @@ static int lis2dh_pm_action(const struct device *dev,
status = lis2dh - > hw_tf - > read_reg ( dev , LIS2DH_REG_CTRL1 ,
status = lis2dh - > hw_tf - > read_reg ( dev , LIS2DH_REG_CTRL1 ,
& lis2dh - > reg_ctrl1_active_val ) ;
& lis2dh - > reg_ctrl1_active_val ) ;
if ( status < 0 ) {
if ( status < 0 ) {
LOG_ERR ( " failed to read reg_cr tl1 " ) ;
LOG_ERR ( " failed to read reg_ctr l1 " ) ;
return status ;
return status ;
}
}
status = lis2dh - > hw_tf - > write_reg ( dev , LIS2DH_REG_CTRL1 ,
status = lis2dh - > hw_tf - > write_reg ( dev , LIS2DH_REG_CTRL1 ,
LIS2DH_SUSPEND ) ;
LIS2DH_SUSPEND ) ;
if ( status < 0 ) {
if ( status < 0 ) {
LOG_ERR ( " failed to write reg_cr tl1 " ) ;
LOG_ERR ( " failed to write reg_ctr l1 " ) ;
return status ;
return status ;
}
}
break ;
break ;