#define v_FS_MASK_EN(x) BITS_MASK(x, 1, 3)
#define v_HDMI_HSYNC_POL(x) BITS_MASK(x, 1, 4)
#define v_HDMI_VSYNC_POL(x) BITS_MASK(x, 1, 5)
- #define v_HDMI_DEN_POL(x) BITS_MASK(x. 1, 6)
+ #define v_HDMI_DEN_POL(x) BITS_MASK(x, 1, 6)
#define INT_STATUS (0x10)
#define m_HS_INT_STA BITS(1, 0)
#define v_BCSH_EN(x) BITS_MASK(x, 1, 0)
#define v_BCSH_R2Y_CSC_MODE(x) BITS_MASK(x, 1, 1) /* rk312x */
#define v_BCSH_OUT_MODE(x) BITS_MASK(x, 3, 2)
- #define v_BCSH_CSC_MODE(x) BITS_MASK(x, 3, 4)
+ #define v_BCSH_Y2R_CSC_MODE(x) BITS_MASK(x, 3, 4)
#define v_BCSH_Y2R_EN(x) BITS_MASK(x, 1, 6) /* rk312x */
#define v_BCSH_R2Y_EN(x) BITS_MASK(x, 1, 7) /* rk312x */
#define CalScale(x, y) ((((u32)(x - 1)) * 0x1000) / (y - 1))
+#define INT_STA_MSK (m_HS_INT_STA | m_FS_INT_STA | \
+ m_LF_INT_STA | m_BUS_ERR_INT_STA)
+#define INT_CLR_SHIFT 8
struct rk_lcdc_drvdata {
u8 soc_type;
u32 reg_phy_base; /* physical basic address of lcdc register */
u32 len; /* physical map length of lcdc register */
spinlock_t reg_lock; /* one time only one process allowed to config the register */
-
+
+ int __iomem *hwc_lut_addr_base;
int __iomem *dsp_lut_addr_base;
int prop; /* used for primary or extended display device */
bool pre_init;
bool pwr18; /* if lcdc use 1.8v power supply */
bool clk_on; /* if aclk or hclk is closed ,acess to register is not allowed */
+ bool sclk_on; /* if sclk is open or closed */
u8 atv_layer_cnt; /* active layer counter,when atv_layer_cnt = 0,lcdc is disable*/
unsigned int irq;
struct clk *dclk; /* lcdc dclk */
struct clk *aclk; /* lcdc share memory frequency */
struct clk *sclk; /* scaler clk */
+ struct clk *pll_sclk;
u32 pixclock;
u32 s_pixclock;
u32 standby; /* 1:standby,0:work */
- u16 overlay_mode;
+ struct backlight_device *backlight;
+ u32 iommu_status;
};
static inline void lcdc_writel(struct lcdc_device *lcdc_dev, u32 offset, u32 v)
}
static inline u32 lcdc_readl(struct lcdc_device *lcdc_dev, u32 offset)
+{
+ u32 v;
+ v = readl_relaxed(lcdc_dev->regs + offset);
+ return v;
+}
+
+static inline u32 lcdc_readl_backup(struct lcdc_device *lcdc_dev, u32 offset)
{
u32 v;
u32 *_pv = (u32*)lcdc_dev->regsbak;