History log of /drivers/video/nvidia/nv_backlight.c
Revision Date Author Comments
bb7ca747f8d6243b3943c5b133048652020f4a50 23-Mar-2011 Matthew Garrett <mjg@redhat.com> 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>
acc2472ed33fc5e72482cc3b3b846077d97c2f8b 16-Nov-2010 Lionel Debroux <lionel_debroux@yahoo.fr> backlight: constify backlight_ops

backlight_device_register has been expecting a const "ops" argument, and using
it as such, since 9905a43b2d563e6f89e4c63c4278ada03f2ebb14. Let's make the
remaining backlight_ops instances const.

Inspired by hunks of the grsecurity patch, updated for newer kernels.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a19a6ee6cad2b20292a774c2f56ba8039b0fac9c 17-Feb-2010 Matthew Garrett <mjg@redhat.com> backlight: Allow properties to be passed at registration

Values such as max_brightness should be set before backlights are
registered, but the current API doesn't allow that. Add a parameter to
backlight_device_register and update drivers to ensure that they
set this correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
655bfd7aebb12481ab9275284d9500bee5ba3e70 09-Jul-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Convert from struct class_device to struct device

Convert the backlight and LCD classes from struct class_device
to struct device since class_device is scheduled for removal.

One nasty API break is the backlight power attribute has had to be
renamed to bl_power and the LCD power attribute has had to be renamed
to lcd_power since the original names clash with the core. I can't see
a way around this.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
b9860ecf2553fbc4c3bd66f5df7e82a6d5179775 06-Mar-2007 Dave Jones <davej@redhat.com> [PATCH] nvidiafb backlight: Fix implicit declaration in nv_backlight

drivers/video/nvidia/nv_backlight.c: In function 'nvidia_bl_init':
drivers/video/nvidia/nv_backlight.c:103: error: implicit declaration of function 'pmac_has_backlight_type'

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: James Simmons <jsimmons@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
238576e12fef1d52751c6e08db2d0bdb0e248caf 26-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Fix nvidia backlight initial brightness

Fix a mix up when the nvidia driver was converted resulting
in the backlight having an incorrect initial brightness.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
599a52d12629394236d785615808845823875868 11-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Separate backlight properties from backlight ops pointers

Per device data such as brightness belongs to the indivdual device
and should therefore be separate from the the backlight operation
function pointers. This patch splits the two types of data and
allows simplifcation of some code.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
321709c5994f952b78d567fd7083dbebbdc381b7 10-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Clean up pmac_backlight handling

Move the setting/unsetting of pmac_backlight into the
backlight core instead of doing it in each driver.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
37ce69a57ff217a4ca0871e9ee5aa58c052b7d86 10-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Rework backlight/fb interaction simplifying, lots

fb_info->bl_mutex is badly thought out and the backlight class doesn't
need it if the framebuffer/backlight register/unregister order is
consistent, particularly after the backlight locking fixes.

Fix the drivers to use the order:

backlight_device_register()
register_framebuffer()
unregister_framebuffer()
backlight_device_unregister()

and turn bl_mutex into a lock for the bl_curve data only.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
1cfc97f21f6ab91df8d5617fcbf758322fdd238b 09-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Remove uneeded nvidia set_power calls

nvidia_bl_set_power isn't needed since the backlight class handles
this by receiving fb events itself and calling update_status so
remove it.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
28ee086d5b36aab2931f6740e409bb0fb6c65e5f 08-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Fix external uses of backlight internal semaphore

backlight_device->sem has a very specific use as documented in the
header file. The external users of this are using it for a different
reason, to serialise access to the update_status() method.

backlight users were supposed to implement their own internal
serialisation of update_status() if needed but everyone is doing
things differently and incorrectly. Therefore add a global mutex to
take care of serialisation for everyone, once and for all.

Locking for get_brightness remains optional since most users don't
need it.

Also update the lcd class in a similar way.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
dfcba200679dc3f62212154b65b40b835ce69ab7 08-Feb-2007 Richard Purdie <rpurdie@rpsys.net> backlight: Remove unneeded owner field

Remove uneeded owner field from backlight_properties structure.

Nothing uses it and it is unlikely that it will ever be used. The
backlight class uses other means to ensure that nothing references
unloaded code.

Based on a patch from Dmitry Torokhov <dtor@insightbb.com>

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
a8274d57afb83e4954ddcb3f8b7dd1c03a379bd4 19-Dec-2006 James Simmons <jsimmons@infradead.org> fbdev: update after backlight argument change

Update the frambuffer drivers to the backlight_device_registers changes.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Cc: Luming Yu <Luming.yu@intel.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
a930363881c225fb52824145d1ba8f1a8c447dd8 01-Sep-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] backlight last round of fixes

Fix some more problems (inverted use of semaphores in some places). He
also moved my checks into within the protected section which is better.

Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
98a3c781057fa43494e7e8b39d639e93fca0ecbf 31-Aug-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org> [PATCH] fbdev: Fix crashes in various fbdev's blank routines

The backlight changes that went in had a bug where they could cause the
kernel to access an unitialized pointer when blanking if there is no
backlight control on a machine.

The bug affects atyfb, aty128fb, nvidiafb and rivafb. radeonfb seems to
be ok. This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
e01af0384f54023b4548b7742952da2ffcafd4cd 10-Jul-2006 Michael Hanselmann <linux-kernel@hansmi.ch> [PATCH] powermac: Combined fixes for backlight code

This patch fixes several problems:
- pmac_backlight_key() is called under interrupt context, and therefore
can't use mutexes or semaphores, so defer the backlight level for
later, as it's not critical (original code by Aristeu S. Rozanski F.
<aris@valeta.org>).
- Add exports for functions that might be called from modules
- Fix Kconfig depdencies on PMAC_BACKLIGHT.
- Fix locking issues on calls from inside the driver (reported by
Aristeu S. Rozanski F., too)
- Fix wrong calculation of backlight values in some of the drivers
- Replace pmac_backlight_key_up/down by inline functions

[akpm@osdl.org: fix function prototypes]
Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Acked-by: Aristeu S. Rozanski F. <aris@valeta.org>
Acked-by: Rene Nussbaumer <linux-kernel@killerfox.forkbomb.ch>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
5474c120aafe78ca54bf272f7a01107c42da2b21 25-Jun-2006 Michael Hanselmann <linux-kernel@hansmi.ch> [PATCH] Rewritten backlight infrastructure for portable Apple computers

This patch contains a total rewrite of the backlight infrastructure for
portable Apple computers. Backward compatibility is retained. A sysfs
interface allows userland to control the brightness with more steps than
before. Userland is allowed to upload a brightness curve for different
monitors, similar to Mac OS X.

[akpm@osdl.org: add needed exports]
Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>