ARM: OMAP54xx: Enable IPU to L3_main1, l3_main2 static dependency

System hangs were noticed when during the following scenario
Display was off, IPU was getting shutdown during in suspend
path.

Based on experiments done, it was noticed that if L3 is
prevented from idling before IPU idles, then the hangs do away.
The other workaround, also proven to be robust, is to enable
IPU to L3_main1, L3_main2 static dependency.

Defect ID in omap database: COBRA-1.0BUG00191

workaround developed based on experiments and findings
by Ghongdemath, Girish <girishsg@ti.com>,
Shah, Bhavin <bshah@ti.com>

Change-Id: I7c1a34423be703ab0edaacbff142cb664f70fac6
Signed-off-by: Mahesh Renduchintala <mahesh@ti.com>
TI thermal framework: introduce temperature injection for debugging

For debugging purposes, it is interesting to have a way to exercise
the policies without waiting for the silicon to change it's thermal
dynamics. This patch introduces the temperature injection feature.

Now, it should be possible to write scripts to change the temperature
for a specific sensor, consequently of a domain and its governor is
expected to behave accordingly.

The sensor will be reporting the same value written by the user.
A negative value will return the sensor to it's normal operation.

Change-Id: I9b8eb991f714951b8f6f83a1a21d6ff5525562a7
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
TI thermal framework: adapt tmp006 to allow temperature injection

Because tmp006 driver sets the temperature to current_temperature
no matter what, it is hard to inject temperature in the domain
it is registered. For this reason, this patch changes the driver
so that the WQ uses functions from the FW instead of hardcodedly
set the temperature.

Change-Id: I0ed7b325b0ab3cf0fa21a417b3ba517d15b0b064
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
TI thermal framework: adapt on die sensors to allow temperature injection

Because the ondie sensor driver sets the dev_ops of both on die
domain sensors (cpu/gpu) to point to same memory location,
the inject temperature will fail. This happens because once
one domain is being debug, the other will have side effects,
as both dev_ops point to same memory location.

This patch fixes the issue by allocation memory for both dev_ops.

Change-Id: I384cb3d52081ab2d614f8c0ba005b01916a988fc
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
ARM: OMAP3: PM: TWL4030: minor cleanup

Rename TWL4030 registers configuration
and specific data in omap-twl.c.
Move OMAP3 VP macros to voltage.h.

Change-Id: I06ef4a81e9f3f8c74f53de7cca5152c6f3525537
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
[taras@ti.com: minor changes]
Signed-off-by: Taras Kondratiuk <taras@ti.com>
ARM: OMAP4: PM: TWL6030: minor cleanup

Rename TWL6030 registers configuration
and specific data in omap-twl.c

Change-Id: Ie85794b07f7cc4da7a147123f669e8a0e3dbd5f0
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
[taras@ti.com: minor changes]
Signed-off-by: Taras Kondratiuk <taras@ti.com>
ARM: OMAP4: PM: TWL6032: Add OMAP4470 PMIC support

TWL6032 used as PMIC for OMAP4470 based SOMs.
New specific definitions TWL6032 support were been added.
Settings for those resources same as for TWL6030.

Resources_to_power-rails connection scheme for
OMAP4470 + TWL6032 is:

    TWL_6032[SMPS1] -> OMAP4470[VDD_MPU]
    TWL_6032[SMPS2] -> OMAP4470[VDD_CORE]
    TWL_6032[SMSP5] -> OMAP4470[VDD_IVA]

Change-Id: If8393a89c547cea77f2208a9dad0a7266fa91d37
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
[oleksandr.tyshchenko@ti.com: ported from K3.0]
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@ti.com>
[taras@ti.com: minor changes]
Signed-off-by: Taras Kondratiuk <taras@ti.com>
MFD: twl6030: add software power off control

System can be shutdown from userspace by populating
pm_power_off hook for the platform

The hook is twl6030(pmic) specific here

Change-Id: I8821bb734e3171428d9380d352332608ae074f48
[vikram.pandita@ti.com: port to K3.0]
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Rajeev Kulkarni <rajeevk@ti.com>
Conflicts:
	drivers/mfd/Makefile
	include/linux/i2c/twl.h
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
MFD: palmas: irq: mask interrupts on cleanup

Mask interrupts on cleanups after freeing interrupts
This ensures that no pending triggers take place

Change-Id: Icb31dd24598b5be595d9f8329880d67a6d6cf2fa
Signed-off-by: Nishanth Menon <nm@ti.com>
MFD: palmas: add shutdown handler

Add a shutdown handler to cleanly shutdown all palmas devices.

Change-Id: I30d0183dd855c4553d1cc1e15d140b507085573f
Signed-off-by: Nishanth Menon <nm@ti.com>
MFD: palmas: add poweroff support

Provide required hook to allow system shutdown using Palmas.
This is enabled if CONFIG_MFD_PALMAS_POWEROFF is set

Change-Id: I7259152b3350b060db0893ae78629b9015740d42
Signed-off-by: Nishanth Menon <nm@ti.com>
USB: OTG: palmas-usb: Use VBUS bit (INT3_LINE_STATE[7]) only

In the vbus_wakeup_irq() handler use only the required VBUS
bit (INT3_LINE_STATE[7]) instead of full register compare, to
determine the presence/absence of VBUS in device mode.

Change-Id: Ie01d39564804a13ad119e9bbd6c09bab498e8c76
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
USB: OTG: palmas-usb: Use ID_INT_SRC, to determine presence of ID

Use USB_ID_INT_SRC register instead of USB_ID_INT_LATCH_SET to
determine ID GND/FLOAT scenario. It is observed that the latch
mechanism holds on to any glitch on the ID line when the system
is coming out of shutdown/reboot.

Moreover, USB_ID_INT_SRC reflects the current state of the ID line
at any given time and the id_wakeup_irq() handler is tied to changes
in this register and hence its better to use USB_ID_INT_SRC.

Change-Id: I81c893eb3bc59e75f3cf4f9663e11c7ec4b3ca20
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
USB: OTG: palmas-usb: Fix USB cold-plug detection logic.

It is observed that while faking the vbus/id_wakeup_irq handlers
to detect USB cold-plug scenarios, Host mode (ID GND) situation
is also invoking the IRQ hander simultaneously, causing a bad race
condition and XHCI stack to complain about dual registration.

To avoid this scenario, detect the usb cold-plug scenario before
the irq handlers are registered during probe.

Change-Id: I7d38457119812c0b1dcc45426bd80a2633cbc6ec
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
USB: OTG: palmas_usb: Add a shutdown handler.

This patch adds a shutdown handler to disable/free
important resources in the device shutdown path.

Change-Id: Ifd490e6bf9867daf619ce4d2772f4cf36d390c70
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
USB: DWC3: Fix detection of USB cold-plug for Host mode (XHCI)

Once the Host mode cold-plug scenario is detected and the
XHCI stack is loaded, the dwc3_gadget_start() should not
try enabling/configuring the endpoints again, else it will
mess up DWC functionality.

This situation is avoided by managing a seperate flag
'gadget_is_connected' for all essential gadget operations.

Change-Id: Ia43616df04814c9a95b5a2e308487c5245e2f412
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
thermal: omap: error check in PM idle notifier callback

PM idle notifier callback functions are directly called
from PM framework during CpuIdle execution. Hence need
to check if the driver is initialised before accessing
any driver related data. If the driver probe has failed,
then accessing the driver data will crash the system.

Change-Id: If4118a1183ce28d2394e19b90e2f4a04a1b4c453
Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
thermal: omap: update copyright entry

simple copyright update

Change-Id: Ic9490f531bb6f6bab9f065f587b08de20dc1f023
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
thermal: omap: update include list

Remove unnecessary includes from omap bandgap driver

Change-Id: Idd32360dc7ceca5f5a0f7b2ae67e32e63d8d886b
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
thermal: omap: move register and bit field definitions to header file

Reorganizing the code so that definitions are now in header file for better
code spliting

Change-Id: Ia7d8d02cd2952410e4fc0f2f1c230484622a8017
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>