summaryrefslogtreecommitdiff
path: root/drivers/gpio/sunxi_gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/sunxi_gpio.c')
-rw-r--r--drivers/gpio/sunxi_gpio.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 670af0c383..510123fdf8 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -118,6 +118,20 @@ int gpio_set_value(unsigned gpio, int value)
return sunxi_gpio_output(gpio, value);
}
+int sunxi_name_to_gpio_bank(const char *name)
+{
+ int group = 0;
+
+ if (*name == 'P' || *name == 'p')
+ name++;
+ if (*name >= 'A') {
+ group = *name - (*name > 'a' ? 'a' : 'A');
+ return group;
+ }
+
+ return -1;
+}
+
int sunxi_name_to_gpio(const char *name)
{
int group = 0;