Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113209
b: refs/heads/master
c: ece2678
h: refs/heads/master
i:
  113207: a65283c
v: v3
  • Loading branch information
Haavard Skinnemoen committed Sep 22, 2008
1 parent 3eb4a99 commit 8a45f16
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96706600de83966812b01a3cb310a13da2a1a4e9
refs/heads/master: ece2678c62ce13ef11a8b43526ccc5db8d711ed3
1 change: 1 addition & 0 deletions trunk/arch/avr32/mach-at32ap/include/mach/portmux.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
void at32_select_periph(unsigned int pin, unsigned int periph,
unsigned long flags);
void at32_select_gpio(unsigned int pin, unsigned long flags);
void at32_deselect_pin(unsigned int pin);
void at32_reserve_pin(unsigned int pin);

#endif /* __ASM_ARCH_PORTMUX_H__ */
19 changes: 19 additions & 0 deletions trunk/arch/avr32/mach-at32ap/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ void __init at32_select_gpio(unsigned int pin, unsigned long flags)
dump_stack();
}

/*
* Undo a previous pin reservation. Will not affect the hardware
* configuration.
*/
void at32_deselect_pin(unsigned int pin)
{
struct pio_device *pio;
unsigned int pin_index = pin & 0x1f;

pio = gpio_to_pio(pin);
if (unlikely(!pio)) {
printk("pio: invalid pin %u\n", pin);
dump_stack();
return;
}

clear_bit(pin_index, &pio->pinmux_mask);
}

/* Reserve a pin, preventing anyone else from changing its configuration. */
void __init at32_reserve_pin(unsigned int pin)
{
Expand Down

0 comments on commit 8a45f16

Please sign in to comment.