diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2008-01-22 04:20:10 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2008-01-22 04:20:10 -0500 |
commit | a2c8cfef6abb33ee49d80c58391ebfc4f94221ef (patch) | |
tree | 2d81734c98f8d72889b3f7de4dc5399e2edb8692 | |
parent | acbcd2631975cf6f0be5cd294cbfd12226cd9958 (diff) |
[Blackfin] arch: GPIO API cleanup and anomaly update
- Add anomaly workaround for bfin_gpio_reset_spi0_ssel1
- Fix style
- Update copyright
- Remove BUG_ON checks for functions intended to be used only by arch
support. GPIO users should only access using the generic GPIO API
- Make all GPIO identifier unsigned int
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 63 | ||||
-rw-r--r-- | include/asm-blackfin/gpio.h | 72 |
2 files changed, 64 insertions, 71 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 7312011a4211..6bbe0a2fccb8 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Description: GPIO Abstraction Layer | 7 | * Description: GPIO Abstraction Layer |
8 | * | 8 | * |
9 | * Modified: | 9 | * Modified: |
10 | * Copyright 2007 Analog Devices Inc. | 10 | * Copyright 2008 Analog Devices Inc. |
11 | * | 11 | * |
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
13 | * | 13 | * |
@@ -137,7 +137,6 @@ static unsigned short *port_fer[gpio_bank(MAX_BLACKFIN_GPIOS)] = { | |||
137 | (unsigned short *) PORTG_FER, | 137 | (unsigned short *) PORTG_FER, |
138 | (unsigned short *) PORTH_FER, | 138 | (unsigned short *) PORTH_FER, |
139 | }; | 139 | }; |
140 | |||
141 | #endif | 140 | #endif |
142 | 141 | ||
143 | #ifdef BF527_FAMILY | 142 | #ifdef BF527_FAMILY |
@@ -211,7 +210,7 @@ static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INT | |||
211 | #endif /* CONFIG_PM */ | 210 | #endif /* CONFIG_PM */ |
212 | 211 | ||
213 | #if defined(BF548_FAMILY) | 212 | #if defined(BF548_FAMILY) |
214 | inline int check_gpio(unsigned short gpio) | 213 | inline int check_gpio(unsigned gpio) |
215 | { | 214 | { |
216 | if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 | 215 | if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 |
217 | || gpio == GPIO_PH14 || gpio == GPIO_PH15 | 216 | || gpio == GPIO_PH14 || gpio == GPIO_PH15 |
@@ -221,7 +220,7 @@ inline int check_gpio(unsigned short gpio) | |||
221 | return 0; | 220 | return 0; |
222 | } | 221 | } |
223 | #else | 222 | #else |
224 | inline int check_gpio(unsigned short gpio) | 223 | inline int check_gpio(unsigned gpio) |
225 | { | 224 | { |
226 | if (gpio >= MAX_BLACKFIN_GPIOS) | 225 | if (gpio >= MAX_BLACKFIN_GPIOS) |
227 | return -EINVAL; | 226 | return -EINVAL; |
@@ -236,7 +235,6 @@ void gpio_error(unsigned gpio) | |||
236 | 235 | ||
237 | static void set_label(unsigned short ident, const char *label) | 236 | static void set_label(unsigned short ident, const char *label) |
238 | { | 237 | { |
239 | |||
240 | if (label && str_ident) { | 238 | if (label && str_ident) { |
241 | strncpy(str_ident[ident].name, label, | 239 | strncpy(str_ident[ident].name, label, |
242 | RESOURCE_LABEL_SIZE); | 240 | RESOURCE_LABEL_SIZE); |
@@ -267,7 +265,7 @@ static int cmp_label(unsigned short ident, const char *label) | |||
267 | } | 265 | } |
268 | 266 | ||
269 | #if defined(BF527_FAMILY) || defined(BF537_FAMILY) | 267 | #if defined(BF527_FAMILY) || defined(BF537_FAMILY) |
270 | static void port_setup(unsigned short gpio, unsigned short usage) | 268 | static void port_setup(unsigned gpio, unsigned short usage) |
271 | { | 269 | { |
272 | if (!check_gpio(gpio)) { | 270 | if (!check_gpio(gpio)) { |
273 | if (usage == GPIO_USAGE) | 271 | if (usage == GPIO_USAGE) |
@@ -278,7 +276,7 @@ static void port_setup(unsigned short gpio, unsigned short usage) | |||
278 | } | 276 | } |
279 | } | 277 | } |
280 | #elif defined(BF548_FAMILY) | 278 | #elif defined(BF548_FAMILY) |
281 | static void port_setup(unsigned short gpio, unsigned short usage) | 279 | static void port_setup(unsigned gpio, unsigned short usage) |
282 | { | 280 | { |
283 | if (usage == GPIO_USAGE) | 281 | if (usage == GPIO_USAGE) |
284 | gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); | 282 | gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); |
@@ -399,7 +397,7 @@ inline void portmux_setup(unsigned short portno, unsigned short function) | |||
399 | #endif | 397 | #endif |
400 | 398 | ||
401 | #ifndef BF548_FAMILY | 399 | #ifndef BF548_FAMILY |
402 | static void default_gpio(unsigned short gpio) | 400 | static void default_gpio(unsigned gpio) |
403 | { | 401 | { |
404 | unsigned short bank, bitmask; | 402 | unsigned short bank, bitmask; |
405 | unsigned long flags; | 403 | unsigned long flags; |
@@ -419,7 +417,6 @@ static void default_gpio(unsigned short gpio) | |||
419 | gpio_bankb[bank]->edge &= ~bitmask; | 417 | gpio_bankb[bank]->edge &= ~bitmask; |
420 | AWA_DUMMY_READ(edge); | 418 | AWA_DUMMY_READ(edge); |
421 | local_irq_restore(flags); | 419 | local_irq_restore(flags); |
422 | |||
423 | } | 420 | } |
424 | #else | 421 | #else |
425 | # define default_gpio(...) do { } while (0) | 422 | # define default_gpio(...) do { } while (0) |
@@ -457,10 +454,9 @@ arch_initcall(bfin_gpio_init); | |||
457 | /* Set a specific bit */ | 454 | /* Set a specific bit */ |
458 | 455 | ||
459 | #define SET_GPIO(name) \ | 456 | #define SET_GPIO(name) \ |
460 | void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ | 457 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ |
461 | { \ | 458 | { \ |
462 | unsigned long flags; \ | 459 | unsigned long flags; \ |
463 | BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ | ||
464 | local_irq_save(flags); \ | 460 | local_irq_save(flags); \ |
465 | if (arg) \ | 461 | if (arg) \ |
466 | gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ | 462 | gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ |
@@ -480,10 +476,9 @@ SET_GPIO(both) | |||
480 | 476 | ||
481 | #if ANOMALY_05000311 || ANOMALY_05000323 | 477 | #if ANOMALY_05000311 || ANOMALY_05000323 |
482 | #define SET_GPIO_SC(name) \ | 478 | #define SET_GPIO_SC(name) \ |
483 | void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ | 479 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ |
484 | { \ | 480 | { \ |
485 | unsigned long flags; \ | 481 | unsigned long flags; \ |
486 | BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ | ||
487 | local_irq_save(flags); \ | 482 | local_irq_save(flags); \ |
488 | if (arg) \ | 483 | if (arg) \ |
489 | gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ | 484 | gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ |
@@ -495,9 +490,8 @@ void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ | |||
495 | EXPORT_SYMBOL(set_gpio_ ## name); | 490 | EXPORT_SYMBOL(set_gpio_ ## name); |
496 | #else | 491 | #else |
497 | #define SET_GPIO_SC(name) \ | 492 | #define SET_GPIO_SC(name) \ |
498 | void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ | 493 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ |
499 | { \ | 494 | { \ |
500 | BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ | ||
501 | if (arg) \ | 495 | if (arg) \ |
502 | gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ | 496 | gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ |
503 | else \ | 497 | else \ |
@@ -511,19 +505,17 @@ SET_GPIO_SC(maskb) | |||
511 | SET_GPIO_SC(data) | 505 | SET_GPIO_SC(data) |
512 | 506 | ||
513 | #if ANOMALY_05000311 || ANOMALY_05000323 | 507 | #if ANOMALY_05000311 || ANOMALY_05000323 |
514 | void set_gpio_toggle(unsigned short gpio) | 508 | void set_gpio_toggle(unsigned gpio) |
515 | { | 509 | { |
516 | unsigned long flags; | 510 | unsigned long flags; |
517 | BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); | ||
518 | local_irq_save(flags); | 511 | local_irq_save(flags); |
519 | gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); | 512 | gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); |
520 | AWA_DUMMY_READ(toggle); | 513 | AWA_DUMMY_READ(toggle); |
521 | local_irq_restore(flags); | 514 | local_irq_restore(flags); |
522 | } | 515 | } |
523 | #else | 516 | #else |
524 | void set_gpio_toggle(unsigned short gpio) | 517 | void set_gpio_toggle(unsigned gpio) |
525 | { | 518 | { |
526 | BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); | ||
527 | gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); | 519 | gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); |
528 | } | 520 | } |
529 | #endif | 521 | #endif |
@@ -534,7 +526,7 @@ EXPORT_SYMBOL(set_gpio_toggle); | |||
534 | 526 | ||
535 | #if ANOMALY_05000311 || ANOMALY_05000323 | 527 | #if ANOMALY_05000311 || ANOMALY_05000323 |
536 | #define SET_GPIO_P(name) \ | 528 | #define SET_GPIO_P(name) \ |
537 | void set_gpiop_ ## name(unsigned short gpio, unsigned short arg) \ | 529 | void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \ |
538 | { \ | 530 | { \ |
539 | unsigned long flags; \ | 531 | unsigned long flags; \ |
540 | local_irq_save(flags); \ | 532 | local_irq_save(flags); \ |
@@ -545,7 +537,7 @@ void set_gpiop_ ## name(unsigned short gpio, unsigned short arg) \ | |||
545 | EXPORT_SYMBOL(set_gpiop_ ## name); | 537 | EXPORT_SYMBOL(set_gpiop_ ## name); |
546 | #else | 538 | #else |
547 | #define SET_GPIO_P(name) \ | 539 | #define SET_GPIO_P(name) \ |
548 | void set_gpiop_ ## name(unsigned short gpio, unsigned short arg) \ | 540 | void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \ |
549 | { \ | 541 | { \ |
550 | gpio_bankb[gpio_bank(gpio)]->name = arg; \ | 542 | gpio_bankb[gpio_bank(gpio)]->name = arg; \ |
551 | } \ | 543 | } \ |
@@ -561,11 +553,10 @@ SET_GPIO_P(both) | |||
561 | SET_GPIO_P(maska) | 553 | SET_GPIO_P(maska) |
562 | SET_GPIO_P(maskb) | 554 | SET_GPIO_P(maskb) |
563 | 555 | ||
564 | |||
565 | /* Get a specific bit */ | 556 | /* Get a specific bit */ |
566 | #if ANOMALY_05000311 || ANOMALY_05000323 | 557 | #if ANOMALY_05000311 || ANOMALY_05000323 |
567 | #define GET_GPIO(name) \ | 558 | #define GET_GPIO(name) \ |
568 | unsigned short get_gpio_ ## name(unsigned short gpio) \ | 559 | unsigned short get_gpio_ ## name(unsigned gpio) \ |
569 | { \ | 560 | { \ |
570 | unsigned long flags; \ | 561 | unsigned long flags; \ |
571 | unsigned short ret; \ | 562 | unsigned short ret; \ |
@@ -578,7 +569,7 @@ unsigned short get_gpio_ ## name(unsigned short gpio) \ | |||
578 | EXPORT_SYMBOL(get_gpio_ ## name); | 569 | EXPORT_SYMBOL(get_gpio_ ## name); |
579 | #else | 570 | #else |
580 | #define GET_GPIO(name) \ | 571 | #define GET_GPIO(name) \ |
581 | unsigned short get_gpio_ ## name(unsigned short gpio) \ | 572 | unsigned short get_gpio_ ## name(unsigned gpio) \ |
582 | { \ | 573 | { \ |
583 | return (0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio))); \ | 574 | return (0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio))); \ |
584 | } \ | 575 | } \ |
@@ -598,7 +589,7 @@ GET_GPIO(maskb) | |||
598 | 589 | ||
599 | #if ANOMALY_05000311 || ANOMALY_05000323 | 590 | #if ANOMALY_05000311 || ANOMALY_05000323 |
600 | #define GET_GPIO_P(name) \ | 591 | #define GET_GPIO_P(name) \ |
601 | unsigned short get_gpiop_ ## name(unsigned short gpio) \ | 592 | unsigned short get_gpiop_ ## name(unsigned gpio) \ |
602 | { \ | 593 | { \ |
603 | unsigned long flags; \ | 594 | unsigned long flags; \ |
604 | unsigned short ret; \ | 595 | unsigned short ret; \ |
@@ -611,7 +602,7 @@ unsigned short get_gpiop_ ## name(unsigned short gpio) \ | |||
611 | EXPORT_SYMBOL(get_gpiop_ ## name); | 602 | EXPORT_SYMBOL(get_gpiop_ ## name); |
612 | #else | 603 | #else |
613 | #define GET_GPIO_P(name) \ | 604 | #define GET_GPIO_P(name) \ |
614 | unsigned short get_gpiop_ ## name(unsigned short gpio) \ | 605 | unsigned short get_gpiop_ ## name(unsigned gpio) \ |
615 | { \ | 606 | { \ |
616 | return (gpio_bankb[gpio_bank(gpio)]->name);\ | 607 | return (gpio_bankb[gpio_bank(gpio)]->name);\ |
617 | } \ | 608 | } \ |
@@ -648,7 +639,7 @@ GET_GPIO_P(maskb) | |||
648 | ************************************************************* | 639 | ************************************************************* |
649 | * MODIFICATION HISTORY : | 640 | * MODIFICATION HISTORY : |
650 | **************************************************************/ | 641 | **************************************************************/ |
651 | int gpio_pm_wakeup_request(unsigned short gpio, unsigned char type) | 642 | int gpio_pm_wakeup_request(unsigned gpio, unsigned char type) |
652 | { | 643 | { |
653 | unsigned long flags; | 644 | unsigned long flags; |
654 | 645 | ||
@@ -656,7 +647,6 @@ int gpio_pm_wakeup_request(unsigned short gpio, unsigned char type) | |||
656 | return -EINVAL; | 647 | return -EINVAL; |
657 | 648 | ||
658 | local_irq_save(flags); | 649 | local_irq_save(flags); |
659 | |||
660 | wakeup_map[gpio_bank(gpio)] |= gpio_bit(gpio); | 650 | wakeup_map[gpio_bank(gpio)] |= gpio_bit(gpio); |
661 | wakeup_flags_map[gpio] = type; | 651 | wakeup_flags_map[gpio] = type; |
662 | local_irq_restore(flags); | 652 | local_irq_restore(flags); |
@@ -665,7 +655,7 @@ int gpio_pm_wakeup_request(unsigned short gpio, unsigned char type) | |||
665 | } | 655 | } |
666 | EXPORT_SYMBOL(gpio_pm_wakeup_request); | 656 | EXPORT_SYMBOL(gpio_pm_wakeup_request); |
667 | 657 | ||
668 | void gpio_pm_wakeup_free(unsigned short gpio) | 658 | void gpio_pm_wakeup_free(unsigned gpio) |
669 | { | 659 | { |
670 | unsigned long flags; | 660 | unsigned long flags; |
671 | 661 | ||
@@ -680,7 +670,7 @@ void gpio_pm_wakeup_free(unsigned short gpio) | |||
680 | } | 670 | } |
681 | EXPORT_SYMBOL(gpio_pm_wakeup_free); | 671 | EXPORT_SYMBOL(gpio_pm_wakeup_free); |
682 | 672 | ||
683 | static int bfin_gpio_wakeup_type(unsigned short gpio, unsigned char type) | 673 | static int bfin_gpio_wakeup_type(unsigned gpio, unsigned char type) |
684 | { | 674 | { |
685 | port_setup(gpio, GPIO_USAGE); | 675 | port_setup(gpio, GPIO_USAGE); |
686 | set_gpio_dir(gpio, 0); | 676 | set_gpio_dir(gpio, 0); |
@@ -789,7 +779,7 @@ void gpio_pm_restore(void) | |||
789 | #endif | 779 | #endif |
790 | #else /* BF548_FAMILY */ | 780 | #else /* BF548_FAMILY */ |
791 | 781 | ||
792 | unsigned short get_gpio_dir(unsigned short gpio) | 782 | unsigned short get_gpio_dir(unsigned gpio) |
793 | { | 783 | { |
794 | return (0x01 & (gpio_array[gpio_bank(gpio)]->port_dir_clear >> gpio_sub_n(gpio))); | 784 | return (0x01 & (gpio_array[gpio_bank(gpio)]->port_dir_clear >> gpio_sub_n(gpio))); |
795 | } | 785 | } |
@@ -1123,7 +1113,6 @@ int gpio_direction_input(unsigned gpio) | |||
1123 | return -EINVAL; | 1113 | return -EINVAL; |
1124 | } | 1114 | } |
1125 | 1115 | ||
1126 | |||
1127 | local_irq_save(flags); | 1116 | local_irq_save(flags); |
1128 | gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); | 1117 | gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); |
1129 | gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); | 1118 | gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); |
@@ -1158,7 +1147,6 @@ void gpio_set_value(unsigned gpio, int arg) | |||
1158 | gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio); | 1147 | gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio); |
1159 | else | 1148 | else |
1160 | gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio); | 1149 | gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio); |
1161 | |||
1162 | } | 1150 | } |
1163 | EXPORT_SYMBOL(gpio_set_value); | 1151 | EXPORT_SYMBOL(gpio_set_value); |
1164 | 1152 | ||
@@ -1200,7 +1188,12 @@ int gpio_direction_output(unsigned gpio, int value) | |||
1200 | 1188 | ||
1201 | local_irq_save(flags); | 1189 | local_irq_save(flags); |
1202 | gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); | 1190 | gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); |
1203 | gpio_set_value(gpio, value); | 1191 | |
1192 | if (value) | ||
1193 | gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio); | ||
1194 | else | ||
1195 | gpio_bankb[gpio_bank(gpio)]->data_clear = gpio_bit(gpio); | ||
1196 | |||
1204 | gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio); | 1197 | gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio); |
1205 | AWA_DUMMY_READ(dir); | 1198 | AWA_DUMMY_READ(dir); |
1206 | local_irq_restore(flags); | 1199 | local_irq_restore(flags); |
@@ -1225,6 +1218,7 @@ void bfin_gpio_reset_spi0_ssel1(void) | |||
1225 | 1218 | ||
1226 | port_setup(gpio, GPIO_USAGE); | 1219 | port_setup(gpio, GPIO_USAGE); |
1227 | gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio); | 1220 | gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio); |
1221 | AWA_DUMMY_READ(data_set); | ||
1228 | udelay(1); | 1222 | udelay(1); |
1229 | } | 1223 | } |
1230 | 1224 | ||
@@ -1259,6 +1253,5 @@ static __init int gpio_register_proc(void) | |||
1259 | proc_gpio->read_proc = gpio_proc_read; | 1253 | proc_gpio->read_proc = gpio_proc_read; |
1260 | return proc_gpio != NULL; | 1254 | return proc_gpio != NULL; |
1261 | } | 1255 | } |
1262 | |||
1263 | __initcall(gpio_register_proc); | 1256 | __initcall(gpio_register_proc); |
1264 | #endif | 1257 | #endif |
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h index 7bba9b17654e..d0426c108262 100644 --- a/include/asm-blackfin/gpio.h +++ b/include/asm-blackfin/gpio.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Description: | 7 | * Description: |
8 | * | 8 | * |
9 | * Modified: | 9 | * Modified: |
10 | * Copyright 2004-2006 Analog Devices Inc. | 10 | * Copyright 2004-2008 Analog Devices Inc. |
11 | * | 11 | * |
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
13 | * | 13 | * |
@@ -304,39 +304,39 @@ | |||
304 | **************************************************************/ | 304 | **************************************************************/ |
305 | 305 | ||
306 | #ifndef BF548_FAMILY | 306 | #ifndef BF548_FAMILY |
307 | void set_gpio_dir(unsigned short, unsigned short); | 307 | void set_gpio_dir(unsigned, unsigned short); |
308 | void set_gpio_inen(unsigned short, unsigned short); | 308 | void set_gpio_inen(unsigned, unsigned short); |
309 | void set_gpio_polar(unsigned short, unsigned short); | 309 | void set_gpio_polar(unsigned, unsigned short); |
310 | void set_gpio_edge(unsigned short, unsigned short); | 310 | void set_gpio_edge(unsigned, unsigned short); |
311 | void set_gpio_both(unsigned short, unsigned short); | 311 | void set_gpio_both(unsigned, unsigned short); |
312 | void set_gpio_data(unsigned short, unsigned short); | 312 | void set_gpio_data(unsigned, unsigned short); |
313 | void set_gpio_maska(unsigned short, unsigned short); | 313 | void set_gpio_maska(unsigned, unsigned short); |
314 | void set_gpio_maskb(unsigned short, unsigned short); | 314 | void set_gpio_maskb(unsigned, unsigned short); |
315 | void set_gpio_toggle(unsigned short); | 315 | void set_gpio_toggle(unsigned); |
316 | void set_gpiop_dir(unsigned short, unsigned short); | 316 | void set_gpiop_dir(unsigned, unsigned short); |
317 | void set_gpiop_inen(unsigned short, unsigned short); | 317 | void set_gpiop_inen(unsigned, unsigned short); |
318 | void set_gpiop_polar(unsigned short, unsigned short); | 318 | void set_gpiop_polar(unsigned, unsigned short); |
319 | void set_gpiop_edge(unsigned short, unsigned short); | 319 | void set_gpiop_edge(unsigned, unsigned short); |
320 | void set_gpiop_both(unsigned short, unsigned short); | 320 | void set_gpiop_both(unsigned, unsigned short); |
321 | void set_gpiop_data(unsigned short, unsigned short); | 321 | void set_gpiop_data(unsigned, unsigned short); |
322 | void set_gpiop_maska(unsigned short, unsigned short); | 322 | void set_gpiop_maska(unsigned, unsigned short); |
323 | void set_gpiop_maskb(unsigned short, unsigned short); | 323 | void set_gpiop_maskb(unsigned, unsigned short); |
324 | unsigned short get_gpio_dir(unsigned short); | 324 | unsigned short get_gpio_dir(unsigned); |
325 | unsigned short get_gpio_inen(unsigned short); | 325 | unsigned short get_gpio_inen(unsigned); |
326 | unsigned short get_gpio_polar(unsigned short); | 326 | unsigned short get_gpio_polar(unsigned); |
327 | unsigned short get_gpio_edge(unsigned short); | 327 | unsigned short get_gpio_edge(unsigned); |
328 | unsigned short get_gpio_both(unsigned short); | 328 | unsigned short get_gpio_both(unsigned); |
329 | unsigned short get_gpio_maska(unsigned short); | 329 | unsigned short get_gpio_maska(unsigned); |
330 | unsigned short get_gpio_maskb(unsigned short); | 330 | unsigned short get_gpio_maskb(unsigned); |
331 | unsigned short get_gpio_data(unsigned short); | 331 | unsigned short get_gpio_data(unsigned); |
332 | unsigned short get_gpiop_dir(unsigned short); | 332 | unsigned short get_gpiop_dir(unsigned); |
333 | unsigned short get_gpiop_inen(unsigned short); | 333 | unsigned short get_gpiop_inen(unsigned); |
334 | unsigned short get_gpiop_polar(unsigned short); | 334 | unsigned short get_gpiop_polar(unsigned); |
335 | unsigned short get_gpiop_edge(unsigned short); | 335 | unsigned short get_gpiop_edge(unsigned); |
336 | unsigned short get_gpiop_both(unsigned short); | 336 | unsigned short get_gpiop_both(unsigned); |
337 | unsigned short get_gpiop_maska(unsigned short); | 337 | unsigned short get_gpiop_maska(unsigned); |
338 | unsigned short get_gpiop_maskb(unsigned short); | 338 | unsigned short get_gpiop_maskb(unsigned); |
339 | unsigned short get_gpiop_data(unsigned short); | 339 | unsigned short get_gpiop_data(unsigned); |
340 | 340 | ||
341 | struct gpio_port_t { | 341 | struct gpio_port_t { |
342 | unsigned short data; | 342 | unsigned short data; |
@@ -382,8 +382,8 @@ struct gpio_port_t { | |||
382 | #define PM_WAKE_LOW 0x8 | 382 | #define PM_WAKE_LOW 0x8 |
383 | #define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING) | 383 | #define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING) |
384 | 384 | ||
385 | int gpio_pm_wakeup_request(unsigned short gpio, unsigned char type); | 385 | int gpio_pm_wakeup_request(unsigned gpio, unsigned char type); |
386 | void gpio_pm_wakeup_free(unsigned short gpio); | 386 | void gpio_pm_wakeup_free(unsigned gpio); |
387 | unsigned int gpio_pm_setup(void); | 387 | unsigned int gpio_pm_setup(void); |
388 | void gpio_pm_restore(void); | 388 | void gpio_pm_restore(void); |
389 | 389 | ||