TI-TFW: ondie-governor: Do not allow decrease cooling level in critical zone

To avoid device overheat do not allow reducing cooling level
in critical zone. Additionally when we reduce cooling level
reduce also critical_zone_reached count, so that next time we enter
critical zone we will apply proper cooling action for each subzone.

Change-Id: I98880c99df93b35c23c346ac69ed805b6d343653
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
USB: OTG: TWL6030: Fix VBUS/ID detection algorithm

Currently, there is the issue associated with
USB Device/Host functionality on OMAP4 SOMs.

Tablet no longer works as USB Device/Host after plugging
to it USB Device (although only enough OTG cable without
any device).

Steps to reproduce:
1. Boot Tablet.
2. Plug USB Device to Tablet via OTG cable/connector and
   check USB enumeration in minicom.
   Result - USB Device is enumerated successfully.
3. Unplug USB Device from Tablet.
4. Plug Tablet to USB Host (PC) via MicroUSB cable and
   check USB enumeration by any of shell commands:
   "adb devices", "lsusb", etc.
   Result - Tablet isn't enumerated. ADB doesn't works.
5. Unplug Tablet from USB Host.
6. Plug USB Device to Tablet again and check USB enumeration.
   Result - USB Device isn't enumerated.

This issue is in incorrect VBUS/ID detection algorithm in
the TWL6030 USB transceiver driver.

Change-Id: I7d4e15b29789a6e9ca65ad6b3763e81cd999d1d4
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
USB: OTG: TWL6032: W/A for VBUS detection interrupt lost while in OPA_MODE

The TWL6032 always miss VBUS detection interrupt while OPA_MODE
is set to 1 in the CHARGERUSB_CTRL1 register.

As W/A this patch disables BOOST mode in ID detection interrupt by
ID_FLOAT event (which occurs when a USB Device was unplugged)
and VBUS interrupt will start to work.

Change-Id: I4d6bfecba0fe8e410f18bbbc8efd8ccd637f0fb3
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
USB: OTG: TWL603X: Don't schedule set_vbus_work if this is not necessary

Now the set_vbus_work is scheduled always even if charger's
DCDC converter mode (charger or boost) no need to change.

This patch adds a check on the current charger's
DCDC converter mode and if this mode match to the required
mode then set_vbus_work is not scheduled.

Change-Id: Ia3fe4bdcc62b3d0b15241300a0ee1a929bf8bb7d
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
serial: omap: set dev->drvdata before enabling pm_runtime

by the time we call our first pm_runtme_get_sync()
after enable pm_runtime, our resume method might
be called. To avoid problems, we must make sure
that our dev->drvdata is set correctly before
our resume method gets called.

Change-Id: I622c08e665eb906f3f3d11d7bb16e067ac368c79
Tested-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[<oleksandr.tyshchenko@ti.com> - back port from main line K3.9]
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
serial: omap: Disable wakeup events after port shutdown

When the port is shutdown we disable interrupts from the port
makes no sense to keep wakeup events enabled for the port
so disable wakeup events also for the port.

Interrupts and wakeup events will be configured back on port open
from startup function.

In uart_shutdown scenarios we have seen without this
patch uart is struck in transistion.

Change-Id: I1547b22ec7155485891e3910f814a27e4acb58ae
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
[<oleksandr.tyshchenko@ti.com> - forward port from K3.0]
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
ARM: OMAP4: twl-common: Add consumer to VAUX3 regulator

This needed to make camera worked.

Change-Id: Ifad174aa6a87361c8401a8103dc7cf4117103132
Signed-off-by: Sergii Postulga <x0153364@ti.com>
MFD: TWL-CORE: Don't setup clock framework for twl603x devices

No need to call clocks_init() from twl_probe() for twl603x devices
because external HF clock is not using for them. Call it only
for twl4030.

Change-Id: I71786bfb7857963793ea3d54e170b8792fc055cc
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  MFD: TWL-CORE: Don't setup clock framework for twl603x devices
  ARM: OMAP4: twl-common: Add consumer to VAUX3 regulator
  serial: omap: Disable wakeup events after port shutdown
  serial: omap: set dev->drvdata before enabling pm_runtime
  USB: OTG: TWL603X: Don't schedule set_vbus_work if this is not necessary
  USB: OTG: TWL6032: W/A for VBUS detection interrupt lost while in OPA_MODE
  USB: OTG: TWL6030: Fix VBUS/ID detection algorithm
  TI-TFW: ondie-governor: Do not allow decrease cooling level in critical zone

Change-Id: I07a4b5631c266ad20314f19b9788c845fab07700
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
OMAPDSS: core: add early suspend support

Add early_suspend & late_resume handlers for all
displays to be suspended/resumed together with
other peripherals.

Change-Id: I7d28a8de0ee5e095524066001fe29386d5e43e80
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
OMAP4: omaplfb: remove early_suspend handling

omaplfb can handle only suspend/resume of just one display
attached to framebuffer, thus can't suspend secondary HDMI
display. Early_suspend/late_resume now handled by DSS core,
for each display without limitations, hence removing this code.

Change-Id: I3c30d618d7dfdba540920d3aac48ba96a21dc3e2
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
OMAPDSS: HDMI: track HDMI module usage

HDMI HW used by audio core & DSS separately w/o
synchronization, which causes troubles at suspend.
Tracking of whether HDMI is streaming video, audio
or both helps correctly put device into sleep.

Change-Id: Ifa7557768df413f76a8b8bb1a0b5dadd03cd4c81
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
Revert "OMAPFB: Do not suspend HDMI driver in early suspend."

This reverts commit 2c1aca96df28ae125a58db2913a2c7ea1dc5dc1d.
Suspend/resume when streaming audio case is being handled by
HDMI driver, and early suspend not handled on omaplfb anymore,
thus cleaning this code up.

Change-Id: I879433a4268243aa190613555cde0f771095d38e
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
OMAP4: board blaze: add camera regulators as rpmsg resources

The camera regulator data is board-specific and has to be
published to the rpmsg resource layer. The necessary data
is added to the OMAP4 blaze board file.

Similar to sEVM fix
commit ID : 18d8188e3392856a763a4652ea56c028feb221d7

Change-Id: Ic28223d114fb9b56372012d8ee6dd4ab7ca95326
Signed-off-by: Sergii Postulga <x0153364@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  OMAP4: board blaze: add camera regulators as rpmsg resources

Change-Id: Ibfb36319ef73ea3440c88917398c6b67f8229fad
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
OMAP4: HDCP: Add support for HDCP on OMAP4

Add support for HDCP on OMAP4

Change-Id: I7973a8f5119e486b74eca705c5a12c1fef05b50e
Signed-off-by: Victor Kleinik <x0150886@ti.com>
Signed-off-by: Sujeet Baranwal <s-baranwal@ti.com>
remoteproc: fix error path of ->find_vqs

Eliminate an erroneous invocation of rproc_shutdown inside
the error path of rproc_virtio_find_vqs.

Change-Id: I88d1a903f6c9ce697d3016ee16b062e3d6aa932f
Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
remoteproc: remove rproc_secure.h file

The rproc_secure.h file has only one exported API, and all
others are internal to the remoteproc driver. The header
by itself doesn't serve much purpose and has therefore been
removed and its contents moved into appropriate files. The
exported API is published through the normal remoteproc.h
file, and the others are moved into the remoteproc internal
header file.

Change-Id: I2e1b43d40306def57c35703250f15ff50f3e948c
Signed-off-by: Suman Anna <s-anna@ti.com>
remoteproc: add rproc_unregister_drm_service api

A new exported function, rproc_unregister_drm_service, is added
to undo the registration of a drm service via the corresponding
rproc_register_drm_service api.

Change-Id: I694d0538f851c52599a773a558b9a7f900a281b4
Signed-off-by: Suman Anna <s-anna@ti.com>
remoteproc: cleanup remoteproc secure code

The remoteproc_secure.c file has been cleaned up for formatting
and other minor changes. It also includes a whole lot of irrelevant
kernel header files, which are also removed.

Change-Id: I8384584b14d7bd350bb4efe301924dff6ba1ad0c
Signed-off-by: Suman Anna <s-anna@ti.com>