/* If a pin's mode is set to GPIO, it is configured as an input to avoid side-effects. The gpio can be manipulated later using standard GPIO API calls.  */
static void config_pin(unsigned long cfg)
/* If a pin's mode is set to GPIO, it is configured as an input to avoid side-effects. The gpio can be manipulated later using standard GPIO API calls.  */
static void config_pin(unsigned long cfg)
{
	int pin = PIN_NUM(cfg);
	int pull = PIN_PULL(cfg);
	int af = PIN_ALT(cfg);
	int output = PIN_DIR(cfg);
	int val = PIN_VAL(cfg);
	if (output)
		db8500_gpio_make_output(pin, val);
	else {
		db8500_gpio_make_input(pin);
		db8500_gpio_set_pull(pin, pull);
	}
	gpio_set_mode(pin, af);
}