mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 02:24:18 +00:00
Merge "feat(st-regulator): add support for regulator-always-on" into integration
This commit is contained in:
commit
a5e8c22233
1 changed files with 25 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, STMicroelectronics - All Rights Reserved
|
||||
* Copyright (c) 2021-2022, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -156,6 +156,10 @@ int regulator_disable(struct rdev *rdev)
|
|||
|
||||
assert(rdev != NULL);
|
||||
|
||||
if (rdev->flags & REGUL_ALWAYS_ON) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = __regulator_set_state(rdev, STATE_DISABLE);
|
||||
|
||||
udelay(rdev->enable_ramp_delay);
|
||||
|
@ -412,6 +416,21 @@ int regulator_set_flag(struct rdev *rdev, uint16_t flag)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int parse_properties(const void *fdt, struct rdev *rdev, int node)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (fdt_getprop(fdt, node, "regulator-always-on", NULL) != NULL) {
|
||||
VERBOSE("%s: set regulator-always-on\n", rdev->desc->node_name);
|
||||
ret = regulator_set_flag(rdev, REGUL_ALWAYS_ON);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the device-tree for a regulator
|
||||
*
|
||||
|
@ -476,6 +495,11 @@ static int parse_dt(struct rdev *rdev, int node)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = parse_properties(fdt, rdev, node);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue