Am Sonntag 11 M?rz 2007 16:21 schrieb Jean Delvare: > Hi Hans, > > Sorry for the delay, I've been busy with large i2c-core changes. I noticed :-) No problem. > > > > I read Documentation/hwmon/sysfs-interface, but I have to admit that I > > don't really understand if fan[1-*]_div has this meaning. If it has, > > we could possibly make prescaler such a sysfs file. > > I'm not certain myself. fan1_div is usually related to the monitoring > only and not to the output. > > Typical chips monitor fan speeds by gating a well defined frequency > with the tachometer pulses. The result is stored in an 8-bit register, > so basically you can only measure fan speeds down to F/255, speeds > below this limit overflow the register. So the chips usually let the > user divide F by a power of two to be able to monitor slower fans - at > the price of resolution. > > So the concept is similar to your "prescaler" in that it's a tradeoff > between resolution and range. But the fan speed control method of the > MAX6650 is completely different from what the other chips do, so other > chips don't need any kind of divider for fan speed control. Obviously, we've reached some limits of the current concept. IMHO, the 'pwm' and 'divider' sysfs files are much too hardware dependent. We should have more abstraction, e.g. like this: fan1_input: (ro) Current speed in RPM fan1_speed: (rw) Desired speed in RPM fan1_min_speed, fan1_max_speed: (rw) Planned/defined operating range in RPM fan1_tacho: (rw) Pulses per round of the tacho generator fan1_mode: (rw) on, off, closed_loop, open_loop, ...