Code Monkey home page Code Monkey logo

Comments (9)

SergeyMy avatar SergeyMy commented on September 27, 2024

NCT6683 and NCT6687
//0-7bit=pwm0-pwm7, 0 - normal 1 - bypass_mode
#define NCT6687_REG_FAN_CTRL_MODE 0xA00

#define NCT6687_REG_FAN_PWM_COMMAND 0xA01
#define NCT6687_FAN_CFG_REQ 0x80
#define NCT6687_FAN_CFG_DONE 0x40

nct6687_write(data, NCT6687_REG_FAN_PWM_COMMAND, NCT6687_FAN_CFG_REQ);
msleep(50);
nct6687_write(data, NCT6687_REG_PWM_WRITE(index), val);
nct6687_write(data, NCT6687_REG_FAN_PWM_COMMAND, NCT6687_FAN_CFG_DONE);

NCT6687 -Ok
NCT6683 -Fail


nct6687_write(data, NCT6687_REG_FAN_PWM_COMMAND, NCT6687_FAN_CFG_REQ);
msleep(50);
nct6687_write(data, NCT6687_REG_PWM_WRITE(index), val);
// nct6687_write(data, NCT6687_REG_FAN_PWM_COMMAND, NCT6687_FAN_CFG_DONE); //return to auto-mode (clear 0xA00, clear 0xA28-0xA2F)
nct6687_write(data, NCT6687_REG_FAN_PWM_COMMAND, 0x00); //manual mode

NCT6683D-OK! (NCT6683D EC firmware version 1.0 build 08/21/17)
NCT6687D-OK! (NCT6687D EC firmware version 1.0 build 05/07/20)
NCT6686D who would check.

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

based on above...functions
save_fan_control
restore_fan_control
not only do not make sense (
REG_FAN_CTRL_MODE
REG_FAN_PWM_COMMAND
REG_PWM_WRITE

can be changed both by NCT66* itself and externally using the same ACPI mechanism)
but can also be harmful (dangerous)

ps
disabled these
save_fan_control
restore_fan_control

functions and removed the control functionality from
store_pwm
and added
SENSOR_TEMPLATE(pwm_bypass, "pwm%d_bypass", S_IRUGO, show_pwm_bypass, store_pwm_bypass, 0);

I think it turned out great

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

//tested on nct6687
0xb00-0xc00 PLF (piecewise linear function)

#define NCT6683_REG_PLF(x) (0xb00 + (x) * 24)

NCT6683_REG_PLF(x)+Y = pwm(x+1)_auto_point(Y+1)_temp
NCT6683_REG_PLF(x)+8+Y*2 = pwm(x+1)_auto_point(Y+1)_pwm

example:
изображение
My BIOS only controls 5 PWM...
22-24 bytes mean something, but I'm not sure what I know yet :)

RW area but protected

#define NCT6683_REG_FAN_CFG_CTRL        0xa01
#define NCT6683_FAN_CFG_REQ             0x80
#define NCT6683_FAN_CFG_DONE            0x00    //! tested on 6683 6687
...
mutex_lock(&data->update_lock);
 nct6683_write(data, NCT6683_REG_FAN_CFG_CTRL, NCT6683_FAN_CFG_REQ);
 usleep_range(2000, 5000);
   nct6683_write(data, 0xb00, 0x27); //<<----protected recording
 nct6683_write(data, NCT6683_REG_FAN_CFG_CTRL, NCT6683_FAN_CFG_DONE);
mutex_unlock(&data->update_lock);

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

@Fred78290
Should I continue or have you closed your eyes to this project?

from nct6687d.

Fred78290 avatar Fred78290 commented on September 27, 2024

@SergeyMy

I don't closed my eyes on this project :)

A little busy and submerged by email to be notified :)

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

//tested on nct6687 nct6683
linear function, overlaps all others

RW area but protected (NCT6683_FAN_CFG_REQ -> NCT6683_FAN_CFG_DONE)

VALUE CRITICAL
       1  2  3  4  5  ....
0x9a0: 60 65 65 65 65 00 00 00  00 00 00 00 00 00 00 00	MAX 101C (0x65)	= alarm(C) for pwm max
0x9d0: 03 03 03 03 03 00 00 00  00 00 00 00 00 00 00 00	3C		=hysteresis

#define NCT6683_REG_CRITICAL_TEMP(x)    (0x9a0 + (x))           /* 8 bit celsium*/
...
sprintf(buf + len,"Crit:%3dC ", nct6683_read(data, NCT6683_REG_CRITICAL_TEMP(numplf-1)) );

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

//tested on nct6687, nct6683 was not confirmed
//RO? I was unable to change this block, where there should be an unlock ctrl :(
PWM DC/PWM (pwm[]_mode)
1=DC 0=PWM
0x2f4.0 PWM1
0x2f4.1 PWM2
0x2f4.2 PWM3
...
0x2f4.7 PWM8

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

//tested on nct6687 nct6683
pwm source select (pwm[1-*]_auto_channels_temp)
20 - (temp6) PCIE
01 - (temp1) CPUcore (CPU)
02 - (temp2) System (CPU_sock)
...
0x917 PWM2
0x91B PWM3
...

from nct6687d.

SergeyMy avatar SergeyMy commented on September 27, 2024

//tested on nct6687 nct6683
source PV (PrimaryValue for PLF) (celsium) //result source selec ((pwm[1-*]_auto_channels_temp)

0xca0 PLF1
0xca1 PLF2
...

from nct6687d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.