Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123819
b: refs/heads/master
c: f2edc75
h: refs/heads/master
i:
  123817: 672ed20
  123815: 1672e5d
v: v3
  • Loading branch information
Ben Dooks committed Dec 15, 2008
1 parent ca8452b commit 8b75fe9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cec444b79073e7d6ef35ced5ef63c3fd83d9b9a7
refs/heads/master: f2edc7565a14aa82231c847abf33d02314cac9f9
49 changes: 22 additions & 27 deletions trunk/arch/arm/plat-s3c24xx/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ static struct s3c24xx_gpio_chip gpios[] = {
.ngpio = 24,
.direction_input = s3c24xx_gpiolib_banka_input,
.direction_output = s3c24xx_gpiolib_banka_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
[1] = {
Expand All @@ -172,10 +170,6 @@ static struct s3c24xx_gpio_chip gpios[] = {
.owner = THIS_MODULE,
.label = "GPIOB",
.ngpio = 16,
.direction_input = s3c24xx_gpiolib_input,
.direction_output = s3c24xx_gpiolib_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
[2] = {
Expand All @@ -185,10 +179,6 @@ static struct s3c24xx_gpio_chip gpios[] = {
.owner = THIS_MODULE,
.label = "GPIOC",
.ngpio = 16,
.direction_input = s3c24xx_gpiolib_input,
.direction_output = s3c24xx_gpiolib_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
[3] = {
Expand All @@ -198,10 +188,6 @@ static struct s3c24xx_gpio_chip gpios[] = {
.owner = THIS_MODULE,
.label = "GPIOD",
.ngpio = 16,
.direction_input = s3c24xx_gpiolib_input,
.direction_output = s3c24xx_gpiolib_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
[4] = {
Expand All @@ -211,10 +197,6 @@ static struct s3c24xx_gpio_chip gpios[] = {
.label = "GPIOE",
.owner = THIS_MODULE,
.ngpio = 16,
.direction_input = s3c24xx_gpiolib_input,
.direction_output = s3c24xx_gpiolib_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
[5] = {
Expand All @@ -224,10 +206,6 @@ static struct s3c24xx_gpio_chip gpios[] = {
.owner = THIS_MODULE,
.label = "GPIOF",
.ngpio = 8,
.direction_input = s3c24xx_gpiolib_input,
.direction_output = s3c24xx_gpiolib_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
[6] = {
Expand All @@ -237,21 +215,38 @@ static struct s3c24xx_gpio_chip gpios[] = {
.owner = THIS_MODULE,
.label = "GPIOG",
.ngpio = 10,
.direction_input = s3c24xx_gpiolib_input,
.direction_output = s3c24xx_gpiolib_output,
.set = s3c24xx_gpiolib_set,
.get = s3c24xx_gpiolib_get,
},
},
};

static __init void s3c24xx_gpiolib_add(struct s3c24xx_gpio_chip *chip)
{
struct gpio_chip *gc = &chip->chip;

BUG_ON(!chip->base);
BUG_ON(!gc->label);
BUG_ON(!gc->ngpio);

if (!gc->direction_input)
gc->direction_input = s3c24xx_gpiolib_input;
if (!gc->direction_output)
gc->direction_output = s3c24xx_gpiolib_output;
if (!gc->set)
gc->set = s3c24xx_gpiolib_set;
if (!gc->get)
gc->get = s3c24xx_gpiolib_get;

/* gpiochip_add() prints own failure message on error. */
gpiochip_add(gc);
}

static __init int s3c24xx_gpiolib_init(void)
{
struct s3c24xx_gpio_chip *chip = gpios;
int gpn;

for (gpn = 0; gpn < ARRAY_SIZE(gpios); gpn++, chip++)
gpiochip_add(&chip->chip);
s3c24xx_gpiolib_add(chip);

return 0;
}
Expand Down

0 comments on commit 8b75fe9

Please sign in to comment.