Merge https://gitlab.denx.de/u-boot/custodians/u-boot-stm
[platform/kernel/u-boot.git] / drivers / video / nexell / soc / s5pxx18_soc_disptop_clk.h
1 /* SPDX-License-Identifier: GPL-2.0+
2  *
3  * Copyright (C) 2016  Nexell Co., Ltd.
4  *
5  * Author: junghyun, kim <jhkim@nexell.co.kr>
6  */
7
8 #ifndef _S5PXX18_SOC_DISPTOP_CLK_H_
9 #define _S5PXX18_SOC_DISPTOP_CLK_H_
10
11 #include "s5pxx18_soc_disptype.h"
12
13 #define PHY_BASEADDR_DISPTOP_CLKGEN_LIST        \
14                 { PHY_BASEADDR_DISPTOP_CLKGEN0_MODULE, \
15                   PHY_BASEADDR_DISPTOP_CLKGEN1_MODULE, \
16                   PHY_BASEADDR_DISPTOP_CLKGEN2_MODULE, \
17                   PHY_BASEADDR_DISPTOP_CLKGEN3_MODULE, \
18                   PHY_BASEADDR_DISPTOP_CLKGEN4_MODULE, \
19                 }
20
21 struct nx_disptop_clkgen_register_set {
22         u32 clkenb;
23         u32 CLKGEN[4];
24 };
25
26 int nx_disp_top_clkgen_initialize(void);
27 u32 nx_disp_top_clkgen_get_number_of_module(void);
28 u32 nx_disp_top_clkgen_get_physical_address(u32 module_index);
29 u32 nx_disp_top_clkgen_get_size_of_register_set(void);
30 void nx_disp_top_clkgen_set_base_address(u32 module_index,
31                                          void *base_address);
32 void *nx_disp_top_clkgen_get_base_address(u32 module_index);
33 void nx_disp_top_clkgen_set_clock_pclk_mode(u32 module_index,
34                                             enum nx_pclkmode mode);
35 enum nx_pclkmode nx_disp_top_clkgen_get_clock_pclk_mode(u32 module_index);
36 void nx_disp_top_clkgen_set_clock_source(u32 module_index, u32 index,
37                                          u32 clk_src);
38 u32 nx_disp_top_clkgen_get_clock_source(u32 module_index, u32 index);
39 void nx_disp_top_clkgen_set_clock_divisor(u32 module_index, u32 index,
40                                           u32 divisor);
41 u32 nx_disp_top_clkgen_get_clock_divisor(u32 module_index, u32 index);
42 void nx_disp_top_clkgen_set_clock_divisor_enable(u32 module_index,
43                                                  int enable);
44 int nx_disp_top_clkgen_get_clock_divisor_enable(u32 module_index);
45 void nx_disp_top_clkgen_set_clock_bclk_mode(u32 module_index,
46                                             enum nx_bclkmode mode);
47 enum nx_bclkmode nx_disp_top_clkgen_get_clock_bclk_mode(u32 module_index);
48
49 void nx_disp_top_clkgen_set_clock_out_inv(u32 module_index, u32 index,
50                                           int out_clk_inv);
51 int nx_disp_top_clkgen_get_clock_out_inv(u32 module_index, u32 index);
52 int nx_disp_top_clkgen_set_input_inv(u32 module_index, u32 index,
53                                      int out_clk_inv);
54 int nx_disp_top_clkgen_get_input_inv(u32 module_index, u32 index);
55
56 void nx_disp_top_clkgen_set_clock_out_select(u32 module_index, u32 index,
57                                              int bbypass);
58
59 #endif