]> Pileus Git - ~andy/linux/blobdiff - drivers/gpu/drm/nouveau/nv50_pm.c
Merge tag 'tags/disintegrate-tile-20121009' into for-linus
[~andy/linux] / drivers / gpu / drm / nouveau / nv50_pm.c
index 0036c8c966de4e3154e73fc016eb934335dc5c11..c4a65039b1ca3199f79866dd1cd1c11988e264d1 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "drmP.h"
+#include <drm/drmP.h>
 #include "nouveau_drm.h"
 #include "nouveau_bios.h"
 #include "nouveau_hw.h"
@@ -853,61 +853,3 @@ resume:
        kfree(info);
        return ret;
 }
-
-static int
-pwm_info(struct drm_device *dev, int *line, int *ctrl, int *indx)
-{
-       struct nouveau_drm *drm = nouveau_drm(dev);
-
-       if (*line == 0x04) {
-               *ctrl = 0x00e100;
-               *line = 4;
-               *indx = 0;
-       } else
-       if (*line == 0x09) {
-               *ctrl = 0x00e100;
-               *line = 9;
-               *indx = 1;
-       } else
-       if (*line == 0x10) {
-               *ctrl = 0x00e28c;
-               *line = 0;
-               *indx = 0;
-       } else {
-               NV_ERROR(drm, "unknown pwm ctrl for gpio %d\n", *line);
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
-int
-nv50_pm_pwm_get(struct drm_device *dev, int line, u32 *divs, u32 *duty)
-{
-       struct nouveau_device *device = nouveau_dev(dev);
-       int ctrl, id, ret = pwm_info(dev, &line, &ctrl, &id);
-       if (ret)
-               return ret;
-
-       if (nv_rd32(device, ctrl) & (1 << line)) {
-               *divs = nv_rd32(device, 0x00e114 + (id * 8));
-               *duty = nv_rd32(device, 0x00e118 + (id * 8));
-               return 0;
-       }
-
-       return -EINVAL;
-}
-
-int
-nv50_pm_pwm_set(struct drm_device *dev, int line, u32 divs, u32 duty)
-{
-       struct nouveau_device *device = nouveau_dev(dev);
-       int ctrl, id, ret = pwm_info(dev, &line, &ctrl, &id);
-       if (ret)
-               return ret;
-
-       nv_mask(device, ctrl, 0x00010001 << line, 0x00000001 << line);
-       nv_wr32(device, 0x00e114 + (id * 8), divs);
-       nv_wr32(device, 0x00e118 + (id * 8), duty | 0x80000000);
-       return 0;
-}