aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:43:31 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:34 -0700
commit5fd6badbd265ef45d3e1faebe5868426ab69595c (patch)
tree51aa4fe2fb3d0af4e3fb80a1cd1ed4ceb6a8f7c8 /drivers/misc
parente1227764cdbcd397728e95de1662c2b9e967d5fe (diff)
downloadu-boot-5fd6badbd265ef45d3e1faebe5868426ab69595c.zip
u-boot-5fd6badbd265ef45d3e1faebe5868426ab69595c.tar.gz
u-boot-5fd6badbd265ef45d3e1faebe5868426ab69595c.tar.bz2
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/Kconfig18
-rw-r--r--drivers/misc/Makefile1
-rw-r--r--drivers/misc/pwrseq-uclass.c24
3 files changed, 43 insertions, 0 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b92da4e..cba2363 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -90,6 +90,24 @@ config MXC_OCOTP
Programmable memory pages that are stored on the some
Freescale i.MX processors.
+config PWRSEQ
+ bool "Enable power-sequencing drivers"
+ depends on DM
+ help
+ Power-sequencing drivers provide support for controlling power for
+ devices. They are typically referenced by a phandle from another
+ device. When the device is started up, its power sequence can be
+ initiated.
+
+config SPL_PWRSEQ
+ bool "Enable power-sequencing drivers for SPL"
+ depends on PWRSEQ
+ help
+ Power-sequencing drivers provide support for controlling power for
+ devices. They are typically referenced by a phandle from another
+ device. When the device is started up, its power sequence can be
+ initiated.
+
config PCA9551_LED
bool "Enable PCA9551 LED driver"
help
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index aa137f5..fc8eb6f 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o
obj-$(CONFIG_NS87308) += ns87308.o
obj-$(CONFIG_PDSP188x) += pdsp188x.o
+obj-$(CONFIG_$(SPL_)PWRSEQ) += pwrseq-uclass.o
obj-$(CONFIG_SANDBOX) += reset_sandbox.o
ifdef CONFIG_DM_I2C
obj-$(CONFIG_SANDBOX) += i2c_eeprom_emul.o
diff --git a/drivers/misc/pwrseq-uclass.c b/drivers/misc/pwrseq-uclass.c
new file mode 100644
index 0000000..8ed2ad4
--- /dev/null
+++ b/drivers/misc/pwrseq-uclass.c
@@ -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",
+};