TI thermal framework: omap die governor: introduce enter zone helper function

TI thermal framework: omap die governor: introduce enter zone helper function

This code changes the OMAP DIE governor to use a helper function to enter
a thermal zone, instead of using a function for each zone. Idea is to
reduce the amount of duplicated code.

This code also introduces a data structure to represent a thermal zone.
The enter zone helper function is based on this data structure.

The logic alert zone logic computation, which depends on if we
are rising or lowering in temperature, is now moved to the zone
matching function. This place is much more convenient, then inside
the enter zone helper.

Change-Id: Ibcb9228556c793104d2ec6f8df092a1c7ea99966
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
TI thermal framework: set temperature when domain is ready

TI thermal framework: set temperature when domain is ready

Instead of reading domain temperature when a domain is ready,
this patch changes the flow to set the temperature. Now,
the temperature will be report to the governor when its domain
is ready with all needed pieces: sensor, governor, cooling agents.

Change-Id: I680bd6ff535dbe452d7b6cb9562594fa37826148
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
TI thermal framework: introduce thermal_lookup_temp function

TI thermal framework: introduce thermal_lookup_temp function

This patch adds a helper function to get temperature of
a thermal domain, based on the domain name.

It will perform a domain name lookup and use its thermal
sensor device to fetch the temperature. If the domain
is not ready to report temperature, it will return an
error code.

Change-Id: I55d173c686e61650cb3a18ff4ae434711f2ebf37
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
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>
modified for Tuna board by faux123

Signed-off-by: Willi Ye <williye97@gmail.com>

Conflicts:
	drivers/misc/Makefile

Conflicts:
	drivers/misc/Makefile
DRIVERS: MISC: move DC from misc to thermal_framework

We have special place for thermal framework. Duty cycle was placed
to separate place. The patch moves DC to thermal_framework place.

Change-Id: Id1e85d853df2fbbd597a5dd87e658fce58e4ae24
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
modified for TUNA by faux123

Signed-off-by: Willi Ye <williye97@gmail.com>

Conflicts:
	drivers/misc/Makefile

Conflicts:
	drivers/misc/Makefile
Thermal Governor: Added duty cycle governor

Add the OMAP duty cycle governor to the thermal framework.
This component will impose the policy for the PCB temp
sensor in case ondie sensor is absent.

Change-Id: I05f7272445567cf74be6f0932d7024f0d9d34dee
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
modified for TUNA board by faux123
board/omap2plus: add missing thermal framework code from OMAPZOOM.org baseline

Signed-off-by: Willi Ye <williye97@gmail.com>

Conflicts:
	arch/arm/mach-omap2/omap2plus-cpufreq.c

Conflicts:
	arch/arm/mach-omap2/omap2plus-cpufreq.c

Conflicts:
	arch/arm/mach-omap2/omap2plus-cpufreq.c