mirror of
https://xff.cz/git/u-boot/
synced 2025-10-22 10:31:56 +02:00
dm: Add a power sequencing uclass
Some devices need special sequences to be used when starting up. Add a uclass for this. Drivers can be added to provide specific features as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
24
drivers/misc/pwrseq-uclass.c
Normal file
24
drivers/misc/pwrseq-uclass.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <pwrseq.h>
|
||||
|
||||
int pwrseq_set_power(struct udevice *dev, bool enable)
|
||||
{
|
||||
struct pwrseq_ops *ops = pwrseq_get_ops(dev);
|
||||
|
||||
if (!ops->set_power)
|
||||
return -ENOSYS;
|
||||
|
||||
return ops->set_power(dev, enable);
|
||||
}
|
||||
|
||||
UCLASS_DRIVER(pwrseq) = {
|
||||
.id = UCLASS_PWRSEQ,
|
||||
.name = "pwrseq",
|
||||
};
|
||||
Reference in New Issue
Block a user