Question about chip driver policy

Morris, John John.Morris at spirentcom.com
Fri Aug 29 15:47:13 CEST 2003


In the new-drivers document, under the heading "Write the new driver", it
says:

  "Remember that you want to output the direct measurements done by the
  chip. If these sensor values need scaling, this should be done through
  the configuration file."

However, many of the existing drivers don't do this. For example, lm85.c has
this macro:

#define FAN_FROM_REG(val) ((val)==0?-1:(val)==0xffff?0:5400000/(val))

which the driver uses to convert from register values to rps. There are lots
of similar constructs in other drivers.

Which is the right way for new drivers - the code or the documentation?






More information about the lm-sensors mailing list