aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2011-03-22 19:30:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-22 20:43:59 -0400
commitbb7ca747f8d6243b3943c5b133048652020f4a50 (patch)
treeb40e879a7b26e3763aea2af2d4dd9079483de11e /drivers/platform
parentccd7510fd8dea5b4b2af87fb2aef2ebd6b23b76b (diff)
backlight: add backlight type
There may be multiple ways of controlling the backlight on a given machine. Allow drivers to expose the type of interface they are providing, making it possible for userspace to make appropriate policy decisions. Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexdeucher@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/acer-wmi.c1
-rw-r--r--drivers/platform/x86/asus-laptop.c1
-rw-r--r--drivers/platform/x86/asus_acpi.c1
-rw-r--r--drivers/platform/x86/classmate-laptop.c1
-rw-r--r--drivers/platform/x86/compal-laptop.c1
-rw-r--r--drivers/platform/x86/dell-laptop.c1
-rw-r--r--drivers/platform/x86/eeepc-laptop.c1
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c1
-rw-r--r--drivers/platform/x86/msi-laptop.c1
-rw-r--r--drivers/platform/x86/msi-wmi.c1
-rw-r--r--drivers/platform/x86/panasonic-laptop.c1
-rw-r--r--drivers/platform/x86/sony-laptop.c3
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c1
-rw-r--r--drivers/platform/x86/toshiba_acpi.c1
14 files changed, 15 insertions, 1 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index ad3d099bf5c1..c9784705f6ac 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1031,6 +1031,7 @@ static int __devinit acer_backlight_init(struct device *dev)
1031 struct backlight_device *bd; 1031 struct backlight_device *bd;
1032 1032
1033 memset(&props, 0, sizeof(struct backlight_properties)); 1033 memset(&props, 0, sizeof(struct backlight_properties));
1034 props.type = BACKLIGHT_PLATFORM;
1034 props.max_brightness = max_brightness; 1035 props.max_brightness = max_brightness;
1035 bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops, 1036 bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops,
1036 &props); 1037 &props);
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index f3aa6a7fdab6..5a6f7d7575d6 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -667,6 +667,7 @@ static int asus_backlight_init(struct asus_laptop *asus)
667 667
668 memset(&props, 0, sizeof(struct backlight_properties)); 668 memset(&props, 0, sizeof(struct backlight_properties));
669 props.max_brightness = 15; 669 props.max_brightness = 15;
670 props.type = BACKLIGHT_PLATFORM;
670 671
671 bd = backlight_device_register(ASUS_LAPTOP_FILE, 672 bd = backlight_device_register(ASUS_LAPTOP_FILE,
672 &asus->platform_device->dev, asus, 673 &asus->platform_device->dev, asus,
diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
index fe495939c307..f503607c0645 100644
--- a/drivers/platform/x86/asus_acpi.c
+++ b/drivers/platform/x86/asus_acpi.c
@@ -1507,6 +1507,7 @@ static int __init asus_acpi_init(void)
1507 } 1507 }
1508 1508
1509 memset(&props, 0, sizeof(struct backlight_properties)); 1509 memset(&props, 0, sizeof(struct backlight_properties));
1510 props.type = BACKLIGHT_PLATFORM;
1510 props.max_brightness = 15; 1511 props.max_brightness = 15;
1511 asus_backlight_device = backlight_device_register("asus", NULL, NULL, 1512 asus_backlight_device = backlight_device_register("asus", NULL, NULL,
1512 &asus_backlight_data, 1513 &asus_backlight_data,
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 911135425224..94f93b621d7b 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -564,6 +564,7 @@ static int cmpc_ipml_add(struct acpi_device *acpi)
564 return -ENOMEM; 564 return -ENOMEM;
565 565
566 memset(&props, 0, sizeof(struct backlight_properties)); 566 memset(&props, 0, sizeof(struct backlight_properties));
567 props.type = BACKLIGHT_PLATFORM;
567 props.max_brightness = 7; 568 props.max_brightness = 7;
568 ipml->bd = backlight_device_register("cmpc_bl", &acpi->dev, 569 ipml->bd = backlight_device_register("cmpc_bl", &acpi->dev,
569 acpi->handle, &cmpc_bl_ops, 570 acpi->handle, &cmpc_bl_ops,
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 034572b980c9..eb95878fa583 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -970,6 +970,7 @@ static int __init compal_init(void)
970 if (!acpi_video_backlight_support()) { 970 if (!acpi_video_backlight_support()) {
971 struct backlight_properties props; 971 struct backlight_properties props;
972 memset(&props, 0, sizeof(struct backlight_properties)); 972 memset(&props, 0, sizeof(struct backlight_properties));
973 props.type = BACKLIGHT_PLATFORM;
973 props.max_brightness = BACKLIGHT_LEVEL_MAX; 974 props.max_brightness = BACKLIGHT_LEVEL_MAX;
974 compalbl_device = backlight_device_register(DRIVER_NAME, 975 compalbl_device = backlight_device_register(DRIVER_NAME,
975 NULL, NULL, 976 NULL, NULL,
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index ad24ef36f9f7..de301aa8e5c3 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -671,6 +671,7 @@ static int __init dell_init(void)
671 if (max_intensity) { 671 if (max_intensity) {
672 struct backlight_properties props; 672 struct backlight_properties props;
673 memset(&props, 0, sizeof(struct backlight_properties)); 673 memset(&props, 0, sizeof(struct backlight_properties));
674 props.type = BACKLIGHT_PLATFORM;
674 props.max_brightness = max_intensity; 675 props.max_brightness = max_intensity;
675 dell_backlight_device = backlight_device_register("dell_backlight", 676 dell_backlight_device = backlight_device_register("dell_backlight",
676 &platform_device->dev, 677 &platform_device->dev,
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 49d9ad708f89..6605beac0d0e 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1147,6 +1147,7 @@ static int eeepc_backlight_init(struct eeepc_laptop *eeepc)
1147 struct backlight_device *bd; 1147 struct backlight_device *bd;
1148 1148
1149 memset(&props, 0, sizeof(struct backlight_properties)); 1149 memset(&props, 0, sizeof(struct backlight_properties));
1150 props.type = BACKLIGHT_PLATFORM;
1150 props.max_brightness = 15; 1151 props.max_brightness = 15;
1151 bd = backlight_device_register(EEEPC_LAPTOP_FILE, 1152 bd = backlight_device_register(EEEPC_LAPTOP_FILE,
1152 &eeepc->platform_device->dev, eeepc, 1153 &eeepc->platform_device->dev, eeepc,
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 95e3b0948e9c..493054c2dbe1 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -1128,6 +1128,7 @@ static int __init fujitsu_init(void)
1128 1128
1129 memset(&props, 0, sizeof(struct backlight_properties)); 1129 memset(&props, 0, sizeof(struct backlight_properties));
1130 max_brightness = fujitsu->max_brightness; 1130 max_brightness = fujitsu->max_brightness;
1131 props.type = BACKLIGHT_PLATFORM;
1131 props.max_brightness = max_brightness - 1; 1132 props.max_brightness = max_brightness - 1;
1132 fujitsu->bl_device = backlight_device_register("fujitsu-laptop", 1133 fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
1133 NULL, NULL, 1134 NULL, NULL,
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 7e9bb6df9d39..142d38579314 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -804,6 +804,7 @@ static int __init msi_init(void)
804 } else { 804 } else {
805 struct backlight_properties props; 805 struct backlight_properties props;
806 memset(&props, 0, sizeof(struct backlight_properties)); 806 memset(&props, 0, sizeof(struct backlight_properties));
807 props.type = BACKLIGHT_PLATFORM;
807 props.max_brightness = MSI_LCD_LEVEL_MAX - 1; 808 props.max_brightness = MSI_LCD_LEVEL_MAX - 1;
808 msibl_device = backlight_device_register("msi-laptop-bl", NULL, 809 msibl_device = backlight_device_register("msi-laptop-bl", NULL,
809 NULL, &msibl_ops, 810 NULL, &msibl_ops,
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index 35278ad7e628..d5419c9ec07a 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -254,6 +254,7 @@ static int __init msi_wmi_init(void)
254 if (!acpi_video_backlight_support()) { 254 if (!acpi_video_backlight_support()) {
255 struct backlight_properties props; 255 struct backlight_properties props;
256 memset(&props, 0, sizeof(struct backlight_properties)); 256 memset(&props, 0, sizeof(struct backlight_properties));
257 props.type = BACKLIGHT_PLATFORM;
257 props.max_brightness = ARRAY_SIZE(backlight_map) - 1; 258 props.max_brightness = ARRAY_SIZE(backlight_map) - 1;
258 backlight = backlight_device_register(DRV_NAME, NULL, NULL, 259 backlight = backlight_device_register(DRV_NAME, NULL, NULL,
259 &msi_backlight_ops, 260 &msi_backlight_ops,
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index cc1e0ba104d7..05be30ee158b 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -602,6 +602,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
602 } 602 }
603 /* initialize backlight */ 603 /* initialize backlight */
604 memset(&props, 0, sizeof(struct backlight_properties)); 604 memset(&props, 0, sizeof(struct backlight_properties));
605 props.type = BACKLIGHT_PLATFORM;
605 props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT]; 606 props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT];
606 pcc->backlight = backlight_device_register("panasonic", NULL, pcc, 607 pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
607 &pcc_backlight_ops, &props); 608 &pcc_backlight_ops, &props);
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 5e83370b0812..13d8d63bcca9 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1305,8 +1305,9 @@ static int sony_nc_add(struct acpi_device *device)
1305 "controlled by ACPI video driver\n"); 1305 "controlled by ACPI video driver\n");
1306 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", 1306 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT",
1307 &handle))) { 1307 &handle))) {
1308 struct backlight_properties props; 1308 struct backlight_properties props;
1309 memset(&props, 0, sizeof(struct backlight_properties)); 1309 memset(&props, 0, sizeof(struct backlight_properties));
1310 props.type = BACKLIGHT_PLATFORM;
1310 props.max_brightness = SONY_MAX_BRIGHTNESS - 1; 1311 props.max_brightness = SONY_MAX_BRIGHTNESS - 1;
1311 sony_backlight_device = backlight_device_register("sony", NULL, 1312 sony_backlight_device = backlight_device_register("sony", NULL,
1312 NULL, 1313 NULL,
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index eb9922385ef8..947bdcaa0ce9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6307,6 +6307,7 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6307 return 1; 6307 return 1;
6308 6308
6309 memset(&props, 0, sizeof(struct backlight_properties)); 6309 memset(&props, 0, sizeof(struct backlight_properties));
6310 props.type = BACKLIGHT_PLATFORM;
6310 props.max_brightness = bright_maxlvl; 6311 props.max_brightness = bright_maxlvl;
6311 props.brightness = b & TP_EC_BACKLIGHT_LVLMSK; 6312 props.brightness = b & TP_EC_BACKLIGHT_LVLMSK;
6312 ibm_backlight_device = backlight_device_register(TPACPI_BACKLIGHT_DEV_NAME, 6313 ibm_backlight_device = backlight_device_register(TPACPI_BACKLIGHT_DEV_NAME,
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 209cced786c6..63f42a22e102 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1018,6 +1018,7 @@ static int __init toshiba_acpi_init(void)
1018 create_toshiba_proc_entries(); 1018 create_toshiba_proc_entries();
1019 } 1019 }
1020 1020
1021 props.type = BACKLIGHT_PLATFORM;
1021 props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; 1022 props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
1022 toshiba_backlight_device = backlight_device_register("toshiba", 1023 toshiba_backlight_device = backlight_device_register("toshiba",
1023 &toshiba_acpi.p_dev->dev, 1024 &toshiba_acpi.p_dev->dev,