On 05/19/2009 12:45 PM, Engelmayer Christian wrote: >> I'm not sure we should be exporting gpio functionality like this. First of >> all the gpio function usually is fixed by how the IC is wired up, so I > would >> expect that to be set by the BIOS / firmware. And when not, this should be >> set through a board configuration file, exporting this to userspace feels > wrong. > > I see Your points. I also missed the actual sysfs interface definition. > I will leave setting up the pins and the knowledge on the actual wiring > completely to the custom firmware then. > >> The same can be said for toggling the pin when its an output, its function > will >> depend upon how its wired up again, and I would expect some higher level > interface >> (like an ACPI interface or whatever) expose its functionality in a more > sane way. > > For the usecase that drives me, I would nevertheless need userspace > to be able to check whether an alarm condition exists. Having firmware > set up the gpio usage and enabled the adapted alarm conditions one > could combine the various alarm sources provided by the chip (min/max > output, tach overflow, gpio related) into alarm file 'fan1_alarm' as > already specified in the hwmon sysfs-interface standard. > > Would that be an acceptable extension? > Extending the supported alarms would be fine, although I would not aggregate them all under one sysfs file, just make a gpio#_alarm sysfs file, and make the presence of this file conditional on the configuration of the gpio pins. Would that work for you ? Regards, Hans