- 30 11月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> Reviewed-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
- 01 11月, 2017 1 次提交
-
-
由 Rocky Hao 提交于
RV1108 SOC has one Temperature Sensor for CPU. Reviewed-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NRocky Hao <rocky.hao@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 11 8月, 2017 1 次提交
-
-
由 Rocky Hao 提交于
RK3328 SOC has one Temperature Sensor for CPU. Signed-off-by: NRocky Hao <rocky.hao@rock-chips.com> Reviewed-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
- 17 1月, 2017 1 次提交
-
-
由 Caesar Wang 提交于
As Ayaka reported the thermal was abormal on rk3288 at booting time. thermal thermal_zone1: critical temperature reached(125 C),shutting down thermal thermal_zone2: critical temperature reached(125 C),shutting down thermal thermal_zone1: critical temperature reached(125 C),shutting down thermal thermal_zone2: critical temperature reached(125 C),shutting down ... The root caused by reading the invald analogic value, the value is zero will convert the 125 degree to trigger the critical temperature. Fixes it with insteading of the incorrect reading now. Fixes commit cadf29dc ("thermal: rockchip: optimize the conversion table") Reported-by: Nayaka <ayaka@soulik.info> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 14 12月, 2016 5 次提交
-
-
由 Caesar Wang 提交于
In some cases, some sensors didn't need the trip points, the set_trips will pass {-INT_MAX, INT_MAX} to trigger tsadc alarm in the end, ignore this case and disable the high temperature interrupt. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Reviewed-by: NBrian Norris <briannorris@chromium.org> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
In order to support the valid temperature can conver to analog value. The rockchip thermal driver has not supported the all valid temperature to convert the analog value. (e.g.: 61C, 62C, 63C....) For example: In some cases, we need adjust the trip point. $cd /sys/class/thermal/thermal_zone* $echo 68000 > trip_point_0_temp That will return the max analogic value indicates the invalid before posting this patch. So, this patch will optimize the conversion table to support the other cases. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
The temp_to_code function will return 0 when we set the temperature to a invalid value (e.g. 61C, 62C, 63C....), that's unpractical. This patch will prevent this case happening. That will return the max analog value to indicate the temperature is invalid or over table temperature range. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Brian Norris 提交于
This driver passes struct chip_tsadc_table by value throughout; this is inefficient, and AFAICT, there is no reason for it. Let's pass pointers instead. Signed-off-by: NBrian Norris <briannorris@chromium.org> Reviewed-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Brian Norris 提交于
These error messages don't give much information about what went wrong. It would be nice, for one, to see what invalid temperature was being requested when conversion fails. It's also good to return an error when we can't handle a conversion properly. While we're at it, fix the grammar too. Signed-off-by: NBrian Norris <briannorris@chromium.org> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 23 11月, 2016 1 次提交
-
-
由 Shawn Lin 提交于
It is no necessary to print warning agian and again if we don't add rockchip,grf for dt, otherwise I saw the following log when doing suspend-2-resume. We only need to print it once when parsing dt. It looks quite trivial but the log is apparently verbose. [ 26.615415] PM: early resume of devices complete after 1.539 msecs [ 26.622002] rk_tsadcv2_initialize: Missing rockchip,grf property [ 26.629359] rk_gmac-dwmac ff290000.ethernet: init for RGMII [ 26.639794] PM: resume of devices complete after 18.109 msecs [ 26.646925] Restarting tasks ... done. Reviewed-by: NCaesar Wang <wxt@rock-chips.com> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 27 9月, 2016 6 次提交
-
-
由 Srinivas Pandruvada 提交于
Added one additional parameter to thermal_zone_device_update() to provide caller with an optional capability to specify reason. Currently this event is used by user space governor to trigger different processing based on event code. Also it saves an additional call to read temperature when the event is received. The following events are cuurently defined: - Unspecified event - New temperature sample - Trip point violated - Trip point changed - thermal device up and down - thermal device power capability changed Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
由 Rocky Hao 提交于
In less than 10 ms, the temperature of soc will arise 10 degree. 250 ms is too big for soc tempeture control. Setting 2.5 ms will speed up temperature accessing speed but introduce no more cpu's computing overhead. We set AUTO_PERIOD_TIME and TSADCV3_AUTO_PERIOD_HT_TIME the same value, because normal temperature update speed is also our consern in IPA. Signed-off-by: NRocky Hao <rocky.hao@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: linux-pm@vger.kernel.org Tested-by: NStephen Barber <smbarber@chromium.org> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
由 Rocky Hao 提交于
Due to the voltage ripple, the sensing data of the tsadc is not accurate. And in this patch, the bandgap feature is enhanced to remove the voltage ripple, and then the tsadc can sense the temperature more precisely. Obsolete codes are removed as well. Signed-off-by: NRocky Hao <rocky.hao@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: linux-pm@vger.kernel.org Tested-by: NStephen Barber <smbarber@chromium.org> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
由 Caesar Wang 提交于
The hardware-tracked trips will set the alarm interrupt value for registers. Then when the thermal zone has no trips to be set, That make the thermal trips callback a over range value. The root cause is the rk_tsadcv2_temp_to_code() function to handle the invalid temperature range is indeed incorrect, let's fix it on now. Otherwise, the thermal alarm interrupt will be triggered all the time on some SoCs. Fox example: localhost tmp # grep thermal /proc/interrupts; sleep 5; grep thermal /proc/interrupts 23: 994830 .. GICv3 129 Level rockchip_thermal 23: 1003423 .. GICv3 129 Level rockchip_thermal Reported-by: NRocky Hao <rocky.hao@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: linux-pm@vger.kernel.org Signed-off-by: NEduardo Valentin <edubezval@gmail.com> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
由 Caesar Wang 提交于
We should increase the period cycles to save power since the rk3399 has the high frequency for tsadc clock. Fixes commit b0d70338 ("thermal: rockchip: Support the RK3399 SoCs in thermal driver") Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: linux-pm@vger.kernel.org Signed-off-by: NEduardo Valentin <edubezval@gmail.com> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
由 Caesar Wang 提交于
Whenever the current temperature is updated, the trip points immediately below and above the current temperature are found. A sensor driver callback `set_trips' is then called with the temperatures. Lastly, The sensor will trigger the hardware high temperature interrupts to increase the sampleing rate and throttle frequency to limit the temperature rising When performing passive cooling. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: linux-pm@vger.kernel.org Tested-by: NStephen Barber <smbarber@chromium.org> Signed-off-by: NEduardo Valentin <edubezval@gmail.com> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
-
- 17 5月, 2016 8 次提交
-
-
由 Caesar Wang 提交于
Documentation/timers/timers-howto.txt recommends to use usleep_range on delays > 10usec. The usleep_range indeed reduces CPU load, since the udelay will busy wait for enough loop cycles to achieve the desired delay. Fixes commit b06c52db39fd ("thermal: rockchip: handle the power sequence for tsadc controller"). Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Suggested-by: NEduardo Valentin <edubezval@gmail.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
To update the notes for keeping in mind that quickly in case someone re-read this driver in the future. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Elaine Zhang 提交于
The RK3366 SoCs have two Temperature Sensors, channel 0 is for CPU channel 1 is for GPU. Signed-off-by: NElaine Zhang <zhangqing@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
This adds the grf property to handle the tsadc power sequence on rockchip some SoCs. Verified on rk3399 can work with this patch on now. while true; do grep "" /sys/class/thermal/thermal_zone[0-1]/temp sleep .5; done /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41666 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 /sys/class/thermal/thermal_zone1/temp:41111 /sys/class/thermal/thermal_zone0/temp:40555 Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
This patch fixes the incorrect conversion table. The Code to Temperature mapping is updated based on sillcon results. Fixes commit b0d70338 ("thermal: rockchip: Support the RK3399 SoCs in thermal driver"). Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
We should judge the table.id[mid].code insearch algorithm on matter the adc value increment or decrement. Or otherwise, the temperature return the incorrect value in some cases. [ 1.438589] adc_val=402,temp=-40000 [ 1.438903] adc_val=403,temp=-39375 [ 1.439217] adc_val=404,temp=-38750 ... [ 1.441102] adc_val=410,temp=-40000 [ 1.441416] adc_val=411,temp=-34445 [ 1.441737] adc_val=412,temp=-33889 ... Let's fix it right now. Fixes commit 020ba95d ("thermal: rockchip: Add the sort mode for adc value increment or decrement"). Reported-by: NRocky Hao <rocky.hao@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Shawn Lin 提交于
Disable thermal->clk when enabling pclk fails in resume routine. Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> Reviewed-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Eduardo Valentin 提交于
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org Tested-by: NCaesar Wang <wxt@rock-chips.com> Reviewed-by: NCaesar Wang <wxt@rock-chips.com> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 01 3月, 2016 4 次提交
-
-
由 Caesar Wang 提交于
As the TRM says, add the tsadc_q_sel to control the temperature-code sequence since the rk3228/rk3399 need set this bit (1024 - tsadc_q) as output. Fixes: commit b0d70338 "thermal: rockchip: Support the RK3399 SoCs in thermal driver" 7b02a5e7 "thermal: rockchip: Support the RK3228 SoCs in thermal driver" Reported-by: NElaine Zhang <zhangqing@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
This patch renames to be more adapter compatibles since more and more SoCs are supported in thermal driver. Reported-by: NHuang,Tao <huangtao@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Elaine Zhang 提交于
the calculation use a global table, not their own table. so adapt the table to the correct one. Signed-off-by: NElaine Zhang <zhangqing@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
As the Dan report the smatch check the thermal driver warning: drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt() warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) => (s32min-s32max > s32max)' Although The shut_temp read from DT is u32,the temperature is currently represented as int not long in the thermal driver. Let's change to make shut_temp instead of the thermal->tshut_temp for the condition. Fixes: commit 437df217 ("thermal: rockchip: consistently use int for temperatures") Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 07 1月, 2016 3 次提交
-
-
由 Caesar Wang 提交于
The RK3399 SoCs have two Temperature Sensors, channel 0 is for CPU. channel 1 is for GPU. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
The RK3228 SoCs has one Temperature Sensor, channel 0 is for CPU. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
This patchset trys to dictate unified format for driver. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 13 11月, 2015 6 次提交
-
-
由 Caesar Wang 提交于
The RK3368 SoCs support to 2 channel TS-ADC, the temperature criteria of each channel can be configurable. The system has two Temperature Sensors, channel 0 is for CPU, and channel 1 is for GPU. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
As Temperature is currently represented as int not long in the thermal framework since use int intead of unsigned long/long to represent temperature to avoid bogus overheat detection when negative temperature reported. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
The conversion table has the adc value and temperature. In fact, the adc value only has the increment or decrement mode in conversion table. Moment, we can add the sort mode to be better support the *code_to_temp* for differenr SoCs. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
We should make the conversion table in as a parameter since the different SoCs have the different conversionion table. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
由 Caesar Wang 提交于
The current driver is default to register the two thermal sensors in probe since some SoCs maybe only have one sensor for thermal. In some cases, the channel 0 is not always the cpu or gpu sensor. So add the channel can be configured for sensors. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 12 11月, 2015 1 次提交
-
-
由 Caesar Wang 提交于
Missing a include file caused compile error. drivers/thermal/rockchip_thermal.c: In function 'rockchip_thermal_suspend': drivers/thermal/rockchip_thermal.c:720:2: error: implicit declaration of function 'pinctrl_pm_select_sleep_state' [-Werror=implicit-function-declaration] ... Fixes: 7e38a5b1 ("thermal: rockchip: support the sleep pinctrl state to avoid glitches") Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Reported-by: Nkbuild test robot <lkp@intel.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 04 11月, 2015 1 次提交
-
-
由 Caesar Wang 提交于
When we come out of system suspend state (S3) the tsadc will have been reset and back at its default state. While reprogramming the tsadc it's possible that we'll glitch the output and unintentionally cause the "over temperature" GPIO to be asserted. Since the over temperature GPIO is often hooked up to something that will cause a reboot or shutdown in hardware, this glitch can be catastrophic on some boards. We'll add support for selecting the "sleep" pinctrl state at suspend time. Boards can use this to effectively disable the tsadc at suspend time and avoid glitches when the system is resumed. Reviewed-by: NDouglas Anderson <dianders@chromium.org> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-
- 31 10月, 2015 1 次提交
-
-
由 Dmitry Torokhov 提交于
When requested thermal shutdown signal polarity is low we need to make sure that the bit representing high level of signal is reset, and not set all other bits in that register. Also rename TSADCV2_INT_PD_CLEAR to TSADCV2_INT_PD_CLEAR_MASK to better reflect its nature. Acked-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NDmitry Torokhov <dtor@chromium.org> Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
-