Currently both da903x backlight and voltage reulator drivers have the
same name. Rename the backlight driver to allow use of both drivers as
modules.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Eric Miao <eric.miao@marvell.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The corgi backlight driver is really generic code. This rename makes
this a lot clearer and completes the partial rename made a while ago.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Always invoke backlight_update_status when users want to change
the backlight.
For setups where brightness change is an expensive operation,
this could be done in the driver rather than the core.
http://bugzilla.kernel.org/show_bug.cgi?id=12249
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
LCD driver on tosa requires reprogramming TG after mode
switching. Add support for switching to QVGA mode.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Check input properly in backlight, echo > brightness should not turn off
the backlight.
[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix printk warning]
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
It is stored in the board specific file
./arch/arm/mach-s3c2412/mach-jive.c
as .rgb_if2.
Actually, the value is correct, only semantic is wrong.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Use platform_device_register_simple() and also fix error
handling when platform_device_alloc() fails (cr_backlight_driver
is left registered).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Use platform_device_register_simple() and also fix error
handling when platform_device_alloc() fails (progearbl_driver
is left registered).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Use platform_device_register_simple() and also fix error
handling when platform_device_alloc() fails (hp680_bl_driver
is left registered).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
One more error handling code should have kfree as well
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Eric Miao <eric.miao@marvell.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Error handling code following a kzalloc should free the allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,l;
position p1,p2;
expression *ptr != NULL;
@@
(
if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
|
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
)
<... when != x
when != if (...) { <+...x...+> }
x->f = E
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Richard Purdie <rpurdie@linux.intel.com>
Cc: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The LCD driver core calls LCD drivers when either the blanking state or
the display mode has changed, but does not make any check to see if the
called driver has a .set_mode method.
This means if a driver only has a .set_power method then the system will
OOPS on changing mode (and with the console semaphore held so you cannot
easily see the problem).
Fix the problem by ensuring that either callback is valid before use.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
corgi_lcd has symbol conflict with corgi_bl driver.
Fix it by renaming common symbol in new corgi_lcd driver.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] pxa: corgi backlight driver should not select ssp drivers
[ARM] 5321/1: Kirkwood: fix typo in Makefile
[ARM] 5320/1: fix assembly constraints in implementation of do_div()
[ARM] 5318/1: Swap the PRRR and NMRR values in proc-v7.S
[ARM] 5316/1: AT91: oops (regression) fix on gpio irq
[ARM] msm: vreg interface to msm7k pmic
[ARM] msm: dma: various basic dma improvements and bugfixes
[ARM] msm: clock: provide clk_*() api support for
[ARM] msm: clean up iomap and devices
[ARM] msm: add proc_comm support, necessary for clock and power control
[ARM] msm: rename ARCH_MSM7X00A to ARCH_MSM
[ARM] pxa/spitz: fix unbalance parenthesis in header file spitz.h
[ARM] pxa: update {corgi,spitz}_defconfig to favor SPI-based drivers
[ARM] pxa: fix the corgi_ssp.c dependency issue in {corgi,spitz}_defconfig
Revert "[ARM] pxa/corgi: remove now unused corgi_ssp.c and corgi_lcd.c"
Resolves build errors with eseries and magician defconfigs (which
make use of the corgi backlight driver.)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Separate building of corgi_ssp.c, and introduce a new hidden config option
CONFIG_CORGI_SSP_DEPRECATED for this. Aslo mark corgi_ts.c and corgi_bl.c
as deprecated.
This unbreaks the legacy configs in {corgi,spitz}_defconfig, however, SPI
based ADS7846 touchscreen driver and a new SPI-based corgi_lcd.c driver
with integrated backlight support are recommended.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
On Sharp SL-6000 lcd/backlight is a bit complex, so add two drivers
one for lcd-driving chip, other one for dac regulating the backlight
LEDS.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Use new MODULE_DEVICE_TABLE(dmi, ...) facility. There's no need for
every driver to screw it up for themselves, when the alias can be
generated automatically.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This type of LCD panel can be found on PXA3xx/Littleton platforms.
Add LCD device and SPI-based driver for this.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This is not generic enough, added here for backward compatibility.
And make this an individual commit so future revert will be a bit
easier.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The driver is based on different source files including corgi_ssp.c,
corgi_lcd.c and corgi_bl.c, previously authored by Richard Purdie
and many others.
The LCD and Backlight device actually share the same SPI device, so
they are made into this single driver.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Some LCD panels are capable of different resolutions, and is allowed
to change at run-time, so to make "struct lcd_device" to be able to
handle mode change events here.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add the missing MODULE_ALIAS() to the pwm_backlight driver.
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Make the error paths in the pwm_backlight driver more informative in the
probe path, especially for the times that it finds an error.
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (28 commits)
mm/hugetlb.c must #include <asm/io.h>
video: Fix up hp6xx driver build regressions.
sh: defconfig updates.
sh: Kill off stray mach-rsk7203 reference.
serial: sh-sci: Fix up SH7760/SH7780/SH7785 early printk regression.
sh: Move out individual boards without mach groups.
sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
sh: Allow SH-3 and SH-5 to use common headers.
sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
sh/maple: clean maple bus code
sh: More header path fixups for mach dir refactoring.
sh: Move out the solution engine headers to arch/sh/include/mach-se/
sh: I2C fix for AP325RXA and Migo-R
sh: Shuffle the board directories in to mach groups.
sh: dma-sh: Fix up dreamcast dma.h mach path.
sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
sh: Add ARCH_DEFCONFIG entries for sh and sh64.
sh: Fix compile error of Solution Engine
sh: Proper __put_user_asm() size mismatch fix.
sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
...
It seems that we need to ensure that the lcd is powered up at start,
otherwise we do not see a display.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When registering an platform_lcd, use the name of the platform device
specified in case there are more than one platform_lcd backlights
registered.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch adds a platform driver using the ATMEL PWM driver to control a
backlight which requires a PWM signal and optional GPIO signal for discrete
on/off signal. It has been tested on Favr-32 board from EarthLCD.
The driver is configurable by supplying a struct with the platform data. See
the include/linux/atmel-pwm-bl.h for details.
The board code for Favr-32 will be submitted to the AVR32 kernel list.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add a platform_lcd driver to allow boards with simple lcd power controls
to register themselves easily.
[akpm@linux-foundation.org: build fix]
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add the lcd_device being checked to the check_fb entry of lcd_ops. This
ensures that any driver using this to check against it's own state can do
so, and also makes all the calls in lcd_ops more orthogonal in their
arguments.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Provide support for the ILI9320 display controller chip which is found in
many LCD displays. Included with this is support for an example LCD using
this chip, the VGG2432A4.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nvidia-based Apple Macbook Pros don't appear to handle backlight control
through the graphics card registers or ACPI, but instead trigger changes
via SMI calls. This driver registers a generic backlight device that
lets existing userspace deal with it. Code derived from Julien Blache's
Pommed application.
Signed-off-by: Julien Blache <jb@jblache.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Make the return of pwm_request() be more informative than just
being NULL on error by using PTR_ERR() to respond with an
approriate error.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This allows platform code to manipulate GPIOs and brightness level as
needed.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Patch mostly from Eric Miao, with minor edits by rmk to convert
Eric's driver to a generic PWM-based backlight driver.
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This adds the OMAP1 PWL-based LCD backlight driver. It's been in the OMAP
tree for some time. Note that OMAP2 can do similar things with the generic
timers which have PWM outputs. Such timers are more generic than the PWL
found on OMAP1 chips, but have a different EMI profile because they aren't
driven by a pseudorandom number generator.
[akpm@linux-foundation.org: cleanups]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Avoid driver callbacks when the brightness hasn't changed since
they're not necessary.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>