OMAP4: DPLL cascading: MUSB core: USB handling during DPLL casacading

System can enter DPLL cascading mode only when USB is unplugged.
When USB is plugged, system left DPLL cascading

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

Change-Id: I83c887a278f48962446a3b17ec0d60f853506f90
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
usb: musb: Dont start Host session on probe unless device attached

This patch makes sure that we dont start the Host session unless
there is a cold boot scenario and a device(mouse) is attached.

Without this patch, the Host session was started by default
causing the gadget configuration to be not recognized by
the Host machine on cold boot in device mode.

Change-Id: Ibe8609a77dcb2c5c7455062a04337e4c123ce8a6
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>

Conflicts:
	drivers/usb/musb/musb_core.c
usb: musb: cleanup not needed initializations of state

This patch cleans up the musb code for the state initializations
that are not needed any more and are causing issues.

Change-Id: Ie73fa93a61c8e1ab393d596e6647b6fb7ec06279
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>

Conflicts:
	drivers/usb/musb/musb_gadget.c
OMAP: MUSB: Fix for issue when booting with USB charger connected

Issue:
When the charger is disconnected after bootup, the device fails
to go into OFF mode.
Bug Details:
1. At the end of Gadget Driver probe pm_runtime_put()is not called in
case of charger/USB cable connected during bootup.
2. After bootup when we disconnect the charger, the disconnect handler
for USB_EVENT_NONE checks first if the disconnect was for charger.
If yes it returns without autosuspend else it call pm_runtime_autosuspend.
So because of this PM calls get imbalanced and system does not go to OFF.
Fix:
Logic at the end of the gadget probe function is fixed to prevent
the above problem.

Change-Id: Ief7daade9aed7460bd4d1d576c22024a419ddbda
Signed-off-by: Mantesh Sarashetti <mantesh@ti.com>
CC: Ruchika Kharwar <ruchika@ti.com>

Conflicts:
	drivers/usb/musb/musb_gadget.c
TI TFW:fix for THERMAL_FRAMEWORK disable cause build error

Patch rebuilds Makefiles tree for thermal_framework

Change-Id: Id47b907d83b3231e7c7bb455e2175df3c9d8c9d3
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>

Conflicts:
	arch/arm/configs/blaze_defconfig
	arch/arm/mach-omap2/board-4430sdp.c
Staging Thermal FW: PCB Temp Sensor: Fix management of ADC conversion

When an NTC thermistor is connected to the TWL6030 GPADC Channel #4,
twl6030_gpadc_conversion() function (from twl6030-gpadc driver) is
invoked.
This function stores different results into twl6030_gpadc_request
structure.
The PCB temp sensor driver shall use the ADC code instead of the
converted voltage value.
Later, the PCB temp sensor convert the ADC code into temperature
through a dedicated lookup table.

Change-Id: I1582e96035797f8c0dd6e529c65160a71e54cd6a
Signed-off-by: Sebastien Sabatier <s-sabatier1@ti.com>
OMAP4 Thermal Framework: Add support for 12-bit GPADC on TWL6032

Changing the the algorithm for temperature calculation using a NTC termistor.
Now the temperature is selected from the table depending on the voltage,
and not from the ADC code. In this implementation, the dependence on the ADC resolution is lost.

Change-Id: I83d7b45d1b0c3b4a60089e3502aaeb91640a4ffd
Signed-off-by: Oleksandr_Tyshchenko <oleksandr.tyshchenko@ti.com>
TI thermal framework: Duty Cycle: Add dependency to CPUFREQ

Duty Cycle thermal policy is coupled with CPUfreq,
so build fails if CPUfreq is disabled.

Make Duty Cycle dependent on CPUfreq.

Change-Id: I0cd7178b788fe267c272e987199ad663a4ed76f7
Signed-off-by: Taras Kondratiuk <taras@ti.com>
remoteproc: get suspend address from resource table

The suspend address is used as a flag to check if the remoteproc
has actually suspended. The address could vary according to the
memory map in the remoteproc. Changing the memory map in the
remote processor changes the value of the suspend address.
Passing the address in the resource table information avoids
hardcoding the value in the platform data of the remoteproc.
The value is instead assigned while parsing the resource table.

Change-Id: I698b81d61d391af85bc1556d2abc4c407c1db018
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
remoteproc: create version debugfs after image is loaded

This patch ensures that the image version debugfs entry is
created only after the image is loaded. Version info is
not available before the image is loaded.

If the debugfs entry is created before, then it results in
a kernel panic.

Change-Id: I7311b4a832b5e897ca10f1290900b3178e2c544d
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
remoteproc: fix checkpatch warnings

A few checkpatch warnings have crept into remoteproc over time,
and these have been fixed.

Change-Id: Ife21b9c063505f4ceb4f7f4fd6561c854fc99b90
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>

Conflicts:
	drivers/remoteproc/remoteproc.c
MFD: TWL: Regulator: Add support for REGEN1

REGEN1 is added to platform data, so that it can be
modelled as an regulator and the state of it can be
controlled through drivers and board file.

Change-Id: I3e3251d95841a8522db530b7826746e375e23ce6
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Regulator: tps6130x: Add support for TI tps6130x regulator

Add initial support for TI tps6130x family. TPS6130x can
operate as a standard boost regulator, output voltage range
is 3.825-5.700V. Current source support is not added in this
initial version.

Ported from p-android-omap-2.6.35

Change-Id: I28c9ba1d87652b1269ab23da9e2609fb993b4460
Signed-off-by: Girish S G <girishsg@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Akash Choudhari <akashc@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
OMAP4: power: BQ24156 charger driver.

Create bq2415x_charger.c for BQ24156 AC charger
BQ24156 interacts with TWL6030 for AC charger detection and
charge control. Add support in Kconfig and Makefile.

Change-Id: I3ee6a7a058174d43102a9d36736a3fb682424fcd
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
OMAP4: Battery charging: Reduce bq2415x watchdog timeout

bq2415x has 32 second watchdog timer. If within 32 second
the watchdog timer is not reset then the charge is terminated.

The work to reset watchdog was scheduled every 30 seconds, and
sometimes time out expired. Reduce schedule period to 20 seconds
to reset the watchdog more frequently.

Change-Id: I1680a0db15a566abe38a0aa1c25572e01fe5d844
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
OMAP4: DPLL cascading: The HSMMC output clock handling to support DPLL cascading

The HSMMC1 output clock will change from 96MHz to 49MHz upon entry
to DPLL cascading mode. This patch modifies the MMC1 divisor to
handle the change in clock frequency.

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

Change-Id: Ia52425132bfcc80489b39cb5562dc86cc483cb83
Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
mmc: new api mmc_release_host_sync()

The current mmc API to release a specific mmc host
mmc_release_host() does not call host specific disable()
function immediately, but schedules it to be called with
some delay. Sometimes, during suspend/resume operations,
this is causing host->disable() function not to be called
before suspend and so the resources associated with host
are not released resulting in clocks not being released.

The new API mmc_release_host_sync() calls mmc_host_disable()
immediately instead of calling mmc_host_lazy_diable().

Change-Id: I64f3c8a96c29d9f4cff0382a3fe131faf48f2da1
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>

Conflicts:
	drivers/mmc/core/sdio.c
	drivers/mmc/host/omap_hsmmc.c
Merge branch 'exp' into stable