summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-20 10:17:32 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-20 10:17:32 -0800
commita5527c6a586537c1af7ae6db30bb444ee4abdfe8 (patch)
treef0682de5c461c270f5f58b7304fd5ea5b5d6fb38
parent4afffe5eabc4005674a1ef4f4c96f1ae9f4a979b (diff)
parent8f27489d1105c2386e6ed71c35e74e0e69603cbc (diff)
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: backlight: Remove bogus SYSFS dependency backlight: simplify corgi_bl locking backlight: Separate backlight properties from backlight ops pointers backlight: Clean up pmac_backlight handling backlight: Improve backlight selection for fbdev drivers backlight: Rework backlight/fb interaction simplifying, lots backlight: Remove unneeded backlight update_status calls backlight: Remove uneeded update_status call from chipsfb.c backlight/fbcon: Add FB_EVENT_CONBLANK backlight: Fix Kconfig entries backlight: Remove uneeded nvidia set_power calls backlight: Convert semaphore -> mutex backlight: Fix external uses of backlight internal semaphore backlight: Minor code cleanups for hp680_bl.c backlight: Minor code cleanups for corgi_bl.c backlight: Remove excessive (un)likelys backlight: Remove unneeded owner field backlight: Fix error handling backlight: Add Frontpath ProGear HX1050+ driver backlight: Add maintainer entry
-rw-r--r--MAINTAINERS5
-rw-r--r--arch/powerpc/kernel/traps.c6
-rw-r--r--arch/powerpc/platforms/powermac/backlight.c27
-rw-r--r--drivers/acpi/asus_acpi.c7
-rw-r--r--drivers/acpi/ibm_acpi.c8
-rw-r--r--drivers/acpi/toshiba_acpi.c7
-rw-r--r--drivers/acpi/video.c36
-rw-r--r--drivers/macintosh/via-pmu-backlight.c33
-rw-r--r--drivers/misc/asus-laptop.c31
-rw-r--r--drivers/misc/msi-laptop.c10
-rw-r--r--drivers/misc/sony-laptop.c16
-rw-r--r--drivers/usb/misc/appledisplay.c18
-rw-r--r--drivers/video/Kconfig71
-rw-r--r--drivers/video/Makefile2
-rw-r--r--drivers/video/aty/aty128fb.c102
-rw-r--r--drivers/video/aty/atyfb_base.c100
-rw-r--r--drivers/video/aty/radeon_backlight.c59
-rw-r--r--drivers/video/aty/radeon_base.c3
-rw-r--r--drivers/video/backlight/Kconfig23
-rw-r--r--drivers/video/backlight/Makefile1
-rw-r--r--drivers/video/backlight/backlight.c123
-rw-r--r--drivers/video/backlight/corgi_bl.c54
-rw-r--r--drivers/video/backlight/hp680_bl.c50
-rw-r--r--drivers/video/backlight/lcd.c83
-rw-r--r--drivers/video/backlight/locomolcd.c13
-rw-r--r--drivers/video/backlight/progear_bl.c153
-rw-r--r--drivers/video/chipsfb.c26
-rw-r--r--drivers/video/console/fbcon.c7
-rw-r--r--drivers/video/fbsysfs.c14
-rw-r--r--drivers/video/nvidia/nv_backlight.c92
-rw-r--r--drivers/video/nvidia/nv_proto.h2
-rw-r--r--drivers/video/nvidia/nvidia.c5
-rw-r--r--drivers/video/riva/fbdev.c100
-rw-r--r--include/linux/backlight.h50
-rw-r--r--include/linux/fb.h13
-rw-r--r--include/linux/lcd.h45
36 files changed, 629 insertions, 766 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 6261597a1bce..6fc033f22751 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -679,6 +679,11 @@ L: linux-hams@vger.kernel.org
W: http://www.linux-ax25.org/
S: Maintained
+BACKLIGHT CLASS/SUBSYSTEM
+P: Richard Purdie
+M: rpurdie@rpsys.net
+S: Maintained
+
BAYCOM/HDLCDRV DRIVERS FOR AX.25
P: Thomas Sailer
M: t.sailer@alumni.ethz.ch
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index dcc6f159fd94..17724fb2067f 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -107,12 +107,10 @@ int die(const char *str, struct pt_regs *regs, long err)
if (machine_is(powermac) && pmac_backlight) {
struct backlight_properties *props;
- down(&pmac_backlight->sem);
- props = pmac_backlight->props;
+ props = &pmac_backlight->props;
props->brightness = props->max_brightness;
props->power = FB_BLANK_UNBLANK;
- props->update_status(pmac_backlight);
- up(&pmac_backlight->sem);
+ backlight_update_status(pmac_backlight);
}
mutex_unlock(&pmac_backlight_mutex);
#endif
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
index c3a89414ddc0..de7440e62cc4 100644
--- a/arch/powerpc/platforms/powermac/backlight.c
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -37,21 +37,20 @@ static int pmac_backlight_set_legacy_queued;
*/
static atomic_t kernel_backlight_disabled = ATOMIC_INIT(0);
-/* Protect the pmac_backlight variable */
+/* Protect the pmac_backlight variable below.
+ You should hold this lock when using the pmac_backlight pointer to
+ prevent its potential removal. */
DEFINE_MUTEX(pmac_backlight_mutex);
/* Main backlight storage
*
- * Backlight drivers in this variable are required to have the "props"
+ * Backlight drivers in this variable are required to have the "ops"
* attribute set and to have an update_status function.
*
* We can only store one backlight here, but since Apple laptops have only one
* internal display, it doesn't matter. Other backlight drivers can be used
* independently.
*
- * Lock ordering:
- * pmac_backlight_mutex (global, main backlight)
- * pmac_backlight->sem (backlight class)
*/
struct backlight_device *pmac_backlight;
@@ -104,8 +103,7 @@ static void pmac_backlight_key_worker(struct work_struct *work)
struct backlight_properties *props;
int brightness;
- down(&pmac_backlight->sem);
- props = pmac_backlight->props;
+ props = &pmac_backlight->props;
brightness = props->brightness +
((pmac_backlight_key_queued?-1:1) *
@@ -117,9 +115,7 @@ static void pmac_backlight_key_worker(struct work_struct *work)
brightness = props->max_brightness;
props->brightness = brightness;
- props->update_status(pmac_backlight);
-
- up(&pmac_backlight->sem);
+ backlight_update_status(pmac_backlight);
}
mutex_unlock(&pmac_backlight_mutex);
}
@@ -145,8 +141,7 @@ static int __pmac_backlight_set_legacy_brightness(int brightness)
if (pmac_backlight) {
struct backlight_properties *props;
- down(&pmac_backlight->sem);
- props = pmac_backlight->props;
+ props = &pmac_backlight->props;
props->brightness = brightness *
(props->max_brightness + 1) /
(OLD_BACKLIGHT_MAX + 1);
@@ -156,8 +151,7 @@ static int __pmac_backlight_set_legacy_brightness(int brightness)
else if (props->brightness < 0)
props->brightness = 0;
- props->update_status(pmac_backlight);
- up(&pmac_backlight->sem);
+ backlight_update_status(pmac_backlight);
error = 0;
}
@@ -196,14 +190,11 @@ int pmac_backlight_get_legacy_brightness()
if (pmac_backlight) {
struct backlight_properties *props;
- down(&pmac_backlight->sem);
- props = pmac_backlight->props;
+ props = &pmac_backlight->props;
result = props->brightness *
(OLD_BACKLIGHT_MAX + 1) /
(props->max_brightness + 1);
-
- up(&pmac_backlight->sem);
}
mutex_unlock(&pmac_backlight_mutex);
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index 772299fb5f9d..b770deab968c 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -848,7 +848,7 @@ out:
static int set_brightness_status(struct backlight_device *bd)
{
- return set_brightness(bd->props->brightness);
+ return set_brightness(bd->props.brightness);
}
static int
@@ -1352,11 +1352,9 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
return 0;
}
-static struct backlight_properties asus_backlight_data = {
- .owner = THIS_MODULE,
+static struct backlight_ops asus_backlight_data = {
.get_brightness = read_brightness,
.update_status = set_brightness_status,
- .max_brightness = 15,
};
static void __exit asus_acpi_exit(void)
@@ -1410,6 +1408,7 @@ static int __init asus_acpi_init(void)
asus_backlight_device = NULL;
asus_acpi_exit();
}
+ asus_backlight_device->props.max_brightness = 15;
return 0;
}
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 1a0ed3dc409c..4cc534e36e81 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1701,14 +1701,12 @@ static int brightness_write(char *buf)
static int brightness_update_status(struct backlight_device *bd)
{
- return brightness_set(bd->props->brightness);
+ return brightness_set(bd->props.brightness);
}
-static struct backlight_properties ibm_backlight_data = {
- .owner = THIS_MODULE,
+static struct backlight_ops ibm_backlight_data = {
.get_brightness = brightness_get,
.update_status = brightness_update_status,
- .max_brightness = 7,
};
static int brightness_init(void)
@@ -1720,6 +1718,8 @@ static int brightness_init(void)
return PTR_ERR(ibm_backlight_device);
}
+ ibm_backlight_device->props.max_brightness = 7;
+
return 0;
}
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index faf8a5232d8e..3906d47b9783 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -315,7 +315,7 @@ static int set_lcd(int value)
static int set_lcd_status(struct backlight_device *bd)
{
- return set_lcd(bd->props->brightness);
+ return set_lcd(bd->props.brightness);
}
static unsigned long write_lcd(const char *buffer, unsigned long count)
@@ -533,11 +533,9 @@ static acpi_status __exit remove_device(void)
return AE_OK;
}
-static struct backlight_properties toshiba_backlight_data = {
- .owner = THIS_MODULE,
+static struct backlight_ops toshiba_backlight_data = {
.get_brightness = get_lcd,
.update_status = set_lcd_status,
- .max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1,
};
static void __exit toshiba_acpi_exit(void)
@@ -597,6 +595,7 @@ static int __init toshiba_acpi_init(void)
toshiba_backlight_device = NULL;
toshiba_acpi_exit();
}
+ toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
return (ACPI_SUCCESS(status)) ? 0 : -ENODEV;
}
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index bf525cca3b63..0771b434feb2 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -169,7 +169,6 @@ struct acpi_video_device {
struct acpi_device *dev;
struct acpi_video_device_brightness *brightness;
struct backlight_device *backlight;
- struct backlight_properties *data;
};
/* bus */
@@ -286,13 +285,18 @@ static int acpi_video_get_brightness(struct backlight_device *bd)
static int acpi_video_set_brightness(struct backlight_device *bd)
{
- int request_level = bd->props->brightness;
+ int request_level = bd->props.brightness;
struct acpi_video_device *vd =
(struct acpi_video_device *)class_get_devdata(&bd->class_dev);
acpi_video_device_lcd_set_level(vd, request_level);
return 0;
}
+static struct backlight_ops acpi_backlight_ops = {
+ .get_brightness = acpi_video_get_brightness,
+ .update_status = acpi_video_set_brightness,
+};
+
/* --------------------------------------------------------------------------
Video Management
-------------------------------------------------------------------------- */
@@ -608,31 +612,18 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
unsigned long tmp;
static int count = 0;
char *name;
- struct backlight_properties *acpi_video_data;
-
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
if (!name)
return;
- acpi_video_data = kzalloc(
- sizeof(struct backlight_properties),
- GFP_KERNEL);
- if (!acpi_video_data){
- kfree(name);
- return;
- }
- acpi_video_data->owner = THIS_MODULE;
- acpi_video_data->get_brightness =
- acpi_video_get_brightness;
- acpi_video_data->update_status =
- acpi_video_set_brightness;
sprintf(name, "acpi_video%d", count++);
- device->data = acpi_video_data;
- acpi_video_data->max_brightness = max_level;
acpi_video_device_lcd_get_level_current(device, &tmp);
- acpi_video_data->brightness = (int)tmp;
device->backlight = backlight_device_register(name,
- NULL, device, acpi_video_data);
+ NULL, device, &acpi_backlight_ops);
+ device->backlight->props.max_brightness = max_level;
+ device->backlight->props.brightness = (int)tmp;
+ backlight_update_status(device->backlight);
+
kfree(name);
}
return;
@@ -1677,10 +1668,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
status = acpi_remove_notify_handler(device->dev->handle,
ACPI_DEVICE_NOTIFY,
acpi_video_device_notify);
- if (device->backlight){
- backlight_device_unregister(device->backlight);
- kfree(device->data);
- }
+ backlight_device_unregister(device->backlight);
return 0;
}
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
index 801a974342f9..7e27071746e4 100644
--- a/drivers/macintosh/via-pmu-backlight.c
+++ b/drivers/macintosh/via-pmu-backlight.c
@@ -15,7 +15,7 @@
#define MAX_PMU_LEVEL 0xFF
-static struct backlight_properties pmu_backlight_data;
+static struct backlight_ops pmu_backlight_data;
static DEFINE_SPINLOCK(pmu_backlight_lock);
static int sleeping;
static u8 bl_curve[FB_BACKLIGHT_LEVELS];
@@ -72,7 +72,7 @@ static int pmu_backlight_update_status(struct backlight_device *bd)
{
struct adb_request req;
unsigned long flags;
- int level = bd->props->brightness;
+ int level = bd->props.brightness;
spin_lock_irqsave(&pmu_backlight_lock, flags);
@@ -80,8 +80,8 @@ static int pmu_backlight_update_status(struct backlight_device *bd)
if (sleeping)
goto out;
- if (bd->props->power != FB_BLANK_UNBLANK ||
- bd->props->fb_blank != FB_BLANK_UNBLANK)
+ if (bd->props.power != FB_BLANK_UNBLANK ||
+ bd->props.fb_blank != FB_BLANK_UNBLANK)
level = 0;
if (level > 0) {
@@ -107,14 +107,13 @@ out:
static int pmu_backlight_get_brightness(struct backlight_device *bd)
{
- return bd->props->brightness;
+ return bd->props.brightness;
}
-static struct backlight_properties pmu_backlight_data = {
- .owner = THIS_MODULE,
+static struct backlight_ops pmu_backlight_data = {
.get_brightness = pmu_backlight_get_brightness,
.update_status = pmu_backlight_update_status,
- .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
+
};
#ifdef CONFIG_PM
@@ -152,9 +151,10 @@ void __init pmu_backlight_init()
printk("pmubl: Backlight registration failed\n");
goto error;
}
+ bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
- level = pmu_backlight_data.max_brightness;
+ level = bd->props.max_brightness;
if (autosave) {
/* read autosaved value if available */
@@ -164,19 +164,12 @@ void __init pmu_backlight_init()
level = pmu_backlight_curve_lookup(
(req.reply[0] >> 4) *
- pmu_backlight_data.max_brightness / 15);
+ bd->props.max_brightness / 15);
}
- down(&bd->sem);
- bd->props->brightness = level;
- bd->props->power = FB_BLANK_UNBLANK;
- bd->props->update_status(bd);
- up(&bd->sem);
-
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
+ bd->props.brightness = level;
+ bd->props.power = FB_BLANK_UNBLANK;
+ backlight_update_status(bd);
printk("pmubl: Backlight initialized (%s)\n", name);
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index e4e2b707a353..295e931c0dfb 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -195,11 +195,9 @@ static struct backlight_device *asus_backlight_device;
*/
static int read_brightness(struct backlight_device *bd);
static int update_bl_status(struct backlight_device *bd);
-static struct backlight_properties asusbl_data = {
- .owner = THIS_MODULE,
+static struct backlight_ops asusbl_ops = {
.get_brightness = read_brightness,
.update_status = update_bl_status,
- .max_brightness = 15,
};
/* These functions actually update the LED's, and are called from a
@@ -349,13 +347,8 @@ static void lcd_blank(int blank)
struct backlight_device *bd = asus_backlight_device;
if (bd) {
- down(&bd->sem);
- if (likely(bd->props)) {
- bd->props->power = blank;
- if (likely(bd->props->update_status))
- bd->props->update_status(bd);
- }
- up(&bd->sem);
+ bd->props.power = blank;
+ backlight_update_status(bd);
}
}
@@ -387,13 +380,13 @@ static int set_brightness(struct backlight_device *bd, int value)
static int update_bl_status(struct backlight_device *bd)
{
int rv;
- int value = bd->props->brightness;
+ int value = bd->props.brightness;
rv = set_brightness(bd, value);
if (rv)
return rv;
- value = (bd->props->power == FB_BLANK_UNBLANK) ? 1 : 0;
+ value = (bd->props.power == FB_BLANK_UNBLANK) ? 1 : 0;
return set_lcd_state(value);
}
@@ -1019,7 +1012,7 @@ static int asus_backlight_init(struct device *dev)
if (brightness_set_handle && lcd_switch_handle) {
bd = backlight_device_register(ASUS_HOTK_FILE, dev,
- NULL, &asusbl_data);
+ NULL, &asusbl_ops);
if (IS_ERR(bd)) {
printk(ASUS_ERR
"Could not register asus backlight device\n");
@@ -1029,14 +1022,10 @@ static int asus_backlight_init(struct device *dev)
asus_backlight_device = bd;
- down(&bd->sem);
- if (likely(bd->props)) {
- bd->props->brightness = read_brightness(NULL);
- bd->props->power = FB_BLANK_UNBLANK;
- if (likely(bd->props->update_status))
- bd->props->update_status(bd);
- }
- up(&bd->sem);
+ bd->props.max_brightness = 15;
+ bd->props.brightness = read_brightness(NULL);
+ bd->props.power = FB_BLANK_UNBLANK;
+ backlight_update_status(bd);
}
return 0;
}
diff --git a/drivers/misc/msi-laptop.c b/drivers/misc/msi-laptop.c
index 8e5e07e4c1cf..68c4b58525ba 100644
--- a/drivers/misc/msi-laptop.c
+++ b/drivers/misc/msi-laptop.c
@@ -157,14 +157,12 @@ static int bl_get_brightness(struct backlight_device *b)
static int bl_update_status(struct backlight_device *b)
{
- return set_lcd_level(b->props->brightness);
+ return set_lcd_level(b->props.brightness);
}
-static struct backlight_properties msibl_props = {
- .owner = THIS_MODULE,
+static struct backlight_ops msibl_ops = {
.get_brightness = bl_get_brightness,
.update_status = bl_update_status,
- .max_brightness = MSI_LCD_LEVEL_MAX-1,
};
static struct backlight_device *msibl_device;
@@ -318,10 +316,12 @@ static int __init msi_init(void)
/* Register backlight stuff */
msibl_device = backlight_device_register("msi-laptop-bl", NULL, NULL,
- &msibl_props);
+ &msibl_ops);
if (IS_ERR(msibl_device))
return PTR_ERR(msibl_device);
+ msibl_device->props.max_brightness = MSI_LCD_LEVEL_MAX-1,
+
ret = platform_driver_register(&msipf_driver);
if (ret)
goto fail_backlight;
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index cabbed0015e4..2ebe240dd537 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -384,7 +384,7 @@ static void sony_snc_pf_remove(void)
static int sony_backlight_update_status(struct backlight_device *bd)
{
return acpi_callsetfunc(sony_acpi_handle, "SBRT",
- bd->props->brightness + 1, NULL);
+ bd->props.brightness + 1, NULL);
}
static int sony_backlight_get_brightness(struct backlight_device *bd)
@@ -398,11 +398,9 @@ static int sony_backlight_get_brightness(struct backlight_device *bd)
}
static struct backlight_device *sony_backlight_device;
-static struct backlight_properties sony_backlight_properties = {
- .owner = THIS_MODULE,
+static struct backlight_ops sony_backlight_ops = {
.update_status = sony_backlight_update_status,
.get_brightness = sony_backlight_get_brightness,
- .max_brightness = SONY_MAX_BRIGHTNESS - 1,
};
/*
@@ -484,15 +482,19 @@ static int sony_acpi_add(struct acpi_device *device)
if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) {
sony_backlight_device = backlight_device_register("sony", NULL,
NULL,
- &sony_backlight_properties);
+ &sony_backlight_ops);
if (IS_ERR(sony_backlight_device)) {
printk(LOG_PFX "unable to register backlight device\n");
sony_backlight_device = NULL;
- } else
- sony_backlight_properties.brightness =
+ } else {
+ sony_backlight_device->props.brightness =
sony_backlight_get_brightness
(sony_backlight_device);
+ sony_backlight_device->props.max_brightness =
+ SONY_MAX_BRIGHTNESS - 1;
+ }
+
}
if (sony_snc_pf_add())
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index e573c8ba9785..cf70c16f0e3f 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -141,7 +141,7 @@ static int appledisplay_bl_update_status(struct backlight_device *bd)
int retval;
pdata->msgdata[0] = 0x10;
- pdata->msgdata[1] = bd->props->brightness;
+ pdata->msgdata[1] = bd->props.brightness;
retval = usb_control_msg(
pdata->udev,
@@ -177,11 +177,9 @@ static int appledisplay_bl_get_brightness(struct backlight_device *bd)
return pdata->msgdata[1];
}
-static struct backlight_properties appledisplay_bl_data = {
- .owner = THIS_MODULE,
+static struct backlight_ops appledisplay_bl_data = {
.get_brightness = appledisplay_bl_get_brightness,
.update_status = appledisplay_bl_update_status,
- .max_brightness = 0xFF
};
static void appledisplay_work(struct work_struct *work)
@@ -190,11 +188,9 @@ static void appledisplay_work(struct work_struct *work)
container_of(work, struct appledisplay, work.work);
int retval;
- up(&pdata->bd->sem);
retval = appledisplay_bl_get_brightness(pdata->bd);
if (retval >= 0)
- pdata->bd->props->brightness = retval;
- down(&pdata->bd->sem);
+ pdata->bd->props.brightness = retval;
/* Poll again in about 125ms if there's still a button pressed */
if (pdata->button_pressed)
@@ -288,10 +284,10 @@ static int appledisplay_probe(struct usb_interface *iface,
goto error;
}
+ pdata->bd->props.max_brightness = 0xff;
+
/* Try to get brightness */
- up(&pdata->bd->sem);
brightness = appledisplay_bl_get_brightness(pdata->bd);
- down(&pdata->bd->sem);
if (brightness < 0) {
retval = brightness;
@@ -300,9 +296,7 @@ static int appledisplay_probe(struct usb_interface *iface,
}
/* Set brightness in backlight device */
- up(&pdata->bd->sem);
- pdata->bd->props->brightness = brightness;
- down(&pdata->bd->sem);
+ pdata->bd->props.brightness = brightness;
/* save our data pointer in the interface device */
usb_set_intfdata(iface, pdata);
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 8874cf2fd279..f8bc43c1e7a7 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -4,20 +4,7 @@
menu "Graphics support"
-config FIRMWARE_EDID
- bool "Enable firmware EDID"
- default y
- ---help---
- This enables access to the EDID transferred from the firmware.
- On the i386, this is from the Video BIOS. Enable this if DDC/I2C
- transfers do not work for your driver and if you are using
- nvidiafb, i810fb or savagefb.
-
- In general, choosing Y for this option is safe. If you
- experience extremely long delays while booting before you get
- something on your display, try setting this to N. Matrox cards in
- combination with certain motherboards and monitors are known to
- suffer from this problem.
+source "drivers/video/backlight/Kconfig"
config FB
tristate "Support for frame buffer devices"
@@ -53,9 +40,27 @@ config FB
(e.g. an accelerated X server) and that are not frame buffer
device-aware may cause unexpected results. If unsure, say N.
+config FIRMWARE_EDID
+ bool "Enable firmware EDID"
+ depends on FB
+ default n
+ ---help---
+ This enables access to the EDID transferred from the firmware.
+ On the i386, this is from the Video BIOS. Enable this if DDC/I2C
+ transfers do not work for your driver and if you are using
+ nvidiafb, i810fb or savagefb.
+
+ In general, choosing Y for this option is safe. If you
+ experience extremely long delays while booting before you get
+ something on your display, try setting this to N. Matrox cards in
+ combination with certain motherboards and monitors are known to
+ suffer from this problem.
+
config FB_DDC
tristate
- depends on FB && I2C && I2C_ALGOBIT
+ depends on FB
+ select I2C_ALGOBIT
+ select I2C
default n
config FB_CFB_FILLRECT
@@ -134,6 +139,9 @@ config FB_TILEBLITTING
This is particularly important to one driver, matroxfb. If
unsure, say N.
+comment "Frambuffer hardware drivers"
+ depends on FB
+
config FB_CIRRUS
tristate "Cirrus Logic support"
depends on FB && (ZORRO || PCI)
@@ -671,6 +679,7 @@ config FB_NVIDIA
depends on FB && PCI
select I2C_ALGOBIT if FB_NVIDIA_I2C
select I2C if FB_NVIDIA_I2C
+ select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT
select FB_MODE_HELPERS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -699,8 +708,7 @@ config FB_NVIDIA_I2C
config FB_NVIDIA_BACKLIGHT
bool "Support for backlight control"
- depends on FB_NVIDIA && PMAC_BACKLIGHT
- select FB_BACKLIGHT
+ depends on FB_NVIDIA
default y
help
Say Y here if you want to control the backlight of your display.
@@ -708,9 +716,8 @@ config FB_NVIDIA_BACKLIGHT
config FB_RIVA
tristate "nVidia Riva support"
depends on FB && PCI
- select I2C_ALGOBIT if FB_RIVA_I2C
- select I2C if FB_RIVA_I2C
select FB_DDC if FB_RIVA_I2C
+ select FB_BACKLIGHT if FB_RIVA_BACKLIGHT
select FB_MODE_HELPERS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -747,8 +754,7 @@ config FB_RIVA_DEBUG
config FB_RIVA_BACKLIGHT
bool "Support for backlight control"
- depends on FB_RIVA && PMAC_BACKLIGHT
- select FB_BACKLIGHT
+ depends on FB_RIVA
default y
help
Say Y here if you want to control the backlight of your display.
@@ -798,8 +804,6 @@ config FB_I810_GTF
config FB_I810_I2C
bool "Enable DDC Support"
depends on FB_I810 && FB_I810_GTF
- select I2C
- select I2C_ALGOBIT
select FB_DDC
help
@@ -989,9 +993,8 @@ config FB_MATROX_MULTIHEAD
config FB_RADEON
tristate "ATI Radeon display support"
depends on FB && PCI
- select I2C_ALGOBIT if FB_RADEON_I2C
- select I2C if FB_RADEON_I2C
select FB_DDC if FB_RADEON_I2C
+ select FB_BACKLIGHT if FB_RADEON_BACKLIGHT
select FB_MODE_HELPERS
select FB_CFB_FILLRECT