Currently, libraries such as RPi.GPIO are accessing /dev/mem to get to the GPIO registers directly, which works very well but has a number of issues, not the least of them the fact that you have to run as root whenever you touch GPIO.

As a first step away from this, we're adding a device, /dev/gpiomem, which gives you access to the GPIO registers without root permission. It will always map your pointer to the correct location of the registers, so there is no need to parse /proc/devicetree to try and figure out where they are.

See this pull request on raspberrypi/linux for more details.

I've attached a patch for c_gpio.c which will first check for /dev/gpiomem and then fall back to requiring root privileges if it doesn't exist. /dev/gpiomem will appear in the next Raspbian release (or sooner via rpi-update), at which point RPi.GPIO and similar tools will no longer require root.