ARM: OMAP54XX: PM: SAR registers addresses fix for ES2

OMAP5430ES2 has some of the register addresses changed.

Change-Id: Ic6b1a4757e7ae43399d0a68fdcae7799ca701de3
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: OMAP5: PM: Enable idle voltage scaling for ES2.0

Change-Id: I426010502ad53ac855dbca0d03ef034dd1f3dc3e
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: OMAP4+: USB host: fix sar save logic for non-usb config

Now the kernel will save the USB context during the first device
off entry, instead of skipping the save completely and causing a failure
on second off-mode entry.

Change-Id: I7645838780d97b11a6e42b9ab9313eb619f9a4e1
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: OMAP5: PM: scale MPU voltage down to 0V with ES2 device off

OMAP5430-1.0 BUG01699 which impacted OMAP5 ES1.0 is fixed in
ES2.0. Hence it is safe to switch MPU voltage to 0V around
OFF mode for ES2.0.

Change-Id: I3af6e7be3bbce2598135ea8b593d28519495734d
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: OMAP5: Update CPU wakeup memory offset for ES2.0

On OMAP5 ES2.0 SOCs, CPU wakeup address needs to be updated
to use the proper address.

Change-Id: I5300731dadf587da887b3d28805d9c2d896368bf
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  ARM: OMAP5: Update CPU wakeup memory offset for ES2.0
  ARM: OMAP5: PM: scale MPU voltage down to 0V with ES2 device off
  ARM: OMAP4+: USB host: fix sar save logic for non-usb config
  ARM: OMAP5: PM: Enable idle voltage scaling for ES2.0
  ARM: OMAP54XX: PM: SAR registers addresses fix for ES2

Change-Id: I5fe2bb6de242b771689c7e8b7475283c5da48c0c
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
ARM: OMAP4: OPP: Enable higher frequency for MPU

With ABB, SmartReflex, and thermal management support in place,
we can now safely enable the higher frequencies on OMAP4 due to
following documents:

- OMAP4430_ES2.x_Public_TRM_vAJ
- OMAP4430_ES2.x_DM_Operating_Condition_Addendum_v0.9
- OMAP4460_ES1.x_Public_TRM_vV
- OMAP4460_ES1.0_ES1.1_DM_Operating_Condition_Addendum_v0.6
- OMAP4470_ES1.0_Public_TRM_vN
- OMAP4470_ES1.0_DM_Operating_Condition_Addendum_v0.6

Since there is an efuse to detect the high performance devices,
we automatically enable that frequency on detection.

Change-Id: I6bb414e07ebd72937e7dfb11635b550fe25fb121
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
ARM: OMAP4: OPP: Enable higher frequency for IVA

With ABB, SmartReflex support in place, we can now safely enable the
higher frequencies on OMAP4 due to following documents:

- OMAP4430_ES2.x_Public_TRM_vAJ
- OMAP4430_ES2.x_DM_Operating_Condition_Addendum_v0.9
- OMAP4460_ES1.x_Public_TRM_vV
- OMAP4460_ES1.0_ES1.1_DM_Operating_Condition_Addendum_v0.6
- OMAP4470_ES1.0_Public_TRM_vN
- OMAP4470_ES1.0_DM_Operating_Condition_Addendum_v0.6

Since there is an efuse to detect the high performance devices,
we automatically enable that frequency on detection.

Change-Id: Id18ed59c20a90351be8d38ec3a3a9979290ac826
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
ARM: OMAP4430: OPP: Add entries for DSP

Add DSP entries to the OPP table.

Change-Id: I0816232e0cf51dac8c95512d669870a45dea047d
Acked-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Hunt <hunt@ti.com>
[ivan.khoronzhuk@ti.com: ported from p-android-omap-3.0]
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
ARM: OMAP4460: OPP: Add entries for DSP

Add DSP entries to the OPP table.

Change-Id: Id26f8ea0eb2ee71a9ecd6ef2b8a2ab3c3a3c440c
[ivan.khoronzhuk@ti.com: forward port from p-android-omap-3.0]
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
ARM: OMAP4470: OPP: Add entries for DSP

Add DSP entries to the OPP table.

Change-Id: Id72a9999c433222ae463bddb0bc3558a881b8654
[ivan.khoronzhuk@ti.com: forward port from p-android-omap-3.0]
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
omap: bandgap: Rename config OMAP5_THERMAL to OMAP_DIE_TEMP_SENSOR

Rename CONFIG_OMAP5_THERMAL to CONFIG_OMAP_DIE_TEMP_SENSOR and related
functions in thermal framework to add support of 446x and 447x
bangap chips.
Also make sensor and cooling devices in thermal framework dependent from
CONFIG_OMAP_THERMAL to add support of DUTY_CYCLE governor for 443x support
later.

Change-Id: I532b2f82acaa0f97a2fe4590439b1982a5d6ebbc
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
TI-TFW: OMAP4470: omap-bandgap: Add configuration structure

Adding the structure for OMAP4470 Bandgap. Most of fields
reused from 4460 as they are the same for both.

Change-Id: Ieb8bedaea2b77e57260c2cd8104920ecb36e6bc6
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
TI-TFW: OMAP4460: omap-bandgap: Initialize callbacks in config structure

This patch initialises the following callbacks in OMAP4460 configuration
structure:
	.report_temperature = omap_thermal_report_temperature,
	.expose_sensor = omap_thermal_expose_sensor,
	.remove_sensor = omap_thermal_remove_sensor,
so that bandgap is registered in thermal framework and is able
to report it temperature.

Change-Id: Iee74102690b8faa259de1d13e999a2d93a81fa49
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
TI-TFW: OMAP4460: omap-bandgap: Update slope/offset values

This patch updates slope and offset in bandgap configuration
structure for OMAP4460.
Updated values are taken from this patch:
http://review.omapzoom.org/#/c/20655/

Change-Id: I51a4a8b827d903cb3275604a99d0c012c2469926
Signed-off-by: Sebastien Sabatier <s-sabatier1@ti.com>
[ruslan.ruslichenko@ti.com forward ported from p-android-omap-3.0]
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
TI-TFW: Thermistor: added Thermistor sensor

This patch adds kernel driver for Thermistor sensor
connected on TWL6030 or TWL6032 GPADC.
It calls dedicated function to start GPADC conversion and
convert the result into milli-degrees celsius.

Change-Id: I0c8917e0043c07ffee319cf3e4f72c428d847999
Signed-off-by: Sebastien Sabatier <s-sabatier1@ti.com>
[oleksandr.tyshchenko@ti.com Add support for 12-bit GPADC on TWL6032]
Signed-off-by: Oleksandr_Tyshchenko <oleksandr.tyshchenko@ti.com>
[ruslan.ruslichenko@ti.com ported from p-android-omap-3.0]
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
ARM: OMAP4: SDP/Tablet44xx: Add registration of thermistor to tablet and blaze board files

Adding registration of thermistor sensor situated close to cpu
on 446x boards.
Values of slope and offset are taken from this patch
http://review.omapzoom.org/#/c/20655/

Change-Id: I23de826c316ae9c9f87f62efbe8e7038e1913d6b
Signed-off-by: Sebastien Sabatier <s-sabatier1@ti.com>
Signed-off-by: Ruslan Ruslichenko <x0191366@ti.com>
ARM: OMAP4: cpuidle: Declare the states with the driver declaration

The cpuidle API allows to declare statically the states in the
driver structure. Let's use it.
We do no longer need the fill_cstate function called at runtime and
by the way adding more instructions at boot time.
More over, the cpuidle_params_table is not used any more - so remove it.

Reference commits:
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=commit;h=78e9016fa466833e0a7a40f7642cd374994b2841
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=commit;h=4e0a64fa74abc7b33b68ed4f14e03e8e6d44c0d6

Change-Id: Iecbc9091264b4ba9a2c02e59757614c91c1b1aa8
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
[grygorii.strashko@ti.com - back port from k3.7]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  ARM: OMAP4: SDP/Tablet44xx: Add registration of thermistor to tablet and blaze board files
  TI-TFW: Thermistor: added Thermistor sensor
  TI-TFW: OMAP4460: omap-bandgap: Update slope/offset values
  TI-TFW: OMAP4460: omap-bandgap: Initialize callbacks in config structure
  TI-TFW: OMAP4470: omap-bandgap: Add configuration structure
  omap: bandgap: Rename config OMAP5_THERMAL to OMAP_DIE_TEMP_SENSOR
  ARM: OMAP4470: OPP: Add entries for DSP
  ARM: OMAP4460: OPP: Add entries for DSP
  ARM: OMAP4430: OPP: Add entries for DSP
  ARM: OMAP4: OPP: Enable higher frequency for IVA
  ARM: OMAP4: OPP: Enable higher frequency for MPU

Conflicts:
	arch/arm/mach-omap2/board-44xx-tablet.c

Change-Id: Ib508887acf8500024a8876219471f5bcf2d10d65
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
ARM: OMAP4: cpuidle: Initialize omap4_idle_data at compile time

We initialize the omap4_idle_data variable at compile time allowing us
to use this global variable directly and to remove the initialization
done at boot time.

Reference commits:
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-
omap.git;a=commit;h=d0d133d9599042355da2896456299e1571709db5
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-
omap.git;a=commit;h=7aeb658d5b65981d7747c10fd5e2c0e3b83bd139
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-
omap.git;a=commit;h=102c25516700f540b2a97a71f9f44c385267f5ca

Change-Id: I95db0fbe14b056479f82075aa2a19fe6fc32fe9d
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
[grygorii.strashko@ti.com - back port from k3.7]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>