aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/sh_mobile_lcdcfb.c
AgeCommit message (Collapse)Author
2011-10-31video: Add module.h to drivers/video files who really use it.Paul Gortmaker
They were getting this implicitly by an include of module.h from device.h -- but we are going to clean that up and break that include chain, so include module.h explicitly now. [ with contributions from Axel Lin <axel.lin@gmail.com> ] Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-03video: irq: Remove IRQF_DISABLEDYong Zhang
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Acked-by: David Brown <davidb@codeaurora.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: Remove sh_mobile_lcdc_set_bpp()Laurent Pinchart
The function duplicates code found in sh_mobile_check_var(). Remove sh_mobile_lcdc_set_bpp() and call sh_mobile_check_var() instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: Split channel initialization from probe functionLaurent Pinchart
Move channel initialization to sh_mobile_lcdc_channel_init() and call the function from sh_mobile_lcdc_probe(). This makes the code more readable and prepares it for fix/var initialization rework. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: Avoid forward declarationsLaurent Pinchart
Reorder probe/remove functions to avoid forward declarations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: Update fix.line_length in .fb_set_par()Laurent Pinchart
Instead of updating the fixed screen information line length manually after calling fb_set_var() in sh_mobile_fb_reconfig(), update the field in the .fb_set_par() operation handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05fbdev: sh_mobile_lcdc: use display information in info for panningLaurent Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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 Pinchart
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-Garcia
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 Sharma
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 Mundt
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 Mundt
git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
2011-05-25sh_mobile_meram: Safely disable MERAM operation when not initializedDamian
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 Mundt
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 Liakhovetski
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 Liakhovetski
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 framebuffersDamian
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 LCDCDamian
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 Mundt
master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
2011-03-29fbdev: sh_mobile_lcdcfb: fix module lock acquisitionAlexandre Courbot
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 Courbot
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 Carpenter
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-Garcia
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 Courbot
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 Hohn
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 Mundt
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 Damm
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 Liakhovetski
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 Liakhovetski
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 Mundt
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
2010-11-16fbdev: sh_mobile_lcdcfb: fix bug in reconfig()Arnd Hannemann
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 Mundt
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 Liakhovetski
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 Liakhovetski
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 Liakhovetski
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 King
devel-stable Conflicts: drivers/video/sh_mobile_hdmi.c
2010-10-15fbdev: sh_mobile_lcdc: relax .check_var() HSYNC testGuennadi Liakhovetski
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 Liakhovetski
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 Damm
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 Liakhovetski
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 Liakhovetski
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>