summaryrefslogtreecommitdiff
path: root/drivers/video
AgeCommit message (Collapse)Author
2011-09-30OMAPDSS: Taal: remove external backlight supportTomi Valkeinen
Taal panel driver supports two kinds of backlight control: 1) using DSI commands sent to the panel to control the backlight, 2) calling function pointers going to the board file to control the backlight. The second option is a bit hacky, and will no longer be needed when the PWM driver supports the backlight features. After that we can use the standard PWM backlight driver. This patch removes the second backlight control mechanism, and adds a boolean field, use_dsi_backlight, to nokia_dsi_panel_data which the board file can use to inform whether the panel driver should use DSI commands to control the backlight. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: FEATURES: Create a range param to get max downscalingArchit Taneja
Create a dss_range_param member called FEAT_PARAM_DOWNSCALE to get the maximum downscaling possible on the current platform. Use this in dispc_ovl_calc_scaling(). Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: DISPC: Clean up scaling related clock and five tap calculationsArchit Taneja
Move DISPC scaling related code from dispc_ovl_setup() to a new function dispc_ovl_calc_scaling(). Use overlay caps to check if the overlay can scale or not. No functional changes are made. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: DISPC: Remove hardcoded use of PPL in five tap clock calculationArchit Taneja
The function calc_fclk_five_taps() uses a fixed value of pixels per line which is used in calculations to get the minimum fclk needed for scaling with five taps to work. Remove this by providing the width of the panel connected to the manager. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: DISPC: Get correct pixel clock for TV managerArchit Taneja
dispc_mgr_pclk_rate() is used to calculate minimum required functional clock for scaling in calc_fclk() and calc_fclk_five_taps(). This function returns the correct pixel clock for LCD and LCD2 managers, but not for TV manager. Extend this function so that it gets the correct pixel clock for TV manager. This also prevents the crash we get when we try to scale overlays connected to TV manager. The current code leads to a BUG() being executed if we call dispc_mgr_pclk_rate() for the TV manager. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: DISPC: Create helper function dispc_mgr_is_lcd()Archit Taneja
Create a helper function called dispc_mgr_is_lcd() which returns true if the manager is LCD or LCD2. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: DISPC: Pass overlay params as arguments to dispc_ovl_setup()Archit Taneja
dispc_ovl_enable_replication() and dispc_ovl_set_fifo_threshold() are currently called in configure_overlay(). These are the only functions which cause DISPC register writes of overlay parameters outside of dispc_ovl_setup(). Move these to dispc_ovl_setup() and pass replication, fifo_low and fifo_high thresholds as arguments to dispc_ovl_setup() in order to be aligned with other overlay parameters. No functional changes are made. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPDSS: DISPC: Reduce the number of arguments in dispc_ovl_setup()Archit Taneja
dispc_ovl_setup() currently takes a large number of overlay arguments, most of these are members of the overlay_info struct. Replace these arguments by passing a overlay_info pointer instead. In configure_overlay(), we create an overlay_info struct called new_oi, this is a copy of the overlay cache's overlay_info member. Update the new_oi parameters which could have been possibly changed in configure_overlay(). Pass its pointer pointer to dispc_ovl_setup(). Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAPFB: find best mode from edidTomi Valkeinen
Use the new read_edid() function to get EDID information from the display (when available), and use the information to use a suitable mode at initialization time. Hot-plug is not yet supported, so the timings selected at init time will stay even if the monitor would be changed. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAP: DSS2: panel-generic-dpi: remove "generic" panelTomi Valkeinen
Remove the "generic" panel config entry, which is not used. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAP: DSS2: add panel-dvi driverTomi Valkeinen
We have currently panel-generic-dpi driver, which is a combined driver for dummy panels and also for DVI output. The aim is to split the panel-generic-dpi into two, one for fixed size dummy panels connected via DPI, and the other (this) for variable resolution output which supports DDC channel (in practice a DVI framer chip connected to DPI output). Original i2c code by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAP: DSS2: HDMI: implement detect()Tomi Valkeinen
Implement detect() by checking the hot plug detect status. The implementation is not very good, as it always turns on the HDMI output to get the detection working. HDMI driver needs improvements so that we could enable only core parts of it. Cc: Mythri P K <mythripk@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAP: DSS2: HDMI: remove error prints in check_timingsTomi Valkeinen
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-30OMAP: DSS2: HDMI: clean up edid reading & fix checksumTomi Valkeinen
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-30OMAP: DSS2: HDMI: split hdmi_core_ddc_edidTomi Valkeinen
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-30OMAP: DSS2: HDMI: remove edid parsingTomi Valkeinen
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-30OMAP: DSS2: HDMI: implement read_edid()Tomi Valkeinen
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-30OMAP: DSS2: HDMI: make set_timing sanerTomi Valkeinen
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-30OMAP: DSS2: HDMI: improve hdmi output enableTomi Valkeinen
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-30OMAP: DSS2: DISPC: improve dispc_mgr_enable_digit_out()Tomi Valkeinen
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-30OMAP: DSS2: add dss_get_hdmi_venc_clk_source()Tomi Valkeinen
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-30OMAP: DSS2: HDMI: change regn definitionTomi Valkeinen
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-30OMAP: DSS2: HDMI: use default dividersTomi Valkeinen
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-30OMAP: DSS2: DISPC: Fix minimum PCD valueTomi Valkeinen
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-30OMAP4: DSS2: Rename hdmi_omap4_panel.c to hdmi_panel.cMythri P K
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-30OMAP4: DSS2: HDMI: Function pointer approach to callMythri P K
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-30OMAP4: DSS2: HDMI: Rename the functions in HDMI IP libraryMythri P K
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-30OMAP4: DSS2: HDMI: Move the HDMI IP dependent audioMythri P K
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-30OMAP4: DSS2: HDMI: Split the current HDMI driver to moveMythri P K
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-30OMAP4: DSS2: HDMI: Move the EDID definition from HDMIMythri P K
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-30OMAP4: DSS2: HDMI: Move HDMI IP independent generic headerMythri P K
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-30OMAP4: DSS2: HDMI: Use specific HDMI timings structureMythri P K
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-30OMAP4: DSS2: HDMI: Move pll and video configurationMythri P K
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-30OMAP4: DSS2: HDMI: HDMI clean up to pass base_addressMythri P K
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-30OMAP: DSS2: DSI Video mode supportArchit Taneja
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-30OMAP: DSS2: DSI: Send zero length packet in dsi_vc_send_null()Archit Taneja
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-30OMAP: DSS2: Create an enum for DSI pixel formatsArchit Taneja
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-30OMAP: DSS2: Clean up stallmode and io pad mode selectionArchit Taneja
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-30OMAP: DSS2: DSI: Introduce generic read functionsArchit Taneja
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-30OMAP: DSS2: DSI: Split dsi_vc_dcs_read() into 2 functionsArchit Taneja
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-30OMAP: DSS2: DSI: Remove functions dsi_vc_dcs_read_1() and dsi_vc_dcs_read_2()Archit Taneja
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-30OMAP: DSS2: DSI: Introduce generic write functionsArchit Taneja
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-30OMAP: DSS2: Create enum for DSI operation modesArchit Taneja
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-30OMAP: DSS2: DSI: Represent L4 and VP as sources of VC instead of modesArchit Taneja
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-30OMAP: DSS2: Use MIPI DSI enums from include/video/mipi_display.hArchit Taneja
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-30OMAP: DSS2: Support for Innolux AT070TN83Thomas Weber
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-30OMAP: DSS2: reorganize functions in dss.hTomi Valkeinen
Group dispc's overlay and manager related functions. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2011-09-30OMAP: DSS2: DISPC: rename manager related funcsTomi Valkeinen
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-30OMAP: DSS2: DISPC: rename overlay related funcsTomi Valkeinen
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-30OMAP: DSS2: DISPC: remove non-existing func prototypesTomi Valkeinen
The functions do not exist, so remove the prototypes. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>