diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_backlight.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_backlight.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 20564f8cb0e..406228f4a2a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c | |||
@@ -89,19 +89,21 @@ static struct backlight_ops nv50_bl_ops = { | |||
89 | 89 | ||
90 | static int nouveau_nv40_backlight_init(struct drm_device *dev) | 90 | static int nouveau_nv40_backlight_init(struct drm_device *dev) |
91 | { | 91 | { |
92 | struct backlight_properties props; | ||
92 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 93 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
93 | struct backlight_device *bd; | 94 | struct backlight_device *bd; |
94 | 95 | ||
95 | if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) | 96 | if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) |
96 | return 0; | 97 | return 0; |
97 | 98 | ||
99 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
100 | props.max_brightness = 31; | ||
98 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, | 101 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, |
99 | &nv40_bl_ops); | 102 | &nv40_bl_ops, &props); |
100 | if (IS_ERR(bd)) | 103 | if (IS_ERR(bd)) |
101 | return PTR_ERR(bd); | 104 | return PTR_ERR(bd); |
102 | 105 | ||
103 | dev_priv->backlight = bd; | 106 | dev_priv->backlight = bd; |
104 | bd->props.max_brightness = 31; | ||
105 | bd->props.brightness = nv40_get_intensity(bd); | 107 | bd->props.brightness = nv40_get_intensity(bd); |
106 | backlight_update_status(bd); | 108 | backlight_update_status(bd); |
107 | 109 | ||
@@ -110,19 +112,21 @@ static int nouveau_nv40_backlight_init(struct drm_device *dev) | |||
110 | 112 | ||
111 | static int nouveau_nv50_backlight_init(struct drm_device *dev) | 113 | static int nouveau_nv50_backlight_init(struct drm_device *dev) |
112 | { | 114 | { |
115 | struct backlight_properties props; | ||
113 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 116 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
114 | struct backlight_device *bd; | 117 | struct backlight_device *bd; |
115 | 118 | ||
116 | if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT)) | 119 | if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT)) |
117 | return 0; | 120 | return 0; |
118 | 121 | ||
122 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
123 | props.max_brightness = 1025; | ||
119 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, | 124 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, |
120 | &nv50_bl_ops); | 125 | &nv50_bl_ops, &props); |
121 | if (IS_ERR(bd)) | 126 | if (IS_ERR(bd)) |
122 | return PTR_ERR(bd); | 127 | return PTR_ERR(bd); |
123 | 128 | ||
124 | dev_priv->backlight = bd; | 129 | dev_priv->backlight = bd; |
125 | bd->props.max_brightness = 1025; | ||
126 | bd->props.brightness = nv50_get_intensity(bd); | 130 | bd->props.brightness = nv50_get_intensity(bd); |
127 | backlight_update_status(bd); | 131 | backlight_update_status(bd); |
128 | return 0; | 132 | return 0; |