2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2017,2018 Emmanuel Vadot <manu@freebsd.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 #include <arm/allwinner/clkng/aw_clk.h>
34 #include <arm/allwinner/clkng/aw_clk_nkmp.h>
35 #include <arm/allwinner/clkng/aw_clk_nm.h>
36 #include <arm/allwinner/clkng/aw_clk_prediv_mux.h>
37 #include <dev/extres/clk/clk_mux.h>
38 #include <dev/extres/clk/clk_div.h>
39 #include <dev/extres/clk/clk_fixed.h>
41 enum aw_ccung_clk_type {
52 enum aw_ccung_clk_type type;
54 struct clk_mux_def *mux;
55 struct clk_div_def *div;
56 struct clk_fixed_def *fixed;
57 struct aw_clk_nkmp_def *nkmp;
58 struct aw_clk_nm_def *nm;
59 struct aw_clk_prediv_mux_def *prediv_mux;
63 struct aw_ccung_softc {
66 struct clkdom *clkdom;
68 struct aw_ccung_reset *resets;
70 struct aw_ccung_gate *gates;
72 struct aw_ccung_clk *clks;
74 struct aw_clk_init *clk_init;
78 struct aw_ccung_reset {
83 struct aw_ccung_gate {
85 const char *parent_name;
91 DECLARE_CLASS(aw_ccung_driver);
93 int aw_ccung_attach(device_t dev);
95 #endif /* __CCU_NG_H__ */