-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 36592 b: refs/heads/master c: 72edd84 h: refs/heads/master v: v3
- Loading branch information
Lennert Buytenhek
authored and
Russell King
committed
Sep 25, 2006
1 parent
b995c58
commit 136fb4e
Showing
7 changed files
with
82 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 610300e8f4f833904096ca1233ffd9dbd73fb11f | ||
refs/heads/master: 72edd84a6b2db1a21d1ed07929cae560e276a0a6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* arch/arm/plat-iop/gpio.c | ||
* GPIO handling for Intel IOP3xx processors. | ||
* | ||
* Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or (at | ||
* your option) any later version. | ||
*/ | ||
|
||
#include <linux/device.h> | ||
#include <asm/hardware/iop3xx.h> | ||
|
||
void gpio_line_config(int line, int direction) | ||
{ | ||
unsigned long flags; | ||
|
||
local_irq_save(flags); | ||
if (direction == GPIO_IN) { | ||
*IOP3XX_GPOE |= 1 << line; | ||
} else if (direction == GPIO_OUT) { | ||
*IOP3XX_GPOE &= ~(1 << line); | ||
} | ||
local_irq_restore(flags); | ||
} | ||
EXPORT_SYMBOL(gpio_line_config); | ||
|
||
int gpio_line_get(int line) | ||
{ | ||
return !!(*IOP3XX_GPID & (1 << line)); | ||
} | ||
EXPORT_SYMBOL(gpio_line_get); | ||
|
||
void gpio_line_set(int line, int value) | ||
{ | ||
unsigned long flags; | ||
|
||
local_irq_save(flags); | ||
if (value == GPIO_LOW) { | ||
*IOP3XX_GPOD &= ~(1 << line); | ||
} else if (value == GPIO_HIGH) { | ||
*IOP3XX_GPOD |= 1 << line; | ||
} | ||
local_irq_restore(flags); | ||
} | ||
EXPORT_SYMBOL(gpio_line_set); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters