summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv40_pm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-11-21 21:28:28 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 19:01:44 +1000
commit675aac033e089833e763ea4fbabae66883d10574 (patch)
tree69e16cb4743d72b36d54bcffa57bf06b9eb449cc /drivers/gpu/drm/nouveau/nv40_pm.c
parentc8b9641a9146b13d34824f99c3d22c8c0c3a06bd (diff)
downloadlinux-675aac033e089833e763ea4fbabae66883d10574.tar.gz
linux-675aac033e089833e763ea4fbabae66883d10574.tar.xz
linux-675aac033e089833e763ea4fbabae66883d10574.zip
drm/nouveau: just pass gpio line to pwm_*, not entire gpio struct
We don't need more than the line id to determine the PWM controller, and the GPIO interfaces are about to change somewhat. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv40_pm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv40_pm.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nv40_pm.c b/drivers/gpu/drm/nouveau/nv40_pm.c
index 3d5a5a7856e6..c7615381c5d9 100644
--- a/drivers/gpu/drm/nouveau/nv40_pm.c
+++ b/drivers/gpu/drm/nouveau/nv40_pm.c
@@ -351,10 +351,9 @@ resume:
}
int
-nv40_pm_pwm_get(struct drm_device *dev, struct dcb_gpio_entry *gpio,
- u32 *divs, u32 *duty)
+nv40_pm_pwm_get(struct drm_device *dev, int line, u32 *divs, u32 *duty)
{
- if (gpio->line == 2) {
+ if (line == 2) {
u32 reg = nv_rd32(dev, 0x0010f0);
if (reg & 0x80000000) {
*duty = (reg & 0x7fff0000) >> 16;
@@ -362,7 +361,7 @@ nv40_pm_pwm_get(struct drm_device *dev, struct dcb_gpio_entry *gpio,
return 0;
}
} else
- if (gpio->line == 9) {
+ if (line == 9) {
u32 reg = nv_rd32(dev, 0x0015f4);
if (reg & 0x80000000) {
*divs = nv_rd32(dev, 0x0015f8);
@@ -370,7 +369,7 @@ nv40_pm_pwm_get(struct drm_device *dev, struct dcb_gpio_entry *gpio,
return 0;
}
} else {
- NV_ERROR(dev, "unknown pwm ctrl for gpio %d\n", gpio->line);
+ NV_ERROR(dev, "unknown pwm ctrl for gpio %d\n", line);
return -ENODEV;
}
@@ -378,17 +377,16 @@ nv40_pm_pwm_get(struct drm_device *dev, struct dcb_gpio_entry *gpio,
}
int
-nv40_pm_pwm_set(struct drm_device *dev, struct dcb_gpio_entry *gpio,
- u32 divs, u32 duty)
+nv40_pm_pwm_set(struct drm_device *dev, int line, u32 divs, u32 duty)
{
- if (gpio->line == 2) {
+ if (line == 2) {
nv_wr32(dev, 0x0010f0, 0x80000000 | (duty << 16) | divs);
} else
- if (gpio->line == 9) {
+ if (line == 9) {
nv_wr32(dev, 0x0015f8, divs);
nv_wr32(dev, 0x0015f4, duty | 0x80000000);
} else {
- NV_ERROR(dev, "unknown pwm ctrl for gpio %d\n", gpio->line);
+ NV_ERROR(dev, "unknown pwm ctrl for gpio %d\n", line);
return -ENODEV;
}