2 # Copyright (c) 2016 Landon Fuller <landon@landonf.org>
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 # IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
23 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include <sys/types.h>
30 #include <dev/bhnd/bhnd.h>
35 # bhnd(4) PMU interface.
37 # Provides a common PMU and clock control interface.
41 struct bhnd_core_pmu_info;
45 * Enabling routing of @p clock (or faster) to a requesting core.
47 * @param dev PMU device.
48 * @param pinfo PMU info for requesting core.
49 * @param clock Clock requested.
52 * @retval ENODEV If an unsupported clock was requested.
54 METHOD int core_req_clock {
56 struct bhnd_core_pmu_info *pinfo;
62 * Request that @p clocks be powered on behalf of a requesting core.
64 * This will power any clock sources (XTAL, PLL, etc,) required by
65 * @p clocks and wait until they are ready, discarding any previous
66 * requests from the @p pinfo device.
68 * Requests from multiple devices are aggregated by the PMU.
70 * @param dev PMU device.
71 * @param pinfo PMU info for requesting core.
72 * @param clocks Clocks requested.
75 * @retval ENODEV If an unsupported clock was requested.
77 METHOD int core_en_clocks {
79 struct bhnd_core_pmu_info *pinfo;
84 * Power up a core-specific external resource.
86 * @param dev The parent of @p child.
87 * @param pinfo PMU info for requesting core.
88 * @param rsrc The core-specific external resource identifier.
91 * @retval ENODEV If @p rsrc is not supported by this PMU driver.
93 METHOD int core_req_ext_rsrc {
95 struct bhnd_core_pmu_info *pinfo;
100 * Power down a core-specific external resource.
102 * @param dev The parent of @p child.
103 * @param pinfo PMU info for requesting core.
104 * @param rsrc The core-specific external resource identifier.
107 * @retval ENODEV If @p rsrc is not supported by this PMU driver.
109 METHOD int core_release_ext_rsrc {
111 struct bhnd_core_pmu_info *pinfo;
116 * Release all outstanding requests (clocks, resources, etc) associated with
119 * @param dev PMU device.
120 * @param pinfo PMU info for requesting core.
123 * @retval non-zero If releasing PMU request state fails, a
124 * regular unix error code will be returned, and
125 * the request state will be left unmodified.
127 METHOD int core_release {
129 struct bhnd_core_pmu_info *pinfo;