summaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mobile_lcdcfb.c
AgeCommit message (Collapse)AuthorFilesLines
2011-09-05fbdev: sh_mobile_lcdc: use display information in info for panningLaurent Pinchart1-12/+12
We must not use any information in the passed var besides xoffset, yoffset and vmode as otherwise applications might abuse it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: Add support for format changes at runtimeLaurent Pinchart1-0/+14
Implement .fb_set_par to support frame buffer format changes at runtime. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: Adjust requested parameters in .fb_check_varLaurent Pinchart1-15/+88
Instead of failing when the requested fb_var_screeninfo parameters are not supported, adjust the parameters according to the hardware capabilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-19fbdev: sh_mobile_meram: Remove unneeded sh_mobile_meram.hLaurent Pinchart1-1/+1
The drivers/video/sh_mobile_meram.h header contains unused definitions and declarations. Move the only used macro to sh_mobile_meram.c, and remove the header. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Restart LCDC in runtime PM resume handlerLaurent Pinchart1-44/+5
Instead of restoring registers blindly, restart the LCDC by going through the startup sequence when resuming from runtime PM suspend. All registers are now correctly initialized in the right order. As a side effect, this also gets rid fo a possible panning restore issue caused by always saving the frame buffer base address registers from set A instead of the currently active set. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Store the frame buffer base address when panningLaurent Pinchart1-13/+9
When the frame buffer base address is changed by a panning operation, store it in the channel structure. It will be reused when runtime PM code will use __sh_mobile_lcdc_start(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Split LCDC start code from sh_mobile_lcdc_startLaurent Pinchart1-158/+151
Splitting the LCDC start code from clock, MERAM and panel management will make the code usable by runtime PM. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Compute clock pattern using divider denominatorLaurent Pinchart1-4/+6
The clock divider pattern is computed based on the dot clock register value which stores the divider denumerator. However, when using a 1:1 divider ratio, the register is programmed with a value that must not be interpreted as a denominator. This results in a shift left operation with a value of 32, which produces undefined behaviour. Compute the clock pattern using the divider denominator, not the dot clock register value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Don't acknowlege interrupts unintentionallyLaurent Pinchart1-12/+8
The LDINTR register caries both interrupt enable and interrupt status bits. When setting or clearing interrupt enable bits, write all status bits to 1 to avoid acknowledging interrupts by mistake. When acknowledging interrupts, write 1 to all non-triggered interrupt bits to avoid losing interrupts. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Replace hardcoded register values with macrosLaurent Pinchart1-111/+93
Instead of hardcoding register values through the driver, define macros for individual register bits using the register name and the bit name, and use the macros. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PMLaurent Pinchart1-3/+3
Resuming from runtime PM restores all LCDC registers. If the dot clock is off at that time display panning information will be corrupted. Turn the dot clock on before resuming from runtime PM. Similarly, turn the clock off after suspending the LCDC. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2011-08-19fbdev: sh_mobile_meram: Enable/disable MERAM along with LCDCDamian Hobson-Garcia1-0/+4
The MERAM reference counts should be tied to the two LCDC devices (LCD/HDMI) so that when they are enable/disabled, the MERAM is as well. Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
2011-07-26atomic: use <linux/atomic.h>Arun Sharma1-1/+1
This allows us to move duplicated code in <asm/atomic.h> (atomic_inc_not_zero() for now) to <linux/atomic.h> Signed-off-by: Arun Sharma <asharma@fb.com> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: David Miller <davem@davemloft.net> Cc: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-02fbdev: sh_mobile_lcdcfb: Fix up fallout from MERAM changes.Paul Mundt1-2/+2
The LCDC driver does no longer compile: CC drivers/video/sh_mobile_meram.o CC drivers/video/sh_mobile_lcdcfb.o drivers/video/sh_mobile_lcdcfb.c: In function 'sh_mobile_lcdc_start': drivers/video/sh_mobile_lcdcfb.c:640:4: error: 'ret' undeclared (first use in this function) drivers/video/sh_mobile_lcdcfb.c:640:4: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [drivers/video/sh_mobile_lcdcfb.o] Error 1 make[1]: *** [drivers/video] Error 2 make: *** [drivers] Error 2 Reported-by: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-25Merge branch 'common/fbdev-meram' of ↵Paul Mundt1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
2011-05-25sh_mobile_meram: Safely disable MERAM operation when not initializedDamian1-1/+2
If the MERAM platform data is defined, but the MERAM has not been properly initaliazed we need to safely fall back to non-MERAM operation. Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-24Merge branches 'common/fbdev' and 'common/fbdev-meram' of ↵Paul Mundt1-20/+105
master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
2011-05-24fbdev: sh_mobile_lcdc: remove runtime PM calls from the notifierGuennadi Liakhovetski1-5/+1
The notifier function calls sh_mobile_lcdc_stop() and sh_mobile_lcdc_start(), which already take care about the runtime PM state. Remove redundant calls. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-24fbdev: sh_mobile_lcdc: reduce scope of a variableGuennadi Liakhovetski1-6/+6
The "ret" variable in sh_mobile_lcdc_start() is only used at one location, move its definition to the inner-most scope. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-23sh_mobile_meram: Add support for NV24 framebuffersDamian1-3/+7
Since the NV24 framebuffer has a CbCr plane that is twice as wide as the Y plane, it needs to be handled as a special case. Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-23sh_mobile_meram: MERAM framework for LCDCDamian1-9/+94
Based on the patch by Takanari Hayama <taki@igel.co.jp> Adds support framework necessary to use Media RAM (MERAM) caching functionality with the LCDC. The MERAM is accessed through up to 4 Interconnect Buffers (ICBs). ICB numbers and MERAM address ranges to use are specified in by filling in the .meram_cfg member of the LCDC platform data Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-29Merge branch 'common/fbdev' of ↵Paul Mundt1-4/+48
master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
2011-03-29fbdev: sh_mobile_lcdcfb: fix module lock acquisitionAlexandre Courbot1-4/+4
Whenever the LCDC is to be started or stopped, a board callback is checked for existence and invoked. Prior to the invokation, the callback's module lock is also acquired, to be released once the callback returns. However, the order of testing makes it possible for the lock to be acquired and not released in case the callback does not exist. This patch reorders the tests to prevent this particular case. Signed-off-by: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-29fbdev: sh_mobile_lcdcfb: add blanking supportAlexandre Courbot1-0/+44
Add a blanking callback to the LCDC driver in order to support both FBIOBLANK and TIOCLINUX blanking ioctls. LCDC clocks are also released if the requested blanking level is superior to FB_BLANK_NORMAL, to allow runtime PM to disable the clocks if possible. Signed-off-by: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-22fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()Dan Carpenter1-2/+3
backlight_device_register() returns an ERR_PTR. It doesn't return NULL. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-16fbdev: sh_mobile_lcdc: Add YUV framebuffer supportDamian Hobson-Garcia1-28/+113
Supports YCbCr420sp, YCbCr422sp, and YCbCr44sp, formats (bpp = 12, 16, and 24) respectively. When double-buffering both Y planes appear before the C planes (Y-Y-C-C), as opposed to Y-C-Y-C. Set .nonstd in struct sh_mobile_lcdc_chan_cfg to enable YUV mode, and use .bpp to distiguish between the 3 modes. The value of .nonstd is copied to bits 16-31 of LDDFR in the LCDC and should be set accordingly. .nonstd must be set to 0 for RGB mode. Due to the encoding of YUV data, the framebuffer will clear to green instead of black. In YUV 420 mode, panning is only possible in 2 line increments. Additionally in YUV 420 mode the vertical resolution of the framebuffer must be an even number. Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-10fbdev: sh_mobile_lcdcfb: add backlight supportAlexandre Courbot1-0/+81
Support for backlight devices controlled through board-specific routines. Backlights can be defined per-channel and follow fbdev directives to switch off as the LCD blanks or is turned on/off. Signed-off-by: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-26console: rename acquire/release_console_sem() to console_lock/unlock()Torben Hohn1-2/+2
The -rt patches change the console_semaphore to console_mutex. As a result, a quite large chunk of the patches changes all acquire/release_console_sem() to acquire/release_console_mutex() This commit makes things use more neutral function names which dont make implications about the underlying lock. The only real change is the return value of console_trylock which is inverted from try_acquire_console_sem() This patch also paves the way to switching console_sem from a semaphore to a mutex. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert] Signed-off-by: Torben Hohn <torbenh@gmx.de> Cc: Thomas Gleixner <tglx@tglx.de> Cc: Greg KH <gregkh@suse.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-06Merge branch 'master' of ↵Paul Mundt1-1/+3
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: drivers/video/sh_mobile_lcdcfb.c Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-06fbdev: sh_mobile_lcdcfb: Enable 32 bpp and 24 bpp supportMagnus Damm1-11/+63
This patch extends the LCDC driver with 24 bpp and 32 bpp support. These modes have been kept disabled earlier due to dependencies between the potential two LCDC channels that are exported as two separate framebuffer devices. The dependency boils down to a byte swap register that is shared between multiple channels. With this patch applied all single channel LCDC hardware can chose freely from 16, 24 and 32 bpp. Dual channel LCDC must stick to the same setup for both channels. Without this patch only 16 bpp is fully supported. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-12-27fbdev: sh_mobile_lcdc: increase maximum framebuffer size to support 1080pGuennadi Liakhovetski1-18/+8
LCDC hardware can support 1920x1080 formats, adjust the driver to cover them. Besides, instead of guessing some "reasonable" validity checks, only verify values in .fb_check_var(), that we are sure, we cannot support. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-12-22fbdev: sh-mobile: restore display size configurationGuennadi Liakhovetski1-1/+3
An earlier patch replaced open-coded video-mode configuration from platform data by a call to fb_videomode_to_var(), thereby setting ofdisplay sizes have been accidentally lost. Restore them. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-12-22Merge branch 'master' of ↵Paul Mundt1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
2010-11-16fbdev: sh_mobile_lcdcfb: fix bug in reconfig()Arnd Hannemann1-2/+2
The function sh_mobile_fb_reconfig() contained a bug, which caused the line_length to be set wrongly, if a mode with a different X-resolution than the default one was chosen. This caused 1080p24 mode to not work on AP4EVB. Additionally the notifier chain was also called with the wrong mode. This patch fixes this, by using the X-resolution of the new mode instead of the old one to calculate line length and hands over the correct mode to the notifier chain. Signed-off-by: Arnd Hannemann <arnd@arndnet.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10fbdev: sh_mobile_lcdcfb: fix up compiler warnings.Paul Mundt1-1/+1
CC drivers/video/sh_mobile_lcdcfb.o drivers/video/sh_mobile_lcdcfb.c: In function 'sh_mobile_check_var': drivers/video/sh_mobile_lcdcfb.c:922: warning: format '%u' expects type 'unsigned int', but argument 11 has type 'long unsigned int' Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10fbdev: sh_mobile_lcdc: increase maximum framebuffer size to support 1080pGuennadi Liakhovetski1-18/+8
LCDC hardware can support 1920x1080 formats, adjust the driver to cover them. Besides, instead of guessing some "reasonable" validity checks, only verify values in .fb_check_var(), that we are sure, we cannot support. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10fbdev: sh_mobile_lcdc: use correct number of modes, when using the defaultGuennadi Liakhovetski1-6/+8
Fix zero mode number, when using the default 720p mode. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10fbdev: sh_mobile_lcdc: use the standard CEA-861 720p timingGuennadi Liakhovetski1-3/+4
sh_mobile_lcdcfb.c has a hard-coded 720p video mode, used as default, if none is explicitly specified by the platform. Adjust its timing to match the CEA standard. Also add an explicit refresh rate value, which is needed, when used with HDMI, to be able to recognise the default 720p mode as a pre-programmed VIC #4. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-28Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/genesis-2.6 into ↵Russell King1-121/+227
devel-stable Conflicts: drivers/video/sh_mobile_hdmi.c
2010-10-15fbdev: sh_mobile_lcdc: relax .check_var() HSYNC testGuennadi Liakhovetski1-1/+1
Some valid and supported video modes have .hsync_len > 120. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15fbdev: sh_mobile_lcdc: make platform videomode table optionalGuennadi Liakhovetski1-24/+49
Add a default 720p mode to the sh_mobile_lcdc driver to be used, when no videomode is specified in the platform data. This can be used, e.g., with HDMI. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-13sh: free-without-alloc fix for sh_mobile_lcdcfbMagnus Damm1-2/+4
Without this fix the LCDC driver will try to free framebuffer memory even though the allocation failed. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-16fbdev: sh_mobile_lcdc: reconfigure the framebuffer, when freeGuennadi Liakhovetski1-1/+111
Currently the sh_mobile_lcdc driver only reconfigures the hardware interface, when a new monitor is plugged in. This patch adds support for dynamic framebuffer reconfiguration, when no user is holding the framebuffer device node open. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_hdmi: support hot-plugging of different HDMI / DVI displaysGuennadi Liakhovetski1-25/+6
With this patch hot-plugging of an HDMI or a DVI monitor can select a different video mode and reconfigure the LCDC and HDMI controllers accordingly. Due to a lack of a standard API to inform framebuffer users of a changed video mode, the framebuffer configuration is preserved regardless of a specific mode, selected for the monitor. As described in a previous patch, this leads to smaller framebuffers being displayed on larger monitors or a part of a larger framebuffer being displayed on a smaller resolution monitor. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_lcdcfb: separate display variable data from framebuffer dataGuennadi Liakhovetski1-17/+20
This is a preparation for a patch, that shall allow displaying of a smaller framebuffer on a bigger display and of a part of a bigger framebuffer on a smaller display. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_hdmi: implement lockingGuennadi Liakhovetski1-31/+15
The SH-Mobile HDMI driver runs in several contexts: ISR, delayed work-queue, task context, when called from the sh_mobile_lcdc framebuffer driver. This creates ample race possibilities. Even though most these races are purely theoretical, it is better to close them. To trace fb_info validity we install a notification callback in the HDMI driver, and the only way for it to get to driver internal data is by using struct sh_mobile_lcdc_chan, therefore it had to be extracted into a separate common header. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_lcdcfb: allocate memory, sufficient for the biggest modeGuennadi Liakhovetski1-6/+20
Now, that we add support for multiple modes to the sh_mobile_lcdcfb driver, it has to allocate memory, sufficient for the biggest of them. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_lcdcfb: fix notifier callback return codesGuennadi Liakhovetski1-6/+8
Notifier callbacks have to return either one of NOTIFY_* codes or a negative errno, converted to a suitable value by the notifier_from_errno() inline, if the notifier chain shall not be continued. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_lcdcfb: Support multiple video modes in platform dataGuennadi Liakhovetski1-5/+5
This is a preparation for HDMI hotplug support. This patch just moves all platform defined video modes for the sh_mobile_lcdcfb driver to separate arrays and switches all users to use element 0 of that array, so, this patch doesn't introduce any functional changes and as such should not cause any regressions. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14fbdev: sh_mobile_lcdcfb: minor simplifications and clean upGuennadi Liakhovetski1-25/+26
Remove an unused variable and simplify several pointer dereferences. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>