xref: /freebsd/sys/dev/qcom_clk/qcom_clk_freqtbl.h (revision e34a491b35626b4209ef0a195e85a03a1089c572)
1*e34a491bSAdrian Chadd /*-
2*e34a491bSAdrian Chadd  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*e34a491bSAdrian Chadd  *
4*e34a491bSAdrian Chadd  * Copyright (c) 2021 Adrian Chadd <adrian@FreeBSD.org>
5*e34a491bSAdrian Chadd  *
6*e34a491bSAdrian Chadd  * Redistribution and use in source and binary forms, with or without
7*e34a491bSAdrian Chadd  * modification, are permitted provided that the following conditions
8*e34a491bSAdrian Chadd  * are met:
9*e34a491bSAdrian Chadd  * 1. Redistributions of source code must retain the above copyright
10*e34a491bSAdrian Chadd  *    notice, this list of conditions and the following disclaimer.
11*e34a491bSAdrian Chadd  * 2. Redistributions in binary form must reproduce the above copyright
12*e34a491bSAdrian Chadd  *    notice, this list of conditions and the following disclaimer in the
13*e34a491bSAdrian Chadd  *    documentation and/or other materials provided with the distribution.
14*e34a491bSAdrian Chadd  *
15*e34a491bSAdrian Chadd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*e34a491bSAdrian Chadd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*e34a491bSAdrian Chadd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*e34a491bSAdrian Chadd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*e34a491bSAdrian Chadd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*e34a491bSAdrian Chadd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*e34a491bSAdrian Chadd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*e34a491bSAdrian Chadd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*e34a491bSAdrian Chadd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*e34a491bSAdrian Chadd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*e34a491bSAdrian Chadd  * SUCH DAMAGE.
26*e34a491bSAdrian Chadd  *
27*e34a491bSAdrian Chadd  * $FreeBSD$
28*e34a491bSAdrian Chadd  */
29*e34a491bSAdrian Chadd 
30*e34a491bSAdrian Chadd #ifndef	__QCOM_CLK_FREQTBL_H__
31*e34a491bSAdrian Chadd #define	__QCOM_CLK_FREQTBL_H__
32*e34a491bSAdrian Chadd 
33*e34a491bSAdrian Chadd struct qcom_clk_freq_tbl {
34*e34a491bSAdrian Chadd 	uint64_t freq;
35*e34a491bSAdrian Chadd 	const char *parent;
36*e34a491bSAdrian Chadd 	uint32_t pre_div;
37*e34a491bSAdrian Chadd 	uint32_t m;
38*e34a491bSAdrian Chadd 	uint32_t n;
39*e34a491bSAdrian Chadd };
40*e34a491bSAdrian Chadd 
41*e34a491bSAdrian Chadd const struct qcom_clk_freq_tbl * qcom_clk_freq_tbl_lookup(
42*e34a491bSAdrian Chadd 	    const struct qcom_clk_freq_tbl *tbl, uint64_t freq);
43*e34a491bSAdrian Chadd 
44*e34a491bSAdrian Chadd #endif	/* __QCOM_CLK_FREQTBL_H__ */
45