本文整理汇总了C++中edp_write函数的典型用法代码示例。如果您正苦于以下问题:C++ edp_write函数的具体用法?C++ edp_write怎么用?C++ edp_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了edp_write函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mdss_edp_phy_vm_pe_init
/* voltage mode and pre emphasis cfg */
void mdss_edp_phy_vm_pe_init(struct mdss_edp_drv_pdata *ep)
{
/* EDP_PHY_EDPPHY_GLB_VM_CFG0 */
edp_write(ep->base + 0x510, 0x3); /* vm only */
/* EDP_PHY_EDPPHY_GLB_VM_CFG1 */
edp_write(ep->base + 0x514, 0x64);
/* EDP_PHY_EDPPHY_GLB_MISC9 */
edp_write(ep->base + 0x518, 0x6c);
}
示例2: edp_isr
irqreturn_t edp_isr(int irq, void *ptr)
{
struct mdss_edp_drv_pdata *ep = (struct mdss_edp_drv_pdata *)ptr;
unsigned char *base = ep->base;
u32 isr1, isr2, mask1, mask2;
u32 ack;
spin_lock(&ep->lock);
isr1 = edp_read(base + 0x308);
isr2 = edp_read(base + 0x30c);
mask1 = isr1 & ep->mask1;
mask2 = isr2 & ep->mask2;
isr1 &= ~mask1; /* remove masks bit */
isr2 &= ~mask2;
pr_debug("%s: isr=%x mask=%x isr2=%x mask2=%x\n",
__func__, isr1, mask1, isr2, mask2);
ack = isr1 & EDP_INTR_STATUS1;
ack <<= 1; /* ack bits */
ack |= mask1;
edp_write(base + 0x308, ack);
ack = isr2 & EDP_INTR_STATUS2;
ack <<= 1; /* ack bits */
ack |= mask2;
edp_write(base + 0x30c, ack);
spin_unlock(&ep->lock);
if (isr1 & EDP_INTR_HPD) {
isr1 &= ~EDP_INTR_HPD; /* clear */
edp_send_events(ep, EV_LINK_TRAIN);
}
if (isr2 & EDP_INTR_READY_FOR_VIDEO)
edp_send_events(ep, EV_VIDEO_READY);
if (isr2 & EDP_INTR_IDLE_PATTERNs_SENT)
edp_send_events(ep, EV_IDLE_PATTERNS_SENT);
if (isr1 && ep->aux_cmd_busy) {
/* clear EDP_AUX_TRANS_CTRL */
edp_write(base + 0x318, 0);
/* read EDP_INTERRUPT_TRANS_NUM */
ep->aux_trans_num = edp_read(base + 0x310);
if (ep->aux_cmd_i2c)
edp_aux_i2c_handler(ep, isr1);
else
edp_aux_native_handler(ep, isr1);
}
return IRQ_HANDLED;
}
示例3: edp_config_sync
static void edp_config_sync(void)
{
int ret = 0;
ret = edp_read(EDP_BASE + 0xc); /* EDP_CONFIGURATION_CTRL */
ret &= ~0x733;
ret |= (0x55 & 0x733);
edp_write(EDP_BASE + 0xc, ret);
edp_write(EDP_BASE + 0xc, 0x55); /* EDP_CONFIGURATION_CTRL */
}
示例4: mdss_edp_irq_disable
static void mdss_edp_irq_disable(struct mdss_edp_drv_pdata *edp_drv)
{
unsigned long flags;
spin_lock_irqsave(&edp_drv->lock, flags);
edp_write(edp_drv->base + 0x308, 0x0);
edp_write(edp_drv->base + 0x30c, 0x0);
spin_unlock_irqrestore(&edp_drv->lock, flags);
edp_drv->mdss_util->disable_irq(&mdss_edp_hw);
}
示例5: mdss_edp_irq_enable
static void mdss_edp_irq_enable(struct mdss_edp_drv_pdata *edp_drv)
{
unsigned long flags;
spin_lock_irqsave(&edp_drv->lock, flags);
edp_write(edp_drv->base + 0x308, edp_drv->mask1);
edp_write(edp_drv->base + 0x30c, edp_drv->mask2);
spin_unlock_irqrestore(&edp_drv->lock, flags);
mdss_enable_irq(&mdss_edp_hw);
}
示例6: mdss_edp_phy_power_ctrl
void mdss_edp_phy_power_ctrl(struct mdss_edp_drv_pdata *ep, int enable)
{
if (enable) {
/* EDP_PHY_EDPPHY_GLB_PD_CTL */
edp_write(ep->base + 0x52c, 0x3f);
/* EDP_PHY_EDPPHY_GLB_CFG */
edp_write(ep->base + 0x528, 0x1);
/* EDP_PHY_PLL_UNIPHY_PLL_GLB_CFG */
edp_write(ep->base + 0x620, 0xf);
} else {
/* EDP_PHY_EDPPHY_GLB_PD_CTL */
edp_write(ep->base + 0x52c, 0xc0);
}
}
示例7: edp_mainlink_ctrl
static void edp_mainlink_ctrl(struct edp_ctrl *ctrl, int enable)
{
u32 data = 0;
edp_write(ctrl->base + REG_EDP_MAINLINK_CTRL, EDP_MAINLINK_CTRL_RESET);
/* Make sure fully reset */
wmb();
usleep_range(500, 1000);
if (enable)
data |= EDP_MAINLINK_CTRL_ENABLE;
edp_write(ctrl->base + REG_EDP_MAINLINK_CTRL, data);
}
示例8: edp_ctrl_irq_enable
static void edp_ctrl_irq_enable(struct edp_ctrl *ctrl, int enable)
{
unsigned long flags;
DBG("%d", enable);
spin_lock_irqsave(&ctrl->irq_lock, flags);
if (enable) {
edp_write(ctrl->base + REG_EDP_INTERRUPT_REG_1, EDP_INTR_MASK1);
edp_write(ctrl->base + REG_EDP_INTERRUPT_REG_2, EDP_INTR_MASK2);
} else {
edp_write(ctrl->base + REG_EDP_INTERRUPT_REG_1, 0x0);
edp_write(ctrl->base + REG_EDP_INTERRUPT_REG_2, 0x0);
}
spin_unlock_irqrestore(&ctrl->irq_lock, flags);
DBG("exit");
}
示例9: edp_clock_synchrous
static void edp_clock_synchrous(struct edp_ctrl *ctrl, int sync)
{
u32 data;
enum edp_color_depth depth;
data = edp_read(ctrl->base + REG_EDP_MISC1_MISC0);
if (sync)
data |= EDP_MISC1_MISC0_SYNC;
else
data &= ~EDP_MISC1_MISC0_SYNC;
/* only legacy rgb mode supported */
depth = EDP_6BIT; /* Default */
if (ctrl->color_depth == 8)
depth = EDP_8BIT;
else if (ctrl->color_depth == 10)
depth = EDP_10BIT;
else if (ctrl->color_depth == 12)
depth = EDP_12BIT;
else if (ctrl->color_depth == 16)
depth = EDP_16BIT;
data |= EDP_MISC1_MISC0_COLOR(depth);
edp_write(ctrl->base + REG_EDP_MISC1_MISC0, data);
}
示例10: mdss_edp_config_ctrl
void mdss_edp_config_ctrl(struct mdss_edp_drv_pdata *ep)
{
struct dpcd_cap *cap;
struct display_timing_desc *dp;
u32 data = 0;
dp = &ep->edid.timing[0];
cap = &ep->dpcd;
data = ep->lane_cnt - 1;
data <<= 4;
if (cap->enhanced_frame)
data |= 0x40;
if (ep->edid.color_depth == 8) {
/* 0 == 6 bits, 1 == 8 bits */
data |= 0x100; /* bit 8 */
}
if (!dp->interlaced) /* progressive */
data |= 0x04;
data |= 0x03; /* sycn clock & static Mvid */
edp_write(ep->base + 0xc, data); /* EDP_CONFIGURATION_CTRL */
}
示例11: mdss_edp_clock_synchrous
void mdss_edp_clock_synchrous(struct mdss_edp_drv_pdata *ep, int sync)
{
u32 data;
u32 color;
/* EDP_MISC1_MISC0 */
data = edp_read(ep->base + 0x02c);
if (sync)
data |= 0x01;
else
data &= ~0x01;
/* only legacy rgb mode supported */
color = 0; /* 6 bits */
if (ep->edid.color_depth == 8)
color = 0x01;
else if (ep->edid.color_depth == 10)
color = 0x02;
else if (ep->edid.color_depth == 12)
color = 0x03;
else if (ep->edid.color_depth == 16)
color = 0x04;
color <<= 5; /* bit 5 to bit 7 */
data |= color;
/* EDP_MISC1_MISC0 */
edp_write(ep->base + 0x2c, data);
}
示例12: msm_edp_ctrl_irq
irqreturn_t msm_edp_ctrl_irq(struct edp_ctrl *ctrl)
{
u32 isr1, isr2, mask1, mask2;
u32 ack;
DBG("");
spin_lock(&ctrl->irq_lock);
isr1 = edp_read(ctrl->base + REG_EDP_INTERRUPT_REG_1);
isr2 = edp_read(ctrl->base + REG_EDP_INTERRUPT_REG_2);
mask1 = isr1 & EDP_INTR_MASK1;
mask2 = isr2 & EDP_INTR_MASK2;
isr1 &= ~mask1; /* remove masks bit */
isr2 &= ~mask2;
DBG("isr=%x mask=%x isr2=%x mask2=%x",
isr1, mask1, isr2, mask2);
ack = isr1 & EDP_INTR_STATUS1;
ack <<= 1; /* ack bits */
ack |= mask1;
edp_write(ctrl->base + REG_EDP_INTERRUPT_REG_1, ack);
ack = isr2 & EDP_INTR_STATUS2;
ack <<= 1; /* ack bits */
ack |= mask2;
edp_write(ctrl->base + REG_EDP_INTERRUPT_REG_2, ack);
spin_unlock(&ctrl->irq_lock);
if (isr1 & EDP_INTERRUPT_REG_1_HPD)
DBG("edp_hpd");
if (isr2 & EDP_INTERRUPT_REG_2_READY_FOR_VIDEO)
DBG("edp_video_ready");
if (isr2 & EDP_INTERRUPT_REG_2_IDLE_PATTERNs_SENT) {
DBG("idle_patterns_sent");
complete(&ctrl->idle_comp);
}
msm_edp_aux_irq(ctrl->aux, isr1);
return IRQ_HANDLED;
}
示例13: edp_sw_mvid_nvid
static int edp_sw_mvid_nvid(struct edp_ctrl *ctrl, u32 m, u32 n)
{
u32 n_multi, m_multi = 5;
if (ctrl->link_rate == DP_LINK_BW_1_62) {
n_multi = 1;
} else if (ctrl->link_rate == DP_LINK_BW_2_7) {
n_multi = 2;
} else {
pr_err("%s: Invalid link rate, %d\n", __func__,
ctrl->link_rate);
return -EINVAL;
}
edp_write(ctrl->base + REG_EDP_SOFTWARE_MVID, m * m_multi);
edp_write(ctrl->base + REG_EDP_SOFTWARE_NVID, n * n_multi);
return 0;
}
示例14: mdss_edp_timing_cfg
static void mdss_edp_timing_cfg(struct mdss_edp_drv_pdata *ep)
{
struct mdss_panel_info *pinfo;
u32 total_ver, total_hor;
u32 data;
pinfo = &ep->panel_data.panel_info;
pr_debug("%s: width=%d hporch= %d %d %d\n", __func__,
pinfo->xres, pinfo->lcdc.h_back_porch,
pinfo->lcdc.h_front_porch, pinfo->lcdc.h_pulse_width);
pr_debug("%s: height=%d vporch= %d %d %d\n", __func__,
pinfo->yres, pinfo->lcdc.v_back_porch,
pinfo->lcdc.v_front_porch, pinfo->lcdc.v_pulse_width);
total_hor = pinfo->xres + pinfo->lcdc.h_back_porch +
pinfo->lcdc.h_front_porch + pinfo->lcdc.h_pulse_width;
total_ver = pinfo->yres + pinfo->lcdc.v_back_porch +
pinfo->lcdc.v_front_porch + pinfo->lcdc.v_pulse_width;
data = total_ver;
data <<= 16;
data |= total_hor;
edp_write(ep->base + 0x1c, data); /* EDP_TOTAL_HOR_VER */
data = (pinfo->lcdc.v_back_porch + pinfo->lcdc.v_pulse_width);
data <<= 16;
data |= (pinfo->lcdc.h_back_porch + pinfo->lcdc.h_pulse_width);
edp_write(ep->base + 0x20, data); /* EDP_START_HOR_VER_FROM_SYNC */
data = pinfo->lcdc.v_pulse_width;
data <<= 16;
data |= pinfo->lcdc.h_pulse_width;
edp_write(ep->base + 0x24, data); /* EDP_HSYNC_VSYNC_WIDTH_POLARITY */
data = pinfo->yres;
data <<= 16;
data |= pinfo->xres;
edp_write(ep->base + 0x28, data); /* EDP_ACTIVE_HOR_VER */
}
示例15: mdss_edp_aux_ctrl
void mdss_edp_aux_ctrl(struct mdss_edp_drv_pdata *ep, int enable)
{
u32 data;
data = edp_read(ep->base + 0x300);
if (enable)
data |= 0x01;
else
data |= ~0x01;
edp_write(ep->base + 0x300, data); /* EDP_AUX_CTRL */
}