Skip to contentSkip to conversation

max1111 doesn't implement the standard sysfs interface

lm-sensors Jean Delvare 2 participants 3 messages Oct 31, 2011

lore
Share & tools
lore
#0 lore raw

Hi Eric,

It was pointed to me that the max1111 driver doesn't implement the standard sysfs interface for hwmon drivers (as described in Documentation/hwmon/sysfs-interface). It exports files adc[0-3]_in, which aren't part of the standard interface. Presumably these should be renamed to in[0-3]_input. Renaming them is probably not sufficient though, as I see no scaling done in the driver. As the MAX1111 chip has a documented full scale of 2.048V, I take it that the LSB of the ADC has a weight of 8 mV. Exporting raw register values to user-space is not OK.

So I would appreciate a fixup patch quickly. Otherwise we'll have to remove the max1111 driver completely, so that it doesn't get used as a (bad) example by other driver authors [1]. I'm sorry I did not spot the problem when reviewing the driver originally.

[1] http://lists.lm-sensors.org/pipermail/lm-sensors/2011-October/034070.html

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Hi Eric,

It was pointed to me that the max1111 driver doesn't implement the standard sysfs interface for hwmon drivers (as described in Documentation/hwmon/sysfs-interface). It exports files adc[0-3]_in, which aren't part of the standard interface. Presumably these should be renamed to in[0-3]_input. Renaming them is probably not sufficient though, as I see no scaling done in the driver. As the MAX1111 chip has a documented full scale of 2.048V, I take it that the LSB of the ADC has a weight of 8 mV. Exporting raw register values to user-space is not OK.

So I would appreciate a fixup patch quickly. Otherwise we'll have to remove the max1111 driver completely, so that it doesn't get used as a (bad) example by other driver authors [1]. I'm sorry I did not spot the problem when reviewing the driver originally.

[1] http://lists.lm-sensors.org/pipermail/lm-sensors/2011-October/034070.html

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw

Re: [lm-sensors] max1111 doesn't implement the standard sysfs

In reply to Jean Delvare

Hi Jean,

Sorry for the non-standard interfaces. I'll work on that soon.

- eric

Quoted 17 lines · Jean Delvare

Hi Eric,

It was pointed to me that the max1111 driver doesn't implement the standard sysfs interface for hwmon drivers (as described in Documentation/hwmon/sysfs-interface). It exports files adc[0-3]_in, which aren't part of the standard interface. Presumably these should be renamed to in[0-3]_input. Renaming them is probably not sufficient though, as I see no scaling done in the driver. As the MAX1111 chip has a documented full scale of 2.048V, I take it that the LSB of the ADC has a weight of 8 mV. Exporting raw register values to user-space is not OK.

So I would appreciate a fixup patch quickly. Otherwise we'll have to remove the max1111 driver completely, so that it doesn't get used as a (bad) example by other driver authors [1]. I'm sorry I did not spot the problem when reviewing the driver originally.

Quoted 5 lines

[1] http://lists.lm-sensors.org/pipermail/lm-sensors/2011-October/034070.html

--
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors