1*8644267aSskrll /* $NetBSD: imx_ccm_fixed.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */
2*8644267aSskrll
3*8644267aSskrll /*-
4*8644267aSskrll * Copyright (c) 2020 Jared McNeill <jmcneill@invisible.ca>
5*8644267aSskrll * All rights reserved.
6*8644267aSskrll *
7*8644267aSskrll * Redistribution and use in source and binary forms, with or without
8*8644267aSskrll * modification, are permitted provided that the following conditions
9*8644267aSskrll * are met:
10*8644267aSskrll * 1. Redistributions of source code must retain the above copyright
11*8644267aSskrll * notice, this list of conditions and the following disclaimer.
12*8644267aSskrll * 2. Redistributions in binary form must reproduce the above copyright
13*8644267aSskrll * notice, this list of conditions and the following disclaimer in the
14*8644267aSskrll * documentation and/or other materials provided with the distribution.
15*8644267aSskrll *
16*8644267aSskrll * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17*8644267aSskrll * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18*8644267aSskrll * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19*8644267aSskrll * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20*8644267aSskrll * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21*8644267aSskrll * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22*8644267aSskrll * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23*8644267aSskrll * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24*8644267aSskrll * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*8644267aSskrll * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*8644267aSskrll * SUCH DAMAGE.
27*8644267aSskrll */
28*8644267aSskrll
29*8644267aSskrll #include <sys/cdefs.h>
30*8644267aSskrll __KERNEL_RCSID(0, "$NetBSD: imx_ccm_fixed.c,v 1.1 2020/12/23 14:42:38 skrll Exp $");
31*8644267aSskrll
32*8644267aSskrll #include <sys/param.h>
33*8644267aSskrll #include <sys/bus.h>
34*8644267aSskrll
35*8644267aSskrll #include <dev/clk/clk_backend.h>
36*8644267aSskrll
37*8644267aSskrll #include <arm/nxp/imx_ccm.h>
38*8644267aSskrll
39*8644267aSskrll u_int
imx_ccm_fixed_get_rate(struct imx_ccm_softc * sc,struct imx_ccm_clk * clk)40*8644267aSskrll imx_ccm_fixed_get_rate(struct imx_ccm_softc *sc,
41*8644267aSskrll struct imx_ccm_clk *clk)
42*8644267aSskrll {
43*8644267aSskrll struct imx_ccm_fixed *fixed = &clk->u.fixed;
44*8644267aSskrll
45*8644267aSskrll KASSERT(clk->type == IMX_CCM_FIXED);
46*8644267aSskrll
47*8644267aSskrll return fixed->rate;
48*8644267aSskrll }
49