OMAP2: generic Android display configuration setup

Added android_display methods to allow runtime configuration of
Android display resources, such as:

- FB0's vram is dynamically calculated from the number of
  buffers SGX requires in VRAM (swap chain and/or composition
  buffers), and the FB0 display size.
- OMAP VRAM is calculated from FB0's vram need + any other
  specified FB's vram.  (If command line is used to specify
  FB vrams, omap vram must also be specified.)
- TILER1D area reserved for use as DSS MMU by DSSCOMP is
  calculated from default display size.  It can be overriden
  by board file.
- TILER2D carveout size is reduced by TILER1D area (if coallocated
  with TILER2D) and by the TILER2D SGX buffers (swapchain and/or
  composition buffers)
- nonsecure TILER2D carveout size is set to the backpages needed
  by TILER2D SGX buffers.

All of this is coordinated by omap_android_display_setup.  It
takes pointers to the DSS board info, FB platform data, and
optionally to the ION, SGX and DSSCOMP platform data.  It should
be called in board_reserve before omap_ion_init.

If SGX data is provided, it is set as the SGX platform data for
FB0.  Similarly, if DSSCOMP platform data is provided it is
also set.  This can be used to set a preferred tiler1d slot size.
If ION platform data is provided, it is updated with the required
tiler2d carveout sizes.

NOTE:

To maximize TILER2D space, the TILER1D area reserved for android
display is not aligned to 1MB, but is aligned to 32 pages as the
smallest 2D allocation needs a 32-page band.  We further reduce
TILER2D space by the container space lost by the SGX buffers,
which may be larger than the actual backpages bneeded for the
SGX buffers.

Therefore the sum of secure + nonsecure + 1D tiler space may
be smaller than the available container space.

Ported to latest SGX DDK by Dima Svetlov.

Change-Id: I5d8858c38efd842452994e3a3476463083d200d7
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
plat-omap: android-display: Set min number of vram buffers

Omapfb requires at least one vram buffer

Change-Id: I7d719856e3360314f8bccfba8fcbd3b518496b8b
Signed-off-by: Peter Nordström <nordstrom@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
OMAP5: sevm: Make panel configuration dynamic

Enable support for multiple panels, and make the selection of
panel settings dynamic based on kernel boot argument
ompadss.board_id. FB ram size should not be specified since
it is being calculated.

Change-Id: Ifb2404412a21d92718817863b9af8cd2e7af9335
Signed-off-by: Peter Nordström <nordstrom@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
OMAP5: Add platform data to support HDMI default display

Adding new platform data to support HDMI default display feature.
HDMI platform data is selected if HDMI is selected as default
display in boot args.

Change-Id: I4da26797a654972eb61ba5f2cb98968906d29551
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
OMAPFB: Select correct VSYNC IRQ based on DSS channel

Select correct VSYNC IRQ for asynchronous vsync notification
based on the DSS channel.
Current VSYNC notification supports only primary LCD panel.
To support VSYNC notification for default HDMI display this
patch adds the VSYNC IRQ selection based on the DSS channel
for default display.

Change-Id: I0594e80d4b4850c278e6bdd3b07c0cb63488be39
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
OAMP2: support querying default display from early params

Add support for querying default display from early params
Android display will parse the boot arg omapdss.def_disp.

Change-Id: I74b3d44b3336981824e246ef6b2cc1af1ff6305c
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
HACK:OMAPDSS:Restart LCD_EN in case GO bit reset timeout triggers

Incase of UFPSR not coming back to HFUISR, switch OFF & ON the LCD_EN
bit, so that if DISPC has gone to a HALT state, will be re-configured back.

This patch is a WA for this issue & the actual fix to be root-caused on why
the DISPC has been halted even after enabling LCD_EN bit.

Change-Id: I5fa9144f731734957be985dc8858733b3de31924
Signed-off-by: Sreenidhi Koti <sreenidhi@ti.com>
ARM:android_omap: Remove remote control flag

Remove the RC_CORE Flag as we do not need this flag for
IR.

Change-Id: I7d1d363f2a7443cf1df3eef437e53e8dfbb55dab
Signed-off-by: Dan Murphy <dmurphy@ti.com>
qtouch: Remove logging fodder from boot

Remove the qtouch logging fodder upon touch screen initialization.

Change-Id: I3e558ca3082456c2f5921a8aa05b9ca8bc9412ac
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Revert "ARM:android_omap: Remove remote control flag"

This reverts commit 2f11ac1765be6f10c8d69a48e21cecd5258859f4.
This is wrong.  When doing the original code I missed the space
between the # and the CONFIG_RC_CORE which effectively made the config
option not recongnized.

Reverting this patch for the correct patch

Change-Id: I6c1132e739ce9f9b28769c3b5f5ab03d6d210962
Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
ARM:android_omap: Remove remote control flag

Unset the RC_CORE Flag as we do not need this flag for
IR.  Nor do we use Remote controls.

Change-Id: I4a160d05b383cfc56ed6ed4abbd50321af36319c
Signed-off-by: Dan Murphy <dmurphy@ti.com>
omap4: SDP/Tablet44xx: Remove twl6040 base IRQ

twl6040 IRQs are now allocated dynamically, no need to pass base IRQ
from board files anymore.

Change-Id: I8d4a98f442d25af69de895b186f3ef89ff859916
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
omap4: SDP/Tablet44xx: Set pin mux for twl6040 interrupt

Configure pin mux for sys_nirq2 pin, which is connected to twl6040
interrupt (NAUDINT). All analog audio IC events (power-up, headset
insertion/removal, handsfree overcurrent, etc) are reported through
this interrupt line.

Change-Id: I3cc8494110c3d8aa8d58ca6e916faa1f23b3d02c
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  omap4: SDP/Tablet44xx: Set pin mux for twl6040 interrupt
  omap4: SDP/Tablet44xx: Remove twl6040 base IRQ
OMAP5: Fix Section mismatch errors on vram setup

Fix section mismatch errors on vram setup

WARNING: vmlinux.o(.text+0x39448): Section mismatch in reference from the function omap_android_display_setup() to the function .init.text:omap_vram_set_sdram_vram()
The function omap_android_display_setup() references
the function __init omap_vram_set_sdram_vram().
This is often because omap_android_display_setup lacks a __init
annotation or the annotation of omap_vram_set_sdram_vram is wrong.

Change-Id: Iccbc0a5f13bee309bb85c78efff0ba7b49f29716
Signed-off-by: Dan Murphy <dmurphy@ti.com>
MFD: twl6040: PDM_UL errata

When twl6040 enters into Sleep/Deep-Sleep mode, the value of PDMUP could be
at logic 1 (VDDVIO) state. In this state, the pulldown resistor on OMAP side
results in a current drain.

Since the logic 1 reset value cannot be modified on the TWL6040, the solution
to stop the current drain is to disable the pulldown resistor on the input of
the PDM buffer of OMAP.

Since the suggested workaround is not in twl6040 side, but in McPDM pin mux
side, the actual implementation of the workaround is not in twl6040 MFD itself.

Change-Id: If375a32f01fe2dbe116cefcccafb8cc818747308
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
rpmsg: omaprpc: fix locking mutex twice

Fix calling mutex_lock twice.

Change-Id: I687c2785a6ffc00428bc3975a9bd637df36de8b0
Signed-off-by: Alberto Aguirre <a-aguirre@ti.com>
rpmsg: omaprpc: fix omaprpc_release hang

omaprpc_release can hang due to an uninterruptible
wait for an ack from the remote core.

Change wait to be interruptible.

Change-Id: Iaf449119b5525db131c536434c84ea296f6e8a95
Signed-off-by: Alberto Aguirre <a-aguirre@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  rpmsg: omaprpc: fix omaprpc_release hang
  rpmsg: omaprpc: fix locking mutex twice
  MFD: twl6040: PDM_UL errata
USB: Gadget: MTP: Fix functionality break for USB3 mode

The following commit, introduced a functionality break
for MTP in USB3 mode.

8ccc99b8f901bfeb11373fa9358dd6b5503b82e0
USB: gadget: f_mtp: fix send ZLP packet algorithm.

This patch fixes the issue and uses the right descriptors
for Susper Speed (USB3) mode.

Change-Id: Ic4cc1660b6dbaca2bca3cd811bf13f460c75606c
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>