mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
ps8640: add delay every loop when polling ps8640 ready
add delay before and in polling ps8640 ready for reduce the frequence of polling BUG=chrome-os-partner:54897 BRANCH=none TEST=build pass elm and show ui Change-Id: I5c725eed8110ff9f545c1142ca28bcff336b6860 Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/371718 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: jitao shi <jitao.shi@mediatek.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
This commit is contained in:
parent
4db75e681a
commit
bc8c3d6f7c
1 changed files with 9 additions and 3 deletions
|
@ -60,16 +60,22 @@ int ps8640_init(uint8_t bus, uint8_t chip)
|
|||
u8 set_vdo_done;
|
||||
struct stopwatch sw;
|
||||
|
||||
stopwatch_init_msecs_expire(&sw, 350);
|
||||
mdelay(200);
|
||||
stopwatch_init_msecs_expire(&sw, 200);
|
||||
|
||||
do {
|
||||
while (true) {
|
||||
i2c_readb(bus, chip + 2, PAGE2_GPIO_H, &set_vdo_done);
|
||||
if ((set_vdo_done & PS_GPIO9) == PS_GPIO9)
|
||||
break;
|
||||
if (stopwatch_expired(&sw)) {
|
||||
printk(BIOS_INFO, "Failed to init ps8640.\n");
|
||||
return -1;
|
||||
}
|
||||
} while ((set_vdo_done & PS_GPIO9) != PS_GPIO9);
|
||||
|
||||
mdelay(20);
|
||||
}
|
||||
|
||||
mdelay(50);
|
||||
i2c_writeb(bus, chip + 3, PAGE3_SET_ADD, VDO_CTL_ADD);
|
||||
i2c_writeb(bus, chip + 3, PAGE3_SET_VAL, VDO_DIS);
|
||||
i2c_writeb(bus, chip + 3, PAGE3_SET_ADD, VDO_CTL_ADD);
|
||||
|
|
Loading…
Add table
Reference in a new issue