Commit Graph

67 Commits

Author SHA1 Message Date
Timur Tabi 38dd2daf29 drivers/video: fsl-diu-fb: add hardware cursor support
The Freescale DIU supports a 32x32 color hardware cursor.  Framebuffer
cursors are monochrome, so the driver converts the image data to the
format that the DIU expects and then programs to hardware accordingly.

The support cursor enabling/disabling, we provide two cursor image buffers.
One is always blank (all zeroes), and the other contains the real cursor
image data.  To disable the cursor (used typically for cursor blinking),
we just tell the hardware to use the blank cursor data.

Signed-off-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-10 15:03:32 +03:00
Benjamin Herrenschmidt dffff02a6b Merge remote-tracking branch 'agust/next' into next
<<
Please pull mpc5xxx patches for v3.9. The bestcomm driver is
moved to drivers/dma (so it will be usable for ColdFire).
mpc5121 now provides common dtsi file and existing mpc5121 device
trees use it. There are some minor clock init and sparse fixes
and updates for various 5200 device tree files from Grant. Some
fixes for bugs in the mpc5121 DIU driver are also included here
(Andrew Morton suggested to push them via my mpc5xxx tree).
>>
2013-02-20 11:39:05 +11:00
Anatolij Gustschin b2639b5f1d drivers/video: fsl-diu-fb: fix bugs in interrupt handling
Since commit f74de500 "drivers/video: fsl-diu-fb: streamline
enabling of interrupts" the interrupt handling in the driver
is broken. Enabling diu interrupt causes an interrupt storm and
results in system lockup.

The cookie for the interrupt handler function passed to request_irq()
is wrong (it must be a pointer to the diu struct, and not the address
of the pointer to the diu struct). As a result the interrupt handler
can not read diu registers and acknowledge the interrupt. Fix cookie
arguments for request_irq() and free_irq().

Registering the diu interrupt handler in probe() must happen before
install_fb() calls since this function registers framebuffer devices
and if fbcon tries to take over framebuffer after registering a frame
buffer device, it will call fb_open of the diu driver and enable the
interrupts. At this time the diu interrupt handler must be registered
already.

Disabling the interrupts in fsl_diu_release() must happen only if all
other AOIs are closed. Otherwise closing an overlay plane will disable
the interrupts even if the primary frame buffer plane is opened. Add
an appropriate check in the release function.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Timur Tabi <timur@tabi.org>
Cc: stable@vger.kernel.org
2013-01-29 08:29:57 +00:00
Anatolij Gustschin 5d3cc311a7 drivers/video: fsl-diu-fb: fix pixel formats for 24 and 16 bpp
Framebuffer colors for 24 and 16 bpp are currently wrong. The order
of the color component arguments in the MAKE_PF() is not natural
and causes some confusion. The generated pixel format values for 24
and 16 bpp depths do not much the values in the comments.

Fix the macro arguments to be in the natural RGB order and adjust
the arguments for all depths to generate correct pixel format values
(equal to the values mentioned in the comments).

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Timur Tabi <timur@tabi.org>
Acked-by: Timur Tabi <timur@freescale.com>
Cc: stable@vger.kernel.org
2013-01-29 08:26:58 +00:00
Greg Kroah-Hartman 48c68c4f1b Drivers: video: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:01 -08:00
Timur Tabi e7b4271875 drivers/video: fsl-diu-fb: store EDID data in the global object
Although the DIU driver creates five framebuffer devices, only the first
one controls the physical display.  The remaining four are virtual "AOIs".
Therefore, the EDID data should be stored in the global fsl_diu_data
object, instead of the per-framebuffer object.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:20 -06:00
Timur Tabi ceb001b077 drivers/video: fsl-diu-fb: don't touch registers for unused features
We don't use the writeback buffer, so don't initialize the registers for
that feature.

The default value for SYN_POL is already zero, so don't re-initialize it.

Writing the INT_STATUS register does nothing.

The value that we write to the PLUT register only makes sense on the
MPC8610 and P1022, so don't touch that register on the MPC5121.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:20 -06:00
Timur Tabi 7af3b136d4 drivers/video: fsl-diu-fb: clean up reset of primary display
Commit 4b5006ec ("shared DIU framebuffer support") added the ability to
retain the splash screen until the framebuffer is opened by user space.
Clean up this code to eliminate redundant writes to registers, and eliminate
the use of dummy area descriptor.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:20 -06:00
Timur Tabi 8deac723f7 drivers/video: fsl-diu-fb: remove unused 'cursor_reset' variable
Probably left over from initial development in hardware cursor support
that never made it upstream.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:19 -06:00
Timur Tabi 5cc2a36fe8 drivers/video: fsl-diu-fb: improve message displays
Add some debug and error messages that are useful during debugging.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:19 -06:00
Timur Tabi f74de500a1 drivers/video: fsl-diu-fb: streamline enabling of interrupts
Remove functions request_irq_local() and free_irq_local(), and merge
their code into the functions that handle opening and closing the
framebuffer.  We also improve the way that interrupts are enabled.

Also implement a work-around for broken U-Boots that leave the DIU
interrupts enabled.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:19 -06:00
Timur Tabi e95c17e9ca drivers/video: fsl-diu-fb: add support for set_gamma ioctls
The MPC5121 BSP comes with a gamma_set utility that initializes the gamma
table via an ioctl.  Unfortunately, the ioctl number that utility uses
is defined improperly, but we can still support it.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:19 -06:00
Timur Tabi 2867173572 drivers/video: fsl-diu-fb: simplify platforms that have only one port
Allow the platform code not to define a value for diu_ops.set_monitor_port.
This would be for platforms that only have one monitor port.
set_monitor_port() will never be called with an unsupported port anyway.

Signed-off-by: Timur Tabi <timur@freescale.com>
2012-11-26 13:41:19 -06:00
Damien Cassou c1f383d97c drivers/video/fsl-diu-fb.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

Signed-off-by: Damien Cassou <damien.cassou@lifl.fr>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-08-23 13:06:12 +00:00
Timur Tabi 5e7b911f9a drivers/video: fsl-diu-fb: don't initialize the THRESHOLDS registers
The THRESHOLDS register configures thresholds for two interrupts, but
these interrupts are not used in the DIU driver.  An early version of the
driver may have used the "lines before vsync" interrupt, which requires
the LS_BF_VS of THRESHOLDS to be initialized.

Unfortunately, the initialization of this register does not do a
read-modify-write to set only LS_BF_VS.  On the MPC8610, the value
written is correct.  On other chips, like the P1022, the value overwrites
some reserved bits.  This results in a performance drop on the P1022.

Since the default value is acceptable as-is on all SOCs, we should just
avoid touching this register.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-05-13 13:08:56 +00:00
Michael Neuling f7f5ef0afd drivers/video: compile fixes for fsl-diu-fb.c
Fix a compiler errors introduced in:
  commit ddd3d90543
  Author: Timur Tabi <timur@freescale.com>
  drivers/video: fsl-diu-fb: merge all allocated data into one block

Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-01-28 19:35:24 +00:00
Timur Tabi 05342c0bdf drivers/video: fsl-diu-fb: merge fsl_diu_alloc() into map_video_memory()
Functions fsl_diu_alloc() and fsl_diu_free() were only being called by
map_video_memory() and unmap_video_memory(), respectively.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-01-03 15:59:09 +00:00
Timur Tabi e09a8c3a42 drivers/video: fsl-diu-fb: add default platform ops functions
The DIU driver requires some platform-specific functions to be defined,
but two them can be optional because most platforms implement them the
same way.  Functions set_gamma_table() and get_pixel_format() are only
needed because of quirks in the Freescale MPC8610 HPCD reference board.
For other boards, a generic implementation works, so we shouldn't
require the platform code to define them.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-01-03 15:59:09 +00:00
Timur Tabi d397e916f3 drivers/video: fsl-diu-fb: remove broken reference count enabling the display
The functions enable_lcdc() and disable_lcdc() used the variable fb_enable
to keep a reference count of when the display is enabled, but the code is
broken.  The display is always disabled when disable_lcdc(), and it is
always enabled when enable_lcdc() is called, regardless of the value of
fb_enable.  Obviously, we don't need to keep a reference count, so just
remove the variable.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-01-03 15:59:08 +00:00
Timur Tabi 934dbeebed drivers/video: fsl-diu-fb: set correct framebuffer flags
The DIU uses system RAM for the framebuffer, so FBINFO_VIRTFB should be set.

Since the framebuffer is in system RAM, it can be read from more quickly
than written to, so FBINFO_READS_FAST should be set.

We can also set FBINFO_PARTIAL_PAN_OK for the same reasons.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-01-03 15:59:08 +00:00
Timur Tabi f934fbd6ba drivers/video: fsl-diu-fb: merge init_fbinfo() into install_fb()
Function init_fbinfo() is called only from install_fb(), and it's only a few
lines long.  Plus, it ignores the return code from fb_alloc_cmap().  Merge
its contents into install_fb() and handle errors properly.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-01-03 15:59:08 +00:00
Timur Tabi b779505282 drivers/video: fsl-diu-fb: rename "machine_data" to "data"
"machine_data" is too long and clunky, and the "machine" part doesn't make
much sense, anyway.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-12-19 20:06:41 +00:00
Timur Tabi ddd3d90543 drivers/video: fsl-diu-fb: merge all allocated data into one block
The Freescale DIU driver allocates multiple blocks of memory, including
multiple DMA buffers.  Merge all of these blocks into one data structure.

Specifically:

1) struct fsl_diu_data now contains everything that needs to be allocated,
except for the framebuffers themselves.  DMA'able objects are aligned correctly
within the structure.

2) struct diu_addr is no longer needed, because we don't have to manage
multiple blocks of DMA memory.

3) Since there's no diu_addr any more, macro DMA_ADDR is used to calculate
the DMA address of any field in fsl_diu_data.

4) Functions allocate_buf() and free_buf() are no longer needed, because we
now assume that dma_alloc_coherent() will allocate a page-aligned block,
and everything is properly aligned with fsl_diu_data already, so we no longer
need to align any memory blocks ourselves.

5) The "dummy" area descriptor is now defined separately from the other
five ADs, so NUM_AOIS (previously called FSL_AOI_NUM) is now set to five
instead of six.  Previously, all six were combined together to avoid a
separate call to allocate_buf() just for the dummy AD.

6) framebuffer_alloc() and framebuffer_release() are no longer used.  The
framebuffer is initialized manually.

7) Error handling is simplified since there's only one memory buffer
allocated.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-12-19 20:03:53 +00:00
Timur Tabi 07a0621403 drivers/video: fsl-diu-fb: merge diu_pool into fsl_diu_data
The diu_pool structure contains diu_addr objects for various objects
allocated in DMA space that are used by the DIU, but the only instance
of this structure is a global variable, 'pool'.  Eliminate 'pool' by
merging its fields into the fsl_diu_data structure, which is instantiated
on the heap for each DIU controller found.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:16:36 +00:00
Timur Tabi 3c755b7c09 drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data
The diu_hw structure contains two fields used to access the DIU registers,
but the only instance of this structure is a global variable, 'dr'.
Eliminate 'dr' by merging its fields into the fsl_diu_data structure,
which is instantiated on the heap for each DIU controller found.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi c4e5a02327 drivers/video: fsl-diu-fb: only DIU modes 0 and 1 are supported
The Freescale DIU video controller supports five video "modes", but only
the first two are used by the driver.  The other three are special modes
that don't make sense for a framebuffer driver.  Therefore, there's no
point in keeping a global variable that indicates which mode we're
supposed to use.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi 7e47c21195 drivers/video: fsl-diu-fb: remove unused panel operating mode support
The MFB_TYPE_xxx macros indicate different "operating modes" of each AOI,
but this feature is not actually used in the driver.  The mfb_index.type
field is always set to MFB_TYPE_OUTPUT, so just delete it and any code
that references it.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi 2572df91d5 drivers/video: fsl-diu-fb: use an enum for the AOI index
Each of the five AOIs created by the DIU driver has a special purpose, and
they're not treated equally.  It makes sense to identify them with an enum
instead of a hard-coded number.

Since the 'index' is now an enum, it can only contain allowed values, so
there's no need to check for an invalid value.  This simplifies some other
code, such as fsl_diu_disable_panel(), which no longer needs to return an
error code.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi 760af8f83d drivers/video: fsl-diu-fb: add several new video modes
Add the following new video modes to the Freescale DIU framebuffer driver:

640x480x60
640x480x72
640x480x75
640x480x90
640x480x100
800x480x60
800x600x60
854x480x60
1280x480x60
1280x720x60
1920x1080x60

Also add margin data to the 320x240 video mode.  This mode was originally
intended only for the AOIs (overlays) used on planes two and three, but with
real margin data, it can now be used as an actual video mode.
Video mode data is from earlier work done by Jerry Huang
<Chang-Ming.Huang@freescale.com>.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi 1738f6f84f drivers/video: fsl-diu-fb: remove broken screen blanking support
The function which is supposed to provide screen blanking support doesn't
actually do anything, so the framebuffer layer thinks the screen has
been blanked when it really isn't.  Remove the code completely for now.

A side-effect of this change is that the framebuffer console blanking now
works correctly.  Presumably this is because the console now receives -EINVAL
instead of '0' when it asks the driver to blank the screen, so the console
does it manually now.

A signficant refactoring of the driver is planned, and proper hardware
blanking support will added afterwards.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi b715f9f04c drivers/video: fsl-diu-fb: move some definitions out of the header file
Move several macros and structures from the Freescale DIU driver's header
file into the source file, because they're only used by that file.  Also
delete a few unused macros.

The diu and diu_ad structures cannot be moved because they're being used
by the MPC5121 platform file.  A future patch eliminate the need for
the platform file to access these structs, so they'll be moved also.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:10:12 +00:00
Timur Tabi 36b0b1d415 drivers/video: fsl-diu-fb: fix some ioctls
Use the _IOx macros to define the ioctl commands, instead of hard-coded
numbers.  Unfortunately, the original definitions of MFB_SET_PIXFMT and
MFB_GET_PIXFMT used the wrong value for the size, so these macros have
new values now.  To avoid breaking binary compatibility with older
applications, we retain support for the original values, but the driver
displays a warning message if they're used.

Also remove the FBIOGET_GWINFO and FBIOPUT_GWINFO ioctls.  FBIOPUT_GWINFO
was never implemented, and FBIOGET_GWINFO was never used by any
application.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-10-05 01:06:55 +00:00
Timur Tabi 3f78bbd1a2 drivers/video: fsl-diu-fb: use a normal for-loop to uninstall framebuffers
Uninstalling the framebuffers in reverse order is unnecessary and makes
the for-loop awkward.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:57 +00:00
Timur Tabi 589c797193 drivers/video: fsl-diu-fb: fix memory leak on error
We were forgetting to unmap the video memory if fsl_diu_check_var() fails.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:57 +00:00
Timur Tabi ec02dd23dc drivers/video: fsl-diu-fb: fix potential memcpy buffer overflow bug
It makes no sense to limit the size of a strncpy() to the length of
the source string.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:57 +00:00
Timur Tabi f8c6bf6ae6 drivers/video: fsl-diu-fb: set the driver name to "fsl-diu-fb"
Use the name "fsl-diu-fb" in the Freescale DIU framebuffer driver
during registrations.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:57 +00:00
Timur Tabi bada04fcda drivers/video: fsl-diu-fb: improve local variable usage in some functions
Clean up the local variable usage in request_irq_local() and allocate_buf().
This streamlines the code without affecting functionality.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:57 +00:00
Timur Tabi 63cf8df44e drivers/video: fsl-diu-fb: remove redundant default video mode
The framebuffer layer already uses the first video mode defined in the
fb_videomode array as a default, so there's no need to duplicate the
first entry into a stand-alone structure.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:57 +00:00
Timur Tabi 9e52ba612f drivers/video: fsl-diu-fb: improve device tree usage
Implement various improvements to the way the Freescale DIU framebuffer
driver access the device tree.

1) Use of_iomap() instead of of_address_to_resource() and ioremap()

2) Use be32_to_cpup() instead of directly dereferencing the device_node
   pointer.

3) Rename variable 'ofdev' to 'pdev' to avoid any confusion that it's
   a platform_device pointer, not an of_device pointer (of_device no
   longer exists).

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:56 +00:00
Timur Tabi 89f08e3e5d drivers/video: fsl-diu-fb: fix compilation warning
Fix this compilation warning in the Freescale DIU framebuffer driver:

warning: 'dummy_ad_addr' may be used uninitialized in this function

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:56 +00:00
Timur Tabi 4a64e49df2 drivers/video: fsl-diu-fb: remove unused ioctls
Remove some unused ioctl commands, and treat those commands as unsupported
instead of ignored.

Also remove struct mfb_alpha, which isn't used by any ioctl.  It may have
been once intended for MFB_SET_ALPHA, but that ioctl uses a different
data structure.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:56 +00:00
Timur Tabi 154152aeea drivers/video: fsl-diu-fb: clean up printk usage
Remove debug printk messages (they don't help in debugging), replace
printk(KERN_xxx with its pr_xxx or dev_xxx equivalent, and add a couple
missing error messages.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:56 +00:00
Timur Tabi 4a85dc8b7d drivers/video: fsl-diu-fb: clean up whitespace and formatting
Fix various indentation and line length problems in the Freescale
DIU framebuffer driver.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-18 20:08:56 +00:00
Timur Tabi 7653aaab77 drivers/video: use strings to specify the Freescale DIU monitor port
Instead of using ill-defined numbers (0, 1, and 2) for the monitor port, allow
the user to specify the port by name ("dvi", "lvds", or "dlvds").  This works
on the kernel command line, the module command-line, and the sysfs "monitor"
device.

Note that changing the monitor port does not currently work on the P1022DS,
because the code that talks to the PIXIS FPGA is broken.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-07-13 17:01:39 +09:00
Timur Tabi 39785eb1d3 fsl-diu-fb: remove check for pixel clock ranges
The Freescale DIU framebuffer driver defines two constants, MIN_PIX_CLK and
MAX_PIX_CLK, that are supposed to represent the lower and upper limits of
the pixel clock.  These values, however, are true only for one platform
clock rate (533MHz) and only for the MPC8610.  So the actual range for
the pixel clock is chip-specific, which means the current values are almost
always wrong.  The chance of an out-of-range pixel clock being used are also
remote.

Rather than try to detect an out-of-range clock in the DIU driver, we depend
on the board-specific pixel clock function (e.g. p1022ds_set_pixel_clock)
to clamp the pixel clock to a supported value.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-06-24 17:08:49 +09:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Grant Likely 28541d0f18 dt/video: Eliminate users of of_platform_{,un}register_driver
Get rid of users of of_platform_driver in drivers/video.  The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-02-28 13:22:45 -07:00
Grant Likely 2dc1158137 of/device: Replace struct of_device with struct platform_device
of_device is just an alias for platform_device, so remove it entirely.  Also
replace to_of_device() with to_platform_device() and update comment blocks.

This patch was initially generated from the following semantic patch, and then
edited by hand to pick up the bits that coccinelle didn't catch.

@@
@@
-struct of_device
+struct platform_device

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: David S. Miller <davem@davemloft.net>
2010-08-06 09:25:50 -06:00
Anatolij Gustschin 8b856f040c powerpc/fsl-diu-fb: Support setting display mode using EDID
Adds support for encoding display mode information
in the device tree using verbatim EDID block.

If the EDID entry in the DIU node is present, the
driver will build mode database using EDID data
and allow setting the display modes from this database.
Otherwise display mode will be set using mode
entries from driver's internal database as usual.

This patch also updates device tree bindings.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-01 17:06:44 -06:00
Anatolij Gustschin 4b5006ec7b powerpc/5121: shared DIU framebuffer support
MPC5121 DIU configuration/setup as initialized by the boot
loader currently will get lost while booting Linux. As a
result displaying the boot splash is not possible through
the boot process.

To prevent this we reserve configured DIU frame buffer
address range while booting and preserve AOI descriptor
and gamma table so that DIU continues displaying through
the whole boot process. On first open from user space
DIU frame buffer driver releases the reserved frame
buffer area and continues to operate as usual.

Signed-off-by: John Rigby <jcrigby@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-01 17:06:44 -06:00