summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss/dsi.c
AgeCommit message (Collapse)Author
2014-04-07Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12Scott Wood
2013-10-30video: Remove unnecessary semicolonsJoe Perches
These aren't necessary after switch, for, and if blocks. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-10-29OMAPDSS: DSI: fix perf measuring ifdefsTomi Valkeinen
DSI performance measuring code is meant to be explicitly enabled at compile time. At some point in time the perf code was changed to be enabled if DEBUG is defined. This is not right, so this patch fixes it. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-08-30OMAPDSS: rename omap_dss_device's 'device' field to 'dst'Tomi Valkeinen
In the old panel device model we had omap_dss_output entities, representing the encoders in the DSS block. This entity had "device" field, which pointed to the panel that was using the omap_dss_output. With the new panel device model, the omap_dss_output is integrated into omap_dss_device, which now represents a "display entity". Thus the "device" field, now in omap_dss_device, points to the next entity in the display entity-chain. This patch renames the "device" field to "dst", which much better tells what the field points to. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-29OMAPDSS: DSI: remove code related to old panel modelTomi Valkeinen
Now that the old panel drivers have been removed, we can remove the old-model API and related code from the DSS encoder drivers. This patch removes the code from the DSI driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-06-17OMAPDSS: DSI: Add opsTomi Valkeinen
Add "ops" style method for using DSI functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17OMAPDSS: public omapdss_register_output()Tomi Valkeinen
In order to allow multiple display block in a video pipeline, we need to give the drivers way to register themselves. For now we have the omapdss_register_display() which is used to register panels, and dss_register_output() which is used to register DSS encoders. This patch makes dss_register_output() public (with the name of omapdss_register_output), which can be used to register also external encoders. The distinction between register_output and register_display is that a "display" is an entity at the end of the videopipeline, and "output" is something inside the pipeline. The registration and naming will be made saner in the future, but the current names and functions are kept to minimize changes during the dss device model transition. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17OMAPDSS: add THIS_MODULE owner to DSS outputsTomi Valkeinen
Setup the owner field for DSS output's omap_dss_device so that module refcounting works. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17OMAPDSS: combine omap_dss_output into omap_dss_deviceTomi Valkeinen
We currently have omap_dss_device, which represents an external display device, sometimes an external encoder, sometimes a panel. Then we have omap_dss_output, which represents DSS's output encoder. In the future with new display device model, we construct a video pipeline from the display blocks. To accomplish this, all the blocks need to be presented by the same entity. Thus, this patch combines omap_dss_output into omap_dss_device. Some of the fields in omap_dss_output are already found in omap_dss_device, but some are not. This means we'll have DSS output specific fields in omap_dss_device, which is not very nice. However, it is easier to just keep those output specific fields there for now, and after transition to new display device model is made, they can be cleaned up easier than could be done now. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17OMAPDSS: remove omap_dss_start/stop_device()Tomi Valkeinen
The omap_dss_start_device() and omap_dss_stop_device(), called by the DSS output drivers, are old relics. They originally did something totally else, but nowadays they increase the module ref count for panels that are enabled. This model is quite broken: the panel modules may be used even before they are enabled. For example, configuring the panel requires calls to functions located in the panel modules. In the following patches we try to improve the ref count management for the modules and display devices. The first step, however, is to remove the omap_dss_start/stop_device() totally. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17OMAPDSS: DSI: cleanup regulator initTomi Valkeinen
Separate the regulator initialization code to its own function, removing duplicate code. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17OMAPDSS: only probe pdata if there's oneTomi Valkeinen
omapdss output drivers always read the platform data. This crashes when there's no platform data when using DT. Add a check to read the platform data only if it exists. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-05-02OMAPDSS: DSI: Add error handling for dsi_probe_pdataTomi Valkeinen
Add proper error handling for dsi_probe_pdata(). This will cause EPROBE_DEFER to be properly passed upwards, causing the DSI driver to be probed again later if a resource was missing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-05-02OMAPDSS: DSI: use platform_driver_register()Tomi Valkeinen
Use platform_driver_register() instead of platform_driver_probe() so that we can support EPROBE_DEFER. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-15OMAPDSS: Merge omapdss topic branchesTomi Valkeinen
2013-04-10OMAPDSS: DSI: Use devm_clk_get()Sachin Kamat
Using devm_clk_get cleans up some code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: remove unused old clock calculation codeTomi Valkeinen
Now that the old clock calculation code is no longer used, we can remove it from the driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: use new clock calculation codeTomi Valkeinen
Use the new clock calculation code in the DSI driver. The new code does not need DSI video mode parameters from the panel driver, like the old code does. Instead the new code is given the normal video timings, and a few DSI parameters, which are used to create DSI video timings. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: add new clock calculation codeTomi Valkeinen
Add new way to iterate over DSI PLL and HSDIV clock divisors. dsi_pll_calc() and dss_hsdiv_calc() provide a generic way to go over all the divisors, within given clock range. The functions will call a callback function for each divider set, making the function reusable for all use cases. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI remove unneeded clk source setup codeTomi Valkeinen
We always use the same clock sources for DSI, so let's remove the unnecessary clock source fields from dsi_data. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: add enum omap_dss_dsi_trans_modeTomi Valkeinen
Instead of managing DSI sync ends with booleans, add an enum for the DSI transfer mode. This is much cleaner way to handle the DSI syncs. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: get line buffer size at probeTomi Valkeinen
To find out the DSI line buffer size we need to read HW registers. To make it possible to do DSI configuration calculations without HW powered up, store the line buffer size at DSI driver's probe. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: simplify dsi configurationTomi Valkeinen
We have a bunch of dsi functions that are used to do the basic configuration for DSI. To simplify things, and to make sure we have all the necessary information, create a single dsi config function, which does the basic configuration. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: fix wrong unsigned long long useTomi Valkeinen
dsi_configure_dispc_clocks() stores dsi func clock into unsigned long long, but it should really be just unsigned long. Fix this. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03OMAPDSS: DSI: fix DSI channel source initializationTomi Valkeinen
During the initialization of the DSI protocol registers, we always set the sources of all DSI channels to L4. However, we don't update the value in the dsi_data, so we may end up with a different value in the register and in the dsi_data, leading to DSI problems. This patch fixes the issue by initializing also the channel source in the dsi_data. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03OMAPDSS: DSI: delay dispc initializationTomi Valkeinen
We currently setup both DSI and DISPC related things when the DSI bus is enabled. There's no need for DISPC related thing at that point, though, but only later when the video output is enabled. To make it possible to use the DSI bus before DISPC overlay manager is selected, this patch moves DSI's DISPC initialization to dsi_enable_video_output(), from omapdss_dsi_display_enable(). We also move the selection of DISPC's LCD clock to dsi_enable_video_output. This way there are no DISPC dependencies until the video output is enabled. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03OMAPDSS: add output->dispc_channelTomi Valkeinen
The DISPC channel used for each output is currently passed in panel platform data from the board files. To simplify this, and to make the panel drivers less dependent on OMAP, this patch changes omapdss to resolve the channel independently. The channel is resolved based on the OMAP version and, in case of DSI, the DSI module id. This resolved channel is stored into a new field in output, dispc_channel. The few places where dssdev->channel was used are changed to use output->recommended_channel. After this patch, dssdev->channel is obsolete. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03OMAPDSS: add output->nameTomi Valkeinen
Add name field to omapdss's outputs so that in the following patches panels refer to the output by their name. The name also helps debugging. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03OMAPDSS: DSI: remove omap_dss_device usesTomi Valkeinen
The role of struct omap_dss_device will change in the future. The exact details of that are still a bit unclear. However, the less uses of omap_dss_device we have, the easier the change is in the future. This patch removes uses of omap_dss_device from dsi.c, where it can be done easily. Mostly this means passing dsi platform device to functions, instead of the omap_dss_device. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03OMAPDSS: DSI: remove DSI & DISPC clk divisors from dssdevTomi Valkeinen
struct omap_dss_device contains DSS clock divisors. The idea is that the board file can pass precalculated divisors to the display driver. However, these divsors are no longer needed, as the omapdss driver can calculate the divisors during runtime. This patch removes the divisors from omap_dss_device, and their uses from the dsi driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
2012-12-07OMAPDSS: manage framedone irq with mgr opsTomi Valkeinen
Some of the output drivers need to handle FRAMEDONE interrupt from DISPC. This creates a direct dependency to dispc code, and we need to avoid this to make the compat code to work. Instead of the output drivers registering for dispc interrupts, we create new mgr-ops that are used to register a framedone handler. The code implementing the mgr-ops is responsible for calling the handler when DISPC FRAMEDONE interrupt happens. The compat layer is improved accordingly to do the call to the framedone handler. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-12-07OMAPDSS: manage output-dssdev connection in output driversTomi Valkeinen
We currently attach an output to a dssdev in the initialization code for dssdevices in display.c. This works, but doesn't quite make sense: an output entity represents (surprisingly) an output of DSS, which is managed by an output driver. The output driver also handles adding new dssdev's for that particular output. It makes more sense to make the output-dssdev connection in the output driver. This is also in line with common display framework. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-07OMAPDSS: HACK: look for regulators with omap4 namesTomi Valkeinen
Normally the omapdss driver gets the regulators using the regulator names assigned for omapdss. However, in an effort to get a minimal DSS support for DT enabled kernel on selected boards, we will add omapdss devices and platform data the old way even for DT kernel. This causes the problem that omapdss cannot find the regulators using omapdss's regulator names. This patch creates a temporary workaround for DSI and HDMI by trying to get the regulators also using native OMAP4 regulator names. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05OMAPDSS: hide dss_select_dispc_clk_source()Tomi Valkeinen
dss.c currently exposes functions to configure the dispc source clock and lcd source clock. There are configured separately from the output drivers. However, there is no safe way for the output drivers to handle dispc clock, as it's shared between the outputs. Thus, if, say, the DSI driver sets up DSI PLL and configures both the dispc and lcd clock sources to that DSI PLL, the resulting dispc clock could be too low for, say, HDMI. Thus the output drivers should really only be concerned about the lcd clock, which is what the output drivers actually use. There's lot to do to clean up the dss clock handling, but this patch takes one step forward and removes the use of dss_select_dispc_clk_source() from the output drivers. After this patch, the output drivers only configure the lcd source clock. On omap4+ the dispc src clock is never changed from the default PRCM source. On omap3, where the dispc and lcd clocks are actually the same, setting the lcd clock source sets the dispc clock source. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05OMAPDSS: DSI: workaround for HSDiv problemTomi Valkeinen
It looks like on many OMAP versions powers for both HSClk and HSDiv to be enabled to have a functional HSDiv. This patch fixes the issue by forcing both powers on. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-11-05OMAPDSS: DSI: skip odd dividers when pck >= 100MHzTomi Valkeinen
The DSI PLL and HSDivider can be used to generate the pixel clock for LCD overlay manager, which then goes to DPI output. On the DPI output pin the voltage of the signal is shifted from the OMAP's internal minimal voltage to 1.8V range. The shifting is not instant, and the higher the clock frequency, the less time there is to shift the signal to nominal voltage. If the HSDivider's divider is greater than one and odd, the resulting pixel clock does not have 50% duty cycle. For example, with a divider of 3, the duty cycle is 33%. When combining high frequency (in the area of 140MHz+) and non-50% duty cycle, it has been observed the the shifter does not have enough time to shift the voltage enough, and this leads to bad signal which is rejected by monitors. As a workaround this patch makes the divider calculation skip all odd dividers when the required pixel clock is over 100MHz. The limit of 100MHz is a guesstimate. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-29OMAPDSS: export dss_get_def_display_name()Tomi Valkeinen
Export dss_get_def_display_name() with the name of omapdss_get_def_display_name() so that omapfb can use it after the next patch which moves default display handling to omapfb. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-18OMAPDSS: DSI: fix dsi_get_dsidev_from_id()Tomi Valkeinen
If dsi_get_dsidev_from_id() is called with a DSI module id that does not exist on the board, the function will crash as omap_dss_get_output() will return NULL. This happens on omap3 boards when dumping DSI clocks, as the dumping code will try to get the dsidev for DSI modules 0 and 1, but omap3 only has DSI module 0. Also clean up the id -> output mapping, so that if the function is called with invalid module ID it will return NULL. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Archit Taneja <archit@ti.com>
2012-10-16Merge tag 'v3.7-rc1'Tomi Valkeinen
Merge Linux 3.7-rc1 to get latest upstream changes.
2012-10-12OMAPDSS: Remove dss_debug variableChandrabhanu Mahapatra
All the debug prints have been replaced with pr_debug(). Thus, the dependency on dss_debug variable is replaced with dyndbg in dynamic debugging mode and DEBUG flag otherwise. So, the dss_debug variable is removed along with checks for DEBUG flag. Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Reviewed-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-12OMAPDSS: Replace multi part debug prints with pr_debugChandrabhanu Mahapatra
The various functions in dispc and dsi such as print_irq_status(), print_irq_status_vc(), print_irq_status_cio() and _dsi_print_reset_status() consist of a number of debug prints which need to be enabled all at once or none at all. So, these debug prints in corresponding functions are replaced with one dynamic debug enabled pr_debug() each. Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Reviewed-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-12OMAPDSS: Cleanup DSSDBG with dynamic pr_debug functionChandrabhanu Mahapatra
The printk in DSSDBG function definition is replaced with dynamic debug enabled pr_debug(). The use of dynamic debugging provides more flexibility as each debug statement can be enabled or disabled dynamically on basis of source filename, line number, module name etc., by writing to a control file in debugfs filesystem. For better understanding please refer to Documentation/dynamic-debug-howto.txt. The DSSDBGF() differs from DSSDBG() by providing function name. However, function name, line number, module name and thread ID can be printed through dynamic debug by setting appropriate flags 'f','l','m' and 't' in the debugfs control file. So, DSSDBGF instances are replaced with DSSDBG. Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Reviewed-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-12Merge tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6Linus Torvalds
Pull fbdev updates from Florian Tobias Schandinat: "This includes: - large updates for OMAP - basic OMAP5 DSS support for DPI and DSI outputs - large cleanups and restructuring - some update to Exynos and da8xx-fb - removal of the pnx4008 driver (arch removed) - various other small patches" Fix up some trivial conflicts (mostly just include line changes, but also some due to the renaming of the deferred work functions by Tejun). * tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6: (193 commits) gbefb: fix compile error video: mark nuc900fb_map_video_memory as __devinit video/mx3fb: set .owner to prevent module unloading while being used video: exynos_dp: use clk_prepare_enable and clk_disable_unprepare drivers/video/exynos/exynos_mipi_dsi.c: fix error return code drivers/video/savage/savagefb_driver.c: fix error return code video: s3c-fb: use clk_prepare_enable and clk_disable_unprepare da8xx-fb: save and restore LCDC context across suspend/resume cycle da8xx-fb: add pm_runtime support video/udlfb: fix line counting in fb_write OMAPDSS: add missing include for string.h OMAPDSS: DISPC: Configure color conversion coefficients for writeback OMAPDSS: DISPC: Add manager like functions for writeback OMAPDSS: DISPC: Configure writeback FIFOs OMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup() OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup OMAPDSS: DISPC: Add function to set channel in for writeback OMAPDSS: DISPC: Don't set chroma resampling bit for writeback OMAPDSS: DISPC: Downscale chroma if plane is writeback OMAPDSS: DISPC: Configure input and output sizes for writeback ...
2012-09-26OMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager referencesArchit Taneja
With addition of output entities, a device connects to an output, and an output connects to overlay manager. Replace the dssdev->manager references with dssdev->output->manager to access the manager correctly. When enabling the DSI output, check whether the output entity connected to display is not NULL. In dsi_init_display(), the display won't be connected to the DSI output yet, that happens later in dss_recheck_connections() in the panel driver's probe. Get the dsidev platform device pointer using the DSI moudle number provided in the omap_dss_device struct. Signed-off-by: Archit Taneja <archit@ti.com>
2012-09-26OMAPDSS: DSI: Remove dsi_pdev_map global structArchit Taneja
dsi_pdev_map is a struct visible globally in the DSI driver to get the platform device pointer of the DSI device corresponding to it's module ID. This was required because there was no clean way to derive the platform device from the DSI module instance number or from the connected panel. With the new output entity, it is possible to retrieve the platform device pointer if the omap_dss_output pointer is available. Modify the functions dsi_get_dsidev_from_dssdev() dsi_get_dsidev_from_id() so that they use output instead of dsi_pdev_map to retrieve the dsi platform device pointer. Signed-off-by: Archit Taneja <archit@ti.com>
2012-09-26OMAPDSS: outputs: Create and register output instancesArchit Taneja
Add output structs to output driver's private data. Register output instances by having an init function in the probes of the platform device drivers for different outputs. The *_init_output for each output registers the output and fill up the output's plaform device, type and id fields. The *_uninit_output functions unregister the output. In the probe of each interface driver, the output entities are initialized before the *_probe_pdata() functions intentionally. This is done to ensure that the output entity is prepared before the panels connected to the output are registered. We need the output entities to be ready because OMAPDSS will try to make connections between overlays, managers, outputs and devices during the panel's probe. Signed-off-by: Archit Taneja <archit@ti.com>
2012-09-26OMAPDSS: DSI: Pass dsi platform device wherever possibleArchit Taneja
Many of the DSI functions receive the connected panel's omap_dss_device pointer as an argument. The platform device pointer is then derived via omap_dss_device pointers. Most of these functions don't really require omap_dss_device pointer anymore since we now keep copies of parameters in the driver data which were previously available only via omap_dss_device. Replace the arguments with platform device pointers for such functions. Signed-off-by: Archit Taneja <archit@ti.com>
2012-09-26OMAPDSS: DSI: fix tlpx_half reg field lengthTomi Valkeinen
tlpx_half bit field in DSI_DSIPHY_CFG1 is [20,16], not [22,16] as accessed in the code currently. Fix this. The bug should not have caused any problems on OMAP3/4, as the bits 21,22 are unused. They are used on OMAP5, though. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-09-25Merge OMAP5 DSS changes to omapdssTomi Valkeinen
This series adds basic OMAP5 DSS functionality, mainly related to DSS core, DPI and DSI. * omap5-dss: OMAPDSS: DSI: make OMAP2_DSS_DSI depend on ARCH_OMAP5 OMAPDSS: DSI: Add code to disable PHY DCC OMAPDSS: DSI: Add new linebuffer size for OMAP5 OMAPDSS: DSI: Add FEAT_DSI_PLL_REFSEL OMAPDSS: DSI: Add FEAT_DSI_PLL_SELFREQDCO OMAPDSS: Add support for DPI source selection OMAPDSS: move dss feats to the end of dss.c OMAPDSS: Add basic omap5 features to dss and dispc OMAPDSS: DSI: improve DSI clock calcs for DISPC
2012-09-24OMAPDSS: DSI: Add code to disable PHY DCCTomi Valkeinen
OMAP5 DSI PHY has DCC (Duty Cycle Corrector) block, and by default DCC is enabled and thus the PLL clock is divided by 2 to get the DSI DDR clk. This divider has been 4 for all previous OMAPs, and changing it needs some reorganization of the code. The DCC can be disabled, and in that case the divider is back to the old 4. This patch adds dss feature for the DCC, and adds code to always disable the DCC. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>