platform/kernel/linux-3.10.git
9 years agothermal: exynos: Remove non DT based support
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:38 +0000 (16:20 +0530)]
thermal: exynos: Remove non DT based support

Recently non DT support from Exynos platform is removed and hence
removing non DT support from the driver also. This will help in easy
maintainence.

Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Make the zone handling use trip information
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:37 +0000 (16:20 +0530)]
thermal: exynos: Make the zone handling use trip information

This code simplifies the zone handling to use the trip information passed
by the TMU driver and not the hardcoded macros. This also helps in adding
more zone support.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Return success even if no cooling data supplied
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:36 +0000 (16:20 +0530)]
thermal: exynos: Return success even if no cooling data supplied

This patch removes the error return in the bind/unbind routine
as the platform may not register any cpufreq cooling data.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Modify private_data to appropriate name driver_data
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:35 +0000 (16:20 +0530)]
thermal: exynos: Modify private_data to appropriate name driver_data

This patch renames member private_data to driver_data of the thermal
zone registration structure as this item stores the driver related
data and uses it to call the driver related callbacks.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Add support for instance based register/unregister
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:34 +0000 (16:20 +0530)]
thermal: exynos: Add support for instance based register/unregister

This code modifies the thermal driver to have multiple thermal zone
support by replacing the global thermal zone variable with device data
member of thermal_zone_device.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Fix to clear only the generated interrupts
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:33 +0000 (16:20 +0530)]
thermal: exynos: Fix to clear only the generated interrupts

This patch uses the TMU status register to know the generated interrupts
and only clear them in the interrupt handler.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Support thermal tripping
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:32 +0000 (16:20 +0530)]
thermal: exynos: Support thermal tripping

TMU urgently sends active-high signal (thermal trip) to PMU, and thermal
tripping by hardware logic. Thermal tripping means that PMU cuts off the
whole power of SoC by controlling external voltage regulator.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Move register definitions from driver to data file
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:31 +0000 (16:20 +0530)]
thermal: exynos: Move register definitions from driver to data file

This patch migrates the TMU register definition/bitfields to data file. This
is needed to support SoC's which use the same TMU controller but register
validity, offsets or bitfield may slightly vary across SOC's.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Add extra entries in the tmu platform data
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:30 +0000 (16:20 +0530)]
thermal: exynos: Add extra entries in the tmu platform data

This patch adds entries min_efuse_value, max_efuse_value, default_temp_offset,
trigger_type, cal_type, trim_first_point, trim_second_point, max_trigger_level
trigger_enable in the TMU platform data structure. Also the driver is modified
to use the data passed by these new platform memebers instead of the constant
macros. All these changes helps in separating the SOC specific data part from
the TMU driver.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Add missing definations and code cleanup
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:29 +0000 (16:20 +0530)]
thermal: exynos: Add missing definations and code cleanup

This patch adds some extra register bitfield definations and cleans
up the code to prepare for moving register macros and definations inside
the TMU data section. In this code cleanup the TMU enable bit is correctly used
as bit0 and bit1 is taken care which is reserve bit.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Bifurcate exynos tmu driver and configuration data
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:28 +0000 (16:20 +0530)]
thermal: exynos: Bifurcate exynos tmu driver and configuration data

This code splits the exynos tmu driver code into SOC specific data parts.
This will simplify adding new SOC specific data to the same TMU controller.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Move exynos_thermal.h from include/* to driver/* folder
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:27 +0000 (16:20 +0530)]
thermal: exynos: Move exynos_thermal.h from include/* to driver/* folder

This patch renames and moves include/linux/platform_data/exynos_thermal.h to
drivers/thermal/samsung/exynos_tmu.h. This file movement is needed as exynos
SOC's are not supporting non-DT based platforms and this file now just contains
exynos tmu driver related definations.
Also struct freq_clip_table is now moved to exynos_thermal_common.c as it fixes
the compilation issue occuring because now this new tmu header file is included
in tmu driver c file and not in the common thermal header file.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Rename exynos_thermal.c to exynos_tmu.c
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:26 +0000 (16:20 +0530)]
thermal: exynos: Rename exynos_thermal.c to exynos_tmu.c

This patch renames exynos_thermal.c to exynos_tmu.c. This change is needed as
this file now just contains exynos tmu driver related codes and thermal zone
or cpufreq cooling registration related changes are not there anymore.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Bifurcate exynos thermal common and tmu controller code
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:25 +0000 (16:20 +0530)]
thermal: exynos: Bifurcate exynos thermal common and tmu controller code

This code bifurcates exynos thermal implementation into common and sensor
specific parts. The common thermal code interacts with core thermal layer and
core cpufreq cooling parts and is independent of SOC specific driver. This
change is needed to cleanly add support for new TMU sensors.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Remove un-necessary CPU_THERMAL dependency
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:24 +0000 (16:20 +0530)]
thermal: exynos: Remove un-necessary CPU_THERMAL dependency

This patch removes the dependency on CPU_THERMAL for compiling TMU driver.
This is useful for cases when only TMU controller needs to be initialised
without cpu cooling action.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Use ARCH_HAS_BANDGAP config to know the supported soc's
Amit Daniel Kachhap [Mon, 24 Jun 2013 10:50:23 +0000 (16:20 +0530)]
thermal: exynos: Use ARCH_HAS_BANDGAP config to know the supported soc's

This patch uses the recently added config sybmol ARCH_HAS_BANDGAP to enable
the TMU driver. This will allow adding support for new soc easily as now it
is the platform responsibility to enable this config symbol for a particular
soc.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Moving exynos thermal files into samsung directory
Amit Daniel Kachhap [Fri, 1 Nov 2013 06:45:25 +0000 (15:45 +0900)]
thermal: exynos: Moving exynos thermal files into samsung directory

This movement of files is done for easy maintenance and adding more
new sensor's support for exynos platform easily . This will also help in
bifurcating exynos common, sensor driver and sensor data related parts.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: add imx thermal driver support
Shawn Guo [Mon, 24 Jun 2013 06:30:44 +0000 (14:30 +0800)]
thermal: add imx thermal driver support

This is based on the initial imx thermal work done by
Rob Lee <rob.lee@linaro.org> (Not sure if the email address is still
valid).  Since he is no longer interested in the work and I have
rewritten a significant amount of the code, I just took the authorship
over from him.

It adds the imx thermal support using Temperature Monitor (TEMPMON)
block found on some Freescale i.MX SoCs.  The driver uses syscon regmap
interface to access TEMPMON control registers and calibration data, and
supports cpufreq as the cooling device.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agoThermal: Fix lockup of cpu_down()
Steven Rostedt [Tue, 16 Jul 2013 18:02:28 +0000 (14:02 -0400)]
Thermal: Fix lockup of cpu_down()

Commit f1a18a105 "Thermal: CPU Package temperature thermal" had code
that did a get_online_cpus(), run a loop and then do a
put_online_cpus(). The problem is that the loop had an error exit that
would skip the put_online_cpus() part.

In the error exit part of the function, it also did a get_online_cpus(),
run a loop and then put_online_cpus(). The only way to get to the error
exit part is with get_online_cpus() already performed. If this error
condition is hit, the system will be prevented from taking CPUs offline.
The process taking the CPU offline will lock up hard.

Removing the get_online_cpus() removes the lockup as the hotplug CPU
refcount is back to zero.

This was bisected with ktest.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: x86_pkg_temp: Limit number of pkg temp zones
Srinivas Pandruvada [Mon, 15 Jul 2013 22:38:52 +0000 (15:38 -0700)]
Thermal: x86_pkg_temp: Limit number of pkg temp zones

Although it is unlikley that physical package id is set to some
arbitary number, it is better to prevent in anycase. Since package
temp zones use this in thermal zone type and for allocation, added
a limit.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: x86_pkg_temp: fix krealloc() misuse in in pkg_temp_thermal_device_add()
Wei Yongjun [Tue, 18 Jun 2013 13:09:12 +0000 (21:09 +0800)]
Thermal: x86_pkg_temp: fix krealloc() misuse in in pkg_temp_thermal_device_add()

If krealloc() returns NULL, it doesn't free the original. So any code
of the form 'foo = krealloc(foo, ...);' is almost certainly a bug.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: x86 package temp thermal crash
Srinivas Pandruvada [Thu, 11 Jul 2013 16:50:30 +0000 (09:50 -0700)]
Thermal: x86 package temp thermal crash

On systems with no package MSR support this caused crash as there
is a bug in the logic to check presence of DTHERM and PTS feature
together. Added a change so that when there is no PTS support, module
doesn't get loaded. Even if some CPU comes online with the PTS
feature disabled, and other CPUs has this support, this patch
will still prevent such MSR accesses.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: ti-soc-thermal: use standard GPIO DT bindings
Eduardo Valentin [Fri, 7 Jun 2013 15:11:53 +0000 (11:11 -0400)]
thermal: ti-soc-thermal: use standard GPIO DT bindings

This change updates the ti-soc-thermal driver to use
standard GPIO DT bindings to read the GPIO number associated
to thermal shutdown IRQ, in case the device features it.

Previously, the code was using a specific DT bindings.
As now OMAP supports the standard way to model GPIOs,
there is no point in having a ti specific binding.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree-discuss@lists.ozlabs.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
9 years agothermal: exynos: Support both EXYNOS4X12 SoCs
Tomasz Figa [Tue, 18 Jun 2013 16:31:50 +0000 (01:31 +0900)]
thermal: exynos: Support both EXYNOS4X12 SoCs

EXYNOS4212 and EXYNOS4412 have the same thermal block, so there is no
reason to include support only for EXYNOS4412 in this driver.

Cc: linux-pm@vger.kernel.org
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
9 years agothermal: fix x86_pkg_temp_thermal.c build and Kconfig
Randy Dunlap [Mon, 17 Jun 2013 19:27:17 +0000 (12:27 -0700)]
thermal: fix x86_pkg_temp_thermal.c build and Kconfig

Fix build error in x86_pkg_temp_thermal.c.  It requires that
X86_MCE & X86_THERMAL_VECTOR be enabled, so depend on the latter symbol,
since it depends on X86_MCE (indirectly).

Also, X86_PKG_TEMP_THERMAL is already inside an "if THERMAL" block,
so remove that duplicated dependency.

ERROR: "platform_thermal_package_rate_control" [drivers/thermal/x86_pkg_temp_thermal.ko] undefined!
ERROR: "platform_thermal_package_notify" [drivers/thermal/x86_pkg_temp_thermal.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: CPU Package temperature thermal
Srinivas Pandruvada [Fri, 17 May 2013 23:42:02 +0000 (23:42 +0000)]
Thermal: CPU Package temperature thermal

This driver register CPU digital temperature sensor as a thermal
zone at package level.
Each package will show up as one zone with at max two trip points.
These trip points can be both read and updated. Once a non zero
value is set in the trip point, if the package package temperature
goes above or below this setting, a thermal notification is
generated.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: consider emul_temperature while computing trend
Eduardo Valentin [Wed, 29 May 2013 21:37:00 +0000 (21:37 +0000)]
thermal: consider emul_temperature while computing trend

In case emulated temperature is in use, using the trend
provided by driver layer can lead to bogus situation.
In this case, debugger user would set a temperature value,
but the trend would be from driver computation.

To avoid this situation, this patch changes the get_tz_trend()
to consider the emulated temperature whenever that is in use.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: ti-soc-thermal: add dra752 chip to device table
Eduardo Valentin [Wed, 29 May 2013 15:07:45 +0000 (15:07 +0000)]
thermal: ti-soc-thermal: add dra752 chip to device table

Add support to TI dra752 chips by adapting the driver
device table.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: ti-soc-thermal: add thermal data for DRA752 chips
Eduardo Valentin [Mon, 3 Jun 2013 20:31:55 +0000 (20:31 +0000)]
thermal: ti-soc-thermal: add thermal data for DRA752 chips

This patch adds the thermal data for TI DRA752 chips.
In this change it includes (autogen):
. Register offset definitions
. Bitfields and masks for all registers
. Conversion table

Also, the thermal limits, thresholds and extrapolation
rules are included. The extrapolation rule is simply
add +2C as margin.

All 5 sensors, MPU, GPU, CORE, DSPEVE and IVA, are defined
and exposed. Only MPU has cooling device.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: ti-soc-thermal: remove usage of IS_ERR_OR_NULL
Eduardo Valentin [Wed, 29 May 2013 15:07:43 +0000 (15:07 +0000)]
thermal: ti-soc-thermal: remove usage of IS_ERR_OR_NULL

This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
macro. This macro can lead to dangerous results, like returning
success (0) during a failure scenario (NULL pointer handling).

For this reason this patch is changing the driver after
revisiting the code. These are the cases:
i. For cases in which IS_ERR_OR_NULL() is used for checking
return values of functions that returns either PTR_ERR()
or a valid pointer, it has been translated to IS_ERR() check only.
ii. For cases that a NULL check is still needed, it has been
translated to if (!ptr || IS_ERR(ptr)).

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: ti-soc-thermal: freeze FSM while computing trend
Eduardo Valentin [Fri, 7 Jun 2013 19:13:13 +0000 (19:13 +0000)]
thermal: ti-soc-thermal: freeze FSM while computing trend

In order to read the history buffer, it is required to
freeze BG FSM. This patch adds the missing piece of code
to freeze the FSM and also a contention area to avoid
other parts of the code to access the DTEMPs.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: ti-soc-thermal: remove external heat while extrapolating hotspot
Eduardo Valentin [Wed, 29 May 2013 15:07:41 +0000 (15:07 +0000)]
thermal: ti-soc-thermal: remove external heat while extrapolating hotspot

For boards that provide a PCB sensor close to SoC junction
temperature, it is possible to remove the cumulative heat
reported by the SoC temperature sensor.

This patch changes the extrapolation computation to consider
an external sensor in the extrapolation equations.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: cpu_cooling: fix 'descend' check in get_property()
Shawn Guo [Tue, 28 May 2013 06:22:32 +0000 (06:22 +0000)]
thermal: cpu_cooling: fix 'descend' check in get_property()

The variable 'descend' is initialized as -1 in function get_property(),
and will never get any chance to be updated by the following code.

if (freq != CPUFREQ_ENTRY_INVALID && descend != -1)
descend = !!(freq > table[i].frequency);

This makes function get_property() return the wrong frequency for given
cooling level if the frequency table is sorted in ascending.  Fix it
by correcting the 'descend' check in if-condition to 'descend == -1'.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: spear: Remove redundant use of of_match_ptr
Sachin Kamat [Thu, 16 May 2013 10:28:11 +0000 (10:28 +0000)]
Thermal: spear: Remove redundant use of of_match_ptr

'spear_thermal_id_table' is always compiled in and the driver
is dependent on OF. Hence use of of_match_ptr is unnecessary.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Vincenzo Frascino <vincenzo.frascino@st.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: kirkwood: Remove redundant use of of_match_ptr
Sachin Kamat [Thu, 16 May 2013 10:28:10 +0000 (10:28 +0000)]
Thermal: kirkwood: Remove redundant use of of_match_ptr

'kirkwood_thermal_id_table' is always compiled in and the driver
is dependent on OF. Hence use of of_match_ptr is unnecessary.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: dove: Remove redundant use of of_match_ptr
Sachin Kamat [Thu, 16 May 2013 10:28:09 +0000 (10:28 +0000)]
Thermal: dove: Remove redundant use of of_match_ptr

'dove_thermal_id_table' is always compiled in and the driver
is dependent on OF. Hence use of of_match_ptr is unnecessary.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: armada: Remove redundant use of of_match_ptr
Sachin Kamat [Thu, 16 May 2013 10:28:08 +0000 (10:28 +0000)]
Thermal: armada: Remove redundant use of of_match_ptr

'armada_thermal_id_table' is always compiled in and the driver
is dependent on OF. Hence use of of_match_ptr is unnecessary.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: introduce TI SoC thermal driver
Eduardo Valentin [Wed, 15 May 2013 15:46:00 +0000 (15:46 +0000)]
thermal: introduce TI SoC thermal driver

This patch moves the ti-soc-thermal driver out of
the staging tree to the thermal tree.

Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Rob Landley <rob@landley.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>
Cc: J Keerthy <j-keerthy@ti.com>
Cc: Radhesh Fadnis <radhesh.fadnis@ti.com>
Cc: Cyril Roelandt <tipecaml@gmail.com>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: don't check resource with devm_ioremap_resource
Zhang Rui [Thu, 16 May 2013 02:16:21 +0000 (02:16 +0000)]
Thermal: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource.
No need to duplicate this in the driver.

CC: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
CC: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
9 years agoThermal: core: Ask .get_trip_temp() to register thermal zone device.
Jonghwa Lee [Sat, 18 May 2013 09:50:26 +0000 (09:50 +0000)]
Thermal: core: Ask .get_trip_temp() to register thermal zone device.

This patch adds a requirement needing .get_trip_temp() callback
function for registering thermal zone device. This function is
used when thermal zone is updated and essential where thermal core
handles thermal trip based only polling way not hw interrupt.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: cut the spaces when user sets policy
Andy Shevchenko [Fri, 17 May 2013 11:52:02 +0000 (11:52 +0000)]
thermal: cut the spaces when user sets policy

Setting policy results in invalid value error.
% echo "step_wise" > policy
% echo: write error: Invalid argument

Need clean up of the buffer which "echo" may add based on the arguments, before
comparing aganist list of governor names.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Tested-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agothermal: rcar: Fix typo in probe information message
Laurent Pinchart [Tue, 14 May 2013 23:00:32 +0000 (23:00 +0000)]
thermal: rcar: Fix typo in probe information message

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: spear_thermal: convert to devm_ioremap_resource
Zhang Rui [Thu, 16 May 2013 02:16:20 +0000 (02:16 +0000)]
Thermal: spear_thermal: convert to devm_ioremap_resource

Use the newly introduced devm_ioremap_resource().

devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

CC: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agodrivers/thermal: don't check resource with devm_ioremap_resource
Wolfram Sang [Fri, 10 May 2013 08:17:11 +0000 (08:17 +0000)]
drivers/thermal: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: spear: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 09:57:13 +0000 (09:57 +0000)]
Thermal: spear: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Vincenzo Frascino <vincenzo.frascino@st.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: rcar: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 09:57:12 +0000 (09:57 +0000)]
Thermal: rcar: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: kirkwood: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 09:57:11 +0000 (09:57 +0000)]
Thermal: kirkwood: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: exynos: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 09:57:10 +0000 (09:57 +0000)]
Thermal: exynos: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: dove_thermal: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 09:57:09 +0000 (09:57 +0000)]
Thermal: dove_thermal: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoThermal: armada_thermal: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 09:57:08 +0000 (09:57 +0000)]
Thermal: armada_thermal: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
9 years agoRevert "Thermal: exynos: Support for TMU regulator defined at device tree"
Jonghwa Lee [Fri, 1 Nov 2013 05:54:23 +0000 (14:54 +0900)]
Revert "Thermal: exynos: Support for TMU regulator defined at device tree"

This reverts commit ed58c6a559cf9a870e55587872f9b0eb322e3e6b.

9 years agommc:sdhci-s3c: Use mmc_gpio_request_cd function
Beomho Seo [Fri, 1 Nov 2013 06:17:02 +0000 (15:17 +0900)]
mmc:sdhci-s3c: Use mmc_gpio_request_cd function

This patch used mmc_gpio_request function for detect card from cd gpio pin.

Include slot-gpio header file.
Use mmc_gpio_request_cd function.
Remove sdhci_s3c_setup_card_detect_gpio/card_detect_thread functions.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
9 years agotizen:config: Enable THERMAL and BOOST
Lukasz Majewski [Thu, 31 Oct 2013 17:01:29 +0000 (18:01 +0100)]
tizen:config: Enable THERMAL and BOOST

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoBOOST: Core code compliant with v9 of the patch
Lukasz Majewski [Thu, 31 Oct 2013 15:54:09 +0000 (16:54 +0100)]
BOOST: Core code compliant with v9 of the patch

Update the BOOST framework core to be compliant with v9 version of the patch

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoARM:exynos: Enable boost mode for exynos4412 redwood target
Lukasz Majewski [Mon, 10 Jun 2013 11:57:04 +0000 (13:57 +0200)]
ARM:exynos: Enable boost mode for exynos4412 redwood target

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ
Lukasz Majewski [Tue, 9 Jul 2013 07:08:43 +0000 (09:08 +0200)]
cpufreq:exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ

Special driver data flag (CPUFREQ_BOOST_FREQ) has been added to indicate
frequency, which can be only enabled for BOOST mode.
This frequency shall be used only for limited time, since it might cause
target device to overheat.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- New patch

9 years agoDocumentation:cpufreq:boost: Update BOOST documentation
Lukasz Majewski [Wed, 3 Jul 2013 12:36:24 +0000 (14:36 +0200)]
Documentation:cpufreq:boost: Update BOOST documentation

Since the support for software and hardware controlled boosting has been
added, the corresponding Documentation entry had been updated.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- None

Changes for v5:
- New patch

9 years agocpufreq:boost:Kconfig: Enable software managed BOOST support at Kconfig
Lukasz Majewski [Thu, 18 Jul 2013 13:33:28 +0000 (15:33 +0200)]
cpufreq:boost:Kconfig: Enable software managed BOOST support at Kconfig

For safety reasons new flag - CONFIG_CPU_FREQ_BOOST_SW has been added.
Only after selecting "CPU Frequency Overclocking - Software" Kconfig
option the software managed boost is enabled. It also requires thermal
subsystem to be compiled in. Thermal is necessary for disabling boost
and cooling down the device when overheating detected.

Boost _MUST_NOT_ be enabled without thermal subsystem with properly
defined temperatures which indicate overheating.

This option doesn't affect x86's ACPI hardware managed boost support
(i.e. Intel, AMD). In this situation boost management is embedded at
hardware.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- Remove platform dependency (EXYNOS_THERMAL) in selecting software
  managed boost. Now boost only depends on THERMAL.
- Remove CPUFREQ dependency
- Software boost Kconfig name has been edited

Changes for v5:
- New patch

9 years agothermal:boost: Automatic enable/disable of BOOST feature
Lukasz Majewski [Mon, 8 Jul 2013 15:15:11 +0000 (17:15 +0200)]
thermal:boost: Automatic enable/disable of BOOST feature

This patch provides auto disable/enable operation for boost. When any
defined trip point is passed, the boost is disabled.
In that moment thermal monitor workqueue is woken up and it monitors
if the device temperature drops below 75% of the smallest trip point.
When device cools down, the boost is enabled again.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- Disable boost only when supported and enabled
- Protect boost related thermal_zone_device struct fields with mutex
- Evaluate temperature trend during boost enable decision
- Create separate methods to handle boost enable/disable
  (thermal_boost_{enable|disable}) operations
- Boost is disabled at any trip point passage (not only the non critical one)

Changes for v5:
- Move boost disable code from cpu_cooling.c to thermal_core.c
  (to handle_non_critical_trips)
- Extent struct thermal_zone_device by adding overheated bool flag
- Implement auto enable of boost after device cools down
- Introduce boost_polling flag, which indicates if thermal uses it's predefined
  pool delay or has woken up thermal workqueue only to wait until device
  cools down.

Changes for v4:
- New patch

9 years agocpufreq:exynos:Extend Exynos cpufreq driver to support boost framework
Lukasz Majewski [Thu, 18 Jul 2013 14:49:53 +0000 (16:49 +0200)]
cpufreq:exynos:Extend Exynos cpufreq driver to support boost framework

The struct cpufreq_driver has been extended to embrace the information
related to boost support.

When "boost_mode" device tree attribute is defined for a platform, the
boost_supported flag is set. Moreover boost related attributes were
exported.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- replace exynos_driver.boost_supported = 1 to = true

Changes for v5:
- None

Changes for v4:
- None

Changes for v3:
- Remove low level boost code
- Move boost management code to cpufreq core code
- Use boost_supported flag to indicate if driver supports over clocking

Changes for v2:
- Removal of struct cpufreq_boost
- Removal of the CONFIG_CPU_FREQ_BOOST flag
- low_level_boost with valid address when boost is supported

9 years agocpufreq:acpi:x86: Adjust the acpi-cpufreq.c code to work with common boost solution
Lukasz Majewski [Wed, 3 Jul 2013 15:36:25 +0000 (17:36 +0200)]
cpufreq:acpi:x86: Adjust the acpi-cpufreq.c code to work with common boost solution

The Intel's hardware based boost solution driver has been changed to cooperate with
common cpufreq boost framework.

The global sysfs boost attribute entry code (/sys/devices/system/cpu/cpufreq/boost)
has been moved to a core cpufreq code. This attribute is now only visible,
when cpufreq driver supports it.

The _store_boost() function has been redesigned to be used as enable_boost
callback.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- Use boost_enabled flag defined at acpi_cpufreq_driver to store information
  about boost state
- Instead of using cpufreq_set_boost_enabled(), modify the boost_enable in
  the acpi driver code

Changes for v5:
- Remove acpi-cpufreq's boost_enabled global flag and reuse one defined at
  cpufreq core

Changes for v4:
- add _store_boost to acpi_cpufreq_driver structure

Changes for v3:
- Bring back boost_enabled as a global flag
- Move boost_supported to cpufreq_driver structure

Changes for v2:
- Replace boost_enabled and boost_supported global flags with proper entries
at struct cpufreq_driver.
- Removal of struct cpufreq_boost

9 years agocpufreq: Add boost frequency support in core
Lukasz Majewski [Fri, 19 Jul 2013 11:33:13 +0000 (13:33 +0200)]
cpufreq: Add boost frequency support in core

This commit adds boost frequency support in cpufreq core (Hardware &
Software).
Some SoC (like Exynos4 - e.g. 4x12) allow setting frequency above
its normal operation limits. Such a mode shall be only used for a short
time.

Overclocking (boost) support is essentially provided by platform
dependent cpufreq driver.

This commit unifies support for SW and HW (Intel) overclocking solutions
in the core cpufreq driver. Previously the "boost" sysfs attribute was
defined at acpi driver code.
By default boost is disabled. One global attribute is available at:
/sys/devices/system/cpu/cpufreq/boost.

It only shows up when cpufreq driver supports overclocking.
Under the hood frequencies dedicated for boosting are marked with a
special flag (CPUFREQ_BOOST_FREQ) at driver's frequency table.
It is the user's concern to enable/disable overclocking with proper call to
sysfs.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- Remove sysfs boost attribute when subsys_iterface_unregister() fails
- Move global boost_enabled variable from cpufreq.c to platform dependent
  struct cpufreq_driver
- pr_err() message is also printed when boost disable fails

Changes for v5:
- Rename cpufreq_boost_trigger_state_sw() to cpufreq_boost_enable_sw()
- Extent cpufreq_register_driver() to check if cpufreq driver provided
  boost_enable callback. If not provided, then use cpufreq_boost_enable_sw()
- Use single call to cpufreq_driver->enable_boost() with cpufreq driver
  provided callback or default SW boost enable routine
- Move pr_debug call to store_boost() from cpufreq_boost_trigger_state()
- Change the user_policy.max value when SW boost is toggled. It is necessary
  for proper operation of e.g. thermal subsystem.
- Add check if cpufreq_driver pointer is not NULL at
  cpufreq_boost_supported() routine
- Add EXPORT_SYMBOL_GPL for cpufreq_boost_supported() and
  cpufreq_boost_enabled()
- Remove extra check for cpufreq_boost_supported() at
  cpufreq_freq_table_cpuinfo()
- Explanation of show boost logic at show_available_freqs()
- Add cpufreq_set_boost_enabled() method to set initial value of boost_enabled
  global flag

Changes for v4:
- Remove boost parameter from cpufreq_frequency_table_cpuinfo() function
- Introduce cpufreq_boost_supported() method
- Use of cpufreq_boost_supported() and cpufreq_boost_enabled() to decide
  if frequency shall be skipped
- Rename set_boost_freq() to enable_boost()
- cpufreq_attr_available_freq() moved to freq_table.c
- Use policy list to get access to cpufreq policies
- Rename global boost flag (cpufreq_boost_enabled -> boost_enabled)
- pr_err corrected ( %sable)
- Remove sanity check at cpufreq_boost_trigger_state() entrance [to test if
  boost is supported]
- Use either HW (boost_enable) callback or SW managed boost
- Introduce new cpufreq_boost_trigger_state_sw() method to handle boost
  at SW.
- Protect boost_enabled manipulation with lock.

Changes for v3:
- Method for reading boost status
- Removal of cpufreq_frequency_table_max()
- Extent cpufreq_frequency_table_cpuinfo() to support boost parameter
- boost_supported flag added to cpufreq_driver struct
- "boost" sysfs attribute control flag removed
- One global flag describing state of the boost defined at cpufreq core
- Rename cpufreq_driver's low_level_boost field to set_boost_freq()
- Usage of cpufreq_sysfs_{remove|add}_file() routines

Changes for v2:
- Removal of cpufreq_boost structure and move its fields to cpufreq_driver
  structure
- Flag to indicate if global boost attribute is already defined
- Extent the pr_{err|debbug} functions to show current function names

9 years agocpufreq: Store cpufreq policies in a list
Lukasz Majewski [Tue, 2 Jul 2013 16:01:10 +0000 (18:01 +0200)]
cpufreq: Store cpufreq policies in a list

Policies available in a cpufreq framework are now linked together. They are
accessible via cpufreq_policy_list defined at cpufreq core.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Changes for v6:
- Move policy list entry delete code to __cpufreq_remove_dev()

Changes for v5:
- Call list_add() only when device successfully added

Changes for v4:
- New patch

9 years agocpufreq: Don't create empty /sys/devices/system/cpu/cpufreq directory
Viresh Kumar [Fri, 17 May 2013 10:39:09 +0000 (16:09 +0530)]
cpufreq: Don't create empty /sys/devices/system/cpu/cpufreq directory

When we don't have any file in cpu/cpufreq directory we shouldn't
create it. Specially with the introduction of per-policy governor
instance patchset, even governors are moved to
cpu/cpu*/cpufreq/governor-name directory and so this directory is
just not required.

Lets have it only when required.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
9 years agocosmetic: max77686: Remove unused variable
Lukasz Majewski [Thu, 31 Oct 2013 15:51:54 +0000 (16:51 +0100)]
cosmetic: max77686: Remove unused variable

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoregulator:max77686: Correct GPIOs for BUCK2 DVS setting
Lukasz Majewski [Thu, 31 Oct 2013 15:52:55 +0000 (16:52 +0100)]
regulator:max77686: Correct GPIOs for BUCK2 DVS setting

Before this patch SELB and DVS pins were wrongly defined in the DTS.

As a result MAX77686 always used BUCK2_DVS1 register (the DVS pins were
set all to 0). However the default DVS index (default_dvs_idx) was set to 1.

Therefore, the default value of BUCK2_DVS1 register (1.1V) was always
setup. Wrongly the driver was changing BUCK2_DVS2 register. Due to that
voltage was NOT changed at all.

The problem appeared when BOOST was ported to v3.10-mobile. It requires
around 1.3V, but default voltage is set to 1.1V (0x28). Too small voltage
resulted in OOPs at random places.

As a side note:
The MAX77686 is NOT using DVS with GPIO. It changes the value of current
voltage with I2C utilization.

Tested at: REDWOOD - Exynos4412 - rev1.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agontc_thermistor: Update DT and board configuration to enable NTC thermistors.
Jonghwa Lee [Thu, 31 Oct 2013 15:34:32 +0000 (00:34 +0900)]
ntc_thermistor: Update DT and board configuration to enable NTC thermistors.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoADC: EXYNOS4412: Update DT and board configuration to enable ADC.
Jonghwa Lee [Thu, 31 Oct 2013 15:25:47 +0000 (00:25 +0900)]
ADC: EXYNOS4412: Update DT and board configuration to enable ADC.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agocharger-manager: Fix unit of temperature to deci centigrade.
Jonghwa Lee [Thu, 31 Oct 2013 02:20:56 +0000 (11:20 +0900)]
charger-manager: Fix unit of temperature to deci centigrade.

Fix temperature unit to follow the standard as document describes.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoRevert "battery: max17042/7: Fix temperature unit to milli centigrade."
Jonghwa Lee [Thu, 31 Oct 2013 02:20:27 +0000 (11:20 +0900)]
Revert "battery: max17042/7: Fix temperature unit to milli centigrade."

This reverts commit 79b1d3591b35022b93f2d70c299e74eb54bfec09.

9 years agodisplay: panels: remove duplicated display_entity_set_state() for pm
Donghwa Lee [Wed, 30 Oct 2013 06:46:07 +0000 (15:46 +0900)]
display: panels: remove duplicated display_entity_set_state() for pm

remove duplicated display_entity_set_state() in suspend/resume function

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
9 years agoexynos: drm_fimd: remove duplicated clock control for fimd_dpms
Donghwa Lee [Tue, 29 Oct 2013 07:46:33 +0000 (16:46 +0900)]
exynos: drm_fimd: remove duplicated clock control for fimd_dpms

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
9 years agoexynos: drm_fimd: support lcdblk system register control
Donghwa Lee [Tue, 29 Oct 2013 07:40:20 +0000 (16:40 +0900)]
exynos: drm_fimd: support lcdblk system register control

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
9 years agommc: core: change the clkgate_delay value from 0 to 3.
Jaehoon Chung [Mon, 28 Oct 2013 06:13:22 +0000 (15:13 +0900)]
mmc: core: change the clkgate_delay value from 0 to 3.

When clkgate_delay is set to 0, then clk is gated at every request.
It's inefficient. So, it's changed from 0 to 3.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
9 years agodrivers: s3c-hsotg: hide some not really needed debug messages
Marek Szyprowski [Tue, 22 Oct 2013 13:23:24 +0000 (15:23 +0200)]
drivers: s3c-hsotg: hide some not really needed debug messages

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agodrivers: s3c-hsotg: fix incorrect condition for clear_feature request
Marek Szyprowski [Tue, 22 Oct 2013 13:03:59 +0000 (15:03 +0200)]
drivers: s3c-hsotg: fix incorrect condition for clear_feature request

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agodrivers: s3c-hsotg: fix regulator enable sequence in resume callback
Marek Szyprowski [Fri, 25 Oct 2013 09:24:21 +0000 (11:24 +0200)]
drivers: s3c-hsotg: fix regulator enable sequence in resume callback

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoOF: fdt: Add support for parsing system serial number from device tree
Tomasz Figa [Thu, 26 Sep 2013 17:14:37 +0000 (19:14 +0200)]
OF: fdt: Add support for parsing system serial number from device tree

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: atags_to_fdt: Add support for passing serial number
Tomasz Figa [Thu, 26 Sep 2013 17:14:12 +0000 (19:14 +0200)]
ARM: atags_to_fdt: Add support for passing serial number

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4412_slp_pq: add the desc_num for mshc
Jaehoon Chung [Thu, 24 Oct 2013 13:36:43 +0000 (22:36 +0900)]
ARM: dts: exynos4412_slp_pq: add the desc_num for mshc

Add the desc_num for mshc. (using 4)

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
9 years agommc: dw_mmc: add the platdat for descriptor number.
Jaehoon Chung [Thu, 24 Oct 2013 13:35:36 +0000 (22:35 +0900)]
mmc: dw_mmc: add the platdat for descriptor number.

This platdata is related with buffer size.
It's increaed the performance.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
9 years agoARM: dts: exynos4412-spl_pq: rename the fixed regulator for eMMC
Jaehoon Chung [Thu, 24 Oct 2013 12:40:24 +0000 (21:40 +0900)]
ARM: dts: exynos4412-spl_pq: rename the fixed regulator for eMMC

VMEM_2.8V is already defined for LDO22.
Fixed regulator need to rename the other.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
9 years agodrm/exynos: fix to calculate offset of each plane for ipp fimc
Seung-Woo Kim [Tue, 22 Oct 2013 07:44:13 +0000 (16:44 +0900)]
drm/exynos: fix to calculate offset of each plane for ipp fimc

NV12 and YUV420 formats are need to calculate offset of each plane
for ipp fimc in a gem buffer. Without proper offset, only Y plane
can be processed, so result shows green frame.
This patch fixes to calculate offset for cbcr planes for NV12 and
YUV420 formats.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agodrm/exynos: add support ARGB8888 for ipp fimc
Seung-Woo Kim [Fri, 4 Oct 2013 06:45:37 +0000 (15:45 +0900)]
drm/exynos: add support ARGB8888 for ipp fimc

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
9 years agocharger-manager: Parse charger_desc from device tree.
Jonghwa Lee [Tue, 22 Oct 2013 07:53:55 +0000 (16:53 +0900)]
charger-manager: Parse charger_desc from device tree.

With this patch, charger-manager can support device tree fully.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agodrivers: s3c-hsotg: add proper suspend/resume support
Marek Szyprowski [Tue, 22 Oct 2013 12:42:14 +0000 (14:42 +0200)]
drivers: s3c-hsotg: add proper suspend/resume support

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agobattery: max17042/7: Fix temperature unit to milli centigrade.
Jonghwa Lee [Tue, 22 Oct 2013 07:55:52 +0000 (16:55 +0900)]
battery: max17042/7: Fix temperature unit to milli centigrade.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agocharger-manager : Add default battery temperature checking funtion.
Jonghwa Lee [Tue, 22 Oct 2013 08:35:58 +0000 (17:35 +0900)]
charger-manager : Add default battery temperature checking funtion.

During the charger manager driver's probing time, it can't succeed
if there's no pre-defined .temperature_out_of_range callback function.
But if fuel gauge supports battery temperature measurement, we
can use it directly. That's what cm_default_get_temp() function does.

With flag measure_batter_temp ON, we normally use cm_default_get_temp()
for .temperature_out_of_range callback funtion.
The TEMP_AMBIENT property is only used for pre-defined one.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agocharger-manager : Replace kzalloc to devm_kzalloc and remove uneccessary code.
Jonghwa Lee [Mon, 21 Oct 2013 11:03:16 +0000 (20:03 +0900)]
charger-manager : Replace kzalloc to devm_kzalloc and remove uneccessary code.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agocharger-manager: Add cm_chg_add_prorperty() macro.
Jonghwa Lee [Mon, 21 Oct 2013 09:33:48 +0000 (18:33 +0900)]
charger-manager: Add cm_chg_add_prorperty() macro.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoM0 : charging : Make to charge battery fully.
Jonghwa Lee [Wed, 16 Oct 2013 10:42:19 +0000 (19:42 +0900)]
M0 : charging : Make to charge battery fully.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoFuel Guague: MAX17042: Use regmap to interface with internal registers
Jonghwa Lee [Wed, 16 Oct 2013 04:39:11 +0000 (13:39 +0900)]
Fuel Guague: MAX17042: Use regmap to interface with internal registers

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoextcon: Extcon load time modification
Kamil Debski [Tue, 15 Oct 2013 13:30:00 +0000 (15:30 +0200)]
extcon: Extcon load time modification

This modification enables use of extcon by drivers loaded early during the
boot (e.g. udc-core).

Signed-off-by: Kamil Debski <k.debski@samsung.com>
9 years agousb: gadget: udc-core: Add extcon hanling to reduce power use
Kamil Debski [Tue, 15 Oct 2013 11:55:18 +0000 (13:55 +0200)]
usb: gadget: udc-core: Add extcon hanling to reduce power use

Extcon driver provides information about what kind of cable has been
inserted in the device's USB port. Power use can be reduced if UDC is
switched off while no suitable cable is present.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
9 years agos3c-hsotg: Fix driver context storing
Kamil Debski [Tue, 15 Oct 2013 13:16:05 +0000 (15:16 +0200)]
s3c-hsotg: Fix driver context storing

Before applying this fix calling s3c_hsotg_udc_start, *stop and *start
again resulted in a WARN_ON(hsotg->driver) being triggered in *start.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
9 years agos3c-hsotg: Regulator switching fix
Kamil Debski [Tue, 15 Oct 2013 13:26:40 +0000 (15:26 +0200)]
s3c-hsotg: Regulator switching fix

This patch delays switching off regulators in s3c_hsotg_udc_stop after
the critical section has been finished.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
9 years agophy: exynos-usb: Remove ref counting for additional reset for Exynos4212
Kamil Debski [Tue, 15 Oct 2013 13:41:41 +0000 (15:41 +0200)]
phy: exynos-usb: Remove ref counting for additional reset for Exynos4212

Reference counting in this case is not necessary.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
9 years agodts: exynos4412-slp_pq: Remove regulator_always_on for HSIC regulator
Kamil Debski [Tue, 15 Oct 2013 13:41:32 +0000 (15:41 +0200)]
dts: exynos4412-slp_pq: Remove regulator_always_on for HSIC regulator

This regulator should be switched on/off by driver that use it.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
9 years agodts: Add extcon phandle to hsotg node
Lukasz Czerwinski [Fri, 19 Jul 2013 07:01:50 +0000 (09:01 +0200)]
dts: Add extcon phandle to hsotg node

This patch adds extconi device(max77693) phandle for s3c_hsotg node.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agomfd: max77693: Add max77693-pmuic compatible
Lukasz Czerwinski [Thu, 18 Jul 2013 11:58:43 +0000 (13:58 +0200)]
mfd: max77693: Add max77693-pmuic compatible

This patch adds of_compatible field for max7763-pmuic - mfd device

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>