X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fgpio%2Fmxs_gpio.c;h=367b852039da52ccd23b9f99162cc53984dcc516;hb=ca75159d8abc085b39e3e468ca34ccb2940d2bf5;hp=d9a7a3aaf663e971b4b28b96801e4f402a6ced51;hpb=5b9c79a81db80c3f9e50c77477957cd803429af8;p=u-boot diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c index d9a7a3aaf6..367b852039 100644 --- a/drivers/gpio/mxs_gpio.c +++ b/drivers/gpio/mxs_gpio.c @@ -8,8 +8,7 @@ */ #include -#include -#include +#include #include #include #include @@ -95,10 +94,10 @@ int gpio_direction_output(unsigned gpio, int value) struct mxs_register_32 *reg = (struct mxs_register_32 *)(MXS_PINCTRL_BASE + offset); - writel(1 << PAD_PIN(gpio), ®->reg_set); - gpio_set_value(gpio, value); + writel(1 << PAD_PIN(gpio), ®->reg_set); + return 0; } @@ -114,3 +113,18 @@ int gpio_free(unsigned gpio) { return 0; } + +int name_to_gpio(const char *name) +{ + unsigned bank, pin; + char *end; + + bank = simple_strtoul(name, &end, 10); + + if (!*end || *end != ':') + return bank; + + pin = simple_strtoul(end + 1, NULL, 10); + + return (bank << MXS_PAD_BANK_SHIFT) | (pin << MXS_PAD_PIN_SHIFT); +}