summaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal_core.c
AgeCommit message (Collapse)Author
2017-05-23thermal: core: make thermal_emergency_poweroff staticColin Ian King
Making thermal_emergency_poweroff static fixes sparse warning: drivers/thermal/thermal_core.c:6: warning: symbol 'thermal_emergency_poweroff' was not declared. Should it be static? Fixes: ef1d87e06ab4 ("thermal: core: Add a back up thermal shutdown mechanism") Acked-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2017-05-05thermal: core: Add a back up thermal shutdown mechanismKeerthy
orderly_poweroff is triggered when a graceful shutdown of system is desired. This may be used in many critical states of the kernel such as when subsystems detects conditions such as critical temperature conditions. However, in certain conditions in system boot up sequences like those in the middle of driver probes being initiated, userspace will be unable to power off the system in a clean manner and leaves the system in a critical state. In cases like these, the /sbin/poweroff will return success (having forked off to attempt powering off the system. However, the system overall will fail to completely poweroff (since other modules will be probed) and the system is still functional with no userspace (since that would have shut itself off). However, there is no clean way of detecting such failure of userspace powering off the system. In such scenarios, it is necessary for a backup workqueue to be able to force a shutdown of the system when orderly shutdown is not successful after a configurable time period. Reported-by: Nishanth Menon <nm@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com> Acked-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2017-05-05thermal: core: Allow orderly_poweroff to be called only onceKeerthy
thermal_zone_device_check --> thermal_zone_device_update --> handle_thermal_trip --> handle_critical_trips --> orderly_poweroff The above sequence happens every 250/500 mS based on the configuration. The orderly_poweroff function is getting called every 250/500 mS. With a full fledged file system it takes at least 5-10 Seconds to power off gracefully. In that period due to the thermal_zone_device_check triggering periodically the thermal work queues bombard with orderly_poweroff calls multiple times eventually leading to failures in gracefully powering off the system. Make sure that orderly_poweroff is called only once. Signed-off-by: Keerthy <j-keerthy@ti.com> Acked-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2017-02-22Merge branches 'thermal-core', 'thermal-soc', 'thermal-intel' and ↵Zhang Rui
'ida-conversion' into next
2017-01-06thermal: core: move tz->device.groups cleanup to thermal_releaseJacob von Chorus
The device_unregister call in thermal_zone_device_unregister causes the thermal_zone_device structure to be freed before the call to free the dynamically allocated attribute groups. This leads to a kernel panic. Furthermore, the 4 calls to free the trip point attribute structures occur before the call to unregister the device, leading to a kernel panic when sysfs attempts to access the attributes to remove them. Here is an example of a kernel panic when the cpu thermal zones are removed upon cpu offline: BUG: unable to handle kernel NULL pointer dereference at (null) IP: strlen+0x0/0x20 <snip> Call Trace: ? kernfs_name_hash+0x17/0x80 kernfs_find_ns+0x3f/0xd0 kernfs_remove_by_name_ns+0x36/0xa0 remove_files.isra.1+0x36/0x70 sysfs_remove_group+0x44/0x90 sysfs_remove_groups+0x2e/0x50 device_remove_attrs+0x5e/0x90 device_del+0x1ea/0x350 device_unregister+0x1a/0x60 thermal_zone_device_unregister+0x1f2/0x210 pkg_thermal_cpu_offline+0x14f/0x1a0 [x86_pkg_temp_thermal] ? kzalloc.constprop.2+0x10/0x10 [x86_pkg_temp_thermal] cpuhp_invoke_callback+0x8d/0x3f0 cpuhp_down_callbacks+0x42/0x80 cpuhp_thread_fun+0x8b/0xf0 smpboot_thread_fn+0x110/0x160 kthread+0x101/0x140 ? sort_range+0x30/0x30 ? kthread_park+0x90/0x90 ret_from_fork+0x25/0x30 This patch moves the kfree calls to clean up the dynamic attributes to the thermal_class's thermal_zone_device release function. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2017-01-04thermal core: convert ID allocation to IDAMatthew Wilcox
The thermal core does not use the ability to look up pointers by ID, so convert it from using an IDR to the more space-efficient IDA. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-12-13Merge branch 'next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux Pull thermal management updates from Zhang Rui: - Thermal core code reorganization and cleanup. Two new files are created for thermal sysfs I/F code and thermal helper functions (Eduardo Valentin). - Sanitize hotplug and locking for x86_pkg_temp driver (Thomas Gleixner) - Update MAINTAINER file for pwm-fan driver and Samsung thermal driver (Lukasz Majewski) - Fix module auto-load for max77620, tango and db8500 thermal driver (Javier Martinez Canillas) - Fix a bug that thermal hwmon sysfs I/F returns wrong critical trip point temperature value (Krzysztof Kozlowski) - Add Skylake PCH 100 series support for intel_pch_thermal driver (OGAWA Hirofumi) - Small fixes and cleanups for platform thermal drivers (Julia Lawall, Luis Henriques, Leo Yan, Stephen Boyd, Shawn Lin, Javi Merino and Lukasz Luba) * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (76 commits) MAINTAINERS: Samsung: Update maintainer for PWM FAN and SAMSUNG THERMAL thermal/x86 pkg temp: Convert to hotplug state machine thermal/x86_pkg_temp: Sanitize package management thermal/x86_pkg_temp: Move work into package struct thermal/x86_pkg_temp: Move work scheduled flag into package struct thermal/x86_pkg_temp: Sanitize locking thermal/x86_pkg_temp: Cleanup code some more thermal/x86_pkg_temp: Cleanup namespace thermal/x86_pkg_temp: Get rid of ref counting thermal/x86_pkg_temp: Sanitize callback (de)initialization thermal/x86_pkg_temp: Replace open coded cpu search thermal/x86_pkg_temp: Remove redundant package search thermal/x86_pkg_temp: Cleanup thermal interrupt handling thermal: hwmon: Properly report critical temperature in sysfs devfreq_cooling: pass a pointer to devfreq in the power model callbacks devfreq_cooling: make the structs devfreq_cooling_xxx visible for all dt-bindings: rockchip-thermal: fix the misleading description thermal: rockchip: improve the warning log thermal: db8500: Fix module autoload thermal: tango: Fix module autoload ...
2016-11-23thermal: core: move slop and offset helpers to thermal_helpers.cEduardo Valentin
Reorganize code to reflect better placement. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: use kzalloc(sizeof(*ptr),...)Eduardo Valentin
As a safety check, this patch changes thermal core to check for pointer content size, instead of type size, while allocating memory. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: improve kerneldoc entry of thermal_cooling_device_unregisterEduardo Valentin
Improve description and keep 80 columns limit. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: remove style warnings and checksEduardo Valentin
Removing several style issues in thermal code code. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: remove void function return statementsEduardo Valentin
Simply removing useless returns of void functions. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: standardize line breaking alignmentEduardo Valentin
Pass through the code to remove check suggested by checkpatch.pl (alignment to parenthesis): CHECK: Alignment should match open parenthesis Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: small style fix when checking for __find_governor()Eduardo Valentin
Remove style issue: CHECK: Comparison to NULL could be written "!__find_governor" + if (__find_governor(governor->name) == NULL) { Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: remove FSF address in the GPL noticeEduardo Valentin
Simplify the GPL notice by removing the FSF address. No need to track FSF location in this file. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: add a comment describing the device management sectionEduardo Valentin
comment describing the section with function to handle registration, unregistration, binding, and unbinding of thermal devices. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: add a comment describing the power actor sectionEduardo Valentin
Simply marking the power actor section and adding a comment describing it. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: add a comment describing the main update loopEduardo Valentin
Simply marking the main update loop section and adding a comment describing it. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move notify to the zone update sectionEduardo Valentin
moving the helper function to closer to similar functions. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: add inline to print_bind_err_msg()Eduardo Valentin
Given that this is simple wrapper, adding the inline flag. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move __bind() to where it is usedEduardo Valentin
Moving the helper to closer where it is used. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: fix couple of style issues on __bind() helperEduardo Valentin
Removing style issues on __bind() and its helpers. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move bind_tz() to where it is usedEduardo Valentin
Moving the helper to closer where it is used. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move bind_cdev() to where it is usedEduardo Valentin
Moving the helper to closer where it is used. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move __unbind() helper to where it is usedEduardo Valentin
Simply moving the helper to closer where it is actually used. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: small style fix on __unbind() helperEduardo Valentin
Simply aligning to parenthesis. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move idr handling to device management sectionEduardo Valentin
Given that idr is only used to get id for thermal devices (zones and cooling), makes sense to move the code closer. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: group functions related to governor handlingEduardo Valentin
Organize thermal core code to group the functions handling with governor manipulation in one single section. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: introduce thermal_helpers.cEduardo Valentin
Here we have a simple code organization. This patch moves functions that do not need to handle thermal core internal data structure to thermal_helpers.c file. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: remove a couple of style issues on helpersEduardo Valentin
Reorganizing the code of helper functions to improve readability and style, as recommended by checkpatch.pl. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move cooling device sysfs to thermal_sysfs.cEduardo Valentin
This is a code reorganization, simply to concentrate the sysfs handling functions in thermal_sysfs.c. This patch moves the cooling device handling functions. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move to_cooling_device macro to header fileEduardo Valentin
Make the to_cooling_device() macro available across files in thermal core. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move thermal_zone sysfs to thermal_sysfs.cEduardo Valentin
This is a code reorganization, simply to concentrate the code handling sysfs in a specific file: thermal_sysfs.c. Right now, moving only the sysfs entries of thermal_zone_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 <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: match parenthesis on code alignmentEduardo Valentin
Cosmetic change in the sysfs handling functions, as recommended by checkpatch.pl. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: treat correctly the return value of *scanf callsEduardo Valentin
This patch checks the return value of all calls to *scanf. The check is to simply match the number of expect inputs. The current code does not do any recovery in case the number of treated inputs are different than the expected. Therefore, keeping the same behavior. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move to_thermal_zone() macro to header fileEduardo Valentin
Simply making this macro available to other thermal core files. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: split available_policies_show()Eduardo Valentin
This patch creates a helper to build a list of available governors. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: split policy_storeEduardo Valentin
Similarly to passive_store, policy_store now is split between thermal core data structure handling and sysfs handling. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: split passive_storeEduardo Valentin
Split passive_store between sysfs handling and thermal core internal data handling. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: remove unnecessary device_remove() callsEduardo Valentin
Given that cdevs sysfs properties are already registered using the dev.groups, there is no need to explicitly call device_remove() for each property. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move trips attributes to tz->device.groupsEduardo Valentin
Finally, move the last thermal zone sysfs attributes to tz->device.groups: trips attributes. This requires adding a attribute_group to thermal_zone_device, creating it dynamically, and then setting all trips attributes in it. The trips attribute is then added to the tz->device.groups. As the removal of all attributes are handled by device core, the device remove calls are not needed anymore. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: create tz->device.groups dynamicallyEduardo Valentin
This is a patch to allow adding groups created dynamically. For now we create only the existing group. However, this is a preparation to allow creating trip groups, which are determined only when the number of trips are known at runtime. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move the trip attrs to the tz sysfs I/F sectionEduardo Valentin
Code reorganization to keep all the sysfs I/F of a thermal zone in the same section. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: fix style on remove_trip_attrs()Eduardo Valentin
Align to parentheses, removing checkpatch warning. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: remove useless empty lineEduardo Valentin
Fix style problem on create_trip_attrs(); Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move power actor code out of sysfs I/F sectionEduardo Valentin
Simply reorganize code to keep only functions of sysfs interface of thermal zone device together. Therefore, move the power actor code out of the sysfs I/F section. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: improve power actor documentationEduardo Valentin
Simple improvement on clarity and removal of checkpatch warning in the documentation of power actor kernel doc. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move passive attr to tz->device.groupsEduardo Valentin
This patch moves the passive attribute to tz->device.groups. Moving the passive attribute also requires a .is_visible() callback implementation for its attribute group. The logic behind the visibility of passive attribute is kept the same. We only expose the passive attribute if the thermal driver has exposed at least one passive trip point. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move mode attribute to tz->device.groupsEduardo Valentin
Moving mode attribute to tz->device.groups requires the implementation of a .is_visible() callback. The condition returned by .is_visible() of the mode attribute group is kept the same, we allow the attribute to be visible only if ops->get_mode() is set by the thermal driver. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2016-11-23thermal: core: move emul_temp creation to tz->device.groupsEduardo Valentin
emul_temp creation is dependent on a compile time condition. Moving to tz->device.groups. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>