Hi Christian, On Fri, Dec 30, 2022 at 06:32:23PM +0100, Christian Lamparter wrote: > On 12/28/22 14:57, Guenter Roeck wrote: > > NCT6799D is mostly compatible to NCT6798D, with minor variations. > > > > Note that NCT6798D and NCT6799D have a new means to select temperature > > sources, and to report temperatures from those sources. This is not > > currently implemented, meaning that most likely not all temperatures > > are reported. > > > > Initial support. Compile tested only. > > FYI: This ID is compatible with the NCT6796D-S on the ASRock X670E PG Lighting Mainboard. > (Previous discussion: "[PATCH v1] hwmon: (nct6775) Add chip ID for NCT6796D-S" > <https://www.spinics.net/lists/linux-hwmon/msg17785.html>) > > With this patch applied, the nct6775 module loads and produces the following output when loaded. > > | [28152.009197] nct6775: Found NCT6799D or compatible chip at 0x2e:0x290 > > and lm-sensors also enumerates the sensors and finally all six fans. > So this is definitively an improvement over my patch. > Thanks a lot for testing. I'd suspect that NCT6796D-S was mislabeled in the user manual. That would not be the first time. > |# sensors > | > |nct6799-isa-0290 > |Adapter: ISA adapter > |in0: 720.00 mV (min = +0.00 V, max = +1.74 V) > |in1: 1.82 V (min = +0.00 V, max = +0.00 V) ALARM > |in2: 3.39 V (min = +2.98 V, max = +3.63 V) > |in3: 3.28 V (min = +2.98 V, max = +3.63 V) > |in4: 1.65 V (min = +0.00 V, max = +0.00 V) ALARM > |in5: 1.05 V (min = +0.00 V, max = +0.00 V) ALARM > |in6: 1.41 V (min = +0.00 V, max = +0.00 V) ALARM > |in7: 3.39 V (min = +2.98 V, max = +3.63 V) > |in8: 3.23 V (min = +2.70 V, max = +3.63 V) > |in9: 904.00 mV (min = +0.00 V, max = +0.00 V) ALARM > |in10: 600.00 mV (min = +0.00 V, max = +0.00 V) ALARM > |in11: 608.00 mV (min = +0.00 V, max = +0.00 V) ALARM > |in12: 1.04 V (min = +0.00 V, max = +0.00 V) ALARM > |in13: 896.00 mV (min = +0.00 V, max = +0.00 V) ALARM > |in14: 1.26 V (min = +0.00 V, max = +0.00 V) ALARM > |fan1: 891 RPM (min = 0 RPM) > |fan2: 0 RPM (min = 0 RPM) > |fan3: 1345 RPM (min = 0 RPM) > |fan4: 774 RPM (min = 0 RPM) > |fan5: 0 RPM (min = 0 RPM) > |fan7: 0 RPM (min = 0 RPM) Interesting. Do you have three fans connected, and the motherboard has seven fans ? > |SYSTIN: +29.5°C sensor = thermistor > |CPUTIN: +29.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor > |AUXTIN0: +4.0°C (high = +67.0°C, hyst = +110.0°C) sensor = thermistor Hmm, that hysteresis value seems wrong. I'll need to check if the register addresses are correct. > |AUXTIN1: +15.0°C sensor = thermistor > |AUXTIN2: +15.0°C sensor = thermistor > |AUXTIN3: +13.0°C sensor = thermistor Looks like either those are not connected, or there is a temperature offset which is not applied, or it is set to wrong values (the chip does support temperature offset registers). Thanks, Guenter > |SMBUSMASTER 0: +40.0°C (high = +80.0°C, hyst = +75.0°C) > |PCH_CHIP_CPU_MAX_TEMP: +0.0°C > |PCH_CHIP_TEMP: +0.0°C > |PCH_CPU_TEMP: +0.0°C > |TSI0_TEMP: +40.0°C > |intrusion0: ALARM > |intrusion1: ALARM > |beep_enable: disabled > > Tested-by: Christian Lamparter <chunkeey@xxxxxxxxx> > > Cheers, > Christian > > (one comment below) > > diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c > > index bf43f73dc835..906394b26781 100644 > > --- a/drivers/hwmon/nct6775-platform.c > > +++ b/drivers/hwmon/nct6775-platform.c > > @@ -36,6 +36,7 @@ static const char * const nct6775_sio_names[] __initconst = { > > "NCT6796D", > > "NCT6797D", > > "NCT6798D", > > + "NCT6799D", > > }; > > static unsigned short force_id; > > @@ -86,6 +87,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal"); > > #define SIO_NCT6796_ID 0xd420 > > #define SIO_NCT6797_ID 0xd450 > > #define SIO_NCT6798_ID 0xd428 > > +#define SIO_NCT6799_ID 0xd800 > > #define SIO_ID_MASK 0xFFF8 > > /* > > @@ -408,7 +410,7 @@ static int nct6775_resume(struct device *dev) > > if (data->kind == nct6791 || data->kind == nct6792 || > > data->kind == nct6793 || data->kind == nct6795 || > > data->kind == nct6796 || data->kind == nct6797 || > > - data->kind == nct6798) > > + data->kind == nct6798 || data->kind == nct6799) > > nct6791_enable_io_mapping(sio_data); > > sio_data->sio_exit(sio_data); > > @@ -555,7 +557,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio > > } else { > > /* > > * NCT6779D, NCT6791D, NCT6792D, NCT6793D, NCT6795D, NCT6796D, > > - * NCT6797D, NCT6798D > > + * NCT6797D, NCT6798D, NCT6799D > > */ > > int cr1a = sio_data->sio_inb(sio_data, 0x1a); > > int cr1b = sio_data->sio_inb(sio_data, 0x1b); > > @@ -565,12 +567,17 @@ nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio > > int cr2b = sio_data->sio_inb(sio_data, 0x2b); > > int cr2d = sio_data->sio_inb(sio_data, 0x2d); > > int cr2f = sio_data->sio_inb(sio_data, 0x2f); > > + bool vsb_ctl_en = cr2f & BIT(0); > > bool dsw_en = cr2f & BIT(3); > > bool ddr4_en = cr2f & BIT(4); > > + bool as_seq1_en = cr2f & BIT(7); > > int cre0; > > + int cre6; > > int creb; > > int cred; > > + cre6 = sio_data->sio_inb(sio_data, 0xe0); > ^^ looks like one extra indent sneaked in? >