analog reading in kernel module

I’m working on a project for using the BBB to do communication over visible light*. For that I’d like to read the analog inputs on the BBB from within a kernel module.
The libpruio library does exactly what I want but I’ve only gotten it to work in userspace. Does anyone know how to get the same functionality from within a kernel module?

It’d be much appreciated if anyone knows this :slight_smile:

*I’ve taken much inspiration from the OpenVLC project.