15 Sep, 2017

1 commit


19 Jun, 2017

1 commit

  • On i.MX7D, if the system enter LPSR mode, the tempmon module
    will be power down, so the regiter's value is lost, so we need
    to save the registers before suspend and restore the register after
    resume back.

    Signed-off-by: Bai Ping
    (cherry picked from commit 72e6a05b52d24b4976c5f012a185c049f0e6ffa6)

    Bai Ping
     

08 Jun, 2017

1 commit

  • When setting passive temperature trip point, it is not
    allowed to set a higher value than the default.

    Currently the driver compares the new temperature to set
    with a constant (0). This comparison wil always be true
    (temp to set higher than 0) and the driver will return
    -EINVAL. This is a leftover from rebasing the commit fc4fcd689419
    ("MLK-11705 thermal: imx: make the critical trip temp changable for test").

    Fix the comparison by using the actual default passive
    temperature value instead of the wrong constant.

    Signed-off-by: Irina Tirdea

    Irina Tirdea
     

23 Feb, 2017

8 commits


09 Jan, 2017

1 commit

  • commit f37fabb8643eaf8e3b613333a72f683770c85eca upstream.

    In the critical sysfs entry the thermal hwmon was returning wrong
    temperature to the user-space. It was reporting the temperature of the
    first trip point instead of the temperature of critical trip point.

    For example:
    /sys/class/hwmon/hwmon0/temp1_crit:50000
    /sys/class/thermal/thermal_zone0/trip_point_0_temp:50000
    /sys/class/thermal/thermal_zone0/trip_point_0_type:active
    /sys/class/thermal/thermal_zone0/trip_point_3_temp:120000
    /sys/class/thermal/thermal_zone0/trip_point_3_type:critical

    Since commit e68b16abd91d ("thermal: add hwmon sysfs I/F") the driver
    have been registering a sysfs entry if get_crit_temp() callback was
    provided. However when accessed, it was calling get_trip_temp() instead
    of the get_crit_temp().

    Fixes: e68b16abd91d ("thermal: add hwmon sysfs I/F")
    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Krzysztof Kozlowski
     

21 Nov, 2016

1 commit

  • Commit 3105f234e0aba43e44e277c20f9b32ee8add43d4 replaced module
    cpu id table with a cpu feature check, which is logically correct.
    But we need the module device table to allow module auto loading.

    Cc: stable@vger.kernel.org # 4.8
    Fixes:3105f234 thermal/powerclamp: correct cpu support check
    Signed-off-by: Jacob Pan
    Signed-off-by: Zhang Rui

    Jacob Pan
     

20 Oct, 2016

3 commits


13 Oct, 2016

1 commit

  • Pull thermal managament updates from Zhang Rui:

    - Enhance thermal "userspace" governor to export the reason when a
    thermal event is triggered and delivered to user space. From Srinivas
    Pandruvada

    - Introduce a single TSENS thermal driver for the different versions of
    the TSENS IP that exist, on different qcom msm/apq SoCs'. Support for
    msm8916, msm8960, msm8974 and msm8996 families is also added. From
    Rajendra Nayak

    - Introduce hardware-tracked trip points support to the device tree
    thermal sensor framework. The framework supports an arbitrary number
    of trip points. Whenever the current temperature is changed, the trip
    points immediately below and above the current temperature are found,
    driver callback is invoked to program the hardware to get notified
    when either of the two trip points are triggered. Hardware-tracked
    trip points support for rockchip thermal driver is also added at the
    same time. From Sascha Hauer, Caesar Wang

    - Introduce a new thermal driver, which enables TMU (Thermal Monitor
    Unit) on QorIQ platform. From Jia Hongtao

    - Introduce a new thermal driver for Maxim MAX77620. From Laxman
    Dewangan

    - Introduce a new thermal driver for Intel platforms using WhiskeyCove
    PMIC. From Bin Gao

    - Add mt2701 chip support to MTK thermal driver. From Dawei Chien

    - Enhance Tegra thermal driver to enable soctherm node and set
    "critical", "hot" trips, for Tegra124, Tegra132, Tegra210. From Wei
    Ni

    - Add resume support for tango thermal driver. From Marc Gonzalez

    - several small fixes and improvements for rockchip, qcom, imx, rcar,
    mtk thermal drivers and thermal core code. From Caesar Wang, Keerthy,
    Rocky Hao, Wei Yongjun, Peter Robinson, Bui Duc Phuc, Axel Lin, Hugh
    Kang

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (48 commits)
    thermal: int3403: Process trip change notification
    thermal: int340x: New Interface to read trip and notify
    thermal: user_space gov: Add additional information in uevent
    thermal: Enhance thermal_zone_device_update for events
    arm64: tegra: set hot trips for Tegra210
    arm64: tegra: set critical trips for Tegra210
    arm64: tegra: add soctherm node for Tegra210
    arm64: tegra: set hot trips for Tegra132
    arm64: tegra: set critical trips for Tegra132
    arm64: tegra: use tegra132-soctherm for Tegra132
    arm: tegra: set hot trips for Tegra124
    arm: tegra: set critical trips for Tegra124
    thermal: tegra: add hw-throttle for Tegra132
    thermal: tegra: add hw-throttle function
    of: Add bindings of hw throttle for Tegra soctherm
    thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register
    thermal: Add Mediatek thermal driver for mt2701.
    dt-bindings: thermal: Add binding document for Mediatek thermal controller
    thermal: max77620: Add thermal driver for reporting junction temp
    thermal: max77620: Add DT binding doc for thermal driver
    ...

    Linus Torvalds
     

27 Sep, 2016

23 commits

  • When ACPI sends notification for trip point change re-read trips and
    notify thermal core, so that this can be passed to user space thermal
    controller.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Zhang Rui

    Srinivas Pandruvada
     
  • Separated the code for reading trip points from int340x_thermal_zone_add to
    a standalone function int340x_thermal_read_trips. This standlone
    interface to read is exported so that int340x drivers can re-read trips
    on ACPI notification for trip point change.
    Also the appropriate notification events are sent by int340x driver based
    on the acpi event using int340x_thermal_zone_device_update().

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Zhang Rui

    Srinivas Pandruvada
     
  • Add additional properties:
    NAME= Thermal zone type
    TEMP= Temperature sample value
    TRIP= Violated trip index
    EVENT= The notification event (new temperature sample, trip violation
    trip changed)

    This is the additional information to what kobject_uevent already
    provides. So it will not impact existing user spaces.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Zhang Rui

    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: Srinivas Pandruvada
    Signed-off-by: Zhang Rui

    Srinivas Pandruvada
     
  • …-hw-throttle' into next

    Zhang Rui
     
  • Tegra132 use CCROC throttle registers to configure
    pulse skiper, set these registers to enable throttle
    function for Tegra132.

    Signed-off-by: Wei Ni
    Signed-off-by: Zhang Rui

    Wei Ni
     
  • Tegra soctherm support HW throttle, when the soctherm snesors'
    temperature is above the throttle trip point, it will trigger
    pulse skiper to tune clocks accroding to the throttle depth.
    Add this function for Tegra124 and Tegra210.
    Since Tegra132 use different registers to configure pulse skiper,
    will support it in next patch.

    Signed-off-by: Wei Ni
    Signed-off-by: Zhang Rui

    Wei Ni
     
  • devm_thermal_zone_of_sensor_register can fail, so check it's return value.

    Signed-off-by: Axel Lin
    Reviewed-by: Matthias Brugger
    Signed-off-by: Zhang Rui

    Axel Lin
     
  • This patch adds support for mt2701 chip to mtk_thermal,
    and integrate both mt8173 and mt2701 on the same driver.
    MT8173 has four banks and five sensors, and MT2701 has
    only one bank and three sensors.

    Signed-off-by: Dawei Chien
    Signed-off-by: Zhang Rui

    dawei.chien@mediatek.com
     
  • Maxim Semiconductor Max77620 supports alarm interrupts when
    its die temperature crosses 120C and 140C. These threshold
    temperatures are not configurable.

    Add thermal driver to register PMIC die temperature as thermal
    zone sensor and capture the die temperature warning interrupts
    to notifying the client.

    Signed-off-by: Laxman Dewangan
    Signed-off-by: Zhang Rui

    Laxman Dewangan
     
  • When this platform is suspended, firmware powers the entire SoC down,
    except a few hardware blocks waiting for wakeup events. There is no
    context to save for this particular block.

    Therefore, there is nothing useful for the driver to do on suspend;
    so we define a NULL suspend hook. On resume, the driver initializes
    the block exactly as is done in the probe callback.

    Signed-off-by: Marc Gonzalez
    Reviewed-by: Kevin Hilman
    Signed-off-by: Zhang Rui

    Marc Gonzalez
     
  • We could see that state is defined as unsigned type, so it
    should never be less than zero. Let' remove this check.

    Signed-off-by: Shawn Lin
    Reviewed-by: Chanwoo Choi
    Signed-off-by: Zhang Rui

    Shawn Lin
     
  • devm_thermal_zone_of_sensor_register() case doesn't need to call
    thermal_zone_device_unregister().
    Otherwise, rcar-thermal can't register thermal zone again after rebind.
    This patch fixes it.

    Signed-off-by: Bui Duc Phuc
    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Zhang Rui

    Bui Duc Phuc
     
  • Signed-off-by: Zhang Rui

    Zhang Rui
     
  • Not much use unless the SoC is selected so depend on the ARCH_MXC
    and COMPILE_TEST like all the other thermal drivers.

    v2: drop extraneous OF

    Signed-off-by: Peter Robinson
    Acked-by: Shawn Guo
    Signed-off-by: Zhang Rui

    Peter Robinson
     
  • In case of error, the function of_iomap() returns NULL pointer
    not ERR_PTR(). The IS_ERR() test in the return value check
    should be replaced with NULL test.
    And the function devm_regmap_init_mmio() returns ERR_PTR()
    and never returns NULL. The NULL test in the return value
    check should be replaced with IS_ERR().

    Signed-off-by: Wei Yongjun
    Acked-by: Rajendra Nayak
    Signed-off-by: Zhang Rui

    Wei Yongjun
     
  • 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: Rocky Hao
    Signed-off-by: Caesar Wang
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: Heiko Stuebner
    Cc: linux-pm@vger.kernel.org
    Tested-by: Stephen Barber
    Signed-off-by: Zhang Rui

    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: Rocky Hao
    Signed-off-by: Caesar Wang
    Cc: Eduardo Valentin
    Cc: Zhang Rui
    Cc: Heiko Stuebner
    Cc: linux-pm@vger.kernel.org
    Tested-by: Stephen Barber
    Signed-off-by: Zhang Rui

    Rocky Hao
     
  • The newly added tsens-8916 driver produces warnings when CONFIG_PM
    is disabled:

    drivers/thermal/qcom/tsens.c:53:12: error: 'tsens_resume' defined but not used [-Werror=unused-function]
    static int tsens_resume(struct device *dev)
    ^~~~~~~~~~~~
    drivers/thermal/qcom/tsens.c:43:12: error: 'tsens_suspend' defined but not used [-Werror=unused-function]
    static int tsens_suspend(struct device *dev)
    ^~~~~~~~~~~~~

    This marks both functions __maybe_unused to let the compiler
    know that they might be used in other configurations, without
    adding ugly #ifdef logic.

    Signed-off-by: Arnd Bergmann
    Reviewed-by: Rajendra Nayak
    Signed-off-by: Zhang Rui

    Arnd Bergmann
     
  • This driver add thermal management support by enabling TMU (Thermal
    Monitoring Unit) on QorIQ platform.

    It's based on thermal of framework:
    - Trip points defined in device tree.
    - Cpufreq as cooling device registered in qoriq cpufreq driver.

    Signed-off-by: Jia Hongtao
    Signed-off-by: Zhang Rui

    Jia Hongtao
     
  • rcar-thermal is supporting both thermal_zone_of_sensor_register() and
    thermal_zone_device_register(). But thermal_zone_of_sensor_register()
    doesn't enable hwmon as default.
    This patch enables it to keep compatibility

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Zhang Rui

    Kuninori Morimoto
     
  • Currently thermal zone set_emul_temp is set unconditionally
    with of_thermal_set_emul_temp function. Set this only if the
    set_emul_temp hook is provided for thermal_zone_of_device_ops.

    This fixes emul_temp failures on platforms for which set_emul_temp
    hook is not populated.

    Fixes: "184a4bf623f (thermal: of: Extend current
    of-thermal.c code to allow setting emulated temp)"
    Suggested-by: Eduardo Valentin
    Signed-off-by: Keerthy
    Signed-off-by: Eduardo Valentin

    Conflicts:
    drivers/thermal/of-thermal.c
    Signed-off-by: Zhang Rui

    Keerthy
     
  • 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: Rocky Hao
    Signed-off-by: Caesar Wang
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: Heiko Stuebner
    Cc: linux-pm@vger.kernel.org
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Caesar Wang