mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
usb: Use new DART code to autoselect compatible mode
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
1edb18ac44
commit
d7bd21d51c
1 changed files with 1 additions and 15 deletions
16
src/usb.c
16
src/usb.c
|
@ -49,35 +49,21 @@ static bool usb_is_initialized = false;
|
|||
|
||||
static dart_dev_t *usb_dart_init(const char *path, const char *mapper_path)
|
||||
{
|
||||
int dart_path[8];
|
||||
int dart_offset;
|
||||
int mapper_offset;
|
||||
|
||||
dart_offset = adt_path_offset_trace(adt, path, dart_path);
|
||||
if (dart_offset < 0) {
|
||||
printf("usb: Error getting DART node %s\n", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mapper_offset = adt_path_offset(adt, mapper_path);
|
||||
if (mapper_offset < 0) {
|
||||
printf("usb: Error getting DART mapper node %s\n", mapper_path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u64 dart_base;
|
||||
if (adt_get_reg(adt, dart_path, "reg", 1, &dart_base, NULL) < 0) {
|
||||
printf("usb: Error getting DART %s base address.\n", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 dart_idx;
|
||||
if (ADT_GETPROP(adt, mapper_offset, "reg", &dart_idx) < 0) {
|
||||
printf("usb: Error getting DART %s device index/\n", mapper_path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dart_init(dart_base, dart_idx);
|
||||
return dart_init_adt(path, dart_idx);
|
||||
}
|
||||
|
||||
static int usb_drd_get_regs(const char *phy_path, const char *drd_path, struct usb_drd_regs *regs)
|
||||
|
|
Loading…
Reference in a new issue