Commit efb8b491 authored by Stefan Agner's avatar Stefan Agner

drm/fsl-dcu: specify volatile registers

Since we are using cached registers, we need to specify volatile
registers explicitly to avoid reading their value from the cache.
This allows to read the correct interrupt status in fsl_dcu_drm_irq
and clear the asserted bits only.
Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
parent a36c9867
...@@ -28,11 +28,21 @@ ...@@ -28,11 +28,21 @@
#include "fsl_dcu_drm_crtc.h" #include "fsl_dcu_drm_crtc.h"
#include "fsl_dcu_drm_drv.h" #include "fsl_dcu_drm_drv.h"
static bool fsl_dcu_drm_is_volatile_reg(struct device *dev, unsigned int reg)
{
if (reg == DCU_INT_STATUS || reg == DCU_UPDATE_MODE)
return true;
return false;
}
static const struct regmap_config fsl_dcu_regmap_config = { static const struct regmap_config fsl_dcu_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.reg_stride = 4, .reg_stride = 4,
.val_bits = 32, .val_bits = 32,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
.volatile_reg = fsl_dcu_drm_is_volatile_reg,
}; };
static int fsl_dcu_drm_irq_init(struct drm_device *dev) static int fsl_dcu_drm_irq_init(struct drm_device *dev)
...@@ -125,7 +135,7 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg) ...@@ -125,7 +135,7 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
if (int_status & DCU_INT_STATUS_VBLANK) if (int_status & DCU_INT_STATUS_VBLANK)
drm_handle_vblank(dev, 0); drm_handle_vblank(dev, 0);
ret = regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0xffffffff); ret = regmap_write(fsl_dev->regmap, DCU_INT_STATUS, int_status);
if (ret) if (ret)
dev_err(dev->dev, "set DCU_INT_STATUS failed\n"); dev_err(dev->dev, "set DCU_INT_STATUS failed\n");
ret = regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE, ret = regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment