summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nv50_gpio.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-07-23 05:31:08 +0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-26 05:42:59 +0400
commitd0875edd9374296af8702d850254809e34a809cd (patch)
treef9870d97129af1a7a941904f38fb60401a65b1b0 /drivers/gpu/drm/nouveau/nv50_gpio.c
parent49eed80ad0cfa5d5d02992e8088463cbf1a5ff85 (diff)
downloadlinux-d0875edd9374296af8702d850254809e34a809cd.tar.xz
drm/nv50: add function to control GPIO IRQ reporting
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_gpio.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_gpio.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c
index bb47ad737267..88715c5003c1 100644
--- a/drivers/gpu/drm/nouveau/nv50_gpio.c
+++ b/drivers/gpu/drm/nouveau/nv50_gpio.c
@@ -74,3 +74,22 @@ nv50_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state)
nv_wr32(dev, r, v);
return 0;
}
+
+void
+nv50_gpio_irq_enable(struct drm_device *dev, enum dcb_gpio_tag tag, bool on)
+{
+ struct dcb_gpio_entry *gpio;
+ u32 reg, mask;
+
+ gpio = nouveau_bios_gpio_entry(dev, tag);
+ if (!gpio) {
+ NV_ERROR(dev, "gpio tag 0x%02x not found\n", tag);
+ return;
+ }
+
+ reg = gpio->line < 16 ? 0xe050 : 0xe070;
+ mask = 0x00010001 << (gpio->line & 0xf);
+
+ nv_wr32(dev, reg + 4, mask);
+ nv_mask(dev, reg + 0, mask, on ? mask : 0);
+}