-
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: 91275 b: refs/heads/master c: 45528e3 h: refs/heads/master i: 91273: 18d5492 91271: ae6c70b v: v3
- Loading branch information
Dmitry Baryshkov
authored and
Russell King
committed
Apr 10, 2008
1 parent
74e48fb
commit 3dda98f
Showing
8 changed files
with
83 additions
and
52 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: c353faa4b2abd8d5142640b880532c97a0807460 | ||
refs/heads/master: 45528e38173e7d8c03821850e8fd1ddbf16f2b3d |
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
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,65 @@ | ||
/* | ||
* linux/arch/arm/mach-sa1100/gpio.c | ||
* | ||
* Generic SA-1100 GPIO handling | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/module.h> | ||
|
||
#include <asm/gpio.h> | ||
#include <asm/hardware.h> | ||
#include "generic.h" | ||
|
||
static int sa1100_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
{ | ||
return GPLR & GPIO_GPIO(offset); | ||
} | ||
|
||
static void sa1100_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
{ | ||
if (value) | ||
GPSR = GPIO_GPIO(offset); | ||
else | ||
GPCR = GPIO_GPIO(offset); | ||
} | ||
|
||
static int sa1100_direction_input(struct gpio_chip *chip, unsigned offset) | ||
{ | ||
unsigned long flags; | ||
|
||
local_irq_save(flags); | ||
GPDR &= ~GPIO_GPIO(offset); | ||
local_irq_restore(flags); | ||
return 0; | ||
} | ||
|
||
static int sa1100_direction_output(struct gpio_chip *chip, unsigned offset, int value) | ||
{ | ||
unsigned long flags; | ||
|
||
local_irq_save(flags); | ||
sa1100_gpio_set(chip, offset, value); | ||
GPDR |= GPIO_GPIO(offset); | ||
local_irq_restore(flags); | ||
return 0; | ||
} | ||
|
||
static struct gpio_chip sa1100_gpio_chip = { | ||
.label = "gpio", | ||
.direction_input = sa1100_direction_input, | ||
.direction_output = sa1100_direction_output, | ||
.set = sa1100_gpio_set, | ||
.get = sa1100_gpio_get, | ||
.base = 0, | ||
.ngpio = GPIO_MAX + 1, | ||
}; | ||
|
||
void __init sa1100_init_gpio(void) | ||
{ | ||
gpiochip_add(&sa1100_gpio_chip); | ||
} |
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