X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fdemo%2Fdemo-uclass.c;h=725f06898f33deb8d7e827f016d1a63da90b71aa;hb=aa8306a90e398e5667ccd03ef8512837116bcc51;hp=636fd8831f5d152310cdd8d7cee1ac7e33c8b492;hpb=ed1d98d801dfb6384d0f2fff45ce1ebf884944ca;p=oweals%2Fu-boot.git diff --git a/drivers/demo/demo-uclass.c b/drivers/demo/demo-uclass.c index 636fd8831f..725f06898f 100644 --- a/drivers/demo/demo-uclass.c +++ b/drivers/demo/demo-uclass.c @@ -19,6 +19,7 @@ DECLARE_GLOBAL_DATA_PTR; UCLASS_DRIVER(demo) = { + .name = "demo", .id = UCLASS_DEMO, }; @@ -42,6 +43,26 @@ int demo_status(struct udevice *dev, int *status) return ops->status(dev, status); } +int demo_get_light(struct udevice *dev) +{ + const struct demo_ops *ops = device_get_ops(dev); + + if (!ops->get_light) + return -ENOSYS; + + return ops->get_light(dev); +} + +int demo_set_light(struct udevice *dev, int light) +{ + const struct demo_ops *ops = device_get_ops(dev); + + if (!ops->set_light) + return -ENOSYS; + + return ops->set_light(dev, light); +} + int demo_parse_dt(struct udevice *dev) { struct dm_demo_pdata *pdata = dev_get_platdata(dev);