Commit Graph

641 Commits (7cd9c9bb57476167e83b7780dbc06d1dd601789d)

Author SHA1 Message Date
Tomi Valkeinen 468c1b934c OMAP: DSS2: HDMI: remove error prints in check_timings
check_timings() is supposed to be used to verify if timings are ok or
not. Currently the HDMI driver prints error messages if the timings are
not ok. This is not right, as it is no error to give invalid timings to
check_timings().

Remove the error prints.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:47 +03:00
Tomi Valkeinen 937fce138f OMAP: DSS2: HDMI: clean up edid reading & fix checksum
Clean up reading of EDID by passing direct address to the block being
read, instead of start address of the whole EDID memory area. Rewrite
the loop which reads the EDID.

This also fixes the checksum calculation, which used to calculate the
checksum only for the first block.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:46 +03:00
Tomi Valkeinen 032b8ea508 OMAP: DSS2: HDMI: split hdmi_core_ddc_edid
Split the DDC initialization off from hdmi_core_ddc_edid() into a
separate function hdmi_core_ddc_init(). This cleans up the
implementation.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:46 +03:00
Tomi Valkeinen 2ea51fef86 OMAP: DSS2: HDMI: remove edid parsing
OMAPFB handles EDID parsing now, using the common helper functions in
fbdev. We can remove the EDID parsing from HDMI driver.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:45 +03:00
Tomi Valkeinen 470245652d OMAP: DSS2: HDMI: implement read_edid()
Implement read_edid() for HDMI by implementing necessary functions to
hdmi.c and to hdmi_omap4_panel.c.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:45 +03:00
Tomi Valkeinen fa70dc5f47 OMAP: DSS2: HDMI: make set_timing saner
Currently the set_timings code for hdmi is quite strange. The display is
disabled in hdmi_omap4_panel.c before setting timings, and enabled in
hdmi.c after setting the timings. Furthermore, the timings were not
permanent, and disabling and enabling the display would lose them.

This patch makes the set_timings handling a bit better.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:44 +03:00
Tomi Valkeinen 3870c909f2 OMAP: DSS2: HDMI: improve hdmi output enable
Enabling HDMI output often causes sync lost errors, and almost always
causes timeout errors being printed from dispc_mgr_enable_digit_out().

The sync lost problem seems to go lessen greatly if we first enable the
HDMI output, and only then enable the DISPC output. However, as this is
only based on observations, the fix may not be perfect as the problem
may lie somewhere else. Nevertheless, HDMI works better with this patch.

This will also fix the dispc's dispc_mgr_enable_digit_out(), as the code
waits for two VSYNCs after enabling the output. If the HDMI output is
disabled (as it was previously), there are no VSYNCs and
dispc_mgr_enable_digit_out() will print timeout errors.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:43 +03:00
Tomi Valkeinen e82b090b80 OMAP: DSS2: DISPC: improve dispc_mgr_enable_digit_out()
dispc_mgr_enable_digit_out() didn't handle HDMI case very well.

Improve the function to use FRAMEDONETV interrupt to see when HDMI has
been disabled.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:43 +03:00
Tomi Valkeinen 4a61e267c8 OMAP: DSS2: add dss_get_hdmi_venc_clk_source()
Add dss_get_hdmi_venc_clk_source(), which can be used to get the value
programmed with dss_select_hdmi_venc_clk_source(). This can be used to
find out if the digit output is going to VENC or HDMI.

For OMAP2/3 dss_get_hdmi_venc_clk_source() always returns
DSS_VENC_TV_CLK.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:42 +03:00
Tomi Valkeinen b44e45825d OMAP: DSS2: HDMI: change regn definition
regn divider is currently programmed to the registers without change,
but when calculating clock frequencies it is used as regn+1.

To make this similar to how DSI handles the dividers this patch changes
the regn value to be used as such for calculations, but the value
programmed to registers is regn-1.

This simplifies the clock frequency calculations, makes it similar to
DSI, and also allows us to use regn value 0 as undefined.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:41 +03:00
Tomi Valkeinen 8d88767a43 OMAP: DSS2: HDMI: use default dividers
Use default regn and regm2 dividers in the hdmi driver if the board file
does not define them.

Cc: Mythri P K <mythripk@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:36 +03:00
Tomi Valkeinen 9eaaf2076d OMAP: DSS2: DISPC: Fix minimum PCD value
The current driver had a hardcoded minimum value of 2 for pixel clock
divisor (PCD). This doesn't seem to be right.

OMAP4 TRM says that PCD can be 1 when not downscaling, and inverted
pixel clock (IPC) is off.

OMAP3 TRM says the same, but also in the register descriptions that PCD
value 1 is invalid.

OMAP2 TRM says PCD 2 is the minimum.

OMAP2 is still untested, but for both OMAP3 and OMAP4 PCD of 1 seems to
work fine.

This patch adds a new DSS feature, FEAT_PARAM_DSS_PCD, which is used to
find the minimum and maximum PCD. The minimum is set to 2 for OMAP2, and
1 for OMAP3/4.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:35 +03:00
Mythri P K d875f992e9 OMAP4: DSS2: Rename hdmi_omap4_panel.c to hdmi_panel.c
As the panel driver will remain generic across OMAP's renaming it to
hdmi_panel.c

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:35 +03:00
Mythri P K 60634a28bc OMAP4: DSS2: HDMI: Function pointer approach to call
HDMI IP fundamentally has replaceable core PHY and PLL blocks.
These blocks might vary across OMAP's but the end functionality such as to
enable or disable PLL, PHY, function to read EDID would remain the same.

Thus to make the current hdmi DSS driver compatible with different OMAP's having
different IP blocks( A combination of different core, PHY, PLL blocks), function
pointer approach is introduced.

With function pointer, relevant IP dependent functions are mapped to the generic
functions used by DSS during the initialization based on the OMAP compiled.
Thus making hdmi DSS driver IP agnostic.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:34 +03:00
Mythri P K 176b578b1a OMAP4: DSS2: HDMI: Rename the functions in HDMI IP library
Functions that are included in HDMI IP driver is renamed to have
IP specific names so that it will not conflict with similar functions
from other IP.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:34 +03:00
Mythri P K 7334167bf1 OMAP4: DSS2: HDMI: Move the HDMI IP dependent audio
Move HDMI IP dependent audio functions from HDMI DSS file  to IP library.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:33 +03:00
Mythri P K 7d983f39ec OMAP4: DSS2: HDMI: Split the current HDMI driver to move
Split the current HDMI driver to move the HDMI IP dependent ( PLL/PHY/Core
configuration code) to a new IP file (ti_hdmi_4xxx_ip.c.
This is to separate IP dependent OMAP agnostic code from OMAP specific DSS
dependent code.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:32 +03:00
Mythri P K 7c1f1ecac9 OMAP4: DSS2: HDMI: Move the EDID definition from HDMI
Clean up to move the EDID definition from the IP dependent header file to hdmi.c

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:32 +03:00
Mythri P K 94c52987d2 OMAP4: DSS2: HDMI: Move HDMI IP independent generic header
Some of the header file definitions that are there in the hdmi.h are generic
and can be used across OMAP's, Thus moving generic definition to new file.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:32 +03:00
Mythri P K 38863b7e1d OMAP4: DSS2: HDMI: Use specific HDMI timings structure
As hdmi has few additional parameters such as vsync and hsync
polarity which is missing in DSS timing structure, define HDMI timings
structure for hdmi to use instead of OMAP DSS timing structure.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:31 +03:00
Mythri P K 7b27da5483 OMAP4: DSS2: HDMI: Move pll and video configuration
As the pll and the video configuration info are part of the ip_data, pll
and video structures are moved to the ip_data structure. Also the pll and
video configuration functions are modified accordingly to take care of the
structure movement.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:31 +03:00
Mythri P K 95a8aeb6c5 OMAP4: DSS2: HDMI: HDMI clean up to pass base_address
As the base_address of the HDMI might differ across SoC's, offset of the HDMI
logical blocks(PHY, PLL and Core) and base address procured from the platform
data are passed dynamically to the functions that modify HDMI IP registers.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:30 +03:00
Archit Taneja 8af6ff0107 OMAP: DSS2: DSI Video mode support
Add initial support for DSI video mode panels:
- Add a new structure omap_dss_dsi_videomode_data in the member "panel" in
  omap_dss_device struct. This allows panel driver to configure dsi video_mode
  specific parameters.
- Configure basic DSI video mode timing parameters: HBP, HFP, HSA, VBP, VFP, VSA,
  TL and VACT.
- Configure DSI protocol engine registers for video_mode support.
- Introduce functions dsi_video_mode_enable() and dsi_video_mode_disable() which
  enable/disable video mode for a given virtual channel and a given pixel format
  type.

Things left for later
- Add functions to check for errors in video mode timings provided by panel.
- Configure timing registers required  for command mode interleaving.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:30 +03:00
Archit Taneja 18b7d09908 OMAP: DSS2: DSI: Send zero length packet in dsi_vc_send_null()
dsi_vc_send_null() currently sends a long packet with data type
MIPI_DSI_NULL_PACKET and packet length 4. Modify it to send a zero
length long packet. This leads to sending only the long packet header
and no payload packets and hence the transfer completes faster.

The function can be modified later if there is a need to send null
packets of a non-zero length.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:29 +03:00
Archit Taneja a3b3cc2b88 OMAP: DSS2: Create an enum for DSI pixel formats
Currently, DSI pixel info is only represented by the pixel size in bits using
the pixel_size parameter in omap_dss_device struct's ctrl member.

This is not sufficient information for DSI video mode usage, as two of the
supported formats(RGB666 loosely packed, and RGB888) have the same pixel
container size, but different data_type values for the video mode packet header.

Create enum "omap_dss_dsi_pixel_format" which describes the pixel data format
the panel is configured for. Create helper function dsi_get_pixel_size() which
returns the pixel size of the given pixel format.

Modify functions omapdss_default_get_recommended_bpp() and dss_use_replication()
to use dsi_get_pixel_size().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:29 +03:00
Archit Taneja 569969d601 OMAP: DSS2: Clean up stallmode and io pad mode selection
Split the function dispc_set_parallel_interface_mode() into 2 separate
functions called dispc_mgr_set_io_pad_mode() and dispc_mgr_enable_stallmode().
The current function tries to set 2 different modes(io pad mode and stall mode)
based on a parameter omap_parallel_interface_mode which loosely corresponds to
the panel interface type.

This isn't correct because a) these 2 modes are independent to some extent,
b) we are currently configuring gpout0/gpout1 for DSI panels which is
unnecessary, c) a DSI Video mode panel won't get configured correctly.

Splitting the functions allows the interface driver to set these modes
independently and hence allow more flexibility.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:28 +03:00
Archit Taneja b3b89c05cb OMAP: DSS2: DSI: Introduce generic read functions
Introduce read functions which use generic Processor-to-Peripheral
transaction types. These are needed by some devices which may not support
corresponding DCS commands.

Add function dsi_vc_generic_send_read_request() which can send
a short packet with 0, 1 or 2 bytes of request data and the corresponding
generic data type.

Rename function dsi_vc_dcs_read_rx_fifo() to dsi_vc_read_rx_fifo() and modify
it to take the enum "dss_dsi_content_type" as an argument to use either DCS
or GENERIC Peripheral-to-Processor transaction types while parsing data read
from the device.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:28 +03:00
Archit Taneja b850975cd8 OMAP: DSS2: DSI: Split dsi_vc_dcs_read() into 2 functions
Split dsi_vc_dcs_read() into the functions:
- dsi_vc_dcs_send_read_request(): This is responsible for sending the short
packet command with the read request.
- dsi_vc_dcs_read_rx_fifo(): This parses the DSI RX fifo of the given virtual
channel, identifies the type of data received, and fills a buffer with the data
provided by the panel.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:27 +03:00
Archit Taneja 5c716a04ed OMAP: DSS2: DSI: Remove functions dsi_vc_dcs_read_1() and dsi_vc_dcs_read_2()
Remove functions dsi_vc_dcs_read_1() and dsi_vc_dcs_read_2(), these are used
when the panel is expected to return 1 and 2 bytes respecitvely. This was manily
used for debugging purposes. These functions should be implemented in the panel
driver if needed.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:27 +03:00
Archit Taneja 6ff8aa3182 OMAP: DSS2: DSI: Introduce generic write functions
Intoduce enum "dss_dsi_content_type" to differentiate between DCS and generic
content types.

Introduce short and long packet write functions which use generic
Processor-to-Peripheral transaction types. These are needed by some devices
which may not support corresponding DCS commands. Create common write functions
which allow code reuse between DCS and generic write functions.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:26 +03:00
Archit Taneja 7e951ee995 OMAP: DSS2: Create enum for DSI operation modes
Create an enum for DSI operation modes, use this to set the capabilities of the
device in dsi_init_display().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:26 +03:00
Archit Taneja d604914484 OMAP: DSS2: DSI: Represent L4 and VP as sources of VC instead of modes
The enum type dsi_vc_mode is a bit misleading as L4 slave port and video port
are sources to VC rather than the mode of operation. Rename then enum type and
its members. Merge dsi_vc_config_vp() and dsi_vc_config_l4() into a single
function called dsi_vc_config_source() which takes dsi_vc_source enum as an
extra argument.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:26 +03:00
Archit Taneja 7a7c48f9ab OMAP: DSS2: Use MIPI DSI enums from include/video/mipi_display.h
MIPI DSI Transaction types and DCS commands are currently defined as
macros in dsi.c and panel-taal.c, remove these and replace them with
enum members defined in include/video/mipi_display.h.

Signed-off-by: Archit Taneja <archit@ti.com>
[tomi.valkeinen@ti.com: reformatted the commit message]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:25 +03:00
Thomas Weber 1e497c4f0a OMAP: DSS2: Support for Innolux AT070TN83
Add support for Innolux AT070TN83, a 7 inch LCD
with RGB-Interface and touch panel to panel-generic-dpi.

Tested with Devkit8000.

Signed-off-by: Thomas Weber <weber@corscience.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:24 +03:00
Tomi Valkeinen cd295aebf1 OMAP: DSS2: reorganize functions in dss.h
Group dispc's overlay and manager related functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:24 +03:00
Tomi Valkeinen 26d9dd0dbe OMAP: DSS2: DISPC: rename manager related funcs
Rename dispc's manager related functions as follows:

- Remove prepending underscores, which were originally used to inform
  that the clocks needs to be enabled. This meaning is no longer valid.
- Prepend the functions with dispc_mgr_*
- Remove "channel" from the name, e.g. dispc_enable_channel ->
  dispc_mgr_enable

The idea is to group manager related functions so that it can be deduced
from the function name that it writes to manager spesific registers.

All dispc_mgr_* functions have enum omap_channel as the first parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:23 +03:00
Tomi Valkeinen f0e5caab97 OMAP: DSS2: DISPC: rename overlay related funcs
Rename dispc's overlay related functions as follows:

- Remove prepending underscores, which were originally used to inform
  that the clocks needs to be enabled. This meaning is no longer valid.
- Prepend the functions with dispc_ovl_*
- Remove "plane" from the name, e.g. dispc_set_plane_ba0 ->
  dispc_ovl_set_ba0

The idea is to group overlay related functions so that it can be deduced
from the function name that it writes to overlay spesific registers.

All dispc_ovl_* functions have enum omap_plane as the first parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:23 +03:00
Tomi Valkeinen 3375483e91 OMAP: DSS2: DISPC: remove non-existing func prototypes
The functions do not exist, so remove the prototypes.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:22 +03:00
Tomi Valkeinen 7fbf1bb02d OMAP: OMAPFB: string parsing cleanups
Use strtobool instead of kstrtoint when parsing bool from sysfs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:22 +03:00
Tomi Valkeinen e3a26aecc0 OMAP: DSS2: string parsing cleanups
Use strtobool and kstrto* functions when parsing sysfs inputs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:21 +03:00
Tomi Valkeinen f6dc815098 OMAP: DSS2: Add GLOBAL_ALPHA & PRE_MULT_ALPHA to ovl caps
Add OMAP_DSS_OVL_CAP_GLOBAL_ALPHA and OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA to
overlay capabilities. Use these instead of FEAT_GLOBAL_ALPHA,
FEAT_GLOBAL_ALPHA_VID1 and FEAT_PRE_MULT_ALPHA in code.

Remove FEAT_GLOBAL_ALPHA_VID1 and FEAT_PRE_MULT_ALPHA which are no
longer used. FEAT_GLOBAL_ALPHA is still used to decide if the HW has
global alpha register.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Archit Taneja <archit@ti.com>
2011-09-30 16:16:21 +03:00
Tomi Valkeinen 67019db864 OMAP: DSS2: Add overlay caps to DSS features
Add support to define overlay capabilities into dss_features. The
features are set to overlay->caps at initialization time.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Archit Taneja <archit@ti.com>
2011-09-30 16:16:21 +03:00
Tomi Valkeinen fe3cc9d6cd OMAP: DSS2: DISPC: use lookup tables for bit shifts
Use lookup tables instead of switch/if in some DISPC functions to make
the code cleaner.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Archit Taneja <archit@ti.com>
2011-09-30 16:16:20 +03:00
Tomi Valkeinen 4a9e78abb7 OMAP: DSS2: Remove support for non-DISPC overlays
Remove support for non-DISPC overlays and overlay managers.

The support to possibly have non-DISPC overlays and managers was made to
make it possible to use CPU and/or sDMA to update RFBI or DSI command
mode displays. It is ok to remove the support, because:

- No one has used the feature.
- Display update without DISPC is very slow, so it is debatable if the
  update would even be usable.
- Removal cleans up code.
- If such a feature is needed later, it is better implemented outside
  omapdss driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Archit Taneja <archit@ti.com>
2011-09-30 16:16:20 +03:00
Tomi Valkeinen 46fc133f95 OMAP: DSS2: Remove "EXPERIMENTAL" from Kconfig
DSS driver has not been "experimental" for many years now, so perhaps
it's time to remove the text from Kconfig titles.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:19 +03:00
Tomi Valkeinen 8fa8031c54 OMAP: DSS2: Handle manager change in apply
Currently when changing the manager of an overlay, set_manager() directly
calls dispc to set the overlay's destination.

Change this to be more in line with other overlay configurations, and
this will also remove the need to have dispc clocks enabled when calling
set_manager().

A new field is added to overlay struct, "manager_changed". This is
similar to "display_changed" field in manager struct, and is used to
inform apply that the manager has changed and thus write to the
registers is needed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:19 +03:00
Tomi Valkeinen 5e7850917f OMAP: DSS2: fix clock sources on error and uninit
DPI and DSI were not cleaning up the clock source in error or uninit
cases. Set the clock source back to PRCM.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:18 +03:00
Tomi Valkeinen bab59b4417 OMAP: OMAPFB: make omapfb start even when a display is missing a driver
Currently omapfb wants that all the display devices have a driver,
otherwise omapfb refuses to start. There's no real requirement to act
like that, and this patch will make omapfb give a warning and skip that
device.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:18 +03:00
Tomi Valkeinen 5bc416cba1 OMAP: DSS2: DSI: Improve dsi_mux_pads parameters
dsi_mux_pads() needs to know about the DSI HW module and the DSI lanes
used. Split the function into two, enable and disable, which take
necessary arguments, and add empty implementations for both.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:17 +03:00
Tomi Valkeinen 7c68dd96d5 OMAP: DSS2: Change DSI device naming
Currently, there are 2 differently named platform devices generated for
the 2 DSS DSI modules. In order to use the same driver, the dsi devices
should be 2 instances of the same platform device.

Change the platform device names from "omapdss_dsi1" and "omapdss_dsi2"
to omapdss_dsi", and set the device indices to 0 and 1.

Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30 16:16:05 +03:00
Tomi Valkeinen f36465822d OMAP: DSS2: remove unneeded fck enable/disables
Now that the HWMOD fmwk handles the fcks of DSS modules properly, the
DSS driver no longer needs to explicitely enable/disable the fck.

This patch removes the enables/disables of fck from dispc, dsi and dss.
The clk_get(fck) is still needed there, as the modules need to know the
frequency of the clock.

For hdmi and venc this patch also removes the clk_get(fck), as they
don't need the clock at all.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-20 11:21:31 +03:00
Tomi Valkeinen 3393b85340 Revert "OMAP: DSS2: HDMI: fix hdmi clock name"
This reverts commit df5d3ed23c.

The HDMI clock name has been fixed in HWMOD data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-20 11:21:31 +03:00
Tomi Valkeinen bfe4f8d32d Revert "HACK: OMAP: DSS2: clk hack for OMAP2/3"
This reverts commit 9ede365aa6.

The hack is no longer needed, as the HWMOD data has been fixed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-20 11:21:31 +03:00
Archit Taneja e13a138bc6 OMAP: DSS2: Use a macro to declare size of the fifo_size array in dispc.c
The array size of fifo_size array in the global dispc struct is currently
hardcoded to 3. Replace this with the MAX_DSS_OVERLAYS macro in dss_features.h,
use dss_features function to get the number of overlays instead of the
ARRAY_SIZE macro in dispc_read_plane_fifo_sizes().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Archit Taneja ac01c29e52 OMAP: DSS2: DISPC: Shorten _dispc_set_color_conv_coef()
Iterate over overlay id's to shorten _dispc_set_color_conv_coef()

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Archit Taneja c6104b8e24 OMAP: DSS2: DISPC: dispc_save_context() and dispc_restore_context() cleanup
Iterate over manager and overlay id's to shorten dispc_save_context() and
dispc_restore_context().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Archit Taneja 4dd2da15fc OMAP: DSS2: DISPC: Shorten dispc_dump_regs()
Iterate over manager and overlay id's to shorten dispc_dump_regs().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Archit Taneja 5010be8012 OMAP: DSS2: DISPC: Prepare dispc_dump_regs() for shortening
Prepare dispc_dump_regs() to iterate over manager and overlay id's. Doing this
requires modifications of the macro "DUMPREG" which currently needs us to specify
the manager/overlay name to get the correct result. For example, in order to
print the register DISPC_TIMING_H(OMAP_DSS_CHANNEL_LCD), we can't iterate over
a varaible i and get the desired result through DUMPREG(DISPC_TIMING_H(i)).

Split the registers into 3 sections, the first with no arguments(common
registers), the second with one argument(manager/overlay id), and the third with
two arguments(overlay id and coefficient index), redefine DUMPREG macros for
each of these.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Andy Doan c5f18d7bab OMAPFB: make debug message more useful
Make the debug message useful by printing the name of the device
that no associated driver could be found for.

Signed-off-by: Andy Doan <andy.doan@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Dima Zavin 13eae1f982 OMAP: DSS: dispc: enable/disable clocks in error handler
There's no guarantee that the error handler worker thread
will run while the dispc clocks are on. Explicitly enable/disable
them.

Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:24 +03:00
Daniel Morsing 0f770b4765 OMAP: DSS2: Don't allow moving managers away from enabled displays
If a manager is moved while attached to an enabled display, the DSS
system will be left in an inconsistent state. This will eventually cause
a kernel oops when the enabled display is disabled.

Fix this by not allowing the user to move a manager away from an enabled
display.

Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:23 +03:00
Tomi Valkeinen 05e1d60607 OMAP: DSS2: check for manager when enabling display
None of the DSS interface drivers check if an overlay manager is
connected to the display when the display is being enabled. This leads
to null pointer crash if the display has no manager.

This patch checks for the manager and returns an error if it is null.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:23 +03:00
Tomi Valkeinen 79e4424fbe OMAP: DSS2: PicoDLP: fix error handling in power_on
Fix two problems in PicoDLP driver's error handling on
picodlp_panel_power_on:

- If omapdss_dpi_display_enable() failed, the its error value was not
  returned
- If picodlp_i2c_init() failed, dssdev->state was erroneously set to
  OMAP_DSS_DISPLAY_ACTIVE

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:23 +03:00
Mayuresh Janorkar 24305db864 OMAP: DSS2: Add picodlp panel driver
PicoDLP is a micro projector from TI.

DLP used in OMAP4 is dpp2600 (DLP Pico Projector) The DLP requires
commands to be sent over i2c for configurations. To know more about
dpp2600 commands please visit:
https://focus.ti.com/myti/docs/extranet.tsp?sectionId=403

The picodlp module consists of a dss driver and an i2c_client.

To know more please visit:
http://www.omappedia.org/wiki/PicoDLP_projector_guide

Based on original design from Mythri P K <mythripk@ti.com>

Signed-off-by: Mayuresh Janorkar <mayur@ti.com>
Signed-off-by: Mythri P K <mythripk@ti.com>
[tomi.valkeinen@ti.com: squashed commits]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-14 18:08:23 +03:00
Tomi Valkeinen df5d3ed23c OMAP: DSS2: HDMI: fix hdmi clock name
The HDMI clock (hdmi_clk) is missing in the current OMAP4 HWMOD
database. Fix this in the DSS driver by using the old clock name
(dss_48mhz_clk).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-08-01 14:56:53 +03:00
Tomi Valkeinen 9ede365aa6 HACK: OMAP: DSS2: clk hack for OMAP2/3
The HWMOD data for OMAP2 and 3 are currently not up to date regarding
DSS (OMAP4 HWMOD data is fine). This patch makes the DSS driver to get
the opt clocks needed for OMAP2/3 with the old clock names, thus
allowing DSS driver to use runtime PM.

The HWMOD databases should be fixes ASAP, and this patch can be reverted
after that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-08-01 14:56:49 +03:00
Tomi Valkeinen 69f06054aa OMAP: DSS2: DSS: Fix context save/restore
The current method of saving and restoring the context could cause a
restore before saving, effectively "restoring" zero values to registers.

Add ctx_valid field to indicate if the saved context is valid and can be
restored.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:22:07 +03:00
Tomi Valkeinen 49ea86f3fa OMAP: DSS2: DISPC: Fix context save/restore
The current method of saving and restoring the context could cause a
restore before saving, effectively "restoring" zero values to registers.

Add ctx_valid field to indicate if the saved context is valid and can be
restored.

Also restructure the code to save the ctx_loss_count in save_context(),
which makes more sense than the previous method of storing new
ctx_loss_count in dispc_need_ctx_restore.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:22:07 +03:00
Tomi Valkeinen 39020710e7 OMAP: DSS2: Remove ctx loss count from dss.c
dss.c only saves 1 register (3 in OMAP3) so the extra overhead from
need_ctx_restore & co. is probably bigger than the time spent saving and
restoring those few registers every time.

So remove the code from dss.c and restore context every time dss has
been off.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:22:06 +03:00
Tomi Valkeinen e6d80f950a OMAP: DSS2: DISPC: remove finegrained clk enables/disables
dispc.c enables and disables clocks in almost every function to make
sure the clocks are enabled when the function is called. This is rather
unoptimal way to handle the problem.

With pm_runtime other components have to call dispc_runtime_get() to
enable dispc clocks before calling any other dispc functions. Thus the
finegrained clk enables/disables can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:22:05 +03:00
Tomi Valkeinen 4fbafaf371 OMAP: DSS2: Use PM runtime & HWMOD support
Use PM runtime and HWMOD support to handle enabling and disabling of DSS
modules.

Each DSS module will have get and put functions which can be used to
enable and disable that module. The functions use pm_runtime and hwmod
opt-clocks to enable the hardware.

Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:22:04 +03:00
Tomi Valkeinen de3050a74e OMAP: DSS2: Remove CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET
CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET is used to avoid an unclear bug at
DSS reset time. The pm runtime will handle reset in the future, and this
code has to be removed. Hopefully we won't see this error anymore.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:16 +03:00
Tomi Valkeinen 7e42403e3b OMAP: DSS2: Remove core_dump_clocks
Currently dss.c does all the low level clock handling in the DSS, and
thus it contains pointers to all the clocks. This allows dss.c to dump
the clock information for all the clocks.

With pm_runtime this is no longer the case, as each submodule will
handle its clocks independently. Thus remove the core_dump_clocks
function as it cannot be used with pm_runtime.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:16 +03:00
Tomi Valkeinen 19077a7361 OMAP: DSS2: DPI: remove unneeded SYSCK enable/disable
DSI PLL requires sys_clk to function, and DPI enables sys_clk when it
wants to use DSI PLL. However, DSI PLL code already handles enabling
sys_clk, so DPI's sys_clk code is extra.

Remove the unneeded sys_clk handling from dpi.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:16 +03:00
Tomi Valkeinen aac927c93b OMAP: DSS2: rewrite use of context_loss_count
The function to get device's context loss count has changed from

omap_pm_get_last_off_on_transaction_id() to
omap_pm_get_dev_context_loss_count()

Change name of the function pointer in omapdss.h accordingly, and use
the term "context loss count" instead of "context id" in the code.

Restructure the context loss count functions to handle errors properly,
and ensure that context is always considered lost if an error happens.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:15 +03:00
Tomi Valkeinen b88f58f091 OMAP: DSS2: Remove clk optimization at dss init
DSS enables core clocks for the duration of initialization to avoid
unnecessary context saves and restores.

With PM runtime the clocks cannot be handled in this way, outside the
dss module drivers. Thus we need to remove the optimization.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:14 +03:00
Tomi Valkeinen cb5930bdb5 OMAP: DSS2: Fix init and unit sequence
The initialization order of the DSS modules is important when pm_runtime
support is implemented. Currently RFBI is initialized before DISPC,
which will cause problems with pm_runtime as RFBI uses DISPC.

The same goes for uninitialization order, and dss_uninit needs to be
called last, and dispc_uninit just before that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:14 +03:00
Tomi Valkeinen b98482ed73 OMAP: DSS2: Clean up probe for DSS & DSI
Both dss.c and dsi.c had a probe function, which was almost a dummy one,
calling dss_init() and dsi_init().

Remove the init functions by moving the initialization code into probe
functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:13 +03:00
Tomi Valkeinen 94c042ce58 OMAP: DSS2: Handle dpll4_m4_ck in dss_get/put_clocks
Get and put for dpll4_m4_ck was handled in dss_init/dss_exit. Move the
code to dss_get/put_clocks(), which is a better place to handle it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-25 10:08:13 +03:00
Tomi Valkeinen 5ed8cf5b8e OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4
The DMA FIFO threshold registers and burst size registers have changed
for OMAP4.  The current code only handles OMAP2/3 case, and so the
values are a bit off for OMAP4.  A summary of the differences between
OMAP2/3 and OMAP4:

Burst size:
OMAP2/3: 4 x 32 bits / 8 x 32 bits / 16 x 32 bits
OMAP4: 2 x 128 bits / 4 x 128 bits / 8 x 128 bits

Threshold size:
OMAP2/3: in bytes (8 bit units)
OMAP4: in 128bit units

This patch fixes the issue by creating two new helper functions in
dss_features: dss_feat_get_buffer_size_unit() and
dss_feat_get_burst_size_unit(). These return (in bytes) the unit size
for threshold registers and unit size for burst size register,
respectively, and are used to calculate correct values.

For the threshold size the usage is straightforward. However, the burst
size register has different multipliers for OMAP2/3 and OMAP4. This
patch solves the problem by defining the multipliers for the burst size
as 2x, 4x and 8x, which fit fine for the OMAP4 burst size definition
(i.e. burst size unit for OMAP4 is 128bits), but requires a slight twist
on OMAP2/3 by defining the burst size unit as 64bit.

As the driver in practice always uses the maximum burst size, and no use
case currently exists where we would want to use a smaller burst size,
this patch changes the driver to hardcode the burst size when
initializing DISPC. This makes the threshold configuration code somewhat
simpler.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:07:14 +03:00
Tomi Valkeinen 15ffa1dac5 OMAP: DSS2: DSI: sync when disabling a display
When the panel driver calls omapdss_dsi_display_disable() it is possible
that there are still some unsent packets in the TX fifo.

Add dsi_sync_vc() calls in the beginning of
omapdss_dsi_display_disable() to make sure the TX fifos are empty.

This allows us to remove the msleep(10) hack from panel-taal.c

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:07:13 +03:00
Tomi Valkeinen 3c07cae2cc OMAP: DSS2: Add Color Phase Rotation support
Add Color Phase Rotation (CPR) support and sysfs files to enable CPR and
to set the CPR coefficient matrix.

CPR is enabled via manager?/cpr_enable file, and the coefficient matrix
is set via manager?/cpr_coef file. The values in cpr_coef are in the
following order:

RR RG RB GR GG GB BR BG BB

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:07:13 +03:00
Nishant Kamat 4df9d104d5 OMAP: DSS: Minor cleanup in ovl and mgr cache structs
The overlay_cache_data and manager_cache_data structs include
the elements of omap_overlay_info and omap_overlay_manager_info
structs respectively. Include the structs instead of the individual
elements to reduce code.

Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:07:12 +03:00
Tomi Valkeinen 332e9d7051 OMAP: DSS2: Add new FEAT definitions for features missing from OMAP2
OMAP2 doesn't have CPR, PRELOAD nor FIR_COEF_V registers. Add new
feature definitions for those, and check the feature before accessing
those registers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:06:49 +03:00
Tomi Valkeinen 525dae6136 OMAP: DSS2: Add FEAT_VENC_REQUIRES_TV_DAC_CLK
OMAP3430 requires an 96MHz clock to VENC's DAC, but no other OMAP needs
it.

Add a new feature, FEAT_VENC_REQUIRES_TV_DAC_CLK, which tells if the
clock is needed on this platform, and use that feature in venc.c to
decide if the clock needs enabling.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:06:43 +03:00
Tomi Valkeinen 8ef0e614b3 OMAP: DSS2: Reset LANEx_ULPS_SIG2 bits after use
LANEx_ULPS_SIG2 bits are left on after entering ULPS. This doesn't cause
any problems currently, as DSI HW is reset when it is enabled. However,
if the reset is not done, operation fails if the bits are still set.

So reset the bits after entering ULPS to ensure operation even without
HW reset.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:05:47 +03:00
Tomi Valkeinen e89456773c OMAP: DSS2: Taal: Make driver more fault tolerant
If ULPS exit fails, and the following reset fails also, Taal driver was
left in state where it thinks DSI is enabled while it really isn't,
leading to crash.

This patch checks the return value of taal_panel_reset, and if that
fails, ulps_enabled is left true, causing the driver to retry ulps exit
later.

Also the return value of taal_wake_up is checked at taal_disable, and if
wake up fails, we'll skip the power_off. This could leave the panel into
a not-quite-valid state, but there's nothing we can do about it in that
situation.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:01:15 +03:00
Tomi Valkeinen 8cff88c5da OMAP: DSS2: remove update_mode from omapdss
Remove the whole update_mode stuff from omapdss driver. If automatic
update for manual update displays is needed, it's better implemented in
higher layers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:01:15 +03:00
Tomi Valkeinen 27cc213ea7 OMAP: DSS2: OMAPFB: Implement auto-update mode
Implement auto-update mode for manual-update displays. omapfb driver
uses a delayed work to update the display with a constant rate.

The update mode can be changed via OMAPFB_SET_UPDATE_MODE ioctl, which
previously called omapdss but is now handled inside omapfb, and a new
sysfs file, "update_mode".

The update interval is by default 20 times per second, but can be
changed via "auto_update_freq" module parameter. There is also a new
module parameter "auto_update", which will make omapfb start manual
update displays in auto-update mode.

This auto-update mode can be used for testing if the userspace does not
support manual update displays properly. However, it is a very
inefficient solution, and should be considered more as a hack for
testing than something that could be used as a long term solution.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:01:14 +03:00
Tomi Valkeinen 065a40bd46 OMAP: DSS2: OMAPFB: Add struct to store per-display data
Create a new struct omapfb_display_data to contain omapfb's private
per-display data. Move the bpp override there.

This struct will be used to hold auto/manual update state of a display
in the following patches.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:01:14 +03:00
Tomi Valkeinen 4a9a5e390c OMAP: DSS2: DSI: Change dummy macros to inline functions
Using empty macros for performance measurement functions when DSS DEBUG
is not enabled causes an unused variable warning.

Change the empty macros to empty inline functions to remove the
warning.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:01:13 +03:00
Tomi Valkeinen 24e6289c02 OMAP: DSS2: remove extra includes from include/video/omapdss.h
omapdss.h included platform_device.h and atomic.h, neither of which is
needed by omapdss.h. Remove those includes from omapdss.h, and fix the
affected .c files which did not include platform_device.h even though
they should.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-07-01 12:01:12 +03:00
Amber Jain 0d66cbb53e OMAP: DSS2: Add support for NV12 format
Add the support for NV12 color format.
Configure base address for UV component of NV12 color format.
Change the way chroma scaling is handled for YUV formats on OMAP4 by enabling
chroma-resampling for video pipeline and hence using FIR2 register set for
scaling UV.
Changes to _dispc_set_scaling(), because of the reason above, are:
- call _dispc_set_scaling_common() to handle scaling for all color formats
  except for OMAP4 where it only handles scaling for RGB or Y-component
- call _dispc_set_scaling_uv() for special handling required for UV
  component on OMAP4.
- dispc_set_scaling_uv() also resets chroma-resampling bit for RGB color modes.

Contains chroma scaling (_dispc_set_scaling_uv) design and implemented by
Lajos Molnar <molnar@ti.com>

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-23 08:29:47 +03:00
Amber Jain ab5ca071e2 OMAP: DSS2: Add new registers for NV12 support
Add new registers specific to UV color component that are introduced in OMAP4.
Add simple helper functions to configure the newly added registers.
These new registers are mainly:
- UV base address registers used specifically for NV12 color-format
- FIR registers used for UV-color-component scaling on OMAP4
- Accumulator registers used for UV-color-component scaling
Add these new registers to save/restore and DUMPREG functions.
Also add two new features for OMAP4:
- FEAT_HANDLE_UV_SEPARATE - this is used on OMAP4 as UV color-component requires
  separate handling.
- FEAT_ATTR2 - this is used on OMAP4 to configure new ATTRIBUTES2 register.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-23 08:29:47 +03:00
Amber Jain 5719d35cce OMAP: DSS2: Use for loop where ever possible in SR(), RR()
Use for loop instead of individual entries for OVL_FIR_COEF_H, OVL_FIR_COEF_HV,
OVL_FIR_COEF_V and OVL_CONV_COEF in SR() and  RR().

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-23 08:29:47 +03:00
Amber Jain ed14a3ce98 OMAP: DSS2: Ensure non-zero FIR values are configured
FIR values can never be zero as per TRM, and the current code writes zero
when scaling is not used. It was not causing any problem as scaling was
disabled when zero was written. Its still safer to not write zero to
it in any case.
Now we configure correct FIR values even when scaling is not used (i.e. set FIR
to 1024 when scaling is not used), but the scaling enable bits are still kept
off if the scaling is not needed.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-23 08:29:47 +03:00
Amber Jain f20e42205a OMAP: DSS2: Add new color formats for OMAP4
Add new color formats supported by OMAP4: NV12, RGBA16, RGBX16,
ARGB16_1555, XRGB16_1555.
NV12 color format is defined here, its support in DSS will be added separately.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-23 08:29:47 +03:00
Ricardo Neri ad44cc3298 OMAP4: DSS2: HDMI: Implement ASoC Codec driver for HDMI audio
Implement an ASoC Codec Driver to handle audio configuration. The
implementation offers an interface for audio configuration and
control to be exposed to ALSA while hidding the HDMI details.

The ASoC driver supports the Basic Audio configuration as described
in CEA-861-D: 2-channel linear PCM with 32, 44.1 and 48kHz sample
rates and 16 bits/sample. It additionally supports 24 bit/sample
in 32-bit words.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-19 15:18:08 +03:00
Ricardo Neri 82335c4cc2 OMAP4: DSS2: HDMI: Add functionality for audio configuration
Add functionality for relevant audio configuration. Functions to
configure the audio FIFO and DMA as well as functions for the audio
core and Audio Info frame are included. This functionality is to
be used by the ASoC HDMI audio codec.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-19 15:18:04 +03:00
Ricardo Neri 5d8dbe4aa9 OMAP4: DSS2: HDMI: Add enums and structures for audio
Add enurations and structures for audio configuration. This includes
enumerations for the Audio InfoFrame, I2S, audio FIFO and audio core.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-19 15:18:00 +03:00
Ricardo Neri 72e91ace30 OMAP4: DSS2: HDMI: Add DSS feature for CTS calculation
CTS and N parameters are used to regenerate the audio clock from
the TMDS clock at the HDMI sink. In  OMAP4430 ES1.0 version
the calculation of the CTS parameter is done by the HDMI IP
(hardware mode) while in others it must be done by the HDMI driver
(software mode). A DSS feature is used to indicate the HDMI
driver which mode is used.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-19 15:17:56 +03:00
Ricardo Neri 6ff7084edf OMAP4: DSS2: Create a DSS features structure for OMAP4430 ES1.0
Create a separate DSS features structure for OMAP4430 ES1.0. This
structure is used to expose features only present in such
silicon version. Specifically, this is required to handle how
the HDMI IP calculates the CTS parameter for audio clock
regeneration packets. OMAP4430 ES1.0 is the only one that supports
computation of the CTS parameter by the HDMI IP (hardware mode).
The rest of the revisions require the HDMI driver to perform the
computation.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-19 15:17:51 +03:00
Archit Taneja 0c65622b1f OMAP: DSS2: DSI: Get line buffer size from DSI_GNQ register
The line buffer sizes vary across DSI modules, create a function
dsi_get_line_buf_size() using DSI_GNQ register to get the size of
line buffer used for the DISPC video port data.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-16 13:31:10 +03:00
Archit Taneja 75d7247c07 OMAP: DSS2: DSI: Get number of DSI data lanes using DSI_GNQ register
On OMAP3, the DSI module has 2 data lanes. On OMAP4, DSI1 has 4 data lanes
and DSI2 has 2 data lanes. Introduce function dsi_get_num_data_lanes() which
returns the number of data lanes on the dsi interface, introduce function
dsi_get_num_data_lanes_dssdev() which returns the number of data lanes used by
the omap_dss_device connected to the lanes.

Use the DSI_GNQ register on OMAP4 to get the number of data lanes, modify
dsi.c to use the number of lanes and the extra data lanes on DSI1.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-16 13:31:09 +03:00
Archit Taneja 49dbf5892f OMAP: DSS2: DSI: Use system workqueue for delayed work instead of a private workqueue
In the previous DSI driver design, a private workqueue was needed to prevent a
deadlock as explained in the commit : 0f16aa0ae6
. In the current design, the workqueue is only used for queueing delayed work in
the case where we don't get a FRAMEDONE interrupt for 250 milliseconds. It is
safe to remove the private workqueue amd use the system workqueue instead to
schedule the delayed work with the new design where the deadlock can't occur.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-16 13:31:09 +03:00
Archit Taneja b6cbb02ed0 OMAP: DSS2: DSI: Remove DISPC pixel clock related info in dsi_dump_clocks()
dsi_dump_clocks() prints lck and pck rates for the DISPC channel which it is
connected to. Remove this since it is already printed by dispc_dump_clocks()
in debugfs.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-16 13:31:08 +03:00
Tomi Valkeinen 897044e99e OMAP: DSS2: OMAPFB: Reduce stack usage
omapfb_mode_to_timings() had struct fb_info, struct fb_var and struct
fb_ops allocated from stack. This caused the stack usage grow quite
high.

Use kzalloc to allocate the structs instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:52 +03:00
Tomi Valkeinen e1d0178901 OMAP: DSS2: OMAPFB: remove dead code
Remove old unused code lying inside #if 0.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:51 +03:00
Tomi Valkeinen c42ced6391 OMAP: DSS2: RFBI: cleanup
The RFBI driver is quite messy. Remove dead and unneeded code and add
statics to functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:51 +03:00
Tomi Valkeinen 1d5952a868 OMAP: DSS2: RFBI: add omap_rfbi_configure
Add omap_rfbi_configure() which the panel driver can use to reconfigure
the data element size and the number of data lines in the RFBI bus.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:50 +03:00
Tomi Valkeinen 5be685faff OMAP: DSS2: RFBI: clock enable/disable changes
RFBI enables and disables clocks inside almost every function to get a
finegrained control to the clocks. However, the current understanding is
that this is not necessary power-management-wise.

Change the clocking scheme so that RFBI clocks are enabled when the
omapdss_rfbi_display_enable is called, and disabled when
omapdss_rfbi_display_disable is called.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:50 +03:00
Tomi Valkeinen 773139f175 OMAP: DSS2: RFBI: add rfbi_bus_lock
Add similar bus lock to RFBI as is in DSI. The panel driver can use the
bus lock to mark that the RFBI bus is currently in use.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:49 +03:00
Tomi Valkeinen 943e4457ca OMAP: DSS2: Add missing dummy functions
dpi.c does not compile if DSI is not compiled in. Add the missing dummy
functions so that dpi.c compiles.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:39:48 +03:00
Archit Taneja 634610ac6c OMAP: DSS2: Taal: Use device name in backlight_device_register
Panel Taal driver uses the string "taal" to register for a backlight device.
This causes backlight_device_register() to fail when a second taal panel
is added. Use dev_name(&dssdev->dev) as a parameter instead of the string.

Note: This will break backlight related sysfs commands. Use the name as
generated by the DSS2 driver, in the form "displayi", which represents
the ith registered display device.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:27 +03:00
Archit Taneja 5a8b572d83 OMAP4: DSS2: DSI: Changes for DSI2 on OMAP4
Introduce DSI2 PLL clock sources needed by LCD2 channel and DSI2 Protocol
engine and DISPC Functional clock. Do the following:

- Modify dss_get_dsi_clk_source() and dss_select_dsi_clk_source() to take the
  dsi module number as an argument.
- Create debugfs files for dsi2, split the corresponding debugfs functions.
- Allow DPI to use these new clock sources.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:27 +03:00
Archit Taneja 2e868dbe1d OMAP: DSS2: DSI: Pass pointer to struct to packet_sent_handler isrs
dsi_packet_sent_handler_vp() and dsi_packet_sent_handler_l4() currently
receive the completion parameter as their argument. This is not sufficient
information to differentiate between DSI1 and DSI2 platform devices.

Pass the struct "dsi_packet_sent_handler_data" to the packet_sent_handler
isrs, these contain the platform_device pointer of the DSI device and the
pointer to the completion struct.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:26 +03:00
Archit Taneja f1da39d9ce OMAP: DSS2: DSI: Use platform_device pointer to get dsi data
The dsi related data structure currently creates one global instance of itself
which is accessed by dsi functions. Remove this global structure instance and
declare the struct as dsi_data. Modify dsi_init() to allocate a "dsi_data"
structure for each platform device instance. Link this data with the device's
platform_device pointer. Create the function dsi_get_dsidrv_data() which takes
the pdev and return a pointer to the device's dsi_data.

Make dsi_get_dsidev_id() return only 0 for now, this will be removed once the
name of the DSI platform device is changed to the device instance form, like
"omapdss_dsi.0" and "omapdss_dsi.1" etc.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:26 +03:00
Archit Taneja a72b64b999 OMAP: DSS2: Pass platform_device as an argument in dsi functions
The DSI interface is represented as a platform device, using the DSI platform
driver(dsi.c). The current DSI driver design is capable of running only one
instance of a DSI device. On OMAP4, there are 2 very similar DSI modules which
can be represented as instances of "omapdss_dsi" platform device.

Add member "module" in "dssdev.phy.dsi" that tells us which DSI module's lanes
the panel is connected to. Modify dsi.c functions to take the device's
platform_device struct pointer, provide functions dsi_get_dsidev_from_dssdev()
and dsi_get_dsidev_from_id() take the panel's omap_dss_device and module number
respectively, and return the platform_device pointer. Currently, the dsi struct
is declared globally and is accessed when dsi data is needed. The new pdev
argument will be used later to provide the platform device's dsi related data.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:26 +03:00
Archit Taneja 41e03d1597 OMAP: DSS2: Remove omap_dss_device argument from dsi_pll_init()
The function dsi_pll_init() has omap_dss_device argument which is
not used. Remove this argument.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:26 +03:00
Archit Taneja 1ffefe755c OMAP: DSS2: DSI: Add extra omap_dss_device argument in functions exported by dsi
Add pointer to omap_dss_device struct as an argument in the functions which
are exported to dsi panel drivers. This argument will tell the DSI driver
which DSI interface's data it has to choose.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-12 19:30:26 +03:00
Niels de Vos 41b21aebe6 OMAP: DSS2: OMAPFB: make DBG() more resistant in if-else constructions
When DBG() is used in a simple if-else, the resulting code path
currently depends on the definition of DBG(). Inserting the statement in
a "do { ... } while (0)" prevents this possible misuse.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
[tomi.valkeinen@ti.com: changed the title of the commit msg]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:54 +03:00
Mike Frysinger 0d548a277c OMAP2: avoid descending into disabled framebuffer dirs
Rather than always add the omap2 dirs to the build list (and thus
force everyone to generate a useless built-in.o), bind the dirs to
their relevant kconfig symbol.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:53 +03:00
Tomi Valkeinen 44538b4315 OMAP: DSS2: Remove DSS_IRQSTATUS
DSS_IRQSTATUS register is available only on OMAP3, and reading it in
dss_dump_registers() on OMAP4 seems to cause a crash.

The register is not used for anything, and displaying its value is of no
use, so let's just remove it altogether.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:53 +03:00
Archit Taneja 55978cc20e OMAP: DSS2: Remove usage of struct dispc_reg
struct dispc_reg was originally used while migrating from old omapfb to
catch cases where the arguments to dispc_read_reg/dispc_write_reg were in
wrong order, since old omapfb had the arguments in reverse order.

Remove this struct and use u16 instead

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:53 +03:00
Archit Taneja 702d144845 OMAP: DSS2: Clean up DISPC overlay manager register definitions
Represent manager/channel specific DISPC registers as inline functions returning
the required dispc_reg struct. This is done since the current method is not
scalable as the number of overlay managers increase in number.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:52 +03:00
Archit Taneja 9b372c2d9d OMAP: DSS2: Clean up DISPC overlay register definitions
Move all DISPC register definitions to a new header dispc.h. There are
separate register offset definitions for GFX, VID1 and VID2 pipeline share
register definitions by using an argument. The introduction of VID3 pipeline
on OMAP4 will not let us use the above method since VID3 pipe register offsets
don't map with VID1 and VID2 offsets.

Represent overlay registers as DISPC_OVL_XXXX(plane), where the plane argument
tells the overlay. Register offsets are calculated as:

DISPC_OVL_XXXX(plane) = DISPC_OVL_BASE(plane) + DISPC_XXXX_OFFSET(plane)

Idea suggested by Tomi Valkeinen.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:52 +03:00
Archit Taneja 5bdd3c9a7d OMAP: DSS2: DSI: enable scp clock in dsi_dump_regs()
OMAP4 requires SCP clocks enabled to access DSI PLL registers and DSI COMPLEXIO
registers. Enable scp clock before accessing the registers and disable it before
exiting dsi_dump_regs().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:51 +03:00
Enric Balletbo i Serra a0ce4ccc60 OMAP: DSS2: Support for Powertip PH480272T
Add support for Powertip PH480242T, a LCD 4.3inch (480x242) display
type with 24-bit RGB interface, to panel-generic-dpi.

Tested with IGEP v2 board.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:51 +03:00
Enric Balletbo i Serra 50ca19d086 OMAP: DSS2: Support for Seiko 70WVW1TZ3
Add support for Seiko 70WVW1TZ3, a LCD 7.0inch WVGA (800x480) display
type with 24-bit RGB interface and Touch-Panel, to panel-generic-dpi

Tested with IGEP v2 board.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:50 +03:00
Vikram Pandita 5d74418101 OMAP: DSS2: DSI: enable interface for omap4
By default, the DSI is not getting enabled for omap4.
OMAP2PLUS does not catch this issue since it has ARCH_OMAP3.

The issue is only seen when using defconfig with ARCH_OMAP4 only.

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Cc: Archit Taneja <archit@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:50 +03:00
Tomi Valkeinen ea29033359 OMAP: DSS2: FEATURES: Add missing consts
omap_dss_features definitions were missing consts.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:49 +03:00
Tomi Valkeinen 6705615e92 OMAP: DSS2: DSI: Add OMAP4 CIO irqs
OMAP4 DSI block has new interrupts for the two new DSI lanes.

Add definitions for those interrupts, and add the interrupts to the CIO
error mask.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:49 +03:00
Tomi Valkeinen 1abf781454 OMAP: DSS2: Taal: Implement ULPS functionality
ULPS is a low power state where the DSI lanes are kept at ground. This
patch implements ULPS by having a DSI bus inactivity timer which
triggers the entry to ULPS. ULPS exit will happen automatically when the
driver needs to do something on the DSI lanes.

The ulps_timeout is configurable from board file or via sysfs.
Additionally another sysfs file, "ulps", can be used to check the
current ULPS state, or to manually enter or exit ULPS.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:48 +03:00
Tomi Valkeinen 883b9ac95e OMAP: DSS2: Taal: Rename esd_wq to workqueue
ESD workqueue will be shared with other functionality also. Rename
"esd_wq" to "workqueue" to better reflect its usage.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:48 +03:00
Tomi Valkeinen bb5476c720 OMAP: DSS2: Taal: Separate panel reset
Separate panel reset code to a function of its own. This will keep the
code cleaner in the future when panel reset is called from multiple
locations.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:48 +03:00
Tomi Valkeinen 1f8fa452af OMAP: DSS2: Taal: Add sysfs file for ESD interval
Implement sysfs support to configure the ESD interval.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:47 +03:00
Tomi Valkeinen 1663d2f70a OMAP: DSS2: Taal: Clean up ESD queueing
Separate the code which queues/cancels ESD work into their own
functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:47 +03:00
Tomi Valkeinen 33a410be6f OMAP: DSS2: Taal: Implement configurable ESD interval
ESD check in Taal driver is currently on/off feature with hardcoded
interval. This patch changes it to a configurable interval, which can be
set from the board file.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:44 +03:00
Tomi Valkeinen 88257b2695 OMAP: DSS2: DSI: ensure VDDS_DSI is disabled on exit
The panel drivers can leave the VDDS_DSI regulator enabled, even when
the panel is disabled, to ensure that the DSI pins are powered.

This patch ensures that VDDS_DSI is disabled on DSI module unload.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:17 +03:00
Tomi Valkeinen d1f5857e4b OMAP: DSS2: DSI: Add DSI pad muxing support
Add dsi_mux_pads function pointer to omap_dss_board_info, and use the
function pointer in DSI code to configure the DSI pads either to normal
DSI operation, or to pull down when in ULPS.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:17 +03:00
Tomi Valkeinen 22d6d67626 OMAP: DSS2: DSI: add parameter to enter ulps on disable
Add parameter to omapdss_dsi_display_disable() which the panel driver
can use to tell if the DSI lanes should be put to ULPS before disabling
the interface.

This can be used to skip ULPS entry in cases where the panel doesn't
care about ULPS state, for example when the panel will be reset, or when
the display interface will be enabled again right after the disable.

This will speed up the operation considerably in cases where entering
ULPS would fail with timeout, and the panel driver isn't even interested
in entering ULPS.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:17 +03:00
Tomi Valkeinen 03329ace1d OMAP: DSS2: DSI: wait for TXCLKESC domain to come out of reset
Add dsi_cio_wait_tx_clk_esc_reset() function which waits for the
TXCLKESC domains to come out of reset.

Things have worked fine without this, but better be safe than sorry.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:16 +03:00
Tomi Valkeinen 65c62bb953 OMAP: DSS2: DSI: fix CIO init and uninit
Use dsi_enable_scp_clk and dsi_disable_scp_clk in CIO init and uninit,
and improve the CIO init by adding a few status checks and error
handling.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:16 +03:00
Tomi Valkeinen 24c1ae4191 OMAP: DSS2: DSI: implement enable/disable SCP clk
SCP clock is needed for CIO on OMAP3, and for CIO and PLL on OMAP4.
Current driver enables the CIO clock always when DSI display is
initialized. However, if a DPI display tries to use DSI PLL, the SCP
clock is never enabled.

This patch implements simple ref counting enable/disable functions for
SCP clock.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:15 +03:00
Tomi Valkeinen c335cbf94e OMAP: DSS2: DSI: fix _dsi_print_reset_status
The bits for TXCLKESCx reset have changed for OMAP3630 and OMAP4.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:15 +03:00
Tomi Valkeinen 293ef19cbb OMAP: DSS2: Add FEAT_DSI_REVERSE_TXCLKESC
OMAP3430 has RESETDONETXCLKESCx bits in the order following bitnumber
order for lanes 0, 1, 2: 28, 27, 26. OMAP3630 and later have them in
saner order: 24, 25, 26 (and 27, 28 for OMAP4).

This patch adds a dss_feature that can be used to differentiate between
those two orders of RESETDONETXCLKESCx bits.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:14 +03:00
Tomi Valkeinen cc5c185098 OMAP: DSS2: DSI: rename complexio related functions
Rename ComplexIO from dsi_complexio_xxx to dsi_cio_xxx for brevity.
Also, add cio prefix for couple of functions that didn't have it, but
are cio related.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:14 +03:00
Tomi Valkeinen 2a89dc1533 OMAP: DSS2: DSI: add option to leave DSI lanes powered on
The DSI pins are powered by VDDS_DSI. If VDDS_DSI is off, the DSI pins
are floating even if they are pinmuxed to, say, safe mode and there's a
pull down/up.

This patch gives the panel drivers an option to leave the VDDS_DSI power
enabled while the DSS itself is turned off. This can be used to keep the
DSI lanes in a valid state while DSS is off, if the DSI pins are muxed
for pull down (not done in this patch).

There will be a slight power consumption increase (~100 uA?) when the
VDDS_DSI is left on, but because this option is used when the panel is
left on, the regulator consumption is negligible compared to panel power
consumption.

When the panel is fully turned off the VDDS_DSI is also turned off.

As an added bonus this will give us faster start up time when starting
up the DSS and the regulator is already enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:13 +03:00
Tomi Valkeinen 40885ab31f OMAP: DSS2: DSI: implement ULPS enter and exit
Entering ULPS (Ultra Low Power State) happens by sending ULPS entry
sequence to the DSI peripheral and pulling the DSI lines down.

Exiting ULPS happens by sending ULPS exit sequence.

We can send the ULPS entry sequence by using OMAP DSS HW's ULPS support,
but we cannot use the ULPS exit support from DSS HW. DSS HW refuses to
send the ULPS exit sequence if it thinks that the lanes are not in ULPS.
After being in OFF mode the DSS HW has been reset, and so it does not
know that the lanes are actually in ULPS.

Thus we need to use the lane override support and manually send the ULPS
exit sequence. Luckily the sequence is very simple.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:13 +03:00
Tomi Valkeinen 95861368e3 OMAP: DSS2: DSI: Remove CIO LDO status check
CIO LDO status check seems to be broken on OMAP3630+ chips, and it's
also quite unclear what LDO status actually tells and when its status
changes.

This patch removes the whole check on the grounds that if there's a
problem with the LDO, we should anyway catch the problem as we check the
CIO power state and CIO reset status.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:12 +03:00
Tomi Valkeinen 0a0ee46b1a OMAP: DSS2: DSI: Add lane override functions
DSI_DSIPHY_CFG10 register can be used to override DSI lane state. Add
functions to configure and enable the override, and to disable the
override.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:12 +03:00
Tomi Valkeinen ab46d8b2a3 OMAP: DSS2: improve clock debugfs output
OMAP4 has clocks set up in a bit interesting way, causing, for example,
the DSS's "ick" to be called "dss_fck".

This patch changes the debugfs output to show both the DSS's name for
the clock (ie. basically the clock alias), and the real name from the
clock struct.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:11 +03:00
Tomi Valkeinen e3502ce97f OMAP: DSS2: Convert simple/strict_strto* to kstrto*
Convert simple/strict_strto* functions to kstrto* functions. Only simple
cases are converted.

simple_strto* uses are still left to places where it is used to parse
numbers from a list of numbers. These need some other solution than
kstrto*.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:11 +03:00
Archit Taneja 7636b3b4e1 OMAP2PLUS: DSS2: Remove hack config "CONFIG_OMAP2_DSS_USE_DSI_PLL"
The clock sources for DISPC_FCLK and LCD1_CLK are now specified in the board file.
There is no need for the hack config "CONFIG_OMAP2_DSS_USE_DSI_PLL" anymore.
Introduce function dpi_use_dsi_pll() which checks for the clock sources to decide
whether DSI PLL is to be used or not.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:10 +03:00
Archit Taneja 6cb07b256a OMAP: DSS2: HDMI: Use dss_device clock configuration for HDMI PLL parameters
Move some of the configurable HDMI PLL parameters to dssdev.clock struct.
Cleanup the function hdmi_compute_pll() by using the parameters defined in the
board file and do some cosmetic modifications.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:10 +03:00
Archit Taneja e888166247 OMAP2PLUS: DSS2: Add clock sources to dss device clock configuration
Add enum dss_clock_source in dssdev.clocks struct so that the clock sources can
be specified in the board file.
Replace hard coded clock sources in dsi.c, dpi.c and replace them with the new
clock source members in dssdev.clocks. Modify the sdp4430_lcd_device struct in
board-4430sdp.c to specify clock sources for DISPC_FCLK, LCD1_CLK and DSI1_FCLK.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:20:06 +03:00
Archit Taneja 89a35e5170 OMAP2PLUS: DSS2: Change enum "dss_clk_source" to "omap_dss_clk_source"
Change enum dss_clk_source to omap_dss_clock_source and move it to
'plat/display.h'. Change the enum members to attach "OMAP_" in the beginning.
These changes are done in order to specify the clock sources for DSS in the
board file.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:27 +03:00
Tomi Valkeinen 14e4d78485 OMAP: DSS2: use __exit for selected panel drivers
We can use __exit for the driver remove function in plain dss panels
(ie. those that do not need i2c or spi).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:26 +03:00
Tomi Valkeinen 06b2b0d597 OMAP: DSS2: make omap_dss_(un)register_device static
omap_dss_register_device and omap_dss_unregister_device can only be
called from core.c, so we can make it static.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:26 +03:00
Tomi Valkeinen 14572c6356 OMAP: DSS2: VENC: Add missing start/stop_device calls
VENC code was missing omap_dss_start/stop_device calls. This didn't
cause any problems as VENC could not be compiled as a module, but
nevertheless it's better to add the calls.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:25 +03:00
Jani Nikula bcd8e374b5 OMAP: DSS2: OMAPFB: Remove implicit display update on unblank
Currently omapfb does an implicit display update (for manual update
displays) on unblank.

There is no guarantee that the framebuffer contains a valid image when
unblank is called. When using manual update displays it is the
responsibility of the user space to update the display, and so it should
be in this case also.

This patch removes the implicit display update on unblank.

Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
[tomi.valkeinen@ti.com: improved description]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:25 +03:00
Tomi Valkeinen 91ac27a687 OMAP: DSS2: OMAPFB: Handle errors when initializing panel
Errors from the panel driver were ignored during panel initialization.
Handle the errors and fail accordingly.

Also move the display initialization to a separate function to make it
cleaner.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:25 +03:00
Jani Nikula 7a0987bf2c OMAP: DSS2: Add method for querying display dimensions from DSS drivers
Add get_dimensions() to struct omap_dss_driver. Use the call, if supported
by the driver, in OMAPFB.

Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:24 +03:00
Tomi Valkeinen b4de838e9f OMAP: DSS2: VENC: Remove sleeps at venc enable/disable
VENC code had 50ms sleep after enabling the output and 100ms sleep after
disabling the output. I don't see any reason for these sleeps.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:24 +03:00
Tomi Valkeinen c6f65e1a43 OMAP: DSS2: VENC: make 20ms venc bug-fix sleep optional
There's a 20ms sleep after VENC reset. It's unknown what bug this
circumvents and on what platforms. Add a Kconfig option to disable the
sleep.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:23 +03:00
Tomi Valkeinen f1aafdcd42 OMAP: DSS2: make 50ms bug-fix sleep optional
For some unknown reason we may get SYNC_LOST errors from the display
subsystem at initialization time if we don't sleep before resetting the
DSS. See the source (dss.c) for more comments.

However, 50ms is quite long time to sleep, and with some configurations
the SYNC_LOST may never happen, so this patch creates a Kconfig option
to disable the sleep.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:23 +03:00
Tomi Valkeinen d792eecd9a OMAP: DSS2: remove non-working msleep(40) workaround
The sleep workaround for the problem described in the comment doesn't
really work. This patch removes the workaround, and improves the comment
about the bug, and proposes an userspace workaround.

omap_dss_set_manager() is called 6 times when loading omapdss and
omapfb, which means that 40ms * 6 = 240ms was spent sleeping when
booting up.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:22 +03:00
Tomi Valkeinen c6940a3dc5 OMAP: DSS2: move dss device clock configuration
Clock configuration was defined inside dssdev.phy.dsi struct. The clock
config doesn't really belong there, and so it's moved to dssdev.clock
struct.

Now the explicit clock configuration could also be used for other
interfaces than DSI, although there's no support for it currently.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:19:16 +03:00
Archit Taneja cf398fb3e6 OMAP: DSS2: DSI: Introduce sync_vc functions
The DSI protocol engine has no interrupt for signalling the end of a Frame
transfer. The present approach is to send a BTA after DISPC generates a
FRAMEDONE interrupt, and unlock the dsi bus only when the BTA Ack is received.

The assumption made with this approach was that OMAP will send a BTA only after
the long packet corresponding to the last line is sent. However, it is possible
that on the DISPC FRAMEDONE interrupt there are 2 (or more) lines of pixel data
in the DSI line buffer. Hence, the BTA Ack could be received for the long packet
corresponding to the second last line (or the third last and so on..).
Therefore, the current method doesn't ensure that the complete frame data is
sent before we start a new transfer. A similar explanation holds valid if we
send a BTA in between multiple short/long command packets from the slave port.

Introduce dsi_sync_vc functions, based on Tomi Valkeinen's idea, which ensure
that the DSI Virtual Channel in use(update_channel) completes its previous work
before proceeding to the next Frame/Command.

For a frame update, the DSI driver now sends a callback to the Panel Driver
on the FRAMEDONE interrupt itself. The callback in the panel driver then unlocks
the bus. dsi_sync_vc() functions are placed in dsi_vc_config_l4() and
dsi_vc_config_vp() to ensure that the previous task of the Virtual Channel is
completed.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:55 +03:00
Archit Taneja 9613c02b5f OMAP4: DSS2: Register configuration changes for DSI
The following changes have changed from OMAP3 to OMAP4 DSI:
-The register field DSI_PLL_FREQSEL in DSI_PLL_CONFIGURATION2 has been removed.
-DCS_CMD_ENABLE and DCS_CMD_CODE bits have been moved from DSI_CTRL to
DSI_VC_CTRLi, hence the control of the bits is available per VC.
-DSI LDO powergood notification doesn't work on OMAP4. This is mentioned in
OMAP4 errata revision 1.8(Errata 1.76).
-OCP_WIDTH register field is included in DSI_VC_CTRL.
-The SCP clock is also required to access DSI PLL registers

Introduce dss features for these changes so that DSI runs on both OMAP3 and
OMAP4.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:55 +03:00
Tomi Valkeinen 2783fa849b OMAP: DSS2: fix panel Kconfig dependencies
All DPI panels were missing dependency to OMAP2_DSS_DPI. Add the
dependency.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:54 +03:00
Tomi Valkeinen c94dfe05c4 OMAP: DSS2: DSI: Fix DSI PLL power bug
OMAP3630 has a HW bug causing DSI PLL power command POWER_ON_DIV (0x3)
to not work properly. The bug prevents us from enabling DSI PLL power
only to HS divider block.

This patch adds a dss feature for the bug and converts POWER_ON_DIV
requests to POWER_ON_ALL (0x2).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:54 +03:00
Archit Taneja 89976f2990 OMAP: DSS2: Fix: Return correct lcd clock source for OMAP2/3
dss.lcd_clk_source is set to the default value DSS_CLK_SRC_FCK at dss_init.
For OMAP2 and OMAP3, the dss.lcd_clk_source should always be the same as
dss.dispc_clk_source. The function dss_get_lcd_clk_source() always returns the
default value DSS_CLK_SRC_FCK for OMAP2/3. This leads to wrong clock dumps when
dispc_clk_source is not DSS_CLK_SRC_FCK.

Correct this function to always return dss.dispc_clk_source for OMAP2/3.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:54 +03:00
Tomi Valkeinen a9a6500b71 OMAP: DSS2: DSI: fix dsi_dump_clocks()
On OMAP4, reading DSI_PLL_CONFIGURATION2 register requires the L3 clock
(CIO_CLK_ICG) to PLL. Currently dsi_dump_clocks() tries to read that
register without enabling the L3 clock, leading to crash if DSI is not
in use.

The status of the bit being read from DSI_PLL_CONFIGURATION2 is
available from dsi_clock_info->use_sys_clk, so we can avoid the whole
problem by just using that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:54 +03:00
Tomi Valkeinen b2765092ae OMAP: DSS2: DSI: fix use_sys_clk & highfreq
use_sys_clk and highfreq fields in dsi.current_cinfo were never set.
Luckily they weren't used anywhere so it didn't cause any problems.

This patch fixes those fields and they are now set at the same time as
the rest of the fields.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:54 +03:00
Tomi Valkeinen 4e9f99d75c OMAP: DSS2: Move nokia-dsi-panel.h to include/video/
arch/arm/plat-omap/include/plat/nokia-dsi-panel.h is an include for the
OMAP DSS panel driver for Nokia's DSI displays. A more logical place for
it is in include/video.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:10:07 +03:00
Tomi Valkeinen f8ae2f08d2 OMAP: DSS2: Move panel-generic-dpi.h to include/video/
arch/arm/plat-omap/include/plat/panel-generic-dpi.h is an include for
the OMAP DSS panel driver for generic DPI displays. A more logical place
for it is in include/video.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:08:51 +03:00
Tomi Valkeinen a0b38cc4d3 OMAP: DSS2: Move display.h to include/video/
arch/arm/plat-omap/include/plat/display.h is an include for the OMAP DSS
driver. A more logical place for it is in include/video.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-05-11 14:05:07 +03: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
Linus Torvalds 4cc4d24efc Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6: (140 commits)
  MAINTAINERS: de-orphan fbdev.
  MAINTAINERS: Add file pattern for fb dt bindings.
  video: Move sm501fb devicetree binding documentation to a better place.
  fbcon: fix situation where fbcon gets deinitialised and can't reinit.
  video, sm501: add OF binding to support SM501
  video, sm501: add edid and commandline support
  video, sm501: add I/O functions for use on powerpc
  video: Fix EDID macros H_SYNC_WIDTH and H_SYNC_OFFSET
  fbcon: Bugfix soft cursor detection in Tile Blitting
  video: add missing framebuffer_release in error path
  video: metronomefb: add __devexit_p around reference to metronomefb_remove
  video: hecubafb: add __devexit_p around reference to hecubafb_remove
  drivers:video:aty:radeon_base Fix typo occationally to occasionally
  atmel_lcdfb: add fb_blank function
  atmel_lcdfb: implement inverted contrast pwm
  video: s3c-fb: return proper error if clk_get fails
  uvesafb,vesafb: create WC or WB PAT-entries
  video: ffb: fix ffb_probe error path
  radeonfb: Let hwmon driver probe the "monid" I2C bus
  fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()
  ...
2011-03-24 07:56:52 -07:00
Matthew Garrett bb7ca747f8 backlight: add backlight type
There may be multiple ways of controlling the backlight on a given
machine.  Allow drivers to expose the type of interface they are
providing, making it possible for userspace to make appropriate policy
decisions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22 17:43:59 -07:00
Murthy, Raghuveer 2de110868f OMAP: DSS2: Implement OMAP4 DSS fclk support
Add dss.dpll4_m4_ck (DSS FCLK) initialization for OMAP4. This is used
to compute the pixel clock for DPI interface and also to reconfigure
the DSS FCLK to the desired rate, corresponding to the rate computed
for pixel clock.

Adding these cpu_is_44xx() checks are meant to be temporary, until a
cleaner implementation to manage these checks are added. Currently this
is needed to get DVI display running on OMAP4 PandaBoard

Signed-off-by: Raghuveer Murthy <raghuveer.murthy@ti.com>
[tomi.valkeinen@ti.com: minor changes due to conflicts]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-18 09:31:03 +05:30
Tomi Valkeinen 0acf659f14 OMAP: DSS2: Clean up for dpll4_m4_ck handling
OMAP2 does not have dpll4_m4_ck source clock for dss functional clock,
but later OMAPs do. Currently we check for cpu type in multiple places
to find out if dpll4_m4_ck is available.

This patch cleans up dss.c by using the fact that dss.dpll4_m4_ck
pointer is NULL on OMAP2. This allows us to remove many of the cpu
checks.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-18 09:31:01 +05:30
Mythri P K adbc2feee1 OMAP4: DSS: HDMI: Call to HDMI module init to register driver.
calling the platform registration of HDMI driver from core
during initialization.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:50 +05:30
Mythri P K 642e21bff2 OMAP4: DSS2: HDMI: Add makefile and kconfig changes to enable HDMI in OMAP4
Adding kconfig and makefile changes to add support for HDMI in OMAP4.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:50 +05:30
Mythri P K 70be83235e OMAP4: DSS2: HDMI: HDMI panel driver addition in the DSS
The panel driver(hdmi_omap4_panel.c) in omap2/dss acts as a controller
to manage the enable and disable requests and synchronize audio and video.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:49 +05:30
Mythri P K c3198a5e83 OMAP4: DSS2: HDMI: HDMI driver addition in the DSS
Adding the hdmi interface driver(hdmi.c) to the dss driver. It configures
the audio and video portion of HDMI based on functionality called by the
panel driver.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Yong Zhi <y-zhi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:49 +05:30
Mythri P K 26adeece88 OMAP4: DSS2: HDMI: HDMI driver header file addition
Adding the hdmi interface driver header file (hdmi.h) to the dss driver.
Register and structure declaration done here.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:49 +05:30
Mythri P K d3862610c9 OMAP4: DSS2: HDMI: Dispc gamma enable set/reset function for TV.
Adding function to reset/set gamma table bit for TV interface, currently
only support for disabled is added.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:49 +05:30
Mythri P K 7ed024aa28 OMAP4: DSS2: HDMI: Select between HDMI VENC clock source.
Adding function to select between HDMI or VENC clock source.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:49 +05:30
Mythri P K b119601d4e OMAP4: DSS2: Add display type HDMI to DSS2
Adding display type HDMI in dss_features, overlay and the manager so that
HDMI type of display will be recognized.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-16 11:45:22 +05:30
Tomi Valkeinen d80d499ed9 OMAP: DSS2: DSI: fix IRQ debug prints
print_irq_status functions can be called with empty irq status when full
irq debugging is enabled. This patch makes print_irq_status functions
return immediately when given an empty irq status to lessen the debug
spam slightly.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 14:24:19 +05:30
Tomi Valkeinen 773b30b22f OMAP: DSS2: DSI: catch DSI errors in send_bta_sync
dsi_vc_send_bta_sync() waits for BTA interrupt with a 500ms timeout. If
a DSI error happens, no BTA is received and the timeout triggers. This
could be handled much faster by listening to DSI errors also.

This patch uses the ISR support to notice DSI errors while waiting for
the BTA, thus speeding up the fail-path considerably.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 14:24:19 +05:30
Tomi Valkeinen f34bd465ca OMAP: DSS2: DSI: use ISR for BTA in framedone
Remove bta_callback from the interrupt handler, and use ISR support
instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 14:24:19 +05:30
Tomi Valkeinen f36a06e702 OMAP: DSS2: DSI: use ISR in send_bta_sync
Remove bta_completion handling from the interrupt handler, and use ISR
support instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 14:24:19 +05:30
Tomi Valkeinen 4ae2ddddf4 OMAP: DSS2: DSI: Add ISR support
Add generic ISR support for DSI interrupts. ISRs can be used instead of
custom hooks in the interrupt handler.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 14:24:18 +05:30
Tomi Valkeinen 69b281a614 OMAP: DSS2: DSI: Restructure IRQ handler
Clean up the IRQ handler a bit by separating collection of IRQ stats and
handling of IRQ errors to separate functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 14:23:29 +05:30
Taneja, Archit 4964111639 OMAP: DSS2: FEATURES: DSI PLL parameter cleanup
The DSI PLL parameters (regm, regn, regm_dispc, regm_dsi, fint) have different
fields and also different Max values on OMAP3 and OMAP4. Use dss features to
calculate the register fields and min/max values based on current OMAP revision.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 12:35:38 +05:30
Taneja, Archit 31ef82377f OMAP: DSS2: FEATURES: Functions to return min and max values of parameters
Create 2 functions dss_feat_get_param_min() and dss_feat_get_param_max() which
return the minimum and maximum value of a parameter. Introduce a enum in
dss_features called dss_range_param which contains parameters whose ranges we
are interested in.

Replace this with dss_feat_get_max_dss_fck() which is specific to the parameter
DSS_FCK.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 12:34:27 +05:30
Taneja, Archit 235e7dba02 OMAP2PLUS: DSS2: FEATURES: Fix usage of dss_reg_field and dss_clk_source_name
The structures dss_reg_field and dss_clk_source_name have enum members which
specify the register field and the clock source respectively. These members are
not used to choose the correct result in the corresponding feature functions.
Remove these members and change the features array declaration to incorporate
these enums.

The structure dss_clk_source_name without the enum member is just a pointer to
an string. Remove the structure and use a character pointer directly.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-15 11:53:51 +05:30
Tomi Valkeinen ba02fa37de HACK: OMAP: DSS2: VENC: disable VENC on OMAP4 to prevent crash
Something seems to be wrong with OMAP4 & VENC, and register access fails
in omap_venchw_probe().

This patch skips venc driver registration on OMAP4, thus circumventing
the problem for now.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-14 15:39:48 +05:30
Taneja, Archit ea75159ee6 OMAP4: DSS2: Clock source changes for OMAP4
On OMAP3, the pixel clock for the LCD manager was derived through DISPC_FCLK as:

Lcd Pixel clock = DISPC_FCLK / lcd / pcd

Where lcd and pcd are divisors in the DISPC_DIVISOR register.

On OMAP4, the pixel clocks for LCD1 and LCD2 managers are derived from 2 new
clocks named LCD1_CLK and LCD2_CLK. The pixel clocks are calculated as:

Lcd_o Pixel clock = LCDo_CLK / lcdo /pcdo, o = 1, 2

Where lcdo and pcdo registers are divisors in DISPC_DIVISORo registers.

LCD1_CLK and LCD2_CLK can have DSS_FCLK, and the M4 divider clocks of DSI1 PLL
and DSI2 PLL as clock sources respectively. Introduce functions to select and
get the clock source for these new clocks. Modify DISPC functions get the
correct lck and pck rates based on the clock source of these clocks. Since
OMAP2/3 don't have these clocks, force OMAP2/3 to always have the LCD_CLK source
as DSS_CLK_SRC_FCK by introducing a dss feature.

Introduce clock source names for OMAP4 and some register field changes in
DSS_CTRL on OMAP4.

Currently, LCD2_CLK can only have DSS_FCLK as its clock source as DSI2 PLL
functionality hasn't been introduced yet. BUG for now if DSI2 PLL is selected as
clock.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:31 +02:00
Taneja, Archit 66534e8e93 OMAP2PLUS: DSS2: Cleanup clock source related code
Clean up some of the DSS functions which select/get clock sources, use switch
to select the clock source members since more clock sources will be introduced
later on.

Remove the use of macro CONFIG_OMAP2_DSS_DSI in dispc_fclk_rate, use a dummy
inline for function for dsi_get_pll_hsdiv_dispc_rate() instead for code clarity.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:30 +02:00
Steve Sakoman 7654b4d3f4 OMAP: DSS2: Add support for LG Philips LB035Q02 panel
This patch adds support for the Gumstix Palo35 expansion board
which utilizes the 320 x 240 pixel LG.Philips LB035Q02 LCD Panel

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:30 +02:00
Tomi Valkeinen b9cb0984a6 OMAP: DSS2: fix omap_dispc_register_isr() fail path
Fix handling of error in omap_dispc_register_isr() in case there are no
free isr slots available.

Reported-by: Ben Tucker <btucker@mpcdata.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:30 +02:00
Murthy, Raghuveer 0cf35df353 OMAP4: DSS2: Using dss_features to set independent core clock divider
Using dss_features to select independent core clock divider and setting
it. Added the register used, to DISPC context save and restore group

-----------------------------------------------------------------------
In OMAP4, the minimum DISPC_CORE_CLK required can be expressed as:

	DISPC_CORE_CLK >= max(PCLK1*HSCALE1, PCLK2*HSCALE2, ...)

Where PCLKi is the pixel clock generated by MANAGERi and HSCALEi is the
maximum horizontal downscaling done through MANAGERi

Based on the usecase, core clk can be increased or decreased at runtime
to save power. Such mechanism are not yet implemented. Hence, we set the
core clock divisor to 1, to support maximum range of resolutions
------------------------------------------------------------------------

Signed-off-by: Raghuveer Murthy <raghuveer.murthy@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:29 +02:00
Murthy, Raghuveer ce7fa5eb1e OMAP: DSS2: Renaming register macro DISPC_DIVISOR(ch)
The OMAP4 DISPC_DIVISOR1 is backward compatible to OMAP3xxx DISPC_DIVISOR.
However DISPC_DIVISOR is also provided in OMAP4, to control DISPC_CORE_CLK
independent of Primary and Secondary display clocks.

Renamed DISPC_DIVISOR(ch) to DISPC_DIVISORo(ch), to facilitate introduction
of DISPC_DIVISOR register, which is specific for OMAP4. OMAP4 has 3 registers
DISPC_DIVISOR, DISPC_DIVISOR1 and DISPC_DIVISOR2.

Also updated, all the usages of DISPC_DIVISOR(ch) to DISPC_DIVISORo(ch).
Use DISPC_DIVISORo(ch) when DISPC_DIVISOR1 or DISPC_DIVISOR2 has to be
configured

OMAP4 TRM uses DISPC_DIVISORo generically to refer to DISPC_DIVISOR1 and
DISPC_DIVISOR2

Signed-off-by: Raghuveer Murthy <raghuveer.murthy@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:29 +02:00
Murthy, Raghuveer 5c6366e14d OMAP: DSS2: Adding dss_features for independent core clk divider
In OMAP3xxx DISPC_DIVISOR register has a logical clock divisor (lcd_div)
field. The lcd_div is common, for deciding the DISPC core functional clock
frequency, and the final pixel clock frequency for LCD display.

In OMAP4, there are 2 LCD channels, hence two divisor registers, DISPC_DIVISOR1
and DISPC_DIVISOR2. Also, there is a third register DISPC_DIVISOR.

The DISPC_DIVISOR in OMAP4 is used to configure lcd_div exclusively for core
functional clock configuration. For pixel clock configuration of primary and
secondary LCDs, lcd_div of DISPC_DIVISOR1 and DISPC_DIVISOR2 are used
respectively

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Raghuveer Murthy <raghuveer.murthy@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:29 +02:00
Tomi Valkeinen 85604b0a24 HACK: OMAP: DSS2: add delay after enabling clocks
On omap4 the registers may not be accessible right after enabling the
clocks. At some point this will be handled by pm_runtime, but, for the
time begin, adding a small delay after clk_enable() should make things
work.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:29 +02:00
Tomi Valkeinen f2988ab9f4 HACK: OMAP: DSS2: Fix OMAP2_DSS_USE_DSI_PLL
When using OMAP2_DSS_USE_DSI_PLL, which selects DSI PLL as source clock
for DISPC, the DSI needs the vdds_dsi regulator. Latest regulator
changes broke this, causing the the code to not acquire the regulator
when using OMAP2_DSS_USE_DSI_PLL.

This patch acquires the vdds_dsi regulator in dsi_pll_init(), fixing the
issue. This is is just a quick hack to get the OMAP2_DSS_USE_DSI_PLL
option working. There shouldn't be any other downside in this solution
than some extra lines of code.

OMAP2_DSS_USE_DSI_PLL is itself a big hack, and should be removed, and
the feature itself should be implemented in a more sane way. However,
the solution is not trivial, and people are using DSI PLL to get more
exact pixel clocks, so this hack is an acceptable temporary solution for
the time being.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:29 +02:00
Archit Taneja bc6d4b1d3d OMAP: DSS2: Use request / release calls in Taal for DSI Virtual Channels.
Taal driver used to take a hard coded Macro for Virtual Channel and the VC_ID.
The Taal panel driver now requests for a Virtual channel through the
omap_dsi_request_vc() call in taal_probe().

The channel number returned by the request_vc() call is used for sending command
and data to the Panel. The DSI driver automatically configures the Virtual
Channel's source to either Video Port or L4 Slave port based on what the panel
driver is using it for.

The driver uses omap_dsi_release_vc() to free the VC specified by the panel.
taal_remove() or when a request_vc() call fails.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:28 +02:00
Archit Taneja 5ee3c1445d OMAP: DSS2: Functions to request/release DSI VCs
Introduce functions which request and release VC's. This will be used in panel
drivers in their probes.

omap_dsi_request_vc() takes in the pointer to the omap_dss_device, the VC_ID
parameter which goes into the header of the DSI packets, and returns a Virtual
channel number (or virtual channel register set) which it can use.

omap_dsi_set_vc_id() takes the omap_dss_device pointer, the Virtual Channel
number and the VC_ID that needs to be set for the specifed Virtual Channel.

omap_dsi_release_vc() takes the omap_dss_device pointer and the Virtual Channel
number that needs to be made free.

Initialisation of VC parameters is done in dsi_init().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:28 +02:00
Tomi Valkeinen 0a58351854 OMAP: DSS2: Remove unneeded cpu_is_xxx checks
cpu_is_omapxxx() was used previously to select the supported interfaces.
Now that the interfaces are platform devices, we no longer need to do
the check when registering the driver. Thus we can just remove the
checks.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:28 +02:00
Tomi Valkeinen 587b5e8269 OMAP: DSS2: Move DPI & SDI init into DSS plat driver
DPI and SDI are different from the other interfaces as they are not
hwmods and there is not platform driver for them. They could be said to
be a part of DSS or DISPC modules, although it's not a clear definition.

This patch moves DPI and SDI initialization into DSS platform driver,
making the code more consistent: omap_dss_probe() only initializes
platform drivers now.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:28 +02:00
Tomi Valkeinen 277b2881c3 OMAP: DSS2: Remove pdev argument from dpi_init
dpi_init() does not use the pdev argument for anything. Remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:28 +02:00
Tomi Valkeinen 42c9dee821 OMAP: DSS2: Remove FB_OMAP_BOOTLOADER_INIT support
FB_OMAP_BOOTLOADER_INIT does not work, and it was only partially
implemented for SDI.

This patch removes support for FB_OMAP_BOOTLOADER_INIT to clean up the
code and to remove any assumptions that FB_OMAP_BOOTLOADER_INIT would
work.

Proper implementation is much more complex, requiring early boot time
register and clock handling to keep the DSS running.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:27 +02:00
Archit Taneja 1bb4783506 OMAP2PLUS: DSS2: DSI: Generalize DSI PLL Clock Naming
DSI PLL output clock names have been made more generic. The clock name
describes what the source of the clock and what clock is used for. Some of
DSI PLL parameters like dividers and DSI PLL source have also been made more
generic.

dsi1_pll_fclk and dsi2_pll_fclk have been changed as dsi_pll_hsdiv_dispc_clk
and dsi_pll_hsdiv_dsi_clk respectively. Also, the hsdividers are now named
regm_dispc and regm_dsi instead of regm3 and regm4.

Functions and macros named on the basis of these clock names have also been
made generic.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:27 +02:00
Archit Taneja 067a57e48e OMAP2PLUS: DSS2: Use dss features to get clock source names of current OMAP
Clock source names vary across OMAP2/3 and OMAP4, the clock source enum
names have been made generic in the driver, but for purposes of debugging
and dumping clock sources, it is better to preserve the actual TRM name of
the clock.

Introduce a dss feature function 'dss_feat_get_clk_source_name()' which
returns a string with the TRM clock name for the current OMAP in use. The OMAP
specific name is printed along the generic name within brackets.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:27 +02:00
Archit Taneja 88134fa138 OMAP2PLUS: DSS2: Make members of dss_clk_source generic
The enum members of 'dss_clk_source' have clock source names specific to
OMAP2/3. Change the names to more generic terms such that they now describe
where the clocks come from and what they are used for.

Also, change the enum member names to have "DSS_CLK_SRC" instead of "DSS_SRC"
for more clarity.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:27 +02:00
Archit Taneja 819d807c59 OMAP2PLUS: DSS2: FEATURES: Function to Provide the max fck supported
The maximum supported frequency for DSS has increased from 173 to 186 Mhz on
OMAP4.

Introduce a dss feature function to get the max_fck to replace DISPC_MAX_FCK
macro.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:27 +02:00
Archit Taneja 87a7484b6a OMAP2PLUS: DSS2: FEATURES: DISPC overlay code cleanup
Add dss_features and register fields to incorporate changes in DISPC pipelines
between OMAP3 and OMAP4.

Register fields added: FEAT_REG_HORIZONTALACCU, FEAT_REG_VERTICALACCU
DSS Features added: FEAT_LINEBUFFERSPLIT, FEAT_ROWREPEATENABLE, FEAT_RESIZECONF

_dispc_set_scaling() and _dispc_set_rotation_attrs() have been cleaned up.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:26 +02:00
Semwal, Sumit a1a0dccaea OMAP2PLUS:DSS2: Use opt_clock_available from pdata
hwmod databases provide information about which optional clocks are available
for a given platform. This is available via a function pointer opt_clock_enable
in pdata.

Use this information during get/enable/disable/put of clocks.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:26 +02:00
Tomi Valkeinen 4b6b7fa2d3 OMAP: DSS2: DSI: remove unused function
dsi_reset_tx_fifo() was not used. Furthermore, OMAP errata states that
TX FIFO flush is not functional, so the function wouldn't even have
worked.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:26 +02:00
Tomi Valkeinen 4a0ab8df3e OMAP: DSS2: Remove unused list
There was an unused list defined in display.c. Remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:25 +02:00
Tomi Valkeinen 6ec549e50b OMAP: DSS2: Check for SDI HW before accessing SDI registers
Only OMAP 3430 hardware has SDI support. The availability of SDI HW can
be found out by checking if the LCD channel supports SDI displays.

This patch checks for SDI HW support before accessing SDI registers,
which fixes a crash on OMAP4 when SDI SW support is compiled in.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:25 +02:00
Tomi Valkeinen f8df01f1a4 OMAP: DSS2: FEATURES: Remove DSI & SDI from OMAP2
OMAP2 doesn't support SDI or DSI. Remove them from
omap2_dss_supported_displays.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:25 +02:00
Tomi Valkeinen 4e777dd765 OMAP: DSS2: FEATURES: Remove SDI from 3630 displays
OMAP 3630 does not support SDI. Split omap3_dss_supported_displays into
3430 and 3630 entries, and remove the SDI from 3630 entry.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:25 +02:00
Tomi Valkeinen e528e3a8b4 OMAP: DSS2: Clean up a switch-case
Support for the display interface was checked in a separate switch-case.
There's no reason for that, and this patch handles the fail code path in
the same switch-case where the display initialization is done.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:24 +02:00
archit taneja affe360d13 OMAP: DSS2: Have separate irq handlers for DISPC and DSI
Currently, the core DSS platform device requests for an irq line for OMAP2 and
OMAP3. Make DISPC and DSI platform devices request for a shared IRQ line.

On OMAP3, the logical OR of DSI and DISPC interrupt lines goes to the MPU. There
is a register DSS_IRQSTATUS which tells if the interrupt came from DISPC or DSI.

On OMAP2, there is no DSI, only DISPC interrupts goto the MPU. There is no
DSS_IRQSTATUS register.

Hence, it makes more sense to have separate irq handlers corresponding to the
DSS sub modules instead of having a common handler.

Since on OMAP3 the logical OR of the lines goes to MPU, the irq line is shared
among the IRQ handlers.

The hwmod irq info has been removed for DSS to DISPC and DSI for OMAP2 and OMAP3
hwmod databases. The Probes of DISPC and DSI now request for irq handlers.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:24 +02:00
Janorkar, Mayuresh 371e208144 OMAPFB: Adding a check for timings in set_def_mode
When omapfb.mode is passed through bootargs, when omapfb is setting mode,
it would check if timings passed are fine for panel attached to it.
It makes use of check_timing API provided by the panel.

In current code if check_timing API is not available for attached panel,
OMAPFB would return -EINVAL and BPP sent via bootargs will not have any effect.

In case of panels like TAAL panel, omapfb or any other driver should not be allowed to
change the timings. So bpps sent via bootargs will not have an effect.

In such case we can check only the x_res and y_res with the panels resolution
and if they match go ahead and set the bpps.
The bpp value sent via bootarg would have an effect.

Signed-off-by: Mayuresh Janorkar <mayur@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:23 +02:00
Tomi Valkeinen 09dc89cb31 OMAP: DSS2: Support for Samsung LTE430WQ-F0C
Add support for Samsung LTE430WQ-F0C to panel-generic-dpi.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:23 +02:00
Tomi Valkeinen 5f42f2ce63 OMAP: DSS2: Delay regulator_get() calls
DSS submodules DPI/SDI/DSI/VENC require a regulator to function.
However, if the board doesn't use, say, SDI, the board shouldn't need to
configure vdds_sdi regulator required by the SDI module.

Currently the regulators are acquired when the DSS driver is loaded.
This means that if the kernel is configured with SDI, vdds_sdi regulator
is needed for all boards.

This patch changes the DSS driver to acquire the regulators only when a
display of particular type is initialized. For example, vdds_sdi is
acquired when sdi_init_display() is called.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:23 +02:00
Jani Nikula ac425ed5fb OMAP: DSS2: Fix def_disp module param description
MODULE_PARM_DESC() takes the name of the actual module parameter, not the
name of the variable, as input. Fix the module parameter description for
def_disp.

Signed-off-by: Jani Nikula <jani@nikula.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:23 +02:00
Mayuresh Janorkar 3f3aa06c46 OMAP2PLUS: DSS2: Add OMAP4 Kconfig support
Enable DSS2 and OMAPFB for OMAP4 in Kconfig

Signed-off-by: Mayuresh Janorkar <mayur@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:22 +02:00
Archit Taneja c7642f67e5 OMAP2PLUS: DSS2: Generalize external clock names in struct dss of dss.c
The dss struct in dss.c has omap2/3 specific clock names. Making them generic,
to increase readability and extendability.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:22 +02:00
Archit Taneja 6af9cd1431 OMAP2PLUS: DSS2: Generalize naming of PRCM related clock enums in DSS driver
enum dss_clock structure is replaced with generic names that
could be used across OMAP2420, 2430, 3xxx, 44xx platforms.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:22 +02:00
Sumit Semwal 872462cdfc OMAP2PLUS: clocks: Align DSS clock names and roles
Currently, clock database has <dev, clock-name> tuples for DSS2. Because of
this, the clock names are different across different OMAP platforms.

This patch aligns the DSS2 clock names and roles across OMAP 2420, 2430, 3xxx,
44xx platforms in the clock databases, hwmod databases for opt-clocks, and DSS
clock handling.

This ensures that clk_get/put/enable/disable APIs in DSS can use uniform role
names.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:22 +02:00
Senthilvadivu Guruswamy ef631f8250 OMAP2,3: DSS2: Get DSS IRQ from platform device
DSS IRQ number can be obtained from platform_get_irq().  This API in turn
picks the right IRQ number belonging to HW IP from the hwmod database.
So hardcoding of IRQ number could be removed.

This IRQ is stored in dss_irq as part of dss structure, and freed it in
dss_exit().

Reviewed-by: Paul Walmsley <paul@pwsan.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:21 +02:00
Senthilvadivu Guruswamy ea9da36a30 OMAP2,3: DSS2: Use platform device to get baseaddr
DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from platform_get_resource().
This API in turn picks the right silicon baseaddr from the hwmod database.
So hardcoding of base addr could be removed.

Reviewed-by: Paul Walmsley <paul@pwsan.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:21 +02:00
Sumit Semwal a06b62f800 OMAP2,3: DSS2: replace printk with dev_dbg in init
This patch replaces printk's in the init/probe functions to dev_dbg
for boot time optimization.

Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:21 +02:00
Senthilvadivu Guruswamy c8aac01b7b OMAP2, 3: DSS2: DSI: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DSI is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, vdds_dsi regulator handling is copied to dsi.c, since vdds_dsi regulator is
needed by dpi_init() too. Board files are updated accordingly to add 2 instances of
vdds_dsi regulator.

DSI platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:21 +02:00
Senthilvadivu Guruswamy 30ea50c9f5 OMAP2, 3: DSS2: VENC: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for VENC is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

Also, venc_vdda_dac reading is moved to venc.c.

VENC platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:20 +02:00
Senthilvadivu Guruswamy 060b6d9cba OMAP2, 3: DSS2: DISPC: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for DISPC is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DISPC platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:20 +02:00
Senthilvadivu Guruswamy 3448d500f7 OMAP2, 3: DSS2: RFBI: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver for RFBI is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

RFBI platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:20 +02:00
Senthilvadivu Guruswamy 8b9cb3a8f3 OMAP2, 3: DSS2: Move clocks from core driver to dss driver
All clock management is moved to dss platform driver. clk_get/put APIs use
dss device instead of core platform device.

Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So the device name is changed from omapdss to omapdss_dss in 2420, 2430,
3xxx clock database files. Now the core driver "omapdss" only takes care
of panel registration with the custom bus.
core driver also uses the clk_enable() / clk_disable() APIs exposed by DSS for
clock management.
DSS driver would do clock management of clocks needed by DISPC, RFBI, DSI, VENC

TODO:  The clock content would be adapted to omap_hwmod in a seperate series.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:19 +02:00
Senthilvadivu Guruswamy 96c401bcb8 OMAP2, 3: DSS2: DSS: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver.
So a platform_driver of DSS is created and init exit methods are moved from core.c
to its driver probe,remove. pdev member has to be maintained by its own drivers.

DSS platform driver is registered from inside omap_dss_probe, in the order desired.

Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:19 +02:00
Sumit Semwal 8ba775ca0d OMAP2, 3: DSS2: remove forced clk-disable from omap_dss_remove
As part of omap hwmod changes, DSS will not be the only controller of its
clocks. hwmod initialization also enables the interface clocks, and
manages them.
So, when DSS is built as a module, omap_dss_remove doesn't try to disable
all clocks that have a higher usecount.

Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-03-11 15:46:19 +02:00
Linus Torvalds d33a6291c1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6: (29 commits)
  video: move SH_MIPI_DSI/SH_LCD_MIPI_DSI to the top of menu
  fbdev: Implement simple blanking in pseudocolor modes for vt8500lcdfb
  video: imx: Update the manufacturer's name
  nuc900fb: don't treat NULL clk as an error
  s3c2410fb: don't treat NULL clk as an error
  video: tidy up modedb formatting.
  video: matroxfb: Correct video option in comments and kernel config help.
  fbdev: sh_mobile_hdmi: simplify pointer handling
  fbdev: sh_mobile_hdmi: framebuffer notifiers have to be registered
  fbdev: sh_mobile_hdmi: add command line option to use the preferred EDID mode
  OMAP: DSS2: Introduce omap_channel as an omap_dss_device parameter, add new overlay manager.
  OMAP: DSS2: Use dss_features to handle DISPC bits removed on OMAP4
  OMAP: DSS2: LCD2 Channel Changes for DISPC
  OMAP: DSS2: Change remaining DISPC functions for new omap_channel argument
  OMAP: DSS2: Introduce omap_channel argument to DISPC functions used by interface drivers
  OMAP: DSS2: Represent DISPC register defines with channel as parameter
  OMAP: DSS2: Add dss_features for omap4 and overlay manager related features
  OMAP: DSS2: Clean up DISPC color mode validation checks
  OMAP: DSS2: Add back authors of panel-generic.c based drivers
  OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers
  ...
2011-01-13 10:39:14 -08:00
Sumit Semwal 18faa1b68a OMAP: DSS2: Introduce omap_channel as an omap_dss_device parameter, add new overlay manager.
A panel connects to one of the overlay managers of DSS through some interface block.
On OMAP4, specifying the type of the display is not sufficient to conclude which manager
the panel should be connected to.
Hence, a new member 'channel' is introduced in omap_dss_device structure to determine
which manager the panel uses. The dss_recheck_connections() called in dss_driver_probe()
uses this channel parameter to set the correct manager to the corresponding omap_dss_device.

The channel parameter is used only once to ensure the correct managers are set for each
panel. The parameter dssdev->manager->id will take care of ensuring that the panel and
then the interface driver configures the correct DISPC channel.

Also, add a new Overlay Manager in manager.c, make other changes needed for LCD2 channel.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Mukund Mittal <mmittal@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
2011-01-10 11:36:51 +02:00
Archit Taneja 6ced40bfc0 OMAP: DSS2: Use dss_features to handle DISPC bits removed on OMAP4
DISPC_CONFIG bits LCDENABLEPOL, LCDENABLESIGNAL, PCKFREEENABLE and FUNCGATED
have been removed from OMAP4, use dss_features to handle them correctly.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
2011-01-10 11:36:50 +02:00