mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
Blackfin arch: a few things still use bfin_read_PORT_FER()
- Update gpio_request to allow multiple request with the same signature (label) - Use generic GPIO API where applicable - Update generic board support form stamp board Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
This commit is contained in:
parent
55249e9e3d
commit
2acde90230
1 changed files with 15 additions and 0 deletions
|
@ -930,6 +930,8 @@ void peripheral_free(unsigned short per)
|
||||||
|
|
||||||
reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
|
reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
|
||||||
|
|
||||||
|
set_label(ident, "free");
|
||||||
|
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(peripheral_free);
|
EXPORT_SYMBOL(peripheral_free);
|
||||||
|
@ -969,6 +971,17 @@ int gpio_request(unsigned short gpio, const char *label)
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allow that the identical GPIO can
|
||||||
|
* be requested from the same driver twice
|
||||||
|
* Do nothing and return -
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (cmp_label(gpio, label) == 0) {
|
||||||
|
local_irq_restore(flags);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
|
if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
|
||||||
printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
|
printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
|
||||||
gpio, get_label(gpio));
|
gpio, get_label(gpio));
|
||||||
|
@ -1016,6 +1029,8 @@ void gpio_free(unsigned short gpio)
|
||||||
|
|
||||||
reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
|
reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
|
||||||
|
|
||||||
|
set_label(gpio, "free");
|
||||||
|
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(gpio_free);
|
EXPORT_SYMBOL(gpio_free);
|
||||||
|
|
Loading…
Reference in a new issue