2 * GPIO Abstraction Layer
4 * Copyright 2006-2010 Analog Devices Inc.
6 * Licensed under the GPL-2 or later
10 #include <asm/errno.h>
12 #include <asm/portmux.h>
14 #if ANOMALY_05000311 || ANOMALY_05000323
17 AWA_data_clear = SYSCR,
21 AWA_maska_clear = UART_SCR,
22 AWA_maska_set = UART_SCR,
23 AWA_maska_toggle = UART_SCR,
24 AWA_maskb = UART_GCTL,
25 AWA_maskb_clear = UART_GCTL,
26 AWA_maskb_set = UART_GCTL,
27 AWA_maskb_toggle = UART_GCTL,
28 AWA_dir = SPORT1_STAT,
29 AWA_polar = SPORT1_STAT,
30 AWA_edge = SPORT1_STAT,
31 AWA_both = SPORT1_STAT,
33 AWA_inen = TIMER_ENABLE,
34 #elif ANOMALY_05000323
35 AWA_inen = DMA1_1_CONFIG,
38 /* Anomaly Workaround */
39 #define AWA_DUMMY_READ(name) bfin_read16(AWA_ ## name)
41 #define AWA_DUMMY_READ(...) do { } while (0)
44 static struct gpio_port_t * const gpio_array[] = {
45 #if defined(BF533_FAMILY)
46 (struct gpio_port_t *) FIO_FLAG_D,
47 #elif defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) \
48 || defined(BF538_FAMILY) || defined(CONFIG_BF50x)
49 (struct gpio_port_t *) PORTFIO,
50 # if !defined(BF538_FAMILY)
51 (struct gpio_port_t *) PORTGIO,
52 (struct gpio_port_t *) PORTHIO,
54 #elif defined(BF561_FAMILY)
55 (struct gpio_port_t *) FIO0_FLAG_D,
56 (struct gpio_port_t *) FIO1_FLAG_D,
57 (struct gpio_port_t *) FIO2_FLAG_D,
58 #elif defined(CONFIG_BF54x)
59 (struct gpio_port_t *)PORTA_FER,
60 (struct gpio_port_t *)PORTB_FER,
61 (struct gpio_port_t *)PORTC_FER,
62 (struct gpio_port_t *)PORTD_FER,
63 (struct gpio_port_t *)PORTE_FER,
64 (struct gpio_port_t *)PORTF_FER,
65 (struct gpio_port_t *)PORTG_FER,
66 (struct gpio_port_t *)PORTH_FER,
67 (struct gpio_port_t *)PORTI_FER,
68 (struct gpio_port_t *)PORTJ_FER,
70 # error no gpio arrays defined
74 #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) || \
76 static unsigned short * const port_fer[] = {
77 (unsigned short *) PORTF_FER,
78 (unsigned short *) PORTG_FER,
79 (unsigned short *) PORTH_FER,
82 # if !defined(BF537_FAMILY)
83 static unsigned short * const port_mux[] = {
84 (unsigned short *) PORTF_MUX,
85 (unsigned short *) PORTG_MUX,
86 (unsigned short *) PORTH_MUX,
90 u8 pmux_offset[][16] = {
91 # if defined(CONFIG_BF52x)
92 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
93 { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
94 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
95 # elif defined(CONFIG_BF51x)
96 { 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */
97 { 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */
98 { 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */
103 #elif defined(BF538_FAMILY)
104 static unsigned short * const port_fer[] = {
105 (unsigned short *) PORTCIO_FER,
106 (unsigned short *) PORTDIO_FER,
107 (unsigned short *) PORTEIO_FER,
111 #ifdef CONFIG_BFIN_GPIO_TRACK
112 #define RESOURCE_LABEL_SIZE 16
114 static struct str_ident {
115 char name[RESOURCE_LABEL_SIZE];
116 } str_ident[MAX_RESOURCES];
118 static void gpio_error(unsigned gpio)
120 printf("bfin-gpio: GPIO %d wasn't requested!\n", gpio);
123 static void set_label(unsigned short ident, const char *label)
126 strncpy(str_ident[ident].name, label,
127 RESOURCE_LABEL_SIZE);
128 str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
132 static char *get_label(unsigned short ident)
134 return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN");
137 static int cmp_label(unsigned short ident, const char *label)
140 printf("bfin-gpio: please provide none-null label\n");
143 return strcmp(str_ident[ident].name, label);
148 #define map_entry(m, i) reserved_##m##_map[gpio_bank(i)]
149 #define is_reserved(m, i, e) (map_entry(m, i) & gpio_bit(i))
150 #define reserve(m, i) (map_entry(m, i) |= gpio_bit(i))
151 #define unreserve(m, i) (map_entry(m, i) &= ~gpio_bit(i))
152 #define DECLARE_RESERVED_MAP(m, c) static unsigned short reserved_##m##_map[c]
154 #define is_reserved(m, i, e) (!(e))
155 #define reserve(m, i)
156 #define unreserve(m, i)
157 #define DECLARE_RESERVED_MAP(m, c)
158 #define gpio_error(gpio)
159 #define set_label(...)
160 #define get_label(...) ""
161 #define cmp_label(...) 1
164 DECLARE_RESERVED_MAP(gpio, GPIO_BANK_NUM);
165 DECLARE_RESERVED_MAP(peri, gpio_bank(MAX_RESOURCES));
167 inline int check_gpio(unsigned gpio)
169 #if defined(CONFIG_BF54x)
170 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
171 || gpio == GPIO_PH14 || gpio == GPIO_PH15
172 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
175 if (gpio >= MAX_BLACKFIN_GPIOS)
180 static void port_setup(unsigned gpio, unsigned short usage)
182 #if defined(BF538_FAMILY)
184 * BF538/9 Port C,D and E are special.
185 * Inverted PORT_FER polarity on CDE and no PORF_FER on F
186 * Regular PORT F GPIOs are handled here, CDE are exclusively
190 if (gpio < MAX_BLACKFIN_GPIOS || gpio >= MAX_RESOURCES)
193 gpio -= MAX_BLACKFIN_GPIOS;
195 if (usage == GPIO_USAGE)
196 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
198 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
203 if (check_gpio(gpio))
206 #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) || \
207 defined(CONFIG_BF50x)
208 if (usage == GPIO_USAGE)
209 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
211 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
213 #elif defined(CONFIG_BF54x)
214 if (usage == GPIO_USAGE)
215 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
217 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
225 unsigned short offset;
227 {.res = P_PPI0_D13, .offset = 11},
228 {.res = P_PPI0_D14, .offset = 11},
229 {.res = P_PPI0_D15, .offset = 11},
230 {.res = P_SPORT1_TFS, .offset = 11},
231 {.res = P_SPORT1_TSCLK, .offset = 11},
232 {.res = P_SPORT1_DTPRI, .offset = 11},
233 {.res = P_PPI0_D10, .offset = 10},
234 {.res = P_PPI0_D11, .offset = 10},
235 {.res = P_PPI0_D12, .offset = 10},
236 {.res = P_SPORT1_RSCLK, .offset = 10},
237 {.res = P_SPORT1_RFS, .offset = 10},
238 {.res = P_SPORT1_DRPRI, .offset = 10},
239 {.res = P_PPI0_D8, .offset = 9},
240 {.res = P_PPI0_D9, .offset = 9},
241 {.res = P_SPORT1_DRSEC, .offset = 9},
242 {.res = P_SPORT1_DTSEC, .offset = 9},
243 {.res = P_TMR2, .offset = 8},
244 {.res = P_PPI0_FS3, .offset = 8},
245 {.res = P_TMR3, .offset = 7},
246 {.res = P_SPI0_SSEL4, .offset = 7},
247 {.res = P_TMR4, .offset = 6},
248 {.res = P_SPI0_SSEL5, .offset = 6},
249 {.res = P_TMR5, .offset = 5},
250 {.res = P_SPI0_SSEL6, .offset = 5},
251 {.res = P_UART1_RX, .offset = 4},
252 {.res = P_UART1_TX, .offset = 4},
253 {.res = P_TMR6, .offset = 4},
254 {.res = P_TMR7, .offset = 4},
255 {.res = P_UART0_RX, .offset = 3},
256 {.res = P_UART0_TX, .offset = 3},
257 {.res = P_DMAR0, .offset = 3},
258 {.res = P_DMAR1, .offset = 3},
259 {.res = P_SPORT0_DTSEC, .offset = 1},
260 {.res = P_SPORT0_DRSEC, .offset = 1},
261 {.res = P_CAN0_RX, .offset = 1},
262 {.res = P_CAN0_TX, .offset = 1},
263 {.res = P_SPI0_SSEL7, .offset = 1},
264 {.res = P_SPORT0_TFS, .offset = 0},
265 {.res = P_SPORT0_DTPRI, .offset = 0},
266 {.res = P_SPI0_SSEL2, .offset = 0},
267 {.res = P_SPI0_SSEL3, .offset = 0},
270 static void portmux_setup(unsigned short per)
272 u16 y, offset, muxreg;
273 u16 function = P_FUNCT2MUX(per);
275 for (y = 0; y < ARRAY_SIZE(port_mux_lut); y++) {
276 if (port_mux_lut[y].res == per) {
278 /* SET PORTMUX REG */
280 offset = port_mux_lut[y].offset;
281 muxreg = bfin_read_PORT_MUX();
284 muxreg &= ~(1 << offset);
288 muxreg |= (function << offset);
289 bfin_write_PORT_MUX(muxreg);
293 #elif defined(CONFIG_BF54x)
294 inline void portmux_setup(unsigned short per)
297 u16 ident = P_IDENT(per);
298 u16 function = P_FUNCT2MUX(per);
300 pmux = gpio_array[gpio_bank(ident)]->port_mux;
302 pmux &= ~(0x3 << (2 * gpio_sub_n(ident)));
303 pmux |= (function & 0x3) << (2 * gpio_sub_n(ident));
305 gpio_array[gpio_bank(ident)]->port_mux = pmux;
308 inline u16 get_portmux(unsigned short per)
311 u16 ident = P_IDENT(per);
313 pmux = gpio_array[gpio_bank(ident)]->port_mux;
315 return (pmux >> (2 * gpio_sub_n(ident)) & 0x3);
317 #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
318 inline void portmux_setup(unsigned short per)
320 u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per);
321 u8 offset = pmux_offset[gpio_bank(ident)][gpio_sub_n(ident)];
323 pmux = *port_mux[gpio_bank(ident)];
324 pmux &= ~(3 << offset);
325 pmux |= (function & 3) << offset;
326 *port_mux[gpio_bank(ident)] = pmux;
330 # define portmux_setup(...) do { } while (0)
334 /***********************************************************
336 * FUNCTIONS: Blackfin General Purpose Ports Access Functions
339 * gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
342 * DESCRIPTION: These functions abstract direct register access
343 * to Blackfin processor General Purpose
346 * CAUTION: These functions do not belong to the GPIO Driver API
347 *************************************************************
348 * MODIFICATION HISTORY :
349 **************************************************************/
351 /* Set a specific bit */
353 #define SET_GPIO(name) \
354 void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
356 unsigned long flags; \
357 local_irq_save(flags); \
359 gpio_array[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
361 gpio_array[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \
362 AWA_DUMMY_READ(name); \
363 local_irq_restore(flags); \
366 SET_GPIO(dir) /* set_gpio_dir() */
367 SET_GPIO(inen) /* set_gpio_inen() */
368 SET_GPIO(polar) /* set_gpio_polar() */
369 SET_GPIO(edge) /* set_gpio_edge() */
370 SET_GPIO(both) /* set_gpio_both() */
373 #define SET_GPIO_SC(name) \
374 void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
376 unsigned long flags; \
377 if (ANOMALY_05000311 || ANOMALY_05000323) \
378 local_irq_save(flags); \
380 gpio_array[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
382 gpio_array[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
383 if (ANOMALY_05000311 || ANOMALY_05000323) { \
384 AWA_DUMMY_READ(name); \
385 local_irq_restore(flags); \
393 void set_gpio_toggle(unsigned gpio)
396 if (ANOMALY_05000311 || ANOMALY_05000323)
397 local_irq_save(flags);
398 gpio_array[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
399 if (ANOMALY_05000311 || ANOMALY_05000323) {
400 AWA_DUMMY_READ(toggle);
401 local_irq_restore(flags);
405 /* Set current PORT date (16-bit word) */
407 #define SET_GPIO_P(name) \
408 void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \
410 unsigned long flags; \
411 if (ANOMALY_05000311 || ANOMALY_05000323) \
412 local_irq_save(flags); \
413 gpio_array[gpio_bank(gpio)]->name = arg; \
414 if (ANOMALY_05000311 || ANOMALY_05000323) { \
415 AWA_DUMMY_READ(name); \
416 local_irq_restore(flags); \
429 /* Get a specific bit */
430 #define GET_GPIO(name) \
431 unsigned short get_gpio_ ## name(unsigned gpio) \
433 unsigned long flags; \
434 unsigned short ret; \
435 if (ANOMALY_05000311 || ANOMALY_05000323) \
436 local_irq_save(flags); \
437 ret = 0x01 & (gpio_array[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \
438 if (ANOMALY_05000311 || ANOMALY_05000323) { \
439 AWA_DUMMY_READ(name); \
440 local_irq_restore(flags); \
454 /* Get current PORT date (16-bit word) */
456 #define GET_GPIO_P(name) \
457 unsigned short get_gpiop_ ## name(unsigned gpio) \
459 unsigned long flags; \
460 unsigned short ret; \
461 if (ANOMALY_05000311 || ANOMALY_05000323) \
462 local_irq_save(flags); \
463 ret = (gpio_array[gpio_bank(gpio)]->name); \
464 if (ANOMALY_05000311 || ANOMALY_05000323) { \
465 AWA_DUMMY_READ(name); \
466 local_irq_restore(flags); \
480 #else /* CONFIG_BF54x */
482 unsigned short get_gpio_dir(unsigned gpio)
484 return (0x01 & (gpio_array[gpio_bank(gpio)]->dir_clear >> gpio_sub_n(gpio)));
487 #endif /* CONFIG_BF54x */
489 /***********************************************************
491 * FUNCTIONS: Blackfin Peripheral Resource Allocation
495 * per Peripheral Identifier
498 * DESCRIPTION: Blackfin Peripheral Resource Allocation and Setup API
501 *************************************************************
502 * MODIFICATION HISTORY :
503 **************************************************************/
505 int peripheral_request(unsigned short per, const char *label)
507 unsigned short ident = P_IDENT(per);
510 * Don't cares are pins with only one dedicated function
513 if (per & P_DONTCARE)
516 if (!(per & P_DEFINED))
519 BUG_ON(ident >= MAX_RESOURCES);
521 /* If a pin can be muxed as either GPIO or peripheral, make
522 * sure it is not already a GPIO pin when we request it.
524 if (unlikely(!check_gpio(ident) && is_reserved(gpio, ident, 1))) {
525 printf("%s: Peripheral %d is already reserved as GPIO by %s !\n",
526 __func__, ident, get_label(ident));
530 if (unlikely(is_reserved(peri, ident, 1))) {
533 * Pin functions like AMC address strobes my
534 * be requested and used by several drivers
538 if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) {
540 if (!(per & P_MAYSHARE)) {
543 * Allow that the identical pin function can
544 * be requested from the same driver twice
547 if (cmp_label(ident, label) == 0)
550 printf("%s: Peripheral %d function %d is already reserved by %s !\n",
551 __func__, ident, P_FUNCT2MUX(per), get_label(ident));
557 reserve(peri, ident);
560 port_setup(ident, PERIPHERAL_USAGE);
562 set_label(ident, label);
567 int peripheral_request_list(const unsigned short per[], const char *label)
572 for (cnt = 0; per[cnt] != 0; cnt++) {
574 ret = peripheral_request(per[cnt], label);
577 for ( ; cnt > 0; cnt--)
578 peripheral_free(per[cnt - 1]);
587 void peripheral_free(unsigned short per)
589 unsigned short ident = P_IDENT(per);
591 if (per & P_DONTCARE)
594 if (!(per & P_DEFINED))
597 if (unlikely(!is_reserved(peri, ident, 0)))
600 if (!(per & P_MAYSHARE))
601 port_setup(ident, GPIO_USAGE);
603 unreserve(peri, ident);
605 set_label(ident, "free");
608 void peripheral_free_list(const unsigned short per[])
611 for (cnt = 0; per[cnt] != 0; cnt++)
612 peripheral_free(per[cnt]);
615 /***********************************************************
617 * FUNCTIONS: Blackfin GPIO Driver
620 * gpio PIO Number between 0 and MAX_BLACKFIN_GPIOS
623 * DESCRIPTION: Blackfin GPIO Driver API
626 *************************************************************
627 * MODIFICATION HISTORY :
628 **************************************************************/
630 int bfin_gpio_request(unsigned gpio, const char *label)
632 if (check_gpio(gpio) < 0)
636 * Allow that the identical GPIO can
637 * be requested from the same driver twice
638 * Do nothing and return -
641 if (cmp_label(gpio, label) == 0)
644 if (unlikely(is_reserved(gpio, gpio, 1))) {
645 printf("bfin-gpio: GPIO %d is already reserved by %s !\n",
646 gpio, get_label(gpio));
649 if (unlikely(is_reserved(peri, gpio, 1))) {
650 printf("bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
651 gpio, get_label(gpio));
655 else { /* Reset POLAR setting when acquiring a gpio for the first time */
656 set_gpio_polar(gpio, 0);
661 set_label(gpio, label);
663 port_setup(gpio, GPIO_USAGE);
668 void bfin_gpio_free(unsigned gpio)
670 if (check_gpio(gpio) < 0)
673 if (unlikely(!is_reserved(gpio, gpio, 0))) {
678 unreserve(gpio, gpio);
680 set_label(gpio, "free");
683 #ifdef BFIN_SPECIAL_GPIO_BANKS
684 DECLARE_RESERVED_MAP(special_gpio, gpio_bank(MAX_RESOURCES));
686 int bfin_special_gpio_request(unsigned gpio, const char *label)
689 * Allow that the identical GPIO can
690 * be requested from the same driver twice
691 * Do nothing and return -
694 if (cmp_label(gpio, label) == 0)
697 if (unlikely(is_reserved(special_gpio, gpio, 1))) {
698 printf("bfin-gpio: GPIO %d is already reserved by %s !\n",
699 gpio, get_label(gpio));
702 if (unlikely(is_reserved(peri, gpio, 1))) {
703 printf("bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
704 gpio, get_label(gpio));
709 reserve(special_gpio, gpio);
712 set_label(gpio, label);
713 port_setup(gpio, GPIO_USAGE);
718 void bfin_special_gpio_free(unsigned gpio)
720 if (unlikely(!is_reserved(special_gpio, gpio, 0))) {
725 reserve(special_gpio, gpio);
727 set_label(gpio, "free");
731 static inline void __bfin_gpio_direction_input(unsigned gpio)
734 gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio);
736 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
738 gpio_array[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
741 int bfin_gpio_direction_input(unsigned gpio)
745 if (!is_reserved(gpio, gpio, 0)) {
750 local_irq_save(flags);
751 __bfin_gpio_direction_input(gpio);
752 AWA_DUMMY_READ(inen);
753 local_irq_restore(flags);
758 void bfin_gpio_toggle_value(unsigned gpio)
761 gpio_set_value(gpio, !gpio_get_value(gpio));
763 gpio_array[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
767 void bfin_gpio_set_value(unsigned gpio, int arg)
770 gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
772 gpio_array[gpio_bank(gpio)]->data_clear = gpio_bit(gpio);
775 int bfin_gpio_direction_output(unsigned gpio, int value)
779 if (!is_reserved(gpio, gpio, 0)) {
784 local_irq_save(flags);
786 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
787 gpio_set_value(gpio, value);
789 gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio);
791 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
795 local_irq_restore(flags);
800 int bfin_gpio_get_value(unsigned gpio)
803 return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)));
807 if (unlikely(get_gpio_edge(gpio))) {
809 local_irq_save(flags);
810 set_gpio_edge(gpio, 0);
811 ret = get_gpio_data(gpio);
812 set_gpio_edge(gpio, 1);
813 local_irq_restore(flags);
816 return get_gpio_data(gpio);
820 /* If we are booting from SPI and our board lacks a strong enough pull up,
821 * the core can reset and execute the bootrom faster than the resistor can
822 * pull the signal logically high. To work around this (common) error in
823 * board design, we explicitly set the pin back to GPIO mode, force /CS
824 * high, and wait for the electrons to do their thing.
826 * This function only makes sense to be called from reset code, but it
827 * lives here as we need to force all the GPIO states w/out going through
828 * BUG() checks and such.
830 void bfin_reset_boot_spi_cs(unsigned short pin)
832 unsigned short gpio = P_IDENT(pin);
833 port_setup(gpio, GPIO_USAGE);
834 gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
835 AWA_DUMMY_READ(data_set);
839 #ifdef CONFIG_BFIN_GPIO_TRACK
840 void bfin_gpio_labels(void)
844 for (c = 0; c < MAX_RESOURCES; c++) {
845 gpio = is_reserved(gpio, c, 1);
846 if (!check_gpio(c) && gpio)
847 printf("GPIO_%d:\t%s\tGPIO %s\n", c,
849 get_gpio_dir(c) ? "OUTPUT" : "INPUT");
850 else if (is_reserved(peri, c, 1))
851 printf("GPIO_%d:\t%s\tPeripheral\n", c, get_label(c));