---
title: "mac下监控风扇转速"
author: "fkpwolf"
date: "2011-10-10T18:06:09Z"
tags: []
categories: ["开源软件"]
slug: "mac"
draft: false
lastmod: "2011-10-19T16:55:47Z"
id: 1187752
url: "https://fkpwolf.iteye.com/blog/1187752"
---

**store\_pwm**: set zhuan shu,  { 0x109, 0x209, 0x309 }. linux driver read speed from this REG also(nct6775\_update\_pwm). Strange, for pwm num is 3, but fan num is 5.

 

 

**store\_pwm\_enable**: NCT6775\_REG\_FAN\_MODE, { 0x102, 0x202, 0x302 }. In linux driver, it get value and then set back. So we should get all possible value at first.

 

    1-&gt;manual

    2-&gt;thermal cruise mode (also called SmartFan I)

    3-&gt;fan speed cruise mode

    4-&gt;variable thermal cruise (also called

SmartFan III)

    5-&gt;enhanced variable thermal cruise (also called

SmartFan IV)

 

**store\_pwm\_mode:** W83627EHF\_REG\_PWM\_ENABLE. In Open Hardware no one like this. 

0-&gt;DC variable voltage,1-&gt;PWM variable duty cycle

has no difference for w83627 and nct6776f. No need for nct6776f? If you want to read value for ref, check method *nct6775\_update\_pwm* then you know how to write it.

\-------------------------------------

[http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ComputerIC/SuperIO/LPCSuperIOforDesktopAndServer/Documents/W83627DHG-P\_W83627DHG-PT.pdf](http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ComputerIC/SuperIO/LPCSuperIOforDesktopAndServer/Documents/W83627DHG-P_W83627DHG-PT.pdf) datasheet of other chip

8.6.2 fan control. each pin has 2 type: pwm or dc

 

\--------------------------------------

 

static struct sensor\_device\_attribute sda\_pwm\[] = {

SENSOR\_ATTR(pwm1, S\_IWUSR | S\_IRUGO, show\_pwm, store\_pwm, 0),

SENSOR\_ATTR(pwm2, S\_IWUSR | S\_IRUGO, show\_pwm, store\_pwm, 1),

SENSOR\_ATTR(pwm3, S\_IWUSR | S\_IRUGO, show\_pwm, store\_pwm, 2),

SENSOR\_ATTR(pwm4, S\_IWUSR | S\_IRUGO, show\_pwm, store\_pwm, 3),

};

what's pwm1,pwm2? defined in fancontrol configuration?

\---------------------------------------------------------------

now I can set speed manually. Then how to control in GUI? There is an tool called Fan control([http://mr21.in/software/macbook-pro-fan-control.html](http://mr21.in/software/macbook-pro-fan-control.html)) which used in Macbook Pro. So there is an standard interface to access smc?

 

user client [http://developer.apple.com/library/mac/#documentation/DeviceDrivers/Conceptual/AccessingHardware/AH\_IOKitLib\_API/AH\_IOKitLib\_API.html#//apple\_ref/doc/uid/TP30000380-TPXREF116](http://developer.apple.com/library/mac/#documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_IOKitLib_API/AH_IOKitLib_API.html%23//apple_ref/doc/uid/TP30000380-TPXREF116)