31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

16 Apr, 2019

1 commit


30 Mar, 2019

1 commit

  • Commit 7cc7de93fad4 ("hwmon: (ntc_thermistor) Convert to new hwmon API")
    converted the driver to use the new hwmon API, but introduced a subtle
    error: The temperature type is no longer reported as temp1_type, but as
    temp2_type.

    Fixes: 7cc7de93fad4 ("hwmon: (ntc_thermistor) Convert to new hwmon API")
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     

24 Feb, 2019

1 commit

  • Use devm_hwmon_device_register_with_info() instead of
    devm_hwmon_device_register_with_groups() to register the hwmon
    device to simplify the code and make it easier to maintain.
    As part of this change, thermal device registration is moved into
    the hwmon core.

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     

17 Dec, 2018

4 commits


09 Sep, 2016

3 commits


17 May, 2016

1 commit


05 Mar, 2016

1 commit


03 Aug, 2015

1 commit

  • The thermal code uses int, long and unsigned long for temperatures
    in different places.

    Using an unsigned type limits the thermal framework to positive
    temperatures without need. Also several drivers currently will report
    temperatures near UINT_MAX for temperatures below 0°C. This will probably
    immediately shut the machine down due to overtemperature if started below
    0°C.

    'long' is 64bit on several architectures. This is not needed since INT_MAX °mC
    is above the melting point of all known materials.

    Consistently use a plain 'int' for temperatures throughout the thermal code and
    the drivers. This only changes the places in the drivers where the temperature
    is passed around as pointer, when drivers internally use another type this is
    not changed.

    Signed-off-by: Sascha Hauer
    Acked-by: Geert Uytterhoeven
    Reviewed-by: Jean Delvare
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Darren Hart
    Reviewed-by: Heiko Stuebner
    Reviewed-by: Peter Feuerer
    Cc: Punit Agrawal
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Jean Delvare
    Cc: Peter Feuerer
    Cc: Heiko Stuebner
    Cc: Lukasz Majewski
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: linux-acpi@vger.kernel.org
    Cc: platform-driver-x86@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-omap@vger.kernel.org
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: Guenter Roeck
    Cc: Rafael J. Wysocki
    Cc: Maxime Ripard
    Cc: Darren Hart
    Cc: lm-sensors@lm-sensors.org
    Signed-off-by: Zhang Rui

    Sascha Hauer
     

04 Jun, 2015

1 commit

  • The function get_ohm_of_thermistor has both the measured voltage and the
    pullup voltage available in microvolts. But it was promptly converting
    both to millivolts before using them to calculate the thermistor
    resistance. That conversion unnecessarily hurt the precision of the
    calculation.

    For example, take the ncpXXwb473 connected to 5000 mV and pulled down
    through a 47000 ohm resistor. At 25 C, the resistance of the thermistor
    is 47000 ohms. The measured voltage will be 2500 mV. If we measure
    instead 2501 mV, then the calculated resistance will be 46962 ohms --
    a difference of 38 ohms. So the precision of the resistance estimate
    could be increased by 38X by doing the calculations in microvolts.

    Signed-off-by: Chris Lesiak
    Signed-off-by: Guenter Roeck

    Chris Lesiak
     

02 Jun, 2015

1 commit

  • The function ntc_adc_iio_read was assuming both a 12 bit ADC and that
    pullup_uv is the same as the ADC reference voltage. If either
    assumption is false, then the result is incorrect.

    Attempt to use iio_convert_raw_to_processed to convert the raw value to
    microvolts. It will fail for iio channels that don't support support
    IIO_CHAN_INFO_SCALE; in that case fall back to the assumptions.

    Signed-off-by: Chris Lesiak
    Signed-off-by: Guenter Roeck

    Chris Lesiak
     

01 Jun, 2015

1 commit


27 May, 2015

1 commit


18 Dec, 2014

1 commit

  • Pull thermal management update from Zhang Rui:
    "Summary:

    - of-thermal extension to allow drivers to register and use its
    functionality in a better way, without exploiting thermal core.
    From Lukasz Majewski.

    - Fix a bug in intel_soc_dts_thermal driver which calls a sleep
    function in interrupt handler. From Maurice Petallo.

    - add a thermal UAPI header file for exporting the thermal generic
    netlink information to user-space. From Florian Fainelli.

    - First round of refactoring in Exynos driver. Bartlomiej and Lukasz
    are attempting to make it lean and easier to understand.

    - New thermal driver for Rockchip (rk3288), with support for DT
    thermal. From Caesar Wang.

    - New thermal driver for Nvidia, Tegra124 SOCTHERM driver, with
    support for DT thermal. From Mikko Perttunen.

    - New cooling device, based on common clock framework. From Eduardo
    Valentin.

    - a couple of small fixes in thermal core framework. From Srinivas
    Pandruvada, Javi Merino, Luis Henriques.

    - Dropping Armada A375-Z1 SoC thermal support as the chip is not in
    the market, armada folks decided to drop its support.

    - a couple of small fixes and cleanups in int340x thermal driver"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (58 commits)
    thermal: provide an UAPI header file
    Thermal/int340x: Clear the error value of the last acpi_bus_get_device() call
    thermal/powerclamp: add id for braswell cpu
    thermal: Intel SoC DTS: Don't do thermal zone update inside spin_lock
    Thermal: fix platform_no_drv_owner.cocci warnings
    Thermal/int340x: avoid unnecessary pointer casting
    thermal: int3403: Delete a check before thermal_zone_device_unregister()
    thermal/int3400: export uuids
    thermal: of: Extend current of-thermal.c code to allow setting emulated temp
    thermal: of: Extend of-thermal to export table of trip points
    thermal: of: Rename struct __thermal_trip to struct thermal_trip
    thermal: of: Extend of-thermal.c to provide check if trip point is valid
    thermal: of: Extend of-thermal.c to provide number of trip points
    thermal: Fix error path in thermal_init()
    thermal: lock the thermal zone when switching governors
    thermal: core: ignore invalid trip temperature
    thermal: armada: Remove support for A375-Z1 SoC
    thermal: rockchip: add driver for thermal
    dt-bindings: document Rockchip thermal
    thermal: exynos: remove exynos_tmu_data.h include
    ...

    Linus Torvalds
     

20 Nov, 2014

1 commit

  • Different drivers request API extensions in of-thermal. For this reason,
    additional callbacks are required to fit the new drivers needs.

    The current API implementation expects the registering sensor driver
    to provide a get_temp and get_trend callbacks as function parameters.
    As the amount of callbacks is growing, this patch changes the existing
    implementation to use a .ops field to hold all the of thermal callbacks
    to sensor drivers.

    This patch also changes the existing of-thermal users to fit the new
    API design. No functional change is introduced in this patch.

    Cc: Alexandre Courbot
    Cc: devicetree@vger.kernel.org
    Cc: Grant Likely
    Cc: Guenter Roeck
    Cc: Jean Delvare
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: linux-tegra@vger.kernel.org
    Cc: lm-sensors@lm-sensors.org
    Cc: Rob Herring
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: Zhang Rui
    Acked-by: Guenter Roeck
    Tested-by: Mikko Perttunen
    Reviewed-by: Mikko Perttunen
    Reviewed-by: Alexandre Courbot
    Reviewed-by: Lukasz Majewski
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

20 Oct, 2014

1 commit


23 Sep, 2014

1 commit


04 Aug, 2014

1 commit


30 Jun, 2014

1 commit


25 Jun, 2014

1 commit

  • Murata Manufacturing Co., Ltd is the vendor for
    NTC (Negative Temperature coefficient) based Thermistors.
    But, the driver extensively uses "NTC" as the vendor name.

    This patch corrects the vendor name also updates the
    compatibility strings according to the vendor-prefix.txt

    Note: Drivers continue to support the previous compatible strings
    but further addition of these compatible strings in device tree
    is deprecated.

    Signed-off-by: Naveen Krishna Chatradhi
    Reviewed-by: Javier Martinez Canillas
    Signed-off-by: Guenter Roeck

    Naveen Krishna Chatradhi
     

25 May, 2014

2 commits

  • The mapping from OF device IDs to platform device IDs is wrong.
    TYPE_NCPXXWB473 is 0, TYPE_NCPXXWL333 is 1, so
    ntc_thermistor_id[TYPE_NCPXXWB473] is { "ncp15wb473", TYPE_NCPXXWB473 }
    while
    ntc_thermistor_id[TYPE_NCPXXWL333] is { "ncp18wb473", TYPE_NCPXXWB473 }.

    So the name is wrong for all but the "ntc,ncp15wb473" entry, and the
    type is wrong for the "ntc,ncp15wl333" entry.

    So map the entries by index, it is neither elegant nor robust but at
    least it is correct.

    Signed-off-by: Jean Delvare
    Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
    Reviewed-by: Guenter Roeck
    Cc: Naveen Krishna Chatradhi
    Cc: Doug Anderson

    Jean Delvare
     
  • In commit 9e8269de, support was added for ntc_thermistor devices being
    declared in the device tree and implemented on top of IIO. With that
    change, a dependency was added to the ntc_thermistor driver:

    depends on (!OF && !IIO) || (OF && IIO)

    This construct has the drawback that the driver can no longer be
    selected when OF is set and IIO isn't, nor when IIO is set and OF is
    not. This is a regression for the original users of the driver.

    As the new code depends on IIO and is useless without OF, include it
    only if both are enabled, and set the dependencies accordingly. This
    is clearer, more simple and more correct.

    Signed-off-by: Jean Delvare
    Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
    Reviewed-by: Guenter Roeck
    Cc: Naveen Krishna Chatradhi
    Cc: Doug Anderson

    Jean Delvare
     

14 Feb, 2014

1 commit

  • The ntc thermistor code was doing math whose temporary result might
    have overflowed 32-bits. We need some casts in there to make it safe.

    In one example I found:
    - pullup_uV: 1800000
    - result of iio_read_channel_raw: 3226
    - 1800000 * 3226 => 0x15a1cbc80

    Signed-off-by: Doug Anderson
    Cc: stable@vger.kernel.org # 3.10+
    Signed-off-by: Guenter Roeck

    Doug Anderson
     

12 Aug, 2013

1 commit


22 Jun, 2013

1 commit


08 Apr, 2013

2 commits


20 Feb, 2013

1 commit

  • Fixes the following sparse warnings:
    drivers/hwmon/ntc_thermistor.c:46:31: warning:
    symbol 'ncpXXwb473' was not declared. Should it be static?
    drivers/hwmon/ntc_thermistor.c:82:31: warning:
    symbol 'ncpXXwl333' was not declared. Should it be static?

    Cc: MyungJoo Ham
    Signed-off-by: Sachin Kamat
    Acked-by: MyungJoo Ham
    Acked-by: Jean Delvare
    Signed-off-by: Guenter Roeck

    Sachin Kamat
     

29 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

22 Jul, 2012

1 commit


21 May, 2012

3 commits

  • Fix checkpatch WARNING: quoted string split across lines

    Signed-off-by: Guenter Roeck
    Reviewed-by: Robert Coulson

    Guenter Roeck
     
  • The following build warning is seen in some configurations:

    drivers/hwmon/ntc_thermistor.c: In function 'ntc_show_temp':
    drivers/hwmon/ntc_thermistor.c:293: warning: 'temp' may be used uninitialized in this function

    Fix the problem by re-arranging the code to overload return values with error
    codes, and by avoiding error returns whenever possible.

    Specifically,

    Simplify lookup_comp() to not return an error. Instead, return i_low == i_high
    if there is an exact match, or if the ohm value is outside the lookup table
    range.

    Modify get_temp_mC() to not return an error. Since it only returns an error
    after lookup_comp() returned an error, this is quite straightforward after above
    change.

    Separate ntc_thermistor_read() into a function to read the resistor value (which
    can return an error), and the call to get_temp_mC() which doesn't. Call the
    functions directly from ntc_show_temp().

    Code was tested using a test program, comparing the result of the old and new
    versions of get_temp_mC() for resistor values between 0 and 2,000,000 ohm.

    As a side effect, this patch reduces code size by approximately 400 bytes on
    x86_64.

    Signed-off-by: Guenter Roeck
    Cc: Donggeun Kim
    Reviewed-by: Robert Coulson

    Guenter Roeck
     
  • hwmon_device_register() never returns a NULL pointer in case of errors, but
    an error value. Use it.

    Signed-off-by: Guenter Roeck
    Reviewed-by: Robert Coulson

    Guenter Roeck