summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_gpio.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-07-26 09:28:25 +1000
committerBen Skeggs <bskeggs@redhat.com>2010-07-26 11:43:57 +1000
commitee2e013131dcf6427334663662dbe760ccdba735 (patch)
tree2533973de31a05dbb06465a124087334842c6f37 /drivers/gpu/drm/nouveau/nv50_gpio.c
parentbf563a6b7c7efb283dd4ddf12cc90c2898195c16 (diff)
drm/nouveau: introduce gpio engine
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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c
index 88715c5003c..b2fab2bf3d6 100644
--- a/drivers/gpu/drm/nouveau/nv50_gpio.c
+++ b/drivers/gpu/drm/nouveau/nv50_gpio.c
@@ -93,3 +93,19 @@ nv50_gpio_irq_enable(struct drm_device *dev, enum dcb_gpio_tag tag, bool on)
nv_wr32(dev, reg + 4, mask);
nv_mask(dev, reg + 0, mask, on ? mask : 0);
}
+
+int
+nv50_gpio_init(struct drm_device *dev)
+{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+
+ /* disable, and ack any pending gpio interrupts */
+ nv_wr32(dev, 0xe050, 0x00000000);
+ nv_wr32(dev, 0xe054, 0xffffffff);
+ if (dev_priv->chipset >= 0x90) {
+ nv_wr32(dev, 0xe070, 0x00000000);
+ nv_wr32(dev, 0xe074, 0xffffffff);
+ }
+
+ return 0;
+}