int mdnie_set_size(unsigned int hsize, unsigned int vsize) { unsigned int reg; /* Bank0 Select : DO NOT REMOVE THIS LINE */ s3c_mdnie_write(MDNIE_REG_BANK_SEL, 0); #if defined(CONFIG_CPU_EXYNOS4212) || defined(CONFIG_CPU_EXYNOS4412) /* Input Data Unmask */ reg = s3c_mdnie_read(S3C_MDNIE_rR1); reg &= ~S3C_MDNIE_INPUT_DATA_ENABLE; s3c_mdnie_write(S3C_MDNIE_rR1, reg); #endif /* LCD width */ reg = s3c_mdnie_read(MDNIE_REG_WIDTH); reg &= ~S3C_MDNIE_SIZE_MASK; reg |= S3C_MDNIE_HSIZE(hsize); s3c_mdnie_write(MDNIE_REG_WIDTH, reg); /* LCD height */ reg = s3c_mdnie_read(MDNIE_REG_HEIGHT); reg &= ~S3C_MDNIE_SIZE_MASK; reg |= S3C_MDNIE_VSIZE(vsize); s3c_mdnie_write(MDNIE_REG_HEIGHT, reg); mdnie_unmask(); return 0; }
static int mdnie_send_sequence(struct mdnie_info *mdnie, const unsigned short *seq) { int ret = 0, i = 0; const unsigned short *wbuf = NULL; if (IS_ERR_OR_NULL(seq)) { dev_err(mdnie->dev, "mdnie sequence is null\n"); return -EPERM; } mutex_lock(&mdnie->dev_lock); wbuf = seq; mdnie_mask(); while (wbuf[i] != END_SEQ) { ret += mdnie_write(wbuf[i], wbuf[i+1]); i += 2; } mdnie_unmask(); mutex_unlock(&mdnie->dev_lock); return ret; }