aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_volt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_volt.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_volt.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_volt.c b/drivers/gpu/drm/nouveau/nouveau_volt.c
index 86d03e15735d..b010cb997b34 100644
--- a/drivers/gpu/drm/nouveau/nouveau_volt.c
+++ b/drivers/gpu/drm/nouveau/nouveau_volt.c
@@ -26,6 +26,7 @@
26 26
27#include "nouveau_drv.h" 27#include "nouveau_drv.h"
28#include "nouveau_pm.h" 28#include "nouveau_pm.h"
29#include "nouveau_gpio.h"
29 30
30static const enum dcb_gpio_tag vidtag[] = { 0x04, 0x05, 0x06, 0x1a, 0x73 }; 31static const enum dcb_gpio_tag vidtag[] = { 0x04, 0x05, 0x06, 0x1a, 0x73 };
31static int nr_vidtag = sizeof(vidtag) / sizeof(vidtag[0]); 32static int nr_vidtag = sizeof(vidtag) / sizeof(vidtag[0]);
@@ -34,7 +35,6 @@ int
34nouveau_voltage_gpio_get(struct drm_device *dev) 35nouveau_voltage_gpio_get(struct drm_device *dev)
35{ 36{
36 struct drm_nouveau_private *dev_priv = dev->dev_private; 37 struct drm_nouveau_private *dev_priv = dev->dev_private;
37 struct nouveau_gpio_engine *gpio = &dev_priv->engine.gpio;
38 struct nouveau_pm_voltage *volt = &dev_priv->engine.pm.voltage; 38 struct nouveau_pm_voltage *volt = &dev_priv->engine.pm.voltage;
39 u8 vid = 0; 39 u8 vid = 0;
40 int i; 40 int i;
@@ -43,7 +43,7 @@ nouveau_voltage_gpio_get(struct drm_device *dev)
43 if (!(volt->vid_mask & (1 << i))) 43 if (!(volt->vid_mask & (1 << i)))
44 continue; 44 continue;
45 45
46 vid |= gpio->get(dev, vidtag[i]) << i; 46 vid |= nouveau_gpio_func_get(dev, vidtag[i]) << i;
47 } 47 }
48 48
49 return nouveau_volt_lvl_lookup(dev, vid); 49 return nouveau_volt_lvl_lookup(dev, vid);
@@ -53,7 +53,6 @@ int
53nouveau_voltage_gpio_set(struct drm_device *dev, int voltage) 53nouveau_voltage_gpio_set(struct drm_device *dev, int voltage)
54{ 54{
55 struct drm_nouveau_private *dev_priv = dev->dev_private; 55 struct drm_nouveau_private *dev_priv = dev->dev_private;
56 struct nouveau_gpio_engine *gpio = &dev_priv->engine.gpio;
57 struct nouveau_pm_voltage *volt = &dev_priv->engine.pm.voltage; 56 struct nouveau_pm_voltage *volt = &dev_priv->engine.pm.voltage;
58 int vid, i; 57 int vid, i;
59 58
@@ -65,7 +64,7 @@ nouveau_voltage_gpio_set(struct drm_device *dev, int voltage)
65 if (!(volt->vid_mask & (1 << i))) 64 if (!(volt->vid_mask & (1 << i)))
66 continue; 65 continue;
67 66
68 gpio->set(dev, vidtag[i], !!(vid & (1 << i))); 67 nouveau_gpio_func_set(dev, vidtag[i], !!(vid & (1 << i)));
69 } 68 }
70 69
71 return 0; 70 return 0;
@@ -117,10 +116,10 @@ nouveau_volt_init(struct drm_device *dev)
117 return; 116 return;
118 117
119 if (P.version == 1) 118 if (P.version == 1)
120 volt = ROMPTR(bios, P.data[16]); 119 volt = ROMPTR(dev, P.data[16]);
121 else 120 else
122 if (P.version == 2) 121 if (P.version == 2)
123 volt = ROMPTR(bios, P.data[12]); 122 volt = ROMPTR(dev, P.data[12]);
124 else { 123 else {
125 NV_WARN(dev, "unknown volt for BIT P %d\n", P.version); 124 NV_WARN(dev, "unknown volt for BIT P %d\n", P.version);
126 } 125 }
@@ -130,7 +129,7 @@ nouveau_volt_init(struct drm_device *dev)
130 return; 129 return;
131 } 130 }
132 131
133 volt = ROMPTR(bios, bios->data[bios->offset + 0x98]); 132 volt = ROMPTR(dev, bios->data[bios->offset + 0x98]);
134 } 133 }
135 134
136 if (!volt) { 135 if (!volt) {
@@ -194,7 +193,7 @@ nouveau_volt_init(struct drm_device *dev)
194 return; 193 return;
195 } 194 }
196 195
197 if (!nouveau_bios_gpio_entry(dev, vidtag[i])) { 196 if (!nouveau_gpio_func_valid(dev, vidtag[i])) {
198 NV_DEBUG(dev, "vid bit %d has no gpio tag\n", i); 197 NV_DEBUG(dev, "vid bit %d has no gpio tag\n", i);
199 return; 198 return;
200 } 199 }