Commit graph

335542 commits

Author SHA1 Message Date
Tomi Valkeinen
3c91ee8cc9 OMAPDSS: DISPC: use WARN_ON() in dispc_mgr_go
dispc_mgr_go() should never be called with manager output disabled or if
the GO bit is already set. Change the current silent returns to
WARN_ONs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:02 +02:00
Tomi Valkeinen
916188a466 OMAPDSS: cleanup WB enable/is_enabled functions
Instead of doing direct register reads/writes, dispc_wb_enable() and
dispc_wb_is_enabled() functions can use the common overlay functions to
set and check the enable bit.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:02 +02:00
Tomi Valkeinen
b08e3e1342 OMAPDSS: DISPC: Remove blocking code from dispc_wb_enable()
WB will not be used with compat-mode, i.e. from omapfb. This means we
don't need the current complex dispc_wb_enable function, but can have a
simple register write version of the function.

This patch removes all the extra code from dispc_wb_enable()

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:02 +02:00
Tomi Valkeinen
15f5e7324a OMAPDSS: DISPC: use get_framedone_irq in disable_digit_out
dispc_mgr_disable_digit_out() needs to wait until the DIGIT output is
turned off. This is done with either VSYNC irq on OMAP2/3 and
FRAMEDONETV on OMAP4+. It currently uses a rather hacky way to decide
what irq to use.

This patch changes dispc_mgr_disable_digit_out to use
dispc_mgr_get_framedone_irq to find out if there's framedone irq on this
SoC, and if not, uses VSYNC.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:02 +02:00
Tomi Valkeinen
cffa947d27 OMAPDSS: DISPC: add no_framedone_tv feat
OMAP2/3 do not have FRAMEDONETV irq, but later omaps do. We currently
always return 0 from dispc_mgr_get_framedone_irq() for TV output to be
compatible with OMAP2/3.

This patch implements "no_framedone_tv" dispc-feature that is used in
dispc_mgr_get_framedone_irq to return either 0 for OMAP2/3, or the
correct IRQ number for FRAMEDONETV on OMAP4+.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:01 +02:00
Tomi Valkeinen
e870f21232 OMAPDSS: don't WARN if there's no DSI device
dsi_get_dsidev_from_id() gives a WARN if DSI support is not compiled in.
This warning is not right, as it's valid to call
dsi_get_dsidev_from_id() to see if there is DSI support or not.

Remove the WARN().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:01 +02:00
Tomi Valkeinen
1de8e129f5 OMAPDSS: DPI: fix crash with dpi_verify_dsi_pll()
If the DSI support has not been compiled in or the SoC doesn't have DSI
hardware, dpi_get_dsidev() returns NULL. This NULL is passed to
dpi_verify_dsi_pll() causing a crash. The bug was added with commit
0e8276ef75 (OMAPDSS: DPI: always use DSI
PLL if available).

Fix this by checking if dsidev is NULL before calling
dpi_verify_dsi_pll().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:01 +02:00
Tomi Valkeinen
7e12be71fb OMAPDSS: remove declarations for non-existing functions
Remove dispc_mgr_is_channel_enabled() and dss_mgr_get_timings()
declarations, as the function doesn't exist.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-27 12:27:01 +02:00
Tomi Valkeinen
474ff6b8a7 omapdss fixes for 3.7-rc
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQr1wOAAoJEPo9qoy8lh71lhgP/iJhDRXhyBQ113ebm8BeGSYY
 prYrUzNFbz2qb9q8LeQejgMSNSnFgj9vvdwox/bwvbloDUSrFSEcSvHzL1blaufD
 GXMqdRxHYOs6k1Yiltf7jchSEeX20PCWRBcSlket8jDY1kzy3siOVlpc9O/53Hj9
 hnCGhwO0D53tgeUnCm4B6VtqmspjoX4eJO6AL9WRlCm/vTre4bk43/hfUNusP5uw
 7cplGxpOQMKLOQuMIIuOBsVVXMQFkVO7FK48keGrxhwWaQZMJUKf4up73625eBTn
 81WhexRPmJ8+kXFY+/qRrKy02j61xfOeJJD/Eh7J6u+FeMoqe9LyxtVzxUeOrLr8
 iV/VWyQnppBiVAc865QQLVyPBHi9OGOPkzGBcWvy/4jv8uxvmG3hiIAxHlTwGrjK
 1deLjbj/smDlgvQ5j9T43+NABiIzUQoNVgRm2iWDh12KGKORwlaBb2hU7r0BLV+D
 /q2BJFPIAkafdQ47eWMPkNvhpMOeOJx6MXv0kQ7kAgq9CcHt1sQpzYZFzZa+CeYZ
 Iq+oLj+ByLj3KbKMmSzJtYW+JLGeguSGgiegRW9s/BESxj0cNjPNLHtNMcrklpjk
 sMrCd04dNlFMJUabKr380l9yVnCRX+tNGc8wYTPRRe7iz8G1Ps9Y9cu7py2xQ5/N
 GIt8UIGa0PeY8R04N/YV
 =1jPB
 -----END PGP SIGNATURE-----

Merge tag 'omapdss-for-3.7-rc' of git://gitorious.org/linux-omap-dss2/linux

omapdss fixes for 3.7-rc

Conflicts:
	drivers/video/omap2/dss/dss.c
2012-11-26 10:26:29 +02:00
Tomi Valkeinen
9b76c9cdec OMAPFB: fix compilation error
omapfb compilation fails on x86 (but not on omap):

drivers/video/omap2/omapfb/omapfb-ioctl.c: In function ‘omapfb_ioctl’:
drivers/video/omap2/omapfb/omapfb-ioctl.c:861:23: error: ‘SZ_1M’ undeclared (first use in this function)
drivers/video/omap2/omapfb/omapfb-ioctl.c:861:23: note: each undeclared identifier is reported only once for each function it appears in

Fix this by including linux/sizes.h.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-23 10:50:32 +02:00
Aaro Koskinen
8ad9375f8b OMAPDSS: do not fail if dpll4_m4_ck is missing
Do not fail if dpll4_m4_ck is missing. The clock is not there on omap24xx,
so this should not be a hard error.

The patch retains the functionality before the commit 185bae10 (OMAPDSS:
DSS: Cleanup cpu_is_xxxx checks).

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-22 17:23:12 +02:00
Aaro Koskinen
ee6352de51 OMAPDSS: panel-n8x0: register the DSS driver after SPI probe
Register the DSS driver after SPI probe. This simplifies the
initialization. This is similar to what is being done e.g.
in panel-acx565akm.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-22 17:22:55 +02:00
Archit Taneja
264236f82e OMAPDSS: Add a dispc_features struct for OMAP5
Add a dispc_features struct for OMAP5. Previously, OMAP5 used the same
struct as OMAP4. The new struct for OMAP5 contains the updated register
field offset and maximum limit for overlay manager width and height.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-20 16:54:39 +02:00
Archit Taneja
33b89928f5 OMAPDSS: Add overlay manager width and height limits as a dispc feature
The overlay manager width and height vary in OMAP5 from previous OMAPs
in terms of maximum limit and register field positions. Add parameters
in dispc_features for these. Also remove params related to manager width
and height from dss_features, as we want to maintain a feature list for
individual IPs.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-20 16:52:16 +02:00
Matthias Brugger
4ee9a5377b OMAPFB: Delete if statement evaluating a constant.
Variable r is never set to any value different to zero.
Delete the if statement as it will never executed.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-19 13:12:41 +02:00
Tushar Behera
c415187b68 OMAPFB: Fix possible null pointer dereferencing
Commit 952cbaaa9b (OMAPFB: Change
dssdev->manager references) added checks for OMAPFB_WAITFORVSYNC ioctl
to verify that the display, output and overlay manager exist. However,
the code erroneously uses && for each part, which means that
OMAPFB_WAITFORVSYNC may crash the kernel if no display, output or
manager is associated with the framebuffer.

This patch fixes the issue by using ||.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-19 10:41:50 +02:00
Tomi Valkeinen
dcca5cf07b Merge branch '3.8/vram-conversion' of git://gitorious.org/linux-omap-dss2/linux
Conflicts:
	drivers/video/omap2/dss/Kconfig
	drivers/video/omap2/omapfb/omapfb-ioctl.c
	drivers/video/omap2/omapfb/omapfb-main.c

Merge changes to make omapfb use common dma_alloc, and remove omap's
custom vram allocator.
2012-11-16 11:42:46 +02:00
Tomi Valkeinen
3c3dd22581 Linux 3.7-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJQlr0MAAoJEHm+PkMAQRiGLVQH/171fUorGn+u2k7dNhSWJXHB
 pPy6MbZhuBWepgRZGS0ffiC5tBvQaf9iK9Fh/9aqrDDw2aELk0CLPqQcfAUF/Jzf
 USPdBSIMNikgZtlWhabxuj/zKdaw8UuiJpCf3rMyIRmjQgmZyw/53TEqF54xTv0I
 Y4Y21vTSVXilQwvwYvcsCEBFrTZqXjLWQ60Hk+QRS9GV7a9m2LFcdiPOtRv17gbd
 CBDuiMHN9R04l2bB+5WHHsu+TNNf5uy3wAgEskDTftneXWjW44R4UR8O0rQh1ezQ
 Pa5WpCyJRRG8UOtPKTS6LEbljBwLLIoVI2JRoJrWoy3OkT63wyowFXyLGWCCrHY=
 =qAGi
 -----END PGP SIGNATURE-----

Merge tag 'v3.7-rc4'

Merge Linux 3.7-rc4 to get fixes for CMA.
2012-11-16 11:41:51 +02:00
Tomi Valkeinen
a915d4ca24 Revert "OMAPDSS: HDMI: Create platform device for audio support"
This reverts commit 14840b9a83.

The commit breaks audio, and a new version will be applied later.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-16 09:32:26 +02:00
Tomi Valkeinen
966458f89d OMAP: remove vram allocator
OMAP specific vram allocator is no longer in use, and we can remove all
the vram code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-13 09:52:41 +02:00
Tomi Valkeinen
b022e17b1c OMAP: common.c: remove init call to vram
OMAP specific vram allocator is no longer used, and we can remove init
call to the vram allocator.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
2012-11-13 09:52:36 +02:00
Tomi Valkeinen
e8ead7b50d OMAP: RX51: remove use of vram
As omapfb no longer uses omap specific vram allocator we can remove the
vram pre-allocation from rx51 board file.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
2012-11-13 09:52:29 +02:00
Tomi Valkeinen
0049fb2603 OMAPFB: use dma_alloc_attrs to allocate memory
Use dma_alloc_attrs to allocate memory instead of omap specific vram
allocator. After this we can remove the omap vram allocator.

There are some downsides to this change:

1) dma_alloc_attrs doesn't let us allocate at certain physical address.
However, this should not be a problem as this feature of vram allocator
is only used when reserving the framebuffer that was initialized by the
bootloader, and we don't currently support "passing" a framebuffer from
the bootloader to the kernel anyway.

2) dma_alloc_attrs, as of now, always ioremaps the allocated area, and
we don't need the ioremap when using VRFB. This patch uses
DMA_ATTR_NO_KERNEL_MAPPING for the allocation, but the flag is currently
not operational.

3) OMAPFB_GET_VRAM_INFO ioctl cannot return real values anymore. I
changed the ioctl to return 64M for all the values, which, I hope, the
applications will interpret as "there's enough vram".

4) "vram" kernel parameter to define how much ram to reserve for video
use no longer works. The user needs to enable CMA and use "cma"
parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-13 09:52:24 +02:00
Tomi Valkeinen
3f5ba55e8f OMAP: FB: use DMA_BIT_MASK() for fb's coherent_dma_mask
Use DMA_BIT_MASK() for fb's coherent_dma_mask for clarity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
2012-11-13 09:51:42 +02:00
Archit Taneja
c909290209 OMAPDSS: APPLY: Remove unnecessary call to mg_clear_shadow_dirty
When doing a manual update in dss_mgr_start_update, we clear the shadow dirty
flags. Although there isn't any harm in clearing them. The need to clear them
out here should never arrive.

When applying configurations for a manual update manager, we never do any
register writes, i.e, calls to dss_mgr_write_regs and dss_mgr_write_regs_extra
never happen while applying. We do all these writes only when we call
dss_mgr_start_update. Hence, there is never a time when the shadow registers
are dirty.

Remove the call to mg_clear_shadow_dirty.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-12 13:52:59 +02:00
Archit Taneja
ca8d4e8bb2 OMAPDSS: APPLY: Remove unnecessary variable in dss_apply_irq_handler
The bool was_updating is never really used for anything. It is set to the
current value of mp->updating, but not used anywhere. Remove this variable.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-12 13:52:59 +02:00
Archit Taneja
02b5ff1a96 OMAPDSS: APPLY: Don't treat an overlay's channel out as shadow bits
An overlay's channel out field isn't a shadow register. The TRM says that it's
taken into effect immediately. This understanding was missing and channel out
was treated as a shadow parameter, and in overlay's private data as extra info.

Program channel out bits directly in dss_ovl_set_manager(). In order to do this
safely, we need to be totally sure that the overlay is disabled in hardware. For
auto update managers, we can assume that the overlay was truly disabled at
dss_ovl_unset_manager() through the wait_pending_extra_info_updates() call.
However, when unsetting manager for an overlay that was previously connected to
a manager in manual update, we can't be sure if the overlay is truly disabled.
That is, op->enabled might not reflect the actual state of the overlay in
hardware. The older manager may require a manual update transfer to truly
disable the overlay. We expect the user of OMAPDSS to take care of this, in
OMAPDSS, we make sure that an overlay's manager isn't unset if there if
extra_info is still dirty for that overlay.

The wrong understanding of channel out bits also explains the reason why we see
sync lost when changing an overlay's manager which was previously connected to a
manual update manager. The following sequence of events caused this:

- When we disable the overlay, no register writes are actually done since the
  manager is manual update, op->enabled is set to false, and the
  extra_info_dirty flag is set. However, in hardware, the overlay is still
  enabled in both shadow and working registers.

- When we unset the manager, the software just configures the overlay's manager
  to point to NULL.

- When we set the overlay to a new manager(which is in auto update) through
  dss_ovl_set_manager, the check  for op->enabled passes, the channel field in
  extra info is set to the new manager. When we do an apply on this manager,
  the new channel out field is set in the hardware immediately, and since the
  overlay enable bit is still set in hardware, the new manager sees that the
  overlay is enabled, and tries to retrieve pixels from it, this leads to sync
  lost as it might be in the middle of processing a frame when we set the
  channel out bit.

The solution to this was to ensure that user space does another update after
disabling the overlay, this actually worked because the overlay was now truly
disabled, and an immediate write to channel out didn't impact since the manager
saw the new overlay as disabled, and doesn't try to retrieve pixels from it.

Remove channel as an extra_info field. Make dss_ovl_unset_manager more strict
about the overlay being disabled when detaching the manager. For overlays
connected to a manual update manager, unset_manager fails if we need another
update to disable the overlay.

We still need to a manual update to ensure the overlay is disabled to get change
the overlay's manager. We could work on doing a dummy update by using DISPC's
capability to gate the different video port signals. This is left for later.

Remove the comment about the sync lost issue.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-12 13:52:59 +02:00
Archit Taneja
6be0d73e2a OMAPDSS: DISPC: Use output width and height to calculate row/pix inc for writeback
When calculating row and pixel increments for graphics and video pipes, we need
to consider the dimensions of the input frame to know how to read from the
buffer. Hence, we need to calculate these parameters from the input to the
pipeline.

For writeback, the row and pixel increments need to be calculated based on the
output of the writeback pipeline, i.e, the dimensions of the frame after
scaling. Ensure that dispc driver uses values of out_width and out_height when
calling calc_dma/calc_tiler_rotation_offset.

For graphics and video pipes, the original code passed the original height as
frame_height to calc_dma_rotation_offset, and not the predecimated height. This
is left as it is for now. We need to figure out why pre decimated height isn't
needed.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-12 13:52:55 +02:00
Archit Taneja
1c031441a9 OMAPDSS: DISPC: Don't allow predecimation for writeback
Since writeback writes to a buffer instead of reading from one, predecimation
doesn't make sense for it. Configure the width and height predecimation limits
to 1 if the plane is writeback.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-12 13:52:55 +02:00
Archit Taneja
5d501085d4 OMAPDSS: DISPC: Fix calc_scaling_44xx() bugs for writeback pipeline
dispc_ovl_calc_scaling_44xx() doesn't work correctly for writeback. There are
two issues with it:

- the function tries to calculate pixel clock for the input plane using
  dispc_plane_pclk_rate(), calling this with writeback as input plane results in
  a BUG(), this function shouldn't be called for writeback at all. Fix this by
  calculating pixel clock only when we are not in mem to mem mode.

- the maximum input_width is the product of the downscale ratio supported and
  the and the given output_width. This was calculated incorrectly by dividing
  output_width with maxdownscale. Fix this.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-12 13:52:55 +02:00
Tomi Valkeinen
76eed4bcb6 OMAPDSS: HACK: look for regulators with omap4 names
Normally the omapdss driver gets the regulators using the regulator
names assigned for omapdss. However, in an effort to get a minimal DSS
support for DT enabled kernel on selected boards, we will add omapdss
devices and platform data the old way even for DT kernel. This causes
the problem that omapdss cannot find the regulators using omapdss's
regulator names.

This patch creates a temporary workaround for DSI and HDMI by trying to
get the regulators also using native OMAP4 regulator names.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-07 10:34:09 +02:00
Ricardo Neri
3758476501 OMAPDSS: HDMI: Remove __exit macro from hdmi_uninit_display
This function is now used in the driver init path to handle
probe errors properly. Thus, it may be possible to use this function
outside the exit path.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-07 09:19:54 +02:00
Tomi Valkeinen
5b30b7fb4d OMAPDSS: DISPC: fix sparse warning
Fix sparse warning:

drivers/video/omap2/dss/dispc.c:3320:6: warning: symbol
'dispc_dump_irqs' was not declared. Should it be static?

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
2012-11-07 08:57:25 +02:00
Ricardo Neri
14840b9a83 OMAPDSS: HDMI: Create platform device for audio support
Creating the accessory devices, such as audio, from the HDMI driver
allows to regard HDMI as a single entity with audio an display
functionality. This intends to follow the design of drivers such
as MFD, in which a single entity handles the creation of the accessory
devices. Such devices are then used by domain-specific drivers; audio in
this case.

Also, this is in line with the DT implementation of HDMI, in which we will
have a single node to describe this feature of the OMAP SoC.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:36 +02:00
Ricardo Neri
d7b6f4437f OMAPDSS: HDMI: Add op to get audio DMA port address offset
It could be possible that the DMA port differs accross diferent HDMI IPs. Thus,
add an IP-specific function to obtain the address offset and size of the DMA
data port.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:36 +02:00
Ricardo Neri
d18bc45543 OMAPDSS: HDMI: Uninit display on device add error
The display must be uninitialized in order to free the requested GPIOs.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:36 +02:00
Ricardo Neri
66a06b0c59 OMAPDSS: HDMI: Handle panel init error at probe
Do not blindly assume that the panel could be initialized.

While there, group mutex initialization at a single place.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:35 +02:00
Ricardo Neri
7888839e25 OMAPDSS: HDMI: Make panel return dssdev register errors
Do not assume blindly that the DSS driver was registered successfully.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:35 +02:00
Ricardo Neri
47e443bce7 OMAPDSS: HDMI: Convert to devm_request_and_ioremap
Using devm_request_and_ioremap provides better memory handling and
improves readability.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:35 +02:00
Ricardo Neri
af23cb3533 OMAPDSS: HDMI: Rename resource variable at probe.
Minor cleanup to give to the resource variable a more proper name.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:33:35 +02:00
Chuansheng Liu
933ed63405 OMAPDSS: APPLY: Fix the usage of wait_for_completion_timeout
The return value of wait_for_completion_timeout() is always
>= 0 with unsigned int type.

So the condition "ret < 0" or "ret >= 0" is pointless.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:29:45 +02:00
Chuansheng Liu
864fa7f461 OMAPDSS: DISPC: Fix the usage of wait_for_completion_timeout
The return value of wait_for_completion_timeout() is always
>= 0 with unsigned int type.

So the condition "ret < 0" or "ret >= 0" is pointless.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-06 13:29:45 +02:00
Tomi Valkeinen
230edc033d OMAPDSS: DISPC: fix DS variable name
check_horiz_timing_omap3() has a variable named 'DS'. i386 uses DS name
for something else, causing a compilation error. As 'DS' is not a very
good local variable name in the first place, let's change it to 'ds',
fixing the issue.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 14:46:15 +02:00
Tomi Valkeinen
a4ae0ba80b Merge branch '3.8/dsi-pll-work'
Merge omapdss patches to enable using DSI PLL for DPI output.
2012-11-05 11:30:21 +02:00
Tomi Valkeinen
0e8276ef75 OMAPDSS: DPI: always use DSI PLL if available
We currently get the decision whether to use PRCM or DSI PLL clock for
DPI from the board file. This is not a good way to handle it, and it
won't work with device tree.

This patch changes DPI to always use DSI PLL if it's available.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 11:17:39 +02:00
Tomi Valkeinen
6061675b3f OMAPDSS: DPI: verify if DSI PLL is operational
The SoCs that have DSI module should have a working DSI PLL. However,
some rare boards have not connected the powers to the DSI PLL.

This patch adds a function that tries to power up the DSI PLL, and
reports if that doesn't succeed. DPI uses this function to fall back to
PRCM clocks if DSI PLL doesn't work.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 11:17:39 +02:00
Tomi Valkeinen
8a3db406f5 OMAPDSS: DPI: use dpi.dsidev to see whether to use dsi pll
Instead of using dpi_use_dsi_pll() to check if dsi pll is to be used, we
can just check if dpi.dsidev != NULL.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 11:17:39 +02:00
Tomi Valkeinen
a5b8399fb6 OMAPDSS: hide dss_select_dispc_clk_source()
dss.c currently exposes functions to configure the dispc source clock
and lcd source clock. There are configured separately from the output
drivers.

However, there is no safe way for the output drivers to handle dispc
clock, as it's shared between the outputs. Thus, if, say, the DSI driver
sets up DSI PLL and configures both the dispc and lcd clock sources to
that DSI PLL, the resulting dispc clock could be too low for, say, HDMI.

Thus the output drivers should really only be concerned about the lcd
clock, which is what the output drivers actually use. There's lot to do
to clean up the dss clock handling, but this patch takes one step
forward and removes the use of dss_select_dispc_clk_source() from the
output drivers.

After this patch, the output drivers only configure the lcd source
clock. On omap4+ the dispc src clock is never changed from the default
PRCM source. On omap3, where the dispc and lcd clocks are actually the
same, setting the lcd clock source sets the dispc clock source.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 11:17:39 +02:00
Tomi Valkeinen
13a1a2b2a6 OMAPDSS: setup default dss fck
We don't currently set the dss fck when starting up. This is not a
problem, as we setup the fck later when configuring the pixel clocks. Or
this is how it was for omap2, for the rest of the omaps this may not be
so.

For DSI, HDMI and also for DPI when using DSI PLL, we don't need to
change the dss fck, and thus it may be left unconfigured. Usually the
dss fck is already setup fine by default, but we can't trust this.

This patch sets the dss fck to maximum at probe time.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 11:14:05 +02:00
Tomi Valkeinen
930b027eb4 OMAPDSS: add dss_calc_clock_rates() back
dss_calc_clock_rates() was removed earlier as it was not used, but it is
needed for DSI PLL calculations, so this patch adds it back.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05 11:14:05 +02:00