mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
pmgr: Add a helper to test for pmgr features in the ADT
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
1f154402a4
commit
7ce414224c
3 changed files with 17 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "adt.h"
|
||||
#include "firmware.h"
|
||||
#include "soc.h"
|
||||
#include "pmgr.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define CLUSTER_PSTATE 0x20020
|
||||
|
|
14
src/pmgr.c
14
src/pmgr.c
|
@ -394,3 +394,17 @@ int pmgr_init(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 pmgr_get_feature(const char *name)
|
||||
{
|
||||
u32 val = 0;
|
||||
|
||||
int node = adt_path_offset(adt, "/arm-io/pmgr");
|
||||
if (node < 0)
|
||||
return 0;
|
||||
|
||||
if (ADT_GETPROP(adt, node, name, &val) < 0)
|
||||
return 0;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
|
|
@ -23,4 +23,6 @@ int pmgr_adt_reset(const char *path);
|
|||
|
||||
int pmgr_reset(int die, const char *name);
|
||||
|
||||
u32 pmgr_get_feature(const char *name);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue