diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-11-21 01:41:48 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 04:01:45 -0500 |
commit | a0b25635515ef5049f93b032a1e37f18b16e0f6f (patch) | |
tree | 34c25948a2fd7b8eadf46418d767d43c9a64c06b /drivers/gpu/drm/nouveau/nouveau_connector.c | |
parent | 675aac033e089833e763ea4fbabae66883d10574 (diff) |
drm/nouveau/gpio: reimplement as nouveau_gpio.c, fixing a number of issues
- moves out of nouveau_bios.c and demagics the logical state definitions
- simplifies chipset-specific driver interface
- makes most of gpio irq handling common, will use for nv4x hpd later
- api extended to allow both direct gpio access, and access using the
logical function states
- api extended to allow for future use of gpio extender chips
- pre-nv50 was handled very badly, the main issue being that all GPIOs
were being treated as output-only.
- fixes nvd0 so gpio changes actually stick, magic reg needs bashing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_connector.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index df99c7f1191a..f3ce34be082a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "nouveau_encoder.h" | 35 | #include "nouveau_encoder.h" |
36 | #include "nouveau_crtc.h" | 36 | #include "nouveau_crtc.h" |
37 | #include "nouveau_connector.h" | 37 | #include "nouveau_connector.h" |
38 | #include "nouveau_gpio.h" | ||
38 | #include "nouveau_hw.h" | 39 | #include "nouveau_hw.h" |
39 | 40 | ||
40 | static void nouveau_connector_hotplug(void *, int); | 41 | static void nouveau_connector_hotplug(void *, int); |
@@ -83,7 +84,6 @@ nouveau_connector_destroy(struct drm_connector *connector) | |||
83 | { | 84 | { |
84 | struct nouveau_connector *nv_connector = nouveau_connector(connector); | 85 | struct nouveau_connector *nv_connector = nouveau_connector(connector); |
85 | struct drm_nouveau_private *dev_priv; | 86 | struct drm_nouveau_private *dev_priv; |
86 | struct nouveau_gpio_engine *pgpio; | ||
87 | struct drm_device *dev; | 87 | struct drm_device *dev; |
88 | 88 | ||
89 | if (!nv_connector) | 89 | if (!nv_connector) |
@@ -93,10 +93,9 @@ nouveau_connector_destroy(struct drm_connector *connector) | |||
93 | dev_priv = dev->dev_private; | 93 | dev_priv = dev->dev_private; |
94 | NV_DEBUG_KMS(dev, "\n"); | 94 | NV_DEBUG_KMS(dev, "\n"); |
95 | 95 | ||
96 | pgpio = &dev_priv->engine.gpio; | 96 | if (nv_connector->hpd != DCB_GPIO_UNUSED) { |
97 | if (pgpio->irq_unregister) { | 97 | nouveau_gpio_isr_del(dev, 0, nv_connector->hpd, 0xff, |
98 | pgpio->irq_unregister(dev, nv_connector->hpd, | 98 | nouveau_connector_hotplug, connector); |
99 | nouveau_connector_hotplug, connector); | ||
100 | } | 99 | } |
101 | 100 | ||
102 | kfree(nv_connector->edid); | 101 | kfree(nv_connector->edid); |
@@ -876,7 +875,6 @@ nouveau_connector_create(struct drm_device *dev, int index) | |||
876 | const struct drm_connector_funcs *funcs = &nouveau_connector_funcs; | 875 | const struct drm_connector_funcs *funcs = &nouveau_connector_funcs; |
877 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 876 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
878 | struct nouveau_display_engine *disp = &dev_priv->engine.display; | 877 | struct nouveau_display_engine *disp = &dev_priv->engine.display; |
879 | struct nouveau_gpio_engine *pgpio = &dev_priv->engine.gpio; | ||
880 | struct nouveau_connector *nv_connector = NULL; | 878 | struct nouveau_connector *nv_connector = NULL; |
881 | struct drm_connector *connector; | 879 | struct drm_connector *connector; |
882 | int type, ret = 0; | 880 | int type, ret = 0; |
@@ -1050,13 +1048,13 @@ nouveau_connector_create(struct drm_device *dev, int index) | |||
1050 | break; | 1048 | break; |
1051 | } | 1049 | } |
1052 | 1050 | ||
1053 | if (nv_connector->hpd != DCB_GPIO_UNUSED && pgpio->irq_register) { | 1051 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; |
1054 | pgpio->irq_register(dev, nv_connector->hpd, | 1052 | if (nv_connector->hpd != DCB_GPIO_UNUSED) { |
1055 | nouveau_connector_hotplug, connector); | 1053 | ret = nouveau_gpio_isr_add(dev, 0, nv_connector->hpd, 0xff, |
1056 | 1054 | nouveau_connector_hotplug, | |
1057 | connector->polled = DRM_CONNECTOR_POLL_HPD; | 1055 | connector); |
1058 | } else { | 1056 | if (ret == 0) |
1059 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | 1057 | connector->polled = DRM_CONNECTOR_POLL_HPD; |
1060 | } | 1058 | } |
1061 | 1059 | ||
1062 | drm_sysfs_connector_add(connector); | 1060 | drm_sysfs_connector_add(connector); |