mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
plat/allwinner: do not setup 'disabled' regulators
If a PMIC regulator has its DT node disabled, leave the regulator off. Change-Id: I895f740328e8f11d485829c3a89a9b9f8e5644be Signed-off-by: Roman Beranek <roman.beranek@prusa3d.com>
This commit is contained in:
parent
5491208afa
commit
9655a1f54b
1 changed files with 17 additions and 2 deletions
|
@ -96,12 +96,27 @@ static int setup_regulator(const void *fdt, int node,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool is_node_disabled(const void *fdt, int node)
|
||||
{
|
||||
const char *cell;
|
||||
cell = fdt_getprop(fdt, node, "status", NULL);
|
||||
if (cell == NULL) {
|
||||
return false;
|
||||
}
|
||||
return strcmp(cell, "okay") != 0;
|
||||
}
|
||||
|
||||
static bool should_enable_regulator(const void *fdt, int node)
|
||||
{
|
||||
if (fdt_getprop(fdt, node, "phandle", NULL) != NULL)
|
||||
if (is_node_disabled(fdt, node)) {
|
||||
return false;
|
||||
}
|
||||
if (fdt_getprop(fdt, node, "phandle", NULL) != NULL) {
|
||||
return true;
|
||||
if (fdt_getprop(fdt, node, "regulator-always-on", NULL) != NULL)
|
||||
}
|
||||
if (fdt_getprop(fdt, node, "regulator-always-on", NULL) != NULL) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue