Commit 42822844 authored by Benjamin Gaignard's avatar Benjamin Gaignard Committed by Yann Gautier
Browse files

fix(drivers/st/pmic): initialize i2c_state



Make sure that i2c->i2c_state is correctly initialized
with I2C_STATE_RESET value this avoid hi2c->lock to not
be set to 0 when calling stm32_i2c_init during platform
suspend/resume operations.

Change-Id: I3b4c1f9115589325eb256789a1764c322741db7d
Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent 8f97c4fa
/* /*
* Copyright (c) 2017-2019, STMicroelectronics - All Rights Reserved * Copyright (c) 2017-2021, STMicroelectronics - All Rights Reserved
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -204,6 +204,7 @@ bool initialize_pmic_i2c(void) ...@@ -204,6 +204,7 @@ bool initialize_pmic_i2c(void)
i2c->i2c_base_addr = i2c_info.base; i2c->i2c_base_addr = i2c_info.base;
i2c->dt_status = i2c_info.status; i2c->dt_status = i2c_info.status;
i2c->clock = i2c_info.clock; i2c->clock = i2c_info.clock;
i2c->i2c_state = I2C_STATE_RESET;
i2c_init.own_address1 = pmic_i2c_addr; i2c_init.own_address1 = pmic_i2c_addr;
i2c_init.addressing_mode = I2C_ADDRESSINGMODE_7BIT; i2c_init.addressing_mode = I2C_ADDRESSINGMODE_7BIT;
i2c_init.dual_address_mode = I2C_DUALADDRESS_DISABLE; i2c_init.dual_address_mode = I2C_DUALADDRESS_DISABLE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment