aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ti-soc-thermal
AgeCommit message (Collapse)Author
2013-04-08staging: ti-soc-thermal: fix device removalEduardo Valentin
While removing, the device needs to unregister the sensor from thermal framework. Before calling the call back the driver needs to check if the call back is registered. This patch fix the check by checking the right callback. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: defer probe if cpufreq is not readyEduardo Valentin
When builtin compiled, there is a chance for this driver be probed before cpufreq driver is up and running. In this case, the cpucooling device can be wrong initialized. Thus, this patch makes sure this driver is probed only when cpufreq driver is ready. Whenever there is no cpufreq driver registered, the probe will return -EPROBE_DEFER. Tested-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: remove extrapolation rules from TODOEduardo Valentin
Extrapolation rules have been revisited. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: update OMAP5 extrapolation rulesEduardo Valentin
Update the constants to the correct hotspot extrapolation equation constants. OMAP4 constants are revisited and correct. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: introduce OMAP4430 extrapolation constantsEduardo Valentin
This patch defines and utilizes the extrapolation constants for OMAP4430. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: Remove TC1/TC2 TODO (already done)Eduardo Valentin
TC1/TC2 are not needed anymore, API has been upgraded. This is a TODO left-over. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: fix min/max TODO (already done)Eduardo Valentin
Min/Max cooling state are defined by registration helper function, if no specific limits are passed. No need to change this code. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: ti-soc-thermal: update TODO listEduardo Valentin
This patch removes out of the TODO list those already completed. Here is the status and why they are removed: on ti-bandgap.c: -- Add support to hwmon: REMOVED, no need to have hwmon interfaces as the control is done via thermal framework. -- Test every exposed API to userland: DONE, via thermal fw APIs By now, no specific API is exposed by this driver -- Revisit data structures and simplify them: DONE, all unused fields are flagged for future removal. -- Once SCM-core api settles, update this driver accordingly: DONE, the BG driver can exist without SCM driver by ioremapping its own registers and doing its own locking. on ti-thermal-common.c/ti-thermal.h: -- Revisit trips and its definitions: DONE, for now there is no need to change current definition. Alert based policy will be add in future. -- Revisit trending: DONE, OMAP5 history buffer support has been implemented. Devices without history buffer will use thermal fw trending capability. on omap5-thermal.c -- Add support for GPU cooling: REMOVED: this will not be part of this driver. Must be done in a separated cooling device. generally: -- make checkpatch.pl and sparse happy: DONE, sparse remaining warning is not an issue. -- update documentation: DONE, kernel-doc for ti-bandgap is now available. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Add get_trend supportJ Keerthy
Patch adds get_trend functionality for OMAP Bandgap thermal devices. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal:Introduce ti_bandgap_get_trend function for OMAP5J Keerthy
The patch adds ti_bandgap_get_trend function. This is specific to OMAP5 for now it computes the trend from the temp values stored in the hardware history buffer. Formula: (T1 - T2) / P. Where: T1: Last read valid temperature. T2: Last but one read valid temperature. P: Update Interval. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Enable HISTORY_BUFFER Feature for OMAP5J Keerthy
This patch enables the HISTORY_BUFFER eature for OMAP5. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Introduce HAS_HISTORY_BUFFER feature for bandgapJ Keerthy
The patch introduces HISTORY_BUFFER feature. This is present in OMAP5 bandgap and it is a hardware history buffer of previously read temperatures. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Modify update_interval r/w functions to incorporate ↵J Keerthy
the OMAP5 feature of COUNTER_DELAY. Update ti_bandgap_write_update_interval and ti_bandgap_read_update_interval functions to incorporate the OMAP5 feature of COUNTER_DELAY. The way we program the delay between two successive temperature conversions is different for OMAP5 as when compared with OMAP4. Incorporating the changes required to program the delay for OMAP5. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Enable COUNTER_DELAY feature for OMAP5J Keerthy
Enable COUNTER_DELAY feature for OMAP5. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Introduce HAS_COUNTER_DELAY feature for bandgapJ Keerthy
Introduce HAS_COUNTER_DELAY feature for bandgap. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Initialise counter_delay field for OMAP5 sensorsJ Keerthy
Initialize all 3 temperature sensors of OMAP5 bandgap with the counter delay mask. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: Add counter_delay_mask field to ↵J Keerthy
temp_sensor_registers struct Add counter_delay_mask field to temp_sensor_registers structure. Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: report alert events on OMAP5 devicesEduardo Valentin
OMAP5430 devices have the capability to generate alert temperature. Thus, whenever a T_ALERT IRQ is served, the ti-bandgap will call .report_temperature to notify the thermal framework about thermal zone update request. This patch allows OMAP5430 devices to notify the thermal framework about T_ALERT events. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: report alert events on OMAP4 devicesEduardo Valentin
OMAP4460 and OMAP4470 devices have the capability to generate alert temperature. Thus, whenever a T_ALERT IRQ is served, the ti-bandgap will call .report_temperature to notify the thermal framework about thermal zone update request. This patch allows OMAP4460 and OMAP4470 devices to notify the thermal framework about T_ALERT events. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: expose ti_thermal_report_temperatureEduardo Valentin
Whenever a sensor has an alert to be reported to the thermal framework, it can use the report ti_thermal_report_temperature helper. This patch expose this function so that bandgap data config declarations could use it. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: remove kernel-doc warnings reported with -vNishanth Menon
Fix all kernel-doc warnings by add documentation about returns. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01staging: ti-soc-thermal: return error in case power switch is not supportedEduardo Valentin
Improve ti_bandgap_power by returning an error code in case the device does not support controlling its power state. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: propagate error codeEduardo Valentin
While writing talert thresholds, propagate the error code from ti_bandgap_update_alert_threshold to the caller of _ti_bandgap_write_threshold. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: fix bitfield writing while updating thresholdsEduardo Valentin
Wrong threshold cold values may be written with current implementation. This patch fixes the threshold update function by simplifying the bitfield manipulation sequence. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: fix condition to apply hystEduardo Valentin
While updating talert thresholds, threshold cold must always be lower than threshold hot. This patch fixes the function ti_bandgap_update_alert_threshold to only change the thresholds by applying a hysteresis when they violate this condition. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: fix several kernel-doc warnings and errorEduardo Valentin
This patch updates the documentation to remove all warnings and errors reported by scripts/kernel-doc. Most are missing arguments due to wrong format. Cc: Nishanth Menon <nm@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25stating: ti-soc-thermal: use sizeof(*pointer) while allocatingEduardo Valentin
Follow Documentation/CodingStyle and use sizeof(*pointer) instead of sizeof(struct type). Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: split writable data from readonly dataEduardo Valentin
This patch changes the data structures of this driver so that readonly data can reside only in the conf pointer. Now each register has a struct to hold its configuration info, to be used base on chip version for instance, and a struct of values to be written, like register shadow and priv data. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: make unexported functions localEduardo Valentin
Move _ti_bandgap_write_threshold and _ti_bandgap_read_threshold to static area, as they are local functions. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: rename symbols to use better prefixEduardo Valentin
As this driver has been renamed to cope with the chips it is supposed to support, this patch also changes the symbol names to use a proper prefix, so it is not suggestive that this driver supports only OMAP devices. Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Benoit <b-cousson@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: ti-soc-thermal: rename Kconfig optionsEduardo Valentin
This patch renames the Kconfig options to cope with the new naming convention. Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Benoit <b-cousson@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25staging: rename omap-thermal driver to ti-soc-thermalEduardo Valentin
Because this driver will support also OMAP derivatives, this patch does a big rename inside this driver, so it better fits its usage. This patch only renames the directory, file names, includes, Makefiles and Kconfig includes. Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Benoit <b-cousson@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>