2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
12 * struct led_uclass_plat - Platform data the uclass stores about each device
16 struct led_uclass_plat {
22 * set_on() - set the state of an LED
24 * @dev: LED device to change
25 * @on: 1 to turn the LED on, 0 to turn it off
26 * @return 0 if OK, -ve on error
28 int (*set_on)(struct udevice *dev, int on);
31 #define led_get_ops(dev) ((struct led_ops *)(dev)->driver->ops)
34 * led_get_by_label() - Find an LED device by label
36 * @label: LED label to look up
37 * @devp: Returns the associated device, if found
38 * @return 0 if found, -ENODEV if not found, other -ve on error
40 int led_get_by_label(const char *label, struct udevice **devp);
43 * led_set_on() - set the state of an LED
45 * @dev: LED device to change
46 * @on: 1 to turn the LED on, 0 to turn it off
47 * @return 0 if OK, -ve on error
49 int led_set_on(struct udevice *dev, int on);