diff options
author | Simon Glass <sjg@chromium.org> | 2017-04-10 11:34:54 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-04-14 19:38:57 -0600 |
commit | ddae9fcddc48d1e624c941148d0df5a4fc7d7d5c (patch) | |
tree | 59af471a5420bfd9ac4936bac0e3bccb37d72e4c /drivers/led/led-uclass.c | |
parent | 56e19871dc2a05aa5508ea51af35df59bbdb6cf5 (diff) | |
download | u-boot-ddae9fcddc48d1e624c941148d0df5a4fc7d7d5c.tar.gz |
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 <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
Diffstat (limited to 'drivers/led/led-uclass.c')
-rw-r--r-- | drivers/led/led-uclass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c index ca4f98c0b3..b30346913b 100644 --- a/drivers/led/led-uclass.c +++ b/drivers/led/led-uclass.c @@ -32,14 +32,14 @@ int led_get_by_label(const char *label, struct udevice **devp) return -ENODEV; } -int led_set_on(struct udevice *dev, int on) +int led_set_state(struct udevice *dev, enum led_state_t state) { struct led_ops *ops = led_get_ops(dev); - if (!ops->set_on) + if (!ops->set_state) return -ENOSYS; - return ops->set_on(dev, on); + return ops->set_state(dev, state); } UCLASS_DRIVER(led) = { |