LInux kernel: invoke callback function in user space from the kernel space

check this discussion thread, Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.