Merge branch 'develop-3.10-next' of 10.10.10.29:rk/kernel into develop-3.10-next
[firefly-linux-kernel-4.4.55.git] / drivers / video / rockchip / transmitter / rk32_lvds.h
1 #ifndef __RK32_LVDS__
2 #define __RK32_LVDS__
3
4 #define LVDS_CH0_REG_0                  0x00
5 #define LVDS_CH0_REG_1                  0x04
6 #define LVDS_CH0_REG_2                  0x08
7 #define LVDS_CH0_REG_3                  0x0c
8 #define LVDS_CH0_REG_4                  0x10
9 #define LVDS_CH0_REG_5                  0x14
10 #define LVDS_CH0_REG_9                  0x24
11 #define LVDS_CFG_REG_c                  0x30
12 #define LVDS_CH0_REG_d                  0x34
13 #define LVDS_CH0_REG_f                  0x3c
14 #define LVDS_CH0_REG_20                 0x80
15 #define LVDS_CFG_REG_21                 0x84
16
17 #define LVDS_SEL_VOP_LIT                (1 << 3)
18
19 #define LVDS_FMT_MASK                   (0x07 << 16)
20 #define LVDS_MSB                        (0x01 << 3)
21 #define LVDS_DUAL                       (0x01 << 4)
22 #define LVDS_FMT_1                      (0x01 << 5)
23 #define LVDS_TTL_EN                     (0x01 << 6)
24 #define LVDS_START_PHASE_RST_1          (0x01 << 7)
25 #define LVDS_DCLK_INV                   (0x01 << 8)
26 #define LVDS_CH0_EN                     (0x01 << 11)
27 #define LVDS_CH1_EN                     (0x01 << 12)
28 #define LVDS_PWRDN                      (0x01 << 15)
29
30 struct rk32_lvds {
31         struct device           *dev;
32         void __iomem            *regs;
33         struct clk              *pclk; /*phb clk*/
34         struct clk              *pd;
35         struct rk_screen        screen;
36         bool                    clk_on;
37 };
38
39 static int inline lvds_writel(struct rk32_lvds *lvds, u32 offset, u32 val)
40 {
41         writel_relaxed(val, lvds->regs + offset);
42         //if (lvds->screen.type == SCREEN_DUAL_LVDS)
43                 writel_relaxed(val, lvds->regs + offset + 0x100);
44         return 0;
45 }
46 #endif