2 #include "camsys_soc_priv.h"
6 static camsys_soc_priv_t* camsys_soc_p;
8 #include "camsys_soc_rk3288.c"
10 static int camsys_rk3288_cfg (camsys_soc_cfg_t cfg_cmd, void* cfg_para)
12 unsigned int *para_int;
16 case Clk_DriverStrength_Cfg:
18 para_int = (unsigned int*)cfg_para;
19 __raw_writel((((*para_int)&0x03)<<3)|(0x03<<3), RK_GRF_VIRT+0x01d4);
23 case Cif_IoDomain_Cfg:
25 para_int = (unsigned int*)cfg_para;
26 if (*para_int < 28000000) {
27 __raw_writel(((1<<1)|(1<<(1+16))),RK_GRF_VIRT+0x0380); // 1.8v IO
29 __raw_writel(((0<<1)|(1<<(1+16))),RK_GRF_VIRT+0x0380); // 3.3v IO
36 camsys_rk3288_mipihpy_cfg((camsys_mipiphy_soc_para_t*)cfg_para);
40 case Isp_SoftRst: /* ddl@rock-chips.com: v0.d.0 */
43 reset = (unsigned int)cfg_para;
46 cru_writel(0x40004000,0x1d0);
48 cru_writel(0x40000000,0x1d0);
49 camsys_trace(1, "Isp_SoftRst: %d",reset);
55 camsys_warn("cfg_cmd: 0x%x isn't support for %s",cfg_cmd,camsys_soc_p->name);
66 camsys_soc_priv_t* camsys_soc_get(void)
68 if (camsys_soc_p != NULL) {
75 int camsys_soc_init(void)
77 camsys_soc_p = kzalloc(sizeof(camsys_soc_priv_t),GFP_KERNEL);
78 if (camsys_soc_p == NULL) {
79 camsys_err("malloc camsys_soc_priv_t failed!");
83 if (soc_is_rk3288()) {
84 strlcpy(camsys_soc_p->name,"camsys_rk3288",31);
85 camsys_soc_p->soc_cfg = camsys_rk3288_cfg;
87 camsys_err("camsys isn't support soc: 0x%lx!",rockchip_soc_id);
93 if (camsys_soc_p != NULL) {
100 int camsys_soc_deinit(void)
102 if (camsys_soc_p != NULL) {