OMAP: I2C: Remove the SYSC register definition

The SYSC register should not accessed in the driver removing the
define from the driver.
Also clean up the syscstate from the omap_i2c_dev struct.

Change-Id: I95a7668de47a26523b51a9d13aea83b7aa7def03
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
OMAP4: I2C: Add hwspinlock support

Adding support for hwspinlock in I2C driver
in Blaze and Blaze_Tablet2.
Also adding an api omap_i2c_get_hwspinlockid to be
used by remote proc to populate the resource table.

Change-Id: I5f554ead10806c90442359365dcb8ebff51bf2bf
Signed-off-by: Christina Warren <cawarren@ti.com>

Conflicts:
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-44xx-tablet.c
	arch/arm/plat-omap/include/plat/i2c.h
	drivers/i2c/busses/i2c-omap.c
ARM: OMAP4: Add resistor selection code to the I2C platform driver

Add a call into the I2C to set the I2C pullup resistor strength.

Change-Id: I0bb9eee666d75e04ebd752cb15f1c41a9c8a7b71
Signed-off-by: Dan Murphy <dmurphy@ti.com>

Conflicts:
	arch/arm/plat-omap/include/plat/i2c.h
OMAP: I2C: Reset support

Under some error conditions the i2c driver may do a reset.
Adding a reset field and support in the device-specific code.

Change-Id: I1093774aa6ba419da92047f28a087b2d29ff6750
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
OMAP: I2C: Remove the reset in the init path

-  The reset in the driver at init is not needed anymore as the
   hwmod framework takes care of reseting it.
-  Reset is removed from omap_i2c_init, which was called
   not only during probe, but also after time out and error handling.
   device_reset were added in those places to effect the reset.
-  Earlier the hwmod SYSC settings were over-written in the driver.
   Removing the same and letting the hwmod take care of the settings.
-  Clean up the SYSS_RESETDONE_MASK macro as it is no longer needed.
-  Clean up the SYSCONFIG SYSC bit defination macros.
-  Fix the typos in wakeup.

Change-Id: I8f4ccdf783de6fe3d883e4aa5290473ea0117945
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>

Conflicts:
	drivers/i2c/busses/i2c-omap.c
I2C: OMAP: Don't check if wait_for_completion_timeout() returns less than zero

By definition, wait_for_completion_timeout() returns an unsigned value and
therefore, it is not necessary to check if the return value is less than zero
as this is not possible.

Move the call to wait_for_completion_timeout() onto a single line as it is less
than 80 characters.

Change-Id: I906a112c1ef339aa0b7ad26896669fa413448fa8
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
I2C: OMAP: Update recovery mechanism from Bus Busy condition

In case a peripheral is driving SDA bus low (ie. a start condition), provide
a constant clock output using the test mode of the OMAP I2C controller to
try and clear the bus. Soft reset I2C controller after attempting the bus clear
to ensure that controller is in a good state.

Based upon Vikram Pandita's patch from TI Android 3.0 kernel and modified for
mainline by Jon Hunter. A couple differences from the original patch ...
1. Add a new function for bus clear
2. Ensure that the CON.I2C_EN bit is set when using the SYSTEST feature to
   output a permanent clock. This bit needs to be set and tpyically it would
   be set by the unidle function but this is not the case for all OMAP
   generations.
3. Program the SYSTEST setting only the bits we care about. However, restore
   SYSTEST registers to there original state as some OMAP generations do not
   implement perform a soft-reset.
4. Clear the CON register after performing the bus clear, so when we call the
   init function the controller is disabled and the init function will
   re-enable later.

Original patch can be found here:
http://git.omapzoom.org/?p=kernel/omap.git;a=commit;h=a2ab04192ba25e60f95ba1ff3af5601a2d7b5bd1

Change-Id: I299357568aeafa4bff4caa5dedb294adbd80df36
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
I2C: enable IRQ only when bus is acquired.

Enable the interrupts only when I2C hw spinlock is acquired

Change-Id: I610236a1c1150f5746546c7bd3a0fad6eff2e706
Signed-off-by: Huzefa Kankroliwala <huzefank@ti.com>
OMAP: I2C: Disable interrupts in omap_i2c_bus_clear()

Interrupts that occur during omap_i2c_bus_clear() can cause to
erroneous behaviour in interrupt handler, i.e. multiple printing of
"RRDY IRQ while no data requested" message. So disable interrupts
in omap_i2c_bus_clear() function since they can't be handled correctly.

Change-Id: If4525c93284766d0a2705d7ca4d1f962e3cc4b15
Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
OMAP: I2C: Wait till functional part of the I2C controller completely becomes valid

Bus busy status bit is not effective when functional part of the I2C controller
is not valid, and bus busy detection in omap_i2c_wait_for_bb() will be skipped
sometimes. So we should wait till functional part of the I2C controller
completely becomes valid, after setting the I2Ci.I2C_CON[15] I2C_EN bit to 1.
For doing that we have to wait till RDONE bit of SYSS register reach "1".

For details see TRM, 23.1.4.3 HS I2C Software Reset.

Change-Id: I989855d6cb2b1aa0098e11245dacb77583fe6647
Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
OMAP4: DPLL cascading: I2C psc reconfiguration to support DPLL cascading

The I2C clocks change from 96MHz to 48MHz in dpll cascading
mode.The I2C driver is registerd with DPLL cascading and
the change in clocks is handled.The device speed of > 1Mbps
is not supported in DPLL cascading mode.

[Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>:
Ported and adapted to p-android-omap-3.0]

Change-Id: Ib37648012476a8246cc9e437f707b6e3969e13a3
Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>

Conflicts:
	drivers/i2c/busses/i2c-omap.c
i2c: omap: implement shutdown handler

Once i2c driver shutdown has been called, ignore any more
transfer requests. This patch adds the missing callback.

Leave the PMIC i2c (i2c-1) alive, since power_off case needs it
well after shutdown handlers have been called for power_off case.

Change-Id: I4f4553327e5c024f78acb8501864dd9beb1883c3
Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
drivers: hwspinlock: compilation warning

When using hwspinlock functions without CONFIG_HWSPINLOCK
being enabled, we get a lot of warnings while compiling:

include/linux/hwspinlock.h: In function '__hwspin_unlock':
include/linux/hwspinlock.h:89: warning: 'return' with a value,
in function returning void

This patch fixes that warning.

Change-Id: If3db9f0e2953b08cb37b8d3c8d58299e706325eb
Signed-off-by: Christina Warren <cawarren@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
OMAP HSI: Documentation

HSI Doc from p-android-omap-2.6.35 updated.

Change-Id: Ie6f7080d85f25cf174d8d87d71d9be22f02d771c
Signed-off-by: Sebastien Jan <s-jan@ti.com>
Signed-off-by: Philippe Mazet <p-mazet@ti.com>
Signed-off-by: Djamil Elaidi <a0919513@ti.com>
Signed-off-by: Djamil Elaidi <d-elaidi@ti.com>
Signed-off-by: Cedric Poignet <c-poignet@ti.com>
Fix build
[Blaze] CMA3000 accelerometer:Port CMA3000 k39 driver to k3.0

Port CMA3000 k39 driver to k3.0

Change-Id: Iaf2ab4e6adccd1e8a0ea7209b41ca30ebfe6802b
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
CMA3000: Fix race condition between enable and work schedule.

Accelerometer work can be scheduled from work itself and from
userspace by enabling it in sysfs. The change in sysfs from
userspace was ignored and work constantly rescheduled,
keeping accelerometer always enabled.

Now mode set from userspace is saved and analyzed in work before
scheduling. If accelerometer is disable, work is not scheduled.

Change-Id: I8eacc45cc974947ef474b5e15c961e04bae611f6
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
cma3000 accelerometer: Update suspend/resume to dev_pm_ops

Update the power management suspend/resume to use
the dev_pm_ops instead of legacy suspend/resume callbacks

Change-Id: I90bfe53bb36c2460c196f475be73079bf5da7cf8
Signed-off-by: Dan Murphy <dmurphy@ti.com>
[Blaze] BH1780GLI Ambient Light:Port BH1780GLI k39 driver to k3.0

Port BH1780GLI k39 driver to k3.0

Change-Id: Ic1cf6f7c9537ffbadc5b5e4a556adccfbff8e737
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
[Blaze] Add power button support for the twl6030

Add the power button support for the twl6030

Signed-off-by: Dan Murphy <dmurphy@ti.com>