diff options
| author | Simon Glass <[email protected]> | 2017-04-10 11:34:54 -0600 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2017-04-14 19:38:57 -0600 |
| commit | ddae9fcddc48d1e624c941148d0df5a4fc7d7d5c (patch) | |
| tree | 59af471a5420bfd9ac4936bac0e3bccb37d72e4c /test | |
| parent | 56e19871dc2a05aa5508ea51af35df59bbdb6cf5 (diff) | |
dm: led: Adjust the LED uclass
At present this is very simple, supporting only on and off. We want to
also support toggling and blinking. As a first step, change the name of
the main method and use an enum to indicate the state.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Ziping Chen <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/dm/led.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/dm/led.c b/test/dm/led.c index 8ee075cf1ca..ebb9b465848 100644 --- a/test/dm/led.c +++ b/test/dm/led.c @@ -41,9 +41,10 @@ static int dm_test_led_gpio(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_LED, 1, &dev)); ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio)); ut_asserteq(0, sandbox_gpio_get_value(gpio, offset)); - led_set_on(dev, 1); + ut_assertok(led_set_state(dev, LEDST_ON)); ut_asserteq(1, sandbox_gpio_get_value(gpio, offset)); - led_set_on(dev, 0); + + ut_assertok(led_set_state(dev, LEDST_OFF)); ut_asserteq(0, sandbox_gpio_get_value(gpio, offset)); return 0; |
