Commit Graph

55 Commits

Author SHA1 Message Date
Manaf Meethalavalappu Pallikunhi 2b81902ec5 msm: limits: Add S1 supply current limiting driver for MSM8909
This driver is a current limit management module to help manage
instantaneous peak current drawn by multiple subsystems on shared
supply. The inputs to the mitigation algorithm are current states
of different subsystems sharing this supply like cpu frequency,
gpu frequency, number of cores online, soc temperature, core leakage,
and modem state. It throttles cpu frequency and limits number of
online cores to reduce the dynamic current so as to keep the total
current drawn from supply in safe limits.

Change-Id: I4592b8be48bad3709e8cfb09da53f23279a8ff9b
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2015-01-29 06:58:48 -08:00
Ram Chandrasekar 0135bfa848 msm: limits: lmh_lite: Add limits management hardware driver
Add a driver to interact with the limits management hardware
lite (LMH-lite).

This driver provides API, which will interact with the trustzone
for getting details like the,
1. sensors supported by the LMH
2. sensors throttling intensity
3. various operating profiles

The driver also provides API for changing the LMH operating profile
and to enable or disable hardware event logs.

The driver handles the interrupt from the LMH-Lite hardware and
notifies the LMH ISR framework. The LMH ISR framework monitors the
throttling intensity of the sensors and then re-arms the interrupt
when the throttling intensities of all the sensors are zero.

CRs-Fixed: 704088
CRs-Fixed: 698387
Change-Id: I9eafb572c4a2a2d89ea55baa4eef23d592d32170
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2014-10-09 20:32:36 -06:00
Ram Chandrasekar 3e138675f5 msm: limits: A new LMH monitor driver
Add a new Limits management hardware (LMH) monitor driver.
The LMH hardware driver, which interacts with the LMH hardware
via a secure image like TZ or hypervisor should register all
the LMH sensors with this driver. LMH monitor driver in turn
registers the sensors with the thermal sysfs framework.

The LMH monitor driver, when notified of a hardware throttling
interrupt by the hardware driver, will read the throttling
intensity and notify the thermal sysfs framework when
thresholds are crossed.

If the LMH hardware is capable of supporting multiple operating
profiles, then it can register itself separately as LMH
profile device. LMH Monitor driver exposes APIs to get/set the
LMH profiles.

LMH monitor driver exposes the below debugfs interfaces.

/sys/kernel/debug/lmh_monitor/interrupt_poll_delay_msec
  - Configures the interrupt polling interval in the LMH
    monitor driver. This value can be used by the hardware
    driver also.
/sys/kernel/debug/lmh_monitor/hw_trace_enable
  - Enable/disable LMH trace
/sys/kernel/debug/lmh_monitor/hw_trace_interval
  - Interval in XO clock ticks for adding timestamp in the
    trace logs.
/sys/kernel/debug/lmh_monitor/lmh-profile/level
  - Set or get the current LMH operating profile
/sys/kernel/debug/lmh_monitor/lmh-profile/total_levels
  - Total operating profile levels supported in this platform
/sys/kernel/debug/lmh_monitor/lmh-profile/available_levels
  - Lists the available profile levels for this platform.

CRs-Fixed: 704088
CRs-Fixed: 698387
Change-Id: I9afb9b8ef8532d8af383b9afc039654a2d550af4
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2014-10-09 20:31:29 -06:00
Manaf Meethalavalappu Pallikunhi 229d7a6791 msm: thermal: Add multi-platform support for KTM
Add multi-platform support to KTM, by cleaning up certain data types,
by removing deprecated header and adding support for KTM IOCTL for
compat platform.

Change-Id: I7816135a7b7e851f47801475949533579f22f770
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2014-04-04 00:08:53 +05:30
Viresh Kumar 67f699ebc1 cpufreq: remove CONFIG_CPU_FREQ_TABLE
CONFIG_CPU_FREQ_TABLE will be always enabled when cpufreq framework is used, as
cpufreq core depends on it. So, we don't need this CONFIG option anymore as it
is not configurable. Remove CONFIG_CPU_FREQ_TABLE and update its users.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Git-commit: 3bc28ab6da039f8020bbcea8e832b63a900bdb66
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[junjiew@codeaurora.org: resolved merge conflicts for Kconfig.arm and
 Kconfig.powerpc by ignoring missing configs. Searched and removed
 CPU_FREQ_TABLE config in our tree (arch/arm/mach-tegra/Kconfig,
 arch/powerpc/platforms/Kconfig, Documentation/android.txt). These conflicts
 are generated because we don't pull Kconfig changes for archs we don't use.]
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2013-12-20 19:07:16 -08:00
Ian Maund f06163e6d0 msm: reap unused kernel files
This change removes source files from the kernel tree that
were not being used during make. The list of used files
was generated using an annotated make log and was then
compared with new files added since the public release of
kernel version 3.10.00. New files which were added but
not used have been removed from the tree.

A diff was also run to determine the list of files that had
been modified since the release of kernel version 3.10.00.
These files were then scrubbed based on the current kernel
configuration, removing invalid and unused conditionals.

Some files which support planned functionality or are
useful in debugging have been excluded from this reap.

Change-Id: Ia44a224d3cea7bc78dd45e8a8279860d35d4b008
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2013-11-21 17:45:28 -08:00
Siddartha Mohanadoss 758a9c329c thermal: qpnp-adc: Add thermal monitoring ADC driver
The thermal monitoring QPNP ADC driver is used for
monitoring multiple channels with recurring
measurements. It configures the VADC_TM peripheral
to set voltage and temperature thresholds and
notifies clients once the thresholds are crossed.

Upto five channels can be individually configured
for input channel, interval time, low and high
threshold.

The driver is added as part of the thermal sysfs
interface to provide the thermal clients the
ability to set temperature thresholds and receive
notification. Clients can separately enable/disable
low/high temperature thresholds for notification.
Channels 3 through 5 are allocated for thermistor
channels that can be used by the thermal clients
using thermal sysfs for temperature threshold
notification.

Separate kernel api's are provided for usb_id
and batt_therm driver to set voltage and temperature
threshold notifications. TM Channels 0 and 1 are
statically mapped for usb_id and batt_therm monitoring
respectively.

Change-Id: I8de8a494d68d3b29c029fdc7d650a8b74f17a645
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2013-09-04 15:43:25 -07:00
David Collins 9ef6bfe3f6 thermal: Add QPNP PMIC temperature alarm driver
Add support for the temperature alarm peripheral found inside
Qualcomm plug-and-play (QPNP) PMIC chips.  The temperature alarm
peripheral outputs a pulse on an interrupt line whenever the
thermal over temperature stage value changes.  Implement an ISR
to manage this interrupt.

Register a thermal zone device in sysfs with mulitple trip points
corresponding to the physical threshold temperatures between over
temperature stages.  The temperature reported by this thermal
zone device should reflect the actual PMIC die temperature if an
ADC is present on the given PMIC.  If no ADC is present, then the
reported temperature should be estimated from the over
temperature stage value.

Send a notification to userspace via sysfs_notify() whenever the
over temperature stage value changes.

Change-Id: Icce6f3668befd9455270d7a8e553e76501d9bd74
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 15:28:42 -07:00
Eugene Seah 29db7d4065 msm: Add support for thermal monitor on msm8974
Add thermal monitoring and mitigation to kernel boot on msm8974
to prevent thermal conditions during boot time.

Change-Id: I9db10a4a69772fdcb8f2a450044ce446da8b593c
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
2013-09-04 15:08:44 -07:00
Siddartha Mohanadoss 2c24e56b58 thermal: tsens: Add 8974 TSENS driver
MSM8974 TSENS block supports 11 temperature
sensors that are used for thermal mitigation.

The TSENS driver is part of the thermal sysfs
framework that allows clients to set thresholds
and receive notification on temperature thresholds
being crossed through thermal sysfs.

The driver provides ability to thermal clients
to set upper/lower thresholds for each sensor
and receive individual notification for each
sensor once the threshold is crossed.

All sensors are enabled by default during
driver initialization.

The driver is initialized early during kernel
initialization to provide capability to the
thermal kernel driver to read temperature
from the TSENS sensors. To support this feature
a kernel API is provide to read the TSENS
temperature.

Change-Id: If17daae81cfb522a9cea786b5db0c920adb5ed2d
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2013-09-04 15:01:52 -07:00
Praveen Chidambaram 7fb15b46c7 msm: thermal: Simplify kernel thermal safeguard mechanism
Using CPUFreq policy objects and setting the max frequency limit by
overriding the policy->max node, leads to race/overwrite conditions with
an user trying to use the scaling_max_frequency node.

The thermal limits are directly communicated to the 'msm' cpufreq driver
and use the cpufreq_update_policy() to ensure that the frequency is
limited as per the thermal safeguard requirements.

CRs-fixed: 370343
Change-Id: Iab5a15e0f0d25da4b9f6a9417dbfc01bf5d6f8f6
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
2013-09-04 14:56:41 -07:00
Praveen Chidambaram 7fcfde3426 msm: thermal: Add MSM thermal sensing and limiting
Add a thermal driver to poll and detect any thermal condition at boot
and limit max cpu frequency on a thermal condition. This driver is
intended to limit cpu thermal output until the userspace thermald
kicks in. The thermald will disable this driver and take over the
cpu thermal sensing and mitigation.

Change-Id: I2710bfdeb5bf01c864437e13da835621d1b9202c
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-09-04 14:50:15 -07:00
Siddartha Mohanadoss e76007faba thermal: msm: Update TSENS for 8960_V2
TSENS V2 supports reading from multiple sensors and
notifiying clients when the lower/upper thresholds
are reached. The lower/upper threshold use the last
sensors threshold that are set through the thermal sysfs.
TSENS HW is enabled only when the main sensor is requested.
The TSENS block is disabled if the main senors is disabled
irrespective of any other sensors that are being enabled.
When TSENS receives notification on temperature threshold
being reached, it checks and sends events to the sensors
that are enabled and whose thresholds are above the upper
or below the lower thresholds set in the tsens threshold
register.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-09-04 14:50:07 -07:00
David Collins 6cc8e56c05 thermal: pm8xxx: Add pm8xxx thermal management driver
Add a PMIC PM8xxx thermal management driver which handles
interrupts associated with thermal overload events and
which provides a means to read the current PMIC die
temperature.

Change-Id: I2063be9335be2971810358e82dd273e8a0acec5a
Signed-off-by: David Collins <collinsd@codeaurora.org>
2013-09-04 14:50:03 -07:00
Siddartha Mohanadoss 8ec7b270e0 thermal: msm_tsens: Add temperature sensor driver
The msm_tsens driver provides temperature notification to
thermal sys driver once the set threshold temperature
is reached and supports configuring the temperature
thresholds. The thermal sys interface is used by userspace
clients to set the configurable temperature thresholds and
receive notification.

Change-Id: I4fcbd2d88a1d36b9eacaeca1925cfe2d3b72f3d9
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-09-04 14:50:03 -07:00
Laura Abbott 54f567fc34 thermal: Add MSM POP memory thermal driver
Add msm_popmem-tm driver for monitoring the temperature of
MSM POP memory. The temperature reported is based off of
the refresh rate of the POP memory. The temperatures
are reported as follows:

Low Temperature: 25C
Normal Temperature: 50C
High (out of range) Temperature: 85C

Change-Id: Id299ac574745b2a5580ff9999dd514481468c184
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-09-04 14:50:01 -07:00
Eduardo Valentin f7188b3dde thermal: cpu_cooling: update Kconfig entry
There is no support for hotplug or any other means of reducing
temperature. So, this patch removes these references from Kconfig.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:40 +08:00
Zhang Rui bbf7fc88c7 Thermal: build cpu_cooling code into thermal_sys module
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
2013-04-14 23:28:49 +08:00
Eduardo Valentin 8837295a73 thermal: add a warning for temperature emulation feature
Because this feature is for debuging purposes, it is highly
recommended to do not enable this on production systems.
This patch adds warnings for system integrators, so that
people are aware of this potential security issue.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-02 21:34:42 +08:00
Amit Daniel Kachhap bffd1f8ac8 thermal: exynos: Adapt to temperature emulation core thermal framework
This removes the driver specific sysfs support of the temperature
emulation and uses the newly added core thermal framework for thermal
emulation. An exynos platform specific handler is added to support this.

In this patch, the exynos senor(tmu) related code and exynos framework
related (thermal zone, cooling devices) code are intentionally kept separate.
So an emulated function pointer is passed from sensor to framework. This is
beneficial in adding more sensor support using the same framework code
which is an ongoing work. The goal is to finally split them totally. Even
the existing read_temperature also follows the same execution method.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-02 21:29:54 +08:00
Ezequiel Garcia fa0d654c84 thermal: Add driver for Armada 370/XP SoC thermal management
This driver supports both Armada 370 and Armada XP SoC
thermal management controllers.

Armada 370 has a register to check a valid temperature, whereas
Armada XP does not. Each has a different initialization (i.e. calibration)
function. The temperature conversion formula is the same for both.

The controller present in each SoC have a very similar feature set,
so it corresponds to have one driver to support both of them.

Although this driver may present similarities to Dove and Kirkwood
thermal driver, the exact differences and coincidences are not fully
known. For this reason, support is given through a separate driver.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-02 21:04:09 +08:00
Zhang Rui 9d185d0417 Thermal: rename thermal governor Kconfig option to avoid generic naming
Currently, we have three Kconfig options for thermal governors, aka,
CONFIG_FAIR_SHARE, CONFIG_USER_SPACE and CONFIG_STEP_WISE.
But these names are too generic that may bring confusion to users.

Rename them to CONFIG_THERMAL_GOV_FAIR_SHARE,
CONFIG_THERMAL_GOV_USER_SPACE, CONFIG_THERMAL_GOV_STEP_WISE
to avoid the generic naming.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-02-08 20:33:42 +08:00
Andrew Lunn 74ffa64c23 Thermal: Dove: Add Themal sensor support for Dove.
The Marvell Dove SoC has a thermal sensor. Add a driver using the
thermal framework.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-02-08 20:26:02 +08:00
Nobuhiro Iwamatsu 7060aa3664 thermal: Add support for the thermal sensor on Kirkwood SoCs
This patch adds support for Kirkwood 88F6282 and 88F6283 thermal sensor.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-02-08 20:25:56 +08:00
Amit Daniel Kachhap e6e238c38b thermal: sysfs: Add a new sysfs node emul_temp for thermal emulation
This patch adds support to set the emulated temperature method in
thermal zone (sensor). After setting this feature thermal zone may
report this temperature and not the actual temperature. The emulation
implementation may be based on sensor capability through platform
specific handler or pure software emulation if no platform handler defined.

This is useful in debugging different temperature threshold and its
associated cooling action. Critical threshold's cannot be emulated.
Writing 0 on this node should disable emulation.

Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-02-06 13:45:42 +08:00
Jacob Pan d6d71ee4a1 PM: Introduce Intel PowerClamp Driver
Intel PowerClamp driver performs synchronized idle injection across
all online CPUs. The goal is to maintain a given package level C-state
ratio.

Compared to other throttling methods already exist in the kernel,
such as ACPI PAD (taking CPUs offline) and clock modulation, this is often
more efficient in terms of performance per watt.

Please refer to Documentation/thermal/intel_powerclamp.txt for more details.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-02-06 13:45:00 +08:00
Jonghwa Lee bbf63be4f3 Thermal: exynos: Add sysfs node supporting exynos's emulation mode.
This patch supports exynos's emulation mode with newly created sysfs node.
Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal
management unit. Thermal emulation mode supports software debug for TMU's
operation. User can set temperature manually with software code and TMU
will read current temperature from user value not from sensor's value.
This patch includes also documentary placed under Documentation/thermal/.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-01-04 15:22:37 +08:00
Linus Torvalds a2013a13e6 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial branch from Jiri Kosina:
 "Usual stuff -- comment/printk typo fixes, documentation updates, dead
  code elimination."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
  HOWTO: fix double words typo
  x86 mtrr: fix comment typo in mtrr_bp_init
  propagate name change to comments in kernel source
  doc: Update the name of profiling based on sysfs
  treewide: Fix typos in various drivers
  treewide: Fix typos in various Kconfig
  wireless: mwifiex: Fix typo in wireless/mwifiex driver
  messages: i2o: Fix typo in messages/i2o
  scripts/kernel-doc: check that non-void fcts describe their return value
  Kernel-doc: Convention: Use a "Return" section to describe return values
  radeon: Fix typo and copy/paste error in comments
  doc: Remove unnecessary declarations from Documentation/accounting/getdelays.c
  various: Fix spelling of "asynchronous" in comments.
  Fix misspellings of "whether" in comments.
  eisa: Fix spelling of "asynchronous".
  various: Fix spelling of "registered" in comments.
  doc: fix quite a few typos within Documentation
  target: iscsi: fix comment typos in target/iscsi drivers
  treewide: fix typo of "suport" in various comments and Kconfig
  treewide: fix typo of "suppport" in various comments
  ...
2012-12-13 12:00:02 -08:00
Masanari Iida e41e85cc17 treewide: Fix typos in various Kconfig
Correct spelling typo within various Kconfig.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-03 11:03:56 +01:00
Eduardo Valentin 4ba115b1e1 thermal: cpu cooling: allow module builds
As thermal drivers can be built as modules and also
the thermal framework itself, building cpu cooling
only as built-in can cause linking errors. For instance:
* Generic Thermal sysfs driver
*
Generic Thermal sysfs driver (THERMAL) [M/n/y/?] m
  generic cpu cooling support (CPU_THERMAL) [N/y/?] (NEW) y

with the following drive:
CONFIG_OMAP_BANDGAP=m

generates:
ERROR: "cpufreq_cooling_unregister" [drivers/staging/omap-thermal/omap-thermal.ko] undefined!
ERROR: "cpufreq_cooling_register" [drivers/staging/omap-thermal/omap-thermal.ko] undefined!

This patch changes cpu cooling driver to allow it
to be built as module.

Reported-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Reviewed-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-22 15:59:52 +08:00
hongbo.zhang aa1acb0451 Thermal: Add ST-Ericsson DB8500 thermal driver.
This driver is based on the thermal management framework in thermal_sys.c. A
thermal zone device is created with the trip points to which cooling devices
can be bound, the current cooling device is cpufreq, e.g. CPU frequency is
clipped down to cool the CPU, and other cooling devices can be added and bound
to the trip points dynamically.  The platform specific PRCMU interrupts are
used to active thermal update when trip points are reached.

Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Francesco Lavra <francescolavra.fl@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-15 20:50:34 +08:00
Zhang Rui ec54c74c8f Exynos: Add missing dependency
CPU_FREQ_TABLE depends on CPU_FREQ. Selecting CPU_FREQ_TABLE without checking
for dependencies gives the following compilation warnings:
warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC && UX500_SOC_DB8500 &&
CPU_THERMAL && EXYNOS_THERMAL) selects CPU_FREQ_TABLE which has unmet
direct dependencies (ARCH_HAS_CPUFREQ && CPU_FREQ)

Based-on-patch-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-15 20:41:46 +08:00
Zhang Rui 72e1989782 Refactor drivers/thermal/Kconfig
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-15 20:41:30 +08:00
Durgadoss R a56757af8e Thermal: Provide option to choose default thermal governor
This patch provides option to choose the default thermal
governor. If no option is provided, the step_wise
governor is selected by default.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-05 14:00:09 +08:00
Durgadoss R 1cc807a234 Thermal: Add a thermal notifier for user space
This patch registers a governor which will let the
user land manage the platform thermals. Whenever a
trip happens, this governor just notifies the user
space using kobj_uevent().

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-05 14:00:08 +08:00
Durgadoss R e151a202a0 Thermal: Introduce a step_wise thermal governor
This patch adds a simple step_wise governor to the
generic thermal layer. This algorithm throttles the
cooling devices in a linear fashion. If the 'trend'
is heating, it throttles by one step. And if the
thermal trend is cooling it de-throttles by one step.

This actually moves the throttling logic from thermal_sys.c
and puts inside step_wise.c, without any change.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-05 14:00:07 +08:00
Durgadoss R 4ccc5743ae Thermal: Introduce fair_share thermal governor
This patch introduces a simple 'weight' based
governor named fair_share governor. Whenever the
thermal framework gets notified of the trip point
violation, this governor (if configured), throttles
the cooling devices associated with a thermal zone.

This mapping between a thermal zone and a cooling device
and the effectiveness of cooling are provided in the
platform layer.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-05 14:00:07 +08:00
David Rientjes dd8e8c4a2c thermal, cpufreq: Fix build when CPU_FREQ_TABLE isn't configured
Commit 0236141837 ("thermal: add generic cpufreq cooling
implementation") requires cpufreq_frequency_get_table(), but that
function is only defined for CONFIG_CPU_FREQ_TABLE resulting in the
following build error:

  drivers/built-in.o: In function `cpufreq_get_max_state':
  drivers/thermal/cpu_cooling.c:259: undefined reference to `cpufreq_frequency_get_table'
  drivers/built-in.o: In function `get_cpu_frequency':
  drivers/thermal/cpu_cooling.c:129: undefined reference to `cpufreq_frequency_get_table'

Fix it by selecting CONFIG_CPU_FREQ_TABLE for such a configuration.

It turns out CONFIG_EXYNOS_THERMAL also needs CONFIG_CPU_FREQ_TABLE, so
select it there as well.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-15 14:00:07 -07:00
Amit Daniel Kachhap f22d9c03cc thermal: exynos5: add exynos5250 thermal sensor driver support
Insert exynos5 TMU sensor changes into the thermal driver.  Some exynos4
changes are made generic for exynos series.

[akpm@linux-foundation.org: fix comment layout]
Signed-off-by: SangWook Ju <sw.ju@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-09-24 14:44:38 +08:00
Amit Daniel Kachhap c48cbba6fe hwmon: exynos4: move thermal sensor driver to driver/thermal directory
This movement is needed because the hwmon entries and corresponding sysfs
interface is a duplicate of utilities already provided by
driver/thermal/thermal_sys.c.  The goal is to place it in thermal folder
and add necessary functions to use the in-kernel thermal interfaces.

Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: SangWook Ju <sw.ju@samsung.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-09-24 14:44:38 +08:00
Amit Daniel Kachhap 0236141837 thermal: add generic cpufreq cooling implementation
This patchset introduces a new generic cooling device based on cpufreq
that can be used on non-ACPI platforms.  As a proof of concept, we have
drivers for the following platforms using this mechanism now:

 * Samsung Exynos (Exynos4 and Exynos5) in the current patchset.
 * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git imx6q_thermal)

There is a small change in cpufreq cooling registration APIs, so a minor
change is needed for Freescale platforms.

Brief Description:

1) The generic cooling devices code is placed inside driver/thermal/*
   as placing inside acpi folder will need un-necessary enabling of acpi
   code.  This code is architecture independent.

2) This patchset adds generic cpu cooling low level implementation
   through frequency clipping.  In future, other cpu related cooling
   devices may be added here.  An ACPI version of this already exists
   (drivers/acpi/processor_thermal.c) .But this will be useful for
   platforms like ARM using the generic thermal interface along with the
   generic cpu cooling devices.  The cooling device registration API's
   return cooling device pointers which can be easily binded with the
   thermal zone trip points.  The important APIs exposed are,

   a) struct thermal_cooling_device *cpufreq_cooling_register(
        struct cpumask *clip_cpus)
   b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

3) Samsung exynos platform thermal implementation is done using the
   generic cpu cooling APIs and the new trip type.  The temperature sensor
   driver present in the hwmon folder(registered as hwmon driver) is moved
   to thermal folder and registered as a thermal driver.

A simple data/control flow diagrams is shown below,

Core Linux thermal <----->  Exynos thermal interface <----- Temperature Sensor
          |                             |
         \|/                            |
  Cpufreq cooling device <---------------

TODO:
*Will send the DT enablement patches later after the driver is merged.

This patch:

Add support for generic cpu thermal cooling low level implementations
using frequency scaling up/down based on the registration parameters.
Different cpu related cooling devices can be registered by the user and
the binding of these cooling devices to the corresponding trip points can
be easily done as the registration APIs return the cooling device pointer.
The user of these APIs are responsible for passing clipping frequency .
The drivers can also register to recieve notification about any cooling
action called.

[akpm@linux-foundation.org: fix comment layout]
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: SangWook Ju <sw.ju@samsung.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-09-24 14:44:38 +08:00
Kuninori Morimoto 1e426ffddf thermal: add Renesas R-Car thermal sensor support
This patch add basic Renesas R-Car thermal sensor support.
It was tested on R-Car H1 Marzen board.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-09-24 14:44:37 +08:00
Viresh Kumar b9c7aff481 drivers/thermal/spear_thermal.c: add Device Tree probing capability
SPEAr platforms now support DT and so must convert all drivers to support
DT.  This patch adds DT probing support for SPEAr thermal sensor driver
and updates its documentation too.

Also, as SPEAr is the only user of this driver and is only available with
DT, make this an only DT driver.  So, platform_data is completely removed
and passed via DT now.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-02 01:49:38 -04:00
Vincenzo Frascino 6a92c36688 thermal: add support for thermal sensor present on SPEAr13xx machines
ST's SPEAr13xx machines are based on CortexA9 ARM processors.  These
machines contain a thermal sensor for junction temperature monitoring.

This patch adds support for this thermal sensor in existing thermal
framework.

[akpm@linux-foundation.org: little code cleanup]
[akpm@linux-foundation.org: print the pointer correctly]
[viresh.kumar@st.com: thermal/spear_thermal: add compilation dependency on PLAT_SPEAR]
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-22 01:05:32 -04:00
Jean Delvare ab92402af0 thermal: hide CONFIG_THERMAL_HWMON
It's about time to revert 16d7523973 ("thermal: Create
CONFIG_THERMAL_HWMON=n").  Anybody running a kernel >= 2.6.40 would also
be running a recent enough version of lm-sensors.

Actually having CONFIG_THERMAL_HWMON is pretty convenient so instead of
dropping it, we keep it but hide it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-08-02 14:51:25 -04:00
Rafael J. Wysocki af06216a8e ACPI: Fix build for CONFIG_NET unset
Several ACPI drivers fail to build if CONFIG_NET is unset, because
they refer to things depending on CONFIG_THERMAL that in turn depends
on CONFIG_NET.  However, CONFIG_THERMAL doesn't really need to depend
on CONFIG_NET, because the only part of it requiring CONFIG_NET is
the netlink interface in thermal_sys.c.

Put the netlink interface in thermal_sys.c under #ifdef CONFIG_NET
and remove the dependency of CONFIG_THERMAL on CONFIG_NET from
drivers/thermal/Kconfig.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Len Brown <lenb@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Luming Yu <luming.yu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-02-28 18:00:31 -08:00
R.Durgadoss 4cb1872870 thermal: Add event notification to thermal framework
This patch adds event notification support to the generic
thermal sysfs framework in the kernel. The notification is in the
form of a netlink event.

Signed-off-by: R.Durgadoss <durgadoss.r@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-01-12 00:08:35 -05:00
Jan Beulich df43176c93 thermal: add missing Kconfig dependency
Otherwise THERMAL_HWMON can be selected when HWMON=n and THERMAL=n, which
fails to build.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-19 01:41:49 -04:00
Rene Herman 16d7523973 thermal: Create CONFIG_THERMAL_HWMON=n
A bug in libsensors <= 2.10.6 is exposed
when this new hwmon I/F is enabled.
Create CONFIG_THERMAL_HWMON=n
until some time after libsensors 2.10.7 ships
so those users can run the latest kernel.

libsensors 3.x is already fixed -- those users
can use CONFIG_THERMAL_HWMON=y now.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Acked-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-06-25 19:25:42 -04:00
Zhang Rui 63c4ec905d thermal: add the support for building the generic thermal as a module
Build the generic thermal driver as module "thermal_sys".

Make ACPI thermal, video, processor and fan SELECT the generic
thermal driver, as these drivers rely on it to build the sysfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:44:00 -04:00