soc/intel/common/block/i2c: Set controller state to active in i2c init

Set the controller state to D0 during the i2c init sequence, this ensures
the controller is up and active.

BUG=b:135941367
TEST=Verify no timeouts seen during I2C controller enumeration sequence

Change-Id: I247ede44b8d1d6871e3e813b63f99a7f6398dd72
Signed-off-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34273
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/intel/common/block/i2c/i2c.c b/src/soc/intel/common/block/i2c/i2c.c
index d551c51..854a61a 100644
--- a/src/soc/intel/common/block/i2c/i2c.c
+++ b/src/soc/intel/common/block/i2c/i2c.c
@@ -87,6 +87,9 @@
 	/* Take device out of reset */
 	lpss_reset_release(base);
 
+	/* Ensure controller is in D0 state */
+	lpss_set_power_state(tree_dev, STATE_D0);
+
 	/* Initialize the controller */
 	if (dw_i2c_init(bus, config) < 0) {
 		printk(BIOS_ERR, "I2C%u failed to initialize\n", bus);
@@ -162,6 +165,9 @@
 	if (!base_address)
 		return;
 
+	/* Ensure controller is in D0 state */
+	lpss_set_power_state(dev, STATE_D0);
+
 	/* Take device out of reset if its not done before */
 	if (lpss_is_controller_in_reset(base_address))
 		lpss_reset_release(base_address);