mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
cros_ec: Reinit the cros_ec device when 'crosec init' is used
This command is supposed to reinit the device. At present with driver model is does nothing. Implement this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
72a38e06a2
commit
e96fc7dfc8
1 changed files with 8 additions and 2 deletions
|
@ -1606,13 +1606,19 @@ static int do_cros_ec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
|
||||
cmd = argv[1];
|
||||
if (0 == strcmp("init", cmd)) {
|
||||
#ifndef CONFIG_DM_CROS_EC
|
||||
#ifdef CONFIG_DM_CROS_EC
|
||||
/* Remove any existing device */
|
||||
ret = uclass_find_device(UCLASS_CROS_EC, 0, &udev);
|
||||
if (!ret)
|
||||
device_remove(udev);
|
||||
ret = uclass_get_device(UCLASS_CROS_EC, 0, &udev);
|
||||
#else
|
||||
ret = cros_ec_init(gd->fdt_blob, &dev);
|
||||
#endif
|
||||
if (ret) {
|
||||
printf("Could not init cros_ec device (err %d)\n", ret);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue