hwmon: (nct7802) fix for buggy temp6 + GPIO question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guenter,

I was wondering why temp6 temperature was reported even with PECI1 disabled and found a bug in nct7802_temp_is_visible() where 46 is treated as an hex instead of a decimal. The fix is :
-       if (index >= 0x46 && (!(reg & 0x02)))                   /* PECI 1 */
+       if (index >= 46 && (!(reg & 0x02)))                     /* PECI 1 */
but to be coherent with the lines above, this is probably better without the parenthesis around the "!" :
+       if (index >= 46 && !(reg & 0x02))                     /* PECI 1 */

About GPIO, I have a custom board where a voltage is connected to the GPIO1 pin just to detect its presence (all sense inputs already used and only presence info is required). I have patched the driver to treat this GPIO1 pin as an "in5" returning 0 or 1 and have added this to sensors file :
  label in5   "3V3AUX Present"
  compute in5 3300*@, @/3300
Is there a better way to do so in a more standard way (yes I know this is custom hardware) ?
For example implement that in a GPIO driver instead of patching the nct7802 one, but with the output displayed by "sensors" (this is realy a sense, not a GPIO).
Or add a standard feature to the nct7802 driver to report the level on GPIO pins if enabled as GPIOs and set as inputs ?

Thanks a lot

Gilles Buloz
Kontron Modular Computers



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux