diff mbox series

[U-Boot,V2,4/4] dm: power-domain: query power domain after get device

Message ID 20180727022039.11147-4-peng.fan@nxp.com
State Accepted
Delegated to: Anatolij Gustschin
Headers show
Series [U-Boot,V2,1/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined | expand

Commit Message

Peng Fan July 27, 2018, 2:20 a.m. UTC
This is to test power_domain_on in device_probe.
If the device has a power-domain property, enable it
when probe the device. So add the test to check
whether it is powered on or not.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

V2: Add review tag

 test/dm/power-domain.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Anatolij Gustschin Aug. 6, 2018, 9:11 a.m. UTC | #1
On Fri, 27 Jul 2018 10:20:39 +0800
Peng Fan peng.fan@nxp.com wrote:

> This is to test power_domain_on in device_probe.
> If the device has a power-domain property, enable it
> when probe the device. So add the test to check
> whether it is powered on or not.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
> V2: Add review tag
> 
>  test/dm/power-domain.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied to u-boot-staging/agust@denx.de, thanks!

--
Anatolij
diff mbox series

Patch

diff --git a/test/dm/power-domain.c b/test/dm/power-domain.c
index a1e1df2bb2..48318218a9 100644
--- a/test/dm/power-domain.c
+++ b/test/dm/power-domain.c
@@ -26,6 +26,8 @@  static int dm_test_power_domain(struct unit_test_state *uts)
 
 	ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "power-domain-test",
 					      &dev_test));
+	ut_asserteq(1, sandbox_power_domain_query(dev_power_domain,
+						  TEST_POWER_DOMAIN));
 	ut_assertok(sandbox_power_domain_test_get(dev_test));
 
 	ut_assertok(sandbox_power_domain_test_on(dev_test));