aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_pm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_pm.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_pm.c b/drivers/gpu/drm/nouveau/nv50_pm.c
index fce1214c3db1..03937212e9d8 100644
--- a/drivers/gpu/drm/nouveau/nv50_pm.c
+++ b/drivers/gpu/drm/nouveau/nv50_pm.c
@@ -715,25 +715,24 @@ resume:
715} 715}
716 716
717static int 717static int
718pwm_info(struct drm_device *dev, struct dcb_gpio_entry *gpio, 718pwm_info(struct drm_device *dev, int *line, int *ctrl, int *indx)
719 int *ctrl, int *line, int *indx)
720{ 719{
721 if (gpio->line == 0x04) { 720 if (*line == 0x04) {
722 *ctrl = 0x00e100; 721 *ctrl = 0x00e100;
723 *line = 4; 722 *line = 4;
724 *indx = 0; 723 *indx = 0;
725 } else 724 } else
726 if (gpio->line == 0x09) { 725 if (*line == 0x09) {
727 *ctrl = 0x00e100; 726 *ctrl = 0x00e100;
728 *line = 9; 727 *line = 9;
729 *indx = 1; 728 *indx = 1;
730 } else 729 } else
731 if (gpio->line == 0x10) { 730 if (*line == 0x10) {
732 *ctrl = 0x00e28c; 731 *ctrl = 0x00e28c;
733 *line = 0; 732 *line = 0;
734 *indx = 0; 733 *indx = 0;
735 } else { 734 } else {
736 NV_ERROR(dev, "unknown pwm ctrl for gpio %d\n", gpio->line); 735 NV_ERROR(dev, "unknown pwm ctrl for gpio %d\n", *line);
737 return -ENODEV; 736 return -ENODEV;
738 } 737 }
739 738
@@ -741,10 +740,9 @@ pwm_info(struct drm_device *dev, struct dcb_gpio_entry *gpio,
741} 740}
742 741
743int 742int
744nv50_pm_pwm_get(struct drm_device *dev, struct dcb_gpio_entry *gpio, 743nv50_pm_pwm_get(struct drm_device *dev, int line, u32 *divs, u32 *duty)
745 u32 *divs, u32 *duty)
746{ 744{
747 int ctrl, line, id, ret = pwm_info(dev, gpio, &ctrl, &line, &id); 745 int ctrl, id, ret = pwm_info(dev, &line, &ctrl, &id);
748 if (ret) 746 if (ret)
749 return ret; 747 return ret;
750 748
@@ -758,10 +756,9 @@ nv50_pm_pwm_get(struct drm_device *dev, struct dcb_gpio_entry *gpio,
758} 756}
759 757
760int 758int
761nv50_pm_pwm_set(struct drm_device *dev, struct dcb_gpio_entry *gpio, 759nv50_pm_pwm_set(struct drm_device *dev, int line, u32 divs, u32 duty)
762 u32 divs, u32 duty)
763{ 760{
764 int ctrl, line, id, ret = pwm_info(dev, gpio, &ctrl, &line, &id); 761 int ctrl, id, ret = pwm_info(dev, &line, &ctrl, &id);
765 if (ret) 762 if (ret)
766 return ret; 763 return ret;
767 764