diff options
author | 2017-11-18 21:03:23 +0000 | |
---|---|---|
committer | 2017-11-18 21:03:23 +0000 | |
commit | e2e1bb60dd81add4668a3a148c6c8d78e33e7662 (patch) | |
tree | 6cc82d9789a92e02f8822248f276b3c74c8cf4c7 | |
parent | Add support for voltage regulators. (diff) | |
download | wireguard-openbsd-e2e1bb60dd81add4668a3a148c6c8d78e33e7662.tar.xz wireguard-openbsd-e2e1bb60dd81add4668a3a148c6c8d78e33e7662.zip |
Extend regulator "framework" with functions to get/set voltages.
ok jsg@
-rw-r--r-- | sys/dev/ofw/ofw_regulator.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/ofw/ofw_regulator.h b/sys/dev/ofw/ofw_regulator.h index 26ce47d28d3..d3abf515734 100644 --- a/sys/dev/ofw/ofw_regulator.h +++ b/sys/dev/ofw/ofw_regulator.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_regulator.h,v 1.2 2016/08/21 14:41:51 kettenis Exp $ */ +/* $OpenBSD: ofw_regulator.h,v 1.3 2017/11/18 21:03:23 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -18,7 +18,21 @@ #ifndef _DEV_OFW_REGULATOR_H_ #define _DEV_OFW_REGULATOR_H_ +struct regulator_device { + int rd_node; + void *rd_cookie; + uint32_t (*rd_get_voltage)(void *); + int (*rd_set_voltage)(void *, uint32_t); + + LIST_ENTRY(regulator_device) rd_list; + uint32_t rd_phandle; +}; + +void regulator_register(struct regulator_device *); + int regulator_enable(uint32_t); int regulator_disable(uint32_t); +uint32_t regulator_get_voltage(uint32_t); +int regulator_set_voltage(uint32_t, uint32_t); #endif /* _DEV_OFW_REGULATOR_H_ */ |