ARM: OMAP4: Add put/get sync clocks in setwakeenable

Need to add the clock calls to the setwakeupenable GPIO functions
as on 4430 when going to idle the IRQ enable register is trying to
be accessed with clocks off causing a kernel panic.

Change-Id: Ia01ea21ff8674a4f48263addfc3bcc7b8475f17c
Signed-off-by: Dan Murphy <dmurphy@ti.com>
GPIO: OMAP2+: On suspend don't wakeup on non-wakeupable interrupts.

While in suspend, device should only be woken-up from those gpio
pins, who has explicitly marked itself has wakeup capable through
enable_irq_wake() functions from respective drivers.

In current implementation, it address the issue where interrupts
were lost when system had entered deeper c-state. So in CpuIdle
path all the pins with interrupts enabled where marked has wakeup
capable to get the system out of deeper c-states.
With this approach, it is observed that lots of spurious
interrupts are waking system from suspend, even though they not
suppose wake the device.

So based on, whether prepare idle is called from CpuIdle or
suspend mark gpio wakeup capable.

Change-Id: Ib3f9be6e56c0656f4b8736861740ed0b4394384f
Signed-off-by: Ambresh K <ambresh@ti.com>
Signed-off-by: Hema Kalliguddi <hemahk@ti.com>
drivers: hwspinlock: use mutex instead of spinlock

We cannot call functions which sleep when we hold a
software spinlock. To avoid the warnings, we use a
mutex instead. The mutex is initialized when we
register the hwspinlock.

Change-Id: Ifa331eb431552b29e1e6aafbb5a3469018909e9c
Signed-off-by: Christina Warren <cawarren@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
OMAP4: Avoid clearing i2c2 irq on A9 when HWSPINLOCK is enabled

This patch is related to this commit:
7dd92cb9a8b9c6bb0f4b03afd26ea50ec90cfb73

On Blaze and Blaze Tablet, the i2c-2 bus is shared by A9 and Ducati.
We want A9 to be able to access the i2c-2 bus when it needs it.
This patch will prevent the i2c-2 irq from being cleared on A9 when
Ducati requests the i2c-2 resource, since hwspinlock is being used to
arbitrate the use of the i2c-2 bus.

Change-Id: Iddb667f77e17d9799a9caa62d9f2a0a0043f1768
Signed-off-by: Christina Warren <cawarren@ti.com>
[Blaze] BMP085 Pressure:Port BMP085 k39 driver to k3.0

Port BMP085 k39 driver to k3.0

Change-Id: If8173267a795523fb219caa40732ab379a903f20
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
syntm12xx: Port synaptics touch screen

Port K35 synaptics touch screen driver from OMAP k35 kernel.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
[Blaze] Synaptics: Update the TS driver from K35

Update the touch screen driver to the k35 version.

This include adding a controller number and
linux friendly input names.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
[Tablet2] Add qtouch driver to k3.

Add the qtouch driver for the mxt224 for the
tablet 2 device.

This is ported from k35.

Change-Id: I4b08f3c1d3964b712cdca1d14ddf994ebef7b8ad
Signed-off-by: Dan Murphy <dmurphy@ti.com>
qtouch: Update the reporting to use the multi touch

Update the reporting of the touch points to use the multi touch
api's.
Also report BTN_TCH to report a down condition

Change-Id: I35831c2f12bfe43d7142da73f3ef570209fd30eb
Signed-off-by: Dan Murphy <dmurphy@ti.com>
[qtouch] Update the touch driver for updated MT protocol

Update the touch screen driver for the MT protocol.
Remove reporting all the data.  Only report the finger in
the packet

Change-Id: I67d09660b007d1689af5993d627bed00b1b7b3d2
Signed-off-by: Dan Murphy <dmurphy@ti.com>
MFD: twl6040-codec: Implement PDMCLK cold temp errata

No PDM clock output is generated when operating in cold temperatures.
The suggested workaround consists of resetting LPPLL and HPPLL after
Sleep/Deep-Sleep mode transitions, before entering in application
mode.

Change-Id: I30453def9de5636fb9b9201c945b1115d11ffe6e
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
MFD: twl6040-codec: Add platform init/exit

Add init/exit to TWL6040 MFD platform data in order to provide
a mechanism to allow platform level initializations (e.g. pin
muxing).

Change-Id: Ifea3af2ba94196e4b7d1ccd14ebcc541443cfe73
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Add initial gc-core driver files.

Initial driver files to enable Vivante Corp 2/3D gcxxx hardware.
Only basic 2D operations have been tested so far.

Change-Id: I656e6752f576c4e70a127060a29b965624e15ae8
Signed-off-by: Alexei Shlychkov <ashlychkov@vivantecorp.com>
Signed-off-by: David Sin <davidsin@ti.com>
Add gc-core build files

Change-Id: I56a8e036dc0fa404b566d72cc7653c1acd2ffcf5
Signed-off-by: David Sin <davidsin@ti.com>
gccore: new core driver enhancements

new drop from vivante corp, which allows batching and four
source blending in one pass. this drop also contains some
code refactoring and other minor bug fixes and improvements.

reference:
https://github.com/hemanthariyani/omap-kernel/commits/4470

    gccore: fix mem allocation bug.
    1) use page_adress for grabbing virt addr
    2) add in logic to enable bb2d clock

    gccore: wakeup fixes.

    gccore: create generic flush functions
    create generic flush functions for user surfaces
    and pages.

    gccore: disable gccore driver by default.
    Relocate where bb2d clocks get enabled/disabled.

    gccore: disable logging by default.
    also, add additional debugging points.

    gccore: fix to address 2d mmu issues.
    testing of multiple large resolutions exposed some
    issues with the 2d mmu logic.

    gccore: fix some performance related issues.
    1) replaced polling logic with semaphore
    2) increased command buffer size
    3) fix bug in free pages logic

    gccore: added pipe select function to gccommit.
    gccore: increase command buffer size
    gccore: change registers from AQ to GC
    gccore: changes to surface logic
    gccore: replace semaphore with completion.
    Also, add timeout detection

    gccore: perform 2d cache ops during map/unmapping
    gccore: only init driver for omap4470

Change-Id: I06a05cc07eab7f76b05fb34d0a795686135d2805
Signed-off-by: David Sin <davidsin@ti.com>
gccore: disable core driver by default

at this point, we are not ready to have the driver on by default.
this will prevent incorrect system power measurement readings because
the gc320 clocks are always on when the driver is initialized.

Change-Id: Ic453fa21e72a87c64875d29afd66da1f76c838cf
Signed-off-by: David Sin <davidsin@ti.com>
GC: Initial Bltsville kernel implementation

Initial working Bltsville kernel implementation for the GC 2D core.

Note: This patch breaks the GC 2D bltsville library in user side.
Additional changes are needed to make it coexist with the kernel
bltsville implementation.

Change-Id: I68394b5fe05799a663b680c830d7ac83c8af1b26
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
Include gc-core into omap build system.

Change-Id: I815cb837e9b45c3077a2e7c10347dc551efce1a1
Signed-off-by: David Sin <davidsin@ti.com>

Conflicts:
	drivers/misc/Kconfig
	drivers/misc/Makefile
DRIVERS: MISC: Add OMAP4430 Static Thermal Policy

Adding Static Thermal Policy for OMAP4430.
Added new driver module to control max opp duty cycle.

Change-Id: I9781f4db19b055eefb0a4bf28bf5f5c516307509
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>

Conflicts:
	drivers/misc/Makefile
Fix merge conflict