Commit 71e7cb73 authored by André Przywara's avatar André Przywara Committed by TrustedFirmware Code Review
Browse files

Merge "plat/allwinner: do not setup 'disabled' regulators" into integration

parents 9719e19a 9655a1f5
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment