aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2011-03-22 19:30:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-22 20:44:00 -0400
commit39b3dee76fa1f1ac8310ea5898ba7c07280bdd9f (patch)
tree2e1ea6ca8afa6c15dc6a288c1b800e52cd823f39 /drivers/video/backlight
parent99fd28e19429f5212f0758adc1b2f08c6e63b6db (diff)
mbp_nvidia_bl: rename to apple_bl
It works on hardware other than Macbook Pros, and it works on GPUs other than Nvidia. It should even work on iMacs, so change the name to match reality more precisely and include an alias so existing users don't get confused. Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Mourad De Clerck <mourad@aquazul.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/Kconfig6
-rw-r--r--drivers/video/backlight/Makefile2
-rw-r--r--drivers/video/backlight/apple_bl.c (renamed from drivers/video/backlight/mbp_nvidia_bl.c)61
3 files changed, 35 insertions, 34 deletions
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index aa8cf9d2e34f..39fff49da19d 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -244,11 +244,11 @@ config BACKLIGHT_MAX8925
244 If you have a LCD backlight connected to the WLED output of MAX8925 244 If you have a LCD backlight connected to the WLED output of MAX8925
245 WLED output, say Y here to enable this driver. 245 WLED output, say Y here to enable this driver.
246 246
247config BACKLIGHT_MACBOOK 247config BACKLIGHT_APPLE
248 tristate "MacBook Backlight Driver" 248 tristate "Apple Backlight Driver"
249 depends on X86 249 depends on X86
250 help 250 help
251 If you have an Apple Macbook say Y to enable a driver for its 251 If you have an Intel-based Apple say Y to enable a driver for its
252 backlight 252 backlight
253 253
254config BACKLIGHT_TOSA 254config BACKLIGHT_TOSA
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 988d7cd159ea..b9ca8490df87 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -27,7 +27,7 @@ obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
27obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o 27obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o
28obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o 28obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o
29obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o 29obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o
30obj-$(CONFIG_BACKLIGHT_MACBOOK) += mbp_nvidia_bl.o 30obj-$(CONFIG_BACKLIGHT_APPLE) += apple_bl.o
31obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o 31obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
32obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o 32obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
33obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o 33obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
diff --git a/drivers/video/backlight/mbp_nvidia_bl.c b/drivers/video/backlight/apple_bl.c
index dd0e145170b7..be98d152b7fd 100644
--- a/drivers/video/backlight/mbp_nvidia_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Backlight Driver for Macbooks 2 * Backlight Driver for Intel-based Apples
3 * 3 *
4 * Copyright (c) Red Hat <mjg@redhat.com> 4 * Copyright (c) Red Hat <mjg@redhat.com>
5 * Based on code from Pommed: 5 * Based on code from Pommed:
@@ -25,7 +25,7 @@
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/acpi.h> 26#include <linux/acpi.h>
27 27
28static struct backlight_device *mb_backlight_device; 28static struct backlight_device *apple_backlight_device;
29 29
30struct hw_data { 30struct hw_data {
31 /* I/O resource to allocate. */ 31 /* I/O resource to allocate. */
@@ -38,7 +38,7 @@ struct hw_data {
38 38
39static const struct hw_data *hw_data; 39static const struct hw_data *hw_data;
40 40
41#define DRIVER "mb_backlight: " 41#define DRIVER "apple_backlight: "
42 42
43/* Module parameters. */ 43/* Module parameters. */
44static int debug; 44static int debug;
@@ -46,7 +46,7 @@ module_param_named(debug, debug, int, 0644);
46MODULE_PARM_DESC(debug, "Set to one to enable debugging messages."); 46MODULE_PARM_DESC(debug, "Set to one to enable debugging messages.");
47 47
48/* 48/*
49 * Implementation for MacBooks with Intel chipset. 49 * Implementation for machines with Intel chipset.
50 */ 50 */
51static void intel_chipset_set_brightness(int intensity) 51static void intel_chipset_set_brightness(int intensity)
52{ 52{
@@ -93,7 +93,7 @@ static const struct hw_data intel_chipset_data = {
93}; 93};
94 94
95/* 95/*
96 * Implementation for MacBooks with Nvidia chipset. 96 * Implementation for machines with Nvidia chipset.
97 */ 97 */
98static void nvidia_chipset_set_brightness(int intensity) 98static void nvidia_chipset_set_brightness(int intensity)
99{ 99{
@@ -139,7 +139,7 @@ static const struct hw_data nvidia_chipset_data = {
139 .set_brightness = nvidia_chipset_set_brightness, 139 .set_brightness = nvidia_chipset_set_brightness,
140}; 140};
141 141
142static int __devinit mb_bl_add(struct acpi_device *dev) 142static int __devinit apple_bl_add(struct acpi_device *dev)
143{ 143{
144 struct backlight_properties props; 144 struct backlight_properties props;
145 struct pci_dev *host; 145 struct pci_dev *host;
@@ -177,64 +177,65 @@ static int __devinit mb_bl_add(struct acpi_device *dev)
177 } 177 }
178 178
179 if (!request_region(hw_data->iostart, hw_data->iolen, 179 if (!request_region(hw_data->iostart, hw_data->iolen,
180 "Macbook backlight")) 180 "Apple backlight"))
181 return -ENXIO; 181 return -ENXIO;
182 182
183 memset(&props, 0, sizeof(struct backlight_properties)); 183 memset(&props, 0, sizeof(struct backlight_properties));
184 props.type = BACKLIGHT_PLATFORM; 184 props.type = BACKLIGHT_PLATFORM;
185 props.max_brightness = 15; 185 props.max_brightness = 15;
186 mb_backlight_device = backlight_device_register("mb_backlight", NULL, 186 apple_backlight_device = backlight_device_register("apple_backlight",
187 NULL, &hw_data->backlight_ops, &props); 187 NULL, NULL, &hw_data->backlight_ops, &props);
188 188
189 if (IS_ERR(mb_backlight_device)) { 189 if (IS_ERR(apple_backlight_device)) {
190 release_region(hw_data->iostart, hw_data->iolen); 190 release_region(hw_data->iostart, hw_data->iolen);
191 return PTR_ERR(mb_backlight_device); 191 return PTR_ERR(apple_backlight_device);
192 } 192 }
193 193
194 mb_backlight_device->props.brightness = 194 apple_backlight_device->props.brightness =
195 hw_data->backlight_ops.get_brightness(mb_backlight_device); 195 hw_data->backlight_ops.get_brightness(apple_backlight_device);
196 backlight_update_status(mb_backlight_device); 196 backlight_update_status(apple_backlight_device);
197 197
198 return 0; 198 return 0;
199} 199}
200 200
201static int __devexit mb_bl_remove(struct acpi_device *dev, int type) 201static int __devexit apple_bl_remove(struct acpi_device *dev, int type)
202{ 202{
203 backlight_device_unregister(mb_backlight_device); 203 backlight_device_unregister(apple_backlight_device);
204 204
205 release_region(hw_data->iostart, hw_data->iolen); 205 release_region(hw_data->iostart, hw_data->iolen);
206 hw_data = NULL; 206 hw_data = NULL;
207 return 0; 207 return 0;
208} 208}
209 209
210static const struct acpi_device_id mb_bl_ids[] = { 210static const struct acpi_device_id apple_bl_ids[] = {
211 {"APP0002", 0}, 211 {"APP0002", 0},
212 {"", 0}, 212 {"", 0},
213}; 213};
214 214
215static struct acpi_driver mb_bl_driver = { 215static struct acpi_driver apple_bl_driver = {
216 .name = "Macbook backlight", 216 .name = "Apple backlight",
217 .ids = mb_bl_ids, 217 .ids = apple_bl_ids,
218 .ops = { 218 .ops = {
219 .add = mb_bl_add, 219 .add = apple_bl_add,
220 .remove = mb_bl_remove, 220 .remove = apple_bl_remove,
221 }, 221 },
222}; 222};
223 223
224static int __init mb_init(void) 224static int __init apple_bl_init(void)
225{ 225{
226 return acpi_bus_register_driver(&mb_bl_driver); 226 return acpi_bus_register_driver(&apple_bl_driver);
227} 227}
228 228
229static void __exit mb_exit(void) 229static void __exit apple_bl_exit(void)
230{ 230{
231 acpi_bus_unregister_driver(&mb_bl_driver); 231 acpi_bus_unregister_driver(&apple_bl_driver);
232} 232}
233 233
234module_init(mb_init); 234module_init(apple_bl_init);
235module_exit(mb_exit); 235module_exit(apple_bl_exit);
236 236
237MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>"); 237MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>");
238MODULE_DESCRIPTION("Macbook Backlight Driver"); 238MODULE_DESCRIPTION("Apple Backlight Driver");
239MODULE_LICENSE("GPL"); 239MODULE_LICENSE("GPL");
240MODULE_DEVICE_TABLE(acpi, mb_bl_ids); 240MODULE_DEVICE_TABLE(acpi, apple_bl_ids);
241MODULE_ALIAS("mbp_nvidia_bl");