Skip to contentSkip to conversation

Sysfs with no struc device ?

DISCUSSION Bodo Eggert 1 participant 1 message Mar 31, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Ayman KHAMOUMA

I'm trying to write a module which is supposed to write the state of a pin in a sysfs file. As it is neither a char device nor a block device, or anything else, I suposed taht I don't need any struct device...I mau be mistaking... So my question is: How can I create this file in sysfs without any struct device ?

Why don't you create a char device: Reader will get one char per status change (and one initial char, off cause), while mmap will map the flag? You'd get the interface you want (except the path beginning with /sys), and more.

Or, if you wanted a more sophisticated way, you could use a one-button-zero-axis joystick device, very similar to the parport joystick. But I doubt it would make sense for your usecase?