mec1322: Properly initialize the ALTERNATE GPIO level flags

Initialise the ALTERNATE GPIO level flags along with rest of the flags
to prevent GPIO toggling during I2C initialization.

BUG=chrome-os-partner:44821
BRANCH=none
TEST=Manually tested on Kunimitsu FAB3.
     I2C SDA & SCL lines do not toggle during I2C initialization.
     Soon after the I2C init is done, read/write to PMIC is success.

Change-Id: I70f728017b00f407a0422fd4aa4dbfd8590d74de
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/298242
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Kevin K Wong
2015-09-08 16:28:20 -07:00
committed by chrome-bot
parent 8900884cad
commit aca33e4de2
2 changed files with 6 additions and 10 deletions

View File

@@ -323,12 +323,7 @@ static void board_pmic_init(void)
if (i2c_write8(I2C_PORT_PMIC, TPS650830_I2C_ADDR, 0xE5, 0x5))
CPRINTS("PMIC write failed");
}
/*
* TODO (crosbug.com/p/44821): Do the PMIC initialization soon after the I2C
* initialization is done.
* DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_INIT_I2C + 1);
*/
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_pmic_init, HOOK_PRIO_DEFAULT + 1);
DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_INIT_I2C + 1);
/* Initialize board. */
static void board_init(void)

View File

@@ -131,12 +131,13 @@ void gpio_set_flags_by_mask(uint32_t port, uint32_t mask, uint32_t flags)
/* Use as GPIO */
val &= ~((1 << 12) | (1 << 13));
MEC1322_GPIO_CTL(port, i) = val;
/* Set up level */
if (flags & GPIO_HIGH)
MEC1322_GPIO_CTL(port, i) |= (1 << 16);
val |= (1 << 16);
else if (flags & GPIO_LOW)
MEC1322_GPIO_CTL(port, i) &= ~(1 << 16);
val &= ~(1 << 16);
MEC1322_GPIO_CTL(port, i) = val;
}
}