This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Reading hex value from gpio using sysfs?



I need to read a 4-bit hex rotary switch connected to the gpio, and I'd like to use sysfs. I have successfully configured the pinmux, and I know how to add simple one-bit gpio keys, but not how to create a device with 4 bits. I.e. I'd rather not read each individual pin, and build a 4 bit value from this, as it seams like a waste, if I insted could read the nibble in one read and present to sysfs.

Are there any support for this?

Any pointers appreciated!