diff options
author | Liu Ying <victor.liu@nxp.com> | 2018-08-30 15:46:56 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:58:28 +0800 |
commit | 1a04cd435deed3d2e582119a2a616e5cb2400ff5 (patch) | |
tree | fdccca402991321bc88b6dd0c8c052c4dad84a43 | |
parent | 5705389c717f21f920a215e647f1d64eab48700b (diff) |
gpu: imx: dpu: extdst: Add extdst_pixengcfg_syncmode_master() helper
This patch adds extdst_pixengcfg_syncmode_master() helper support
so that the callers may control if a extdst is master or slave
when it works in sync mode. The bit16 of extdst's PIXENGCFG_STATIC
register controls this and it's a part of sync mode fixup logic.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
-rw-r--r-- | drivers/gpu/imx/dpu/dpu-extdst.c | 15 | ||||
-rw-r--r-- | include/video/dpu.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/imx/dpu/dpu-extdst.c b/drivers/gpu/imx/dpu/dpu-extdst.c index b70affc50d3c..013e03a2537e 100644 --- a/drivers/gpu/imx/dpu/dpu-extdst.c +++ b/drivers/gpu/imx/dpu/dpu-extdst.c @@ -170,6 +170,21 @@ void extdst_pixengcfg_div(struct dpu_extdst *ed, u16 div) } EXPORT_SYMBOL_GPL(extdst_pixengcfg_div); +void extdst_pixengcfg_syncmode_master(struct dpu_extdst *ed, bool enable) +{ + u32 val; + + mutex_lock(&ed->mutex); + val = dpu_pec_ed_read(ed, PIXENGCFG_STATIC); + if (enable) + val |= BIT(16); + else + val &= ~BIT(16); + dpu_pec_ed_write(ed, PIXENGCFG_STATIC, val); + mutex_unlock(&ed->mutex); +} +EXPORT_SYMBOL_GPL(extdst_pixengcfg_syncmode_master); + int extdst_pixengcfg_src_sel(struct dpu_extdst *ed, extdst_src_sel_t src) { mutex_lock(&ed->mutex); diff --git a/include/video/dpu.h b/include/video/dpu.h index 0002a7840167..1f2c8287fcdb 100644 --- a/include/video/dpu.h +++ b/include/video/dpu.h @@ -413,6 +413,7 @@ void extdst_pixengcfg_powerdown(struct dpu_extdst *ed, bool powerdown); void extdst_pixengcfg_sync_mode(struct dpu_extdst *ed, ed_sync_mode_t mode); void extdst_pixengcfg_reset(struct dpu_extdst *ed, bool reset); void extdst_pixengcfg_div(struct dpu_extdst *ed, u16 div); +void extdst_pixengcfg_syncmode_master(struct dpu_extdst *ed, bool enable); int extdst_pixengcfg_src_sel(struct dpu_extdst *ed, extdst_src_sel_t src); void extdst_pixengcfg_sel_shdldreq(struct dpu_extdst *ed); void extdst_pixengcfg_shdldreq(struct dpu_extdst *ed, u32 req_mask); |