forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/clk/ingenic/cgu.h
....@@ -1,30 +1,23 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Ingenic SoC CGU driver
34 *
45 * Copyright (c) 2013-2015 Imagination Technologies
56 * Author: Paul Burton <paul.burton@mips.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License as
9
- * published by the Free Software Foundation; either version 2 of
10
- * the License, or (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
167 */
178
189 #ifndef __DRIVERS_CLK_INGENIC_CGU_H__
1910 #define __DRIVERS_CLK_INGENIC_CGU_H__
2011
2112 #include <linux/bitops.h>
13
+#include <linux/clk-provider.h>
2214 #include <linux/of.h>
2315 #include <linux/spinlock.h>
2416
2517 /**
2618 * struct ingenic_cgu_pll_info - information about a PLL
2719 * @reg: the offset of the PLL's control register within the CGU
20
+ * @rate_multiplier: the multiplier needed by pll rate calculation
2821 * @m_shift: the number of bits to shift the multiplier value by (ie. the
2922 * index of the lowest bit of the multiplier value in the PLL's
3023 * control register)
....@@ -45,6 +38,7 @@
4538 * @od_encoding: a pointer to an array mapping post-VCO divider values to
4639 * their encoded values in the PLL control register, or -1 for
4740 * unsupported values
41
+ * @bypass_reg: the offset of the bypass control register within the CGU
4842 * @bypass_bit: the index of the bypass bit in the PLL control register
4943 * @enable_bit: the index of the enable bit in the PLL control register
5044 * @stable_bit: the index of the stable bit in the PLL control register
....@@ -52,10 +46,12 @@
5246 */
5347 struct ingenic_cgu_pll_info {
5448 unsigned reg;
49
+ unsigned rate_multiplier;
5550 const s8 *od_encoding;
5651 u8 m_shift, m_bits, m_offset;
5752 u8 n_shift, n_bits, n_offset;
5853 u8 od_shift, od_bits, od_max;
54
+ unsigned bypass_reg;
5955 u8 bypass_bit;
6056 u8 enable_bit;
6157 u8 stable_bit;
....@@ -88,6 +84,8 @@
8884 * isn't one
8985 * @busy_bit: the index of the busy bit within reg, or -1 if there isn't one
9086 * @stop_bit: the index of the stop bit within reg, or -1 if there isn't one
87
+ * @div_table: optional table to map the value read from the register to the
88
+ * actual divider value
9189 */
9290 struct ingenic_cgu_div_info {
9391 unsigned reg;
....@@ -97,6 +95,7 @@
9795 s8 ce_bit;
9896 s8 busy_bit;
9997 s8 stop_bit;
98
+ const u8 *div_table;
10099 };
101100
102101 /**