diff options
author | james qian wang (Arm Technology China) <james.qian.wang@arm.com> | 2019-01-22 09:24:25 +0000 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2019-04-01 18:08:26 +0100 |
commit | 0dac37bf1c5dc1e8454fbe8d548f6e312cfd982d (patch) | |
tree | 2eb4e346ab6b66eaed624724bd005c10e8095331 /drivers/gpu/drm/arm/display/komeda/komeda_dev.c | |
parent | 321e925c5813c228bafda5ea3729ebddb00a3040 (diff) | |
download | lwn-0dac37bf1c5dc1e8454fbe8d548f6e312cfd982d.tar.gz lwn-0dac37bf1c5dc1e8454fbe8d548f6e312cfd982d.zip |
drm/komeda: Add irq handling
1. Added irq_handler/irq_enable/irq_disable to komeda_dev_func, then the
Komeda-CORE can control the HW irq via these chip function.
2. Install irq and register irq_handler to system by DRM, so once the IRQ
coming, the handling sequence is:
komeda_kms_irq_handler(int irq, void *data)
/* step 1. call into the CHIP to recognize event */
mdev->funcs->irq_handler(mdev, &evts);
/* step 2. notify the crtc to handle the events */
for (i = 0; i < kms->n_crtcs; i++)
komeda_crtc_handle_event(&kms->crtcs[i], &evts);
v2:
- Move get IRQ number into this change.
- Enable irq before drm_dev_register.
Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm/display/komeda/komeda_dev.c')
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index 780ca86c9db9..cf65bf5331d9 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -53,6 +53,7 @@ static int komeda_parse_pipe_dt(struct komeda_dev *mdev, struct device_node *np) static int komeda_parse_dt(struct device *dev, struct komeda_dev *mdev) { + struct platform_device *pdev = to_platform_device(dev); struct device_node *child, *np = dev->of_node; struct clk *clk; int ret; @@ -62,6 +63,11 @@ static int komeda_parse_dt(struct device *dev, struct komeda_dev *mdev) return PTR_ERR(clk); mdev->mclk = clk; + mdev->irq = platform_get_irq(pdev, 0); + if (mdev->irq < 0) { + DRM_ERROR("could not get IRQ number.\n"); + return mdev->irq; + } for_each_available_child_of_node(np, child) { if (of_node_cmp(child->name, "pipeline") == 0) { |