gpio: added gpio_get_direction

Added an API function to get the direction of a GPIO pin. The pin's
configuration is also updated based on the return value of
gpio_chip::get_direction.

Signed-off-by: Michel Megens <dev@michelmegens.net>
gpio: atmega: added the ATmega GPIO source file.

* The ATmega GPIO driver will be implemented in atmega-gpio.c.
* Moved the GPIO core library from gpio.c to gpiolib.c

Signed-off-by: Michel Megens <dev@michelmegens.net>