diff options
author | Stefan Agner <stefan@agner.ch> | 2017-06-02 05:43:30 +0300 |
---|---|---|
committer | Stefan Agner <stefan@agner.ch> | 2017-06-09 00:59:14 +0300 |
commit | 685ec6ebcd0edde718d2c95a550bca36563c9055 (patch) | |
tree | 22f66c075b12e48fc383775957f8e2b533666348 /drivers/gpu/drm/fsl-dcu | |
parent | ffe881fba1e8467872fcb926fe2817aedbec2592 (diff) | |
download | linux-685ec6ebcd0edde718d2c95a550bca36563c9055.tar.xz |
drm/fsl-dcu: implement irq_preinstall/uninstall callbacks
Make use of the irq_preinstall/uninstall callback to clear and
mask all interrupts. Use write 1 to clear as documented by the
data sheet (writing a 0 seems to have cleared interrupt status
too). Remove fsl_dcu_drm_irq_init and call drm_irq_install
directly from fsl_dcu_load makes error handling a bit simpler.
Do not set irq_enabled since drm_irq_install is taking care of
it.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'drivers/gpu/drm/fsl-dcu')
-rw-r--r-- | drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index b34d09b59eee..b134acf19c41 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -51,19 +51,12 @@ static const struct regmap_config fsl_dcu_regmap_config = { .volatile_reg = fsl_dcu_drm_is_volatile_reg, }; -static int fsl_dcu_drm_irq_init(struct drm_device *dev) +static void fsl_dcu_irq_uninstall(struct drm_device *dev) { struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; - int ret; - - ret = drm_irq_install(dev, fsl_dev->irq); - if (ret < 0) - dev_err(dev->dev, "failed to install IRQ handler\n"); - regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0); + regmap_write(fsl_dev->regmap, DCU_INT_STATUS, ~0); regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0); - - return ret; } static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) @@ -83,10 +76,11 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) goto done; } - ret = fsl_dcu_drm_irq_init(dev); - if (ret < 0) + ret = drm_irq_install(dev, fsl_dev->irq); + if (ret < 0) { + dev_err(dev->dev, "failed to install IRQ handler\n"); goto done; - dev->irq_enabled = true; + } if (legacyfb_depth != 16 && legacyfb_depth != 24 && legacyfb_depth != 32) { @@ -168,6 +162,8 @@ static struct drm_driver fsl_dcu_drm_driver = { .load = fsl_dcu_load, .unload = fsl_dcu_unload, .irq_handler = fsl_dcu_drm_irq, + .irq_preinstall = fsl_dcu_irq_uninstall, + .irq_uninstall = fsl_dcu_irq_uninstall, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |