1. 13 Dec, 2021 4 commits
    • Guenter Roeck's avatar
      hwmom: (lm90) Fix citical alarm status for MAX6680/MAX6681 · da7dc056
      Guenter Roeck authored
      Tests with a real chip and a closer look into the datasheet reveals
      that the local and remote critical alarm status bits are swapped for
      MAX6680/MAX6681.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      da7dc056
    • Guenter Roeck's avatar
      hwmon: (lm90) Drop critical attribute support for MAX6654 · 16ba51b5
      Guenter Roeck authored
      Tests with a real chip and a closer look into the datasheet show that
      MAX6654 does not support CRIT/THERM/OVERTEMP limits, so drop support
      of the respective attributes for this chip.
      
      Introduce LM90_HAVE_CRIT flag and use it to instantiate critical limit
      attributes to solve the problem.
      
      Cc: Josh Lehan <krellan@google.com>
      Fixes: 229d495d ("hwmon: (lm90) Add max6654 support to lm90 driver")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      16ba51b5
    • Guenter Roeck's avatar
      hwmon: (lm90) Prevent integer overflow/underflow in hysteresis calculations · 55840b9e
      Guenter Roeck authored
      Commit b50aa496 ("hwmon: (lm90) Prevent integer underflows of
      temperature calculations") addressed a number of underflow situations
      when writing temperature limits. However, it missed one situation, seen
      when an attempt is made to set the hysteresis value to MAX_LONG and the
      critical temperature limit is negative.
      
      Use clamp_val() when setting the hysteresis temperature to ensure that
      the provided value can never overflow or underflow.
      
      Fixes: b50aa496 ("hwmon: (lm90) Prevent integer underflows of temperature calculations")
      Cc: Dmitry Osipenko <digetx@gmail.com>
      Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      55840b9e
    • Guenter Roeck's avatar
      hwmon: (lm90) Fix usage of CONFIG2 register in detect function · fce15c45
      Guenter Roeck authored
      The detect function had a comment "Make compiler happy" when id did not
      read the second configuration register. As it turns out, the code was
      checking the contents of this register for manufacturer ID 0xA1 (NXP
      Semiconductor/Philips), but never actually read the register. So it
      wasn't surprising that the compiler complained, and it indeed had a point.
      Fix the code to read the register contents for manufacturer ID 0xa1.
      
      At the same time, the code was reading the register for manufacturer ID
      0x41 (Analog Devices), but it was not using the results. In effect it was
      just checking if reading the register returned an error. That doesn't
      really add much if any value, so stop doing that.
      
      Fixes: f90be42f ("hwmon: (lm90) Refactor reading of config2 register")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      fce15c45
  2. 12 Dec, 2021 14 commits
  3. 11 Dec, 2021 22 commits