OMAP4: DSS: Fix to correct the manager index for VSYNC irq handler

Patch to fix the Manager id in dss_completion_irq_handler.
DSSCOMP is expecting the manager id 1 to be mapped to HDMI display.
This patch fixes the DSSCOMP_STATE_DISPLAYED callback in DSSCOMP.

Change-Id: I0aab3e494cb305d75a64fabc4cd6919def636285
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
Signed-off-by: Varadarajan Charulatha <charu@ti.com>
OMAP4: HDMI: Add delay after Wrapper reset for HDCP keys to be loaded correctly

After HDMI wrapper reset we are not waiting for suffecient time
for the HDCP keys to be loaded to HDMI_DESHDCP_KEYS memory. This is
sometimes causing in the first byte to be read as 0 and subsequently
results in error being returned due to invalid AKSV key.
We need to have a small delay for the memory to be populated with
HDCP keys before reading it after wrapper reset.

Change-Id: I51f032d31ae05eb9c21ca697cd6b7ac18cdd1c2a
Signed-off-by: Srinivas Pulukuru <srinivas.pulukuru@ti.com>
[Tablet] HACK: Remove the TMP105 sensor from I2C3

There is an interaction issue with the Camera sensor on I2C3
and this sensor when enabled.  We need to not allow registration
until this issue is determined.

Change-Id: I459d9d1c0736ecca6fb0d4865a6cb6083aa522fa
Signed-off-by: Dan Murphy <dmurphy@ti.com>
btwilink: avoid double freeing of recv skb

Upon error in hci_recv_frame, the HCI Core is freed before the error
is reported to btwilink. When the error does get to btwilink and forwarded
to ST core, ST core also attempts to free the skb.

Although the 2 frees of skb should theoritically cause any harm, this is
redundant and hence this patch returns 0 to ST core even upon error,
because there is no action to be taken.

Remove also the #define DEBUG which was used to debug the code.

Change-Id: I05f8c3a9d9795ac3e3e9916006630e809d27e33a
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
MFD: twl6040-codec: Allow passing flags to IRQ request

Allow passing irqflags to TWL6040 IRQ request API (twl6040_request_irq).

Change-Id: I731931c4f8fc9aee57bb3707c94f7b763e140c0a
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
ASoC: twl6040: Convert PLUGINT to no-suspend irq

During suspend/resume cycle, PLUGINT could be processed while
corresponding irq has not being enabled back, so PLUGINT handler
is skipped. Converting PLUGINT to no-suspend type makes this
interrupt to be handled properly during resume as it's kept enabled
during suspend.

Change-Id: I38c344113816afcf05634cb92cdd0d81a908b088
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
OMAP4430: USB Host: Implement workaround for Errata i719

The OMAP4 EHCI controller has the following defect (errata ID i719):

Title:
	HS USB: Multiple OFF Mode Transitions Introduce Corruption

Description:
	When the system enters off mode, the save-and-restore (SAR)
        process comes into play. When the save of the USB context
	occurs, an extra pulse of UTMI_root clock coming from USB
	DPLL is entering the IP, and generates a minor corruption.
	This corrupted context is saved and restored later.
	This corruption will impact the next use of the USB module:
	it could be while resuming a suspended device, or it could
	be upon the enumeration of a new device. The exact failure
	is not predictable: disconnection or stalls have been observed.
	TLL and external PHY modes are impacted.

WORKAROUND:
	During ON time, anytime before starting the next save sequence:
	• Set the CM_L3INIT_HSUSBHOST_CLKCTRL[1:0] MODULEMODE bit field
	  to 0x2 (enabled).
	• Wait 1 ms.
	• Set the same bit field back to 0x0 (disabled).

All OMAP4430 devices are impacted.

Change-Id: I63c866504ae3899c73755e6f6b00d388205c20bd
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
Revert "OMAP4: TEMP_SENSOR: Tuning values of TSHUT-thresholds"

This patches revert commit 24e7232d9d0ad7c3ac6520c7131b82e75d8f166d.
TSHUT_HOT value was decreased to be safe without the support of
PCB temp sensor into the OMAP thermal management.
Some thermal shutdown are observed when integrating the PCB sensor
into the thermal policy and decreasing the TSHUT_HOT value.
As recommended solution is to use an external PCB temp sensor,
it is better to revert the initial patch.

Change-Id: I27ddf08fab5cdedef7b9537fc934694a5b19954f
Signed-off-by: Sebastien Sabatier <s-sabatier1@ti.com>
SGX-KM: egl.cfg sysfs entry

Create a runtime sysfs entry for egl.cfg. This is needed
by the SGX driver to determine which OpenGL libraries
to load.

Change-Id: Ief39f498721d0ad71942f8a49fcfefc4c449d656
Signed-off-by: Tate Hornbeck <tate.hornbeck@ti.com>
ASoC: twl6040: SW WA for DC Offset On EAR Differential Output

Correct Sequencing To Ensure No DC offset On EAR Outputs.
Fix the pops on switches between HF to EP

Change-Id: I497f8d6a2c2662406720a28e7906c5e58917fb24
Signed-off-by: Pierre Moos <p-moos@ti.com>
Signed-off-by: Francois Mazard <f-mazard@ti.com>
OMAP: dmtimer: Fix memory leak on dmtimer error

Change-Id: I858c24a21410f2c1c85b1b8b2c1fc4dc5d3c1e6d
Signed-off-by: Jared Suttles <jsuttles@motorola.com>
OMAP: dmtimer: Fix timer handling logic for non loses_context timers

The use of the enabled flag is currently tightly coupled with the
loses_context flag on the timer struct. This change makes the enabled
flag behave more sanely without consideration of the loses_context flag.

Change-Id: I9d33bb4cc3fd7917ad493adde75cf57cb240b106
Signed-off-by: Jared Suttles <jsuttles@motorola.com>
OMAP4460: OPP: SR1.5: update margin to spec rev 0.4

Update SR1.5 voltage margin from Operating Conditions Data Manual
Addendum Revision 0.4 (December 2011) for OMAP4460.

Change-Id: I4a53f39fd2eab25912f50b2e9cfdea5b8f071941
Signed-off-by: Nishanth Menon <nm@ti.com>
OMAP4: Clock: Force a DPLL clkdm/pwrdm ON before a relock

All DPLLs except USB are in ALWON powerdomain. Make sure the
clkdm/pwrdm for USB DPLL (l3init) is turned on before attempting
a DPLL relock. So, mark the database accordingly.

Without this fix, it was seen that DPLL relock fails while testing
relock in a loop of USB DPLL.

Change-Id: I52f621a2c83e3e0dc4f6c440291860b285854e12
Tested-by: Ameya Palande <ameya.palande@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
OMAP4: PM: work around for CPU1 onlining from OFF/OSWR state on older PPA

Originally detected in OMAP4430 ES2.3 HS samples, CPU1 crashes the
device upon calling PPA service DEFAULT_POR_NS_SMP(0x25).

Rootcause showed that cache maintenance operations required to be
performed before handing over control of CPU1 to HLOS, were incomplete
and not broadcasted from CPU0 to CPU1.

Kernel workaround for this is to use WFI to put CPU1 in OFF
state if CPU0 is not ready yet (this mechanism was in place in previous
versions of this code base but was meant to address a different need).
When putting CPU1 back to off, its internal MMU descriptors are reset
and sync'd with CPU0. CPU1 is brought online by later kernel subsystems.
Note: CPU0 power state is made to OFF for both OSWR and OFF modes.

This issue has been analysed to impact all OMAP4 non GP devices.

A config flag is introduced to allow platforms and distributions to
enable/disable if PPA version requirement is not met.

Change-Id: I82c5880ec2d9a98a54755dfbd01aa981cfed9852
[nm@ti.com, cileija@ti.com: improvements and rootcause support]
Signed-off-by: Carlos Leija <cileija@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com]
[wwang@ti.com: WA identification]
Signed-off-by: Wenbiao Wang <wwang@ti.com>
OMAP4: PM: Disable work around for CPU1 onlining from OFF/OSWR state

CONFIG_OMAP4_PPA_CPU1_ONLINE_BUG should be disabled for PPA > 1.6.4

If PPA version cannot be updated beyond 1.6.4 (PPA <= 1.6.4), this patch
should not be applied.

Note:
Patch with change Id I82c5880ec2d9a98a54755dfbd01aa981cfed9852
introduced this work around by default for all devices using PPA
version 1.6.4 or older.

Change-Id: I9b1e6a81284cfc5463b3e25de9831cb5617ad49d
Signed-off-by: Akash Choudhari <akashc@ti.com>
CC: Carlos Leija <cileija@ti.com>
CC: Nishanth Menon <nm@ti.com]
CC: Wenbiao Wang <wwang@ti.com>
OMAP4: ID: Chip detection for OMAP4470

Add support for detection of the next chip in the OMAP4 family: OMAP4470 ES1.0

Change-Id: I931d3df6e69fdc3ee4a307c204a68fc9b3ff519b
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>
ARM: OMAP4: clock: Define 4470 flag in cpu masks

Define OMAP4470 flag in clock cpu masks.
Reuse CK_44XX clocks for 4470.

Increased 'flags' field size to fit additional CPU type.

Change-Id: I546d69495152567b2248b457172c0ab7b2782ce3
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: voltage: Add 4470 voltage definitions

Add structures containing OMAP4470 voltage supported and various
voltage dependent data for each VDD.

Data is based on Data Manual Operating Condition Addendum v0.2 for 4470.

Change-Id: I8baa6ccf26786b4ee1764fe96f312ae7fb65ccbf
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: OPP: Add 4470 OPP definitions

Add initial OPP definitions for OMAP4470.
Based on Data Manual Operating Condition Addendum v0.2 for 4470.

Change-Id: Ib3c1b3f4b69560e501b97a18cb72bd0aa0e4292f
Signed-off-by: Taras Kondratiuk <taras@ti.com>