Skip to content

Commit 2302915

Browse files
Elaine Zhangmmind
authored andcommitted
clk: rockchip: Optimize PLL table memory usage
Before the change: The sizeof rk3568_pll_rates = 2544 Use union: The sizeof rk3568_pll_rates = 1696 In future Soc, more PLL types will be added, and the rockchip_pll_rate_table will add more members, and the space savings will be even more pronounced by using union. Signed-off-by: Elaine Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 6efb943 commit 2302915

File tree

1 file changed

+18
-11
lines changed
  • drivers/clk/rockchip

1 file changed

+18
-11
lines changed

drivers/clk/rockchip/clk.h

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,24 @@ struct rockchip_clk_provider {
271271

272272
struct rockchip_pll_rate_table {
273273
unsigned long rate;
274-
unsigned int nr;
275-
unsigned int nf;
276-
unsigned int no;
277-
unsigned int nb;
278-
/* for RK3036/RK3399 */
279-
unsigned int fbdiv;
280-
unsigned int postdiv1;
281-
unsigned int refdiv;
282-
unsigned int postdiv2;
283-
unsigned int dsmpd;
284-
unsigned int frac;
274+
union {
275+
struct {
276+
/* for RK3066 */
277+
unsigned int nr;
278+
unsigned int nf;
279+
unsigned int no;
280+
unsigned int nb;
281+
};
282+
struct {
283+
/* for RK3036/RK3399 */
284+
unsigned int fbdiv;
285+
unsigned int postdiv1;
286+
unsigned int refdiv;
287+
unsigned int postdiv2;
288+
unsigned int dsmpd;
289+
unsigned int frac;
290+
};
291+
};
285292
};
286293

287294
/**

0 commit comments

Comments
 (0)