diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-03-27 19:19:51 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2011-03-27 19:19:51 +0000 |
commit | 878f3adcc0fd0ec9276565566f4e6e857a3d0504 (patch) | |
tree | 77af84c45ebfa1ac9d05d86b547dba303565335b /target/linux/ramips/files | |
parent | c31af34adbcb59922fcb0c67b4ea9bd2e4a42dde (diff) | |
download | upstream-878f3adcc0fd0ec9276565566f4e6e857a3d0504.tar.gz upstream-878f3adcc0fd0ec9276565566f4e6e857a3d0504.tar.bz2 upstream-878f3adcc0fd0ec9276565566f4e6e857a3d0504.zip |
ramips: setup GPIO chip functions on the fly
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26324 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files')
-rw-r--r-- | target/linux/ramips/files/arch/mips/ralink/common/gpio.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/common/gpio.c b/target/linux/ramips/files/arch/mips/ralink/common/gpio.c index 766d7876d5..81c3a1f0d6 100644 --- a/target/linux/ramips/files/arch/mips/ralink/common/gpio.c +++ b/target/linux/ramips/files/arch/mips/ralink/common/gpio.c @@ -147,10 +147,6 @@ static int ramips_gpio_get(struct gpio_chip *chip, unsigned offset) static struct ramips_gpio_chip ramips_gpio_chip0 = { .chip = { .label = "ramips-gpio0", - .direction_input = ramips_gpio_direction_input, - .direction_output = ramips_gpio_direction_output, - .get = ramips_gpio_get, - .set = ramips_gpio_set, .base = 0, .ngpio = RALINK_SOC_GPIO0_COUNT, }, @@ -173,10 +169,6 @@ static struct ramips_gpio_chip ramips_gpio_chip0 = { static struct ramips_gpio_chip ramips_gpio_chip1 = { .chip = { .label = "ramips-gpio1", - .direction_input = ramips_gpio_direction_input, - .direction_output = ramips_gpio_direction_output, - .get = ramips_gpio_get, - .set = ramips_gpio_set, .base = 32, .ngpio = RALINK_SOC_GPIO1_COUNT, }, @@ -199,10 +191,6 @@ static struct ramips_gpio_chip ramips_gpio_chip1 = { static struct ramips_gpio_chip ramips_gpio_chip2 = { .chip = { .label = "ramips-gpio2", - .direction_input = ramips_gpio_direction_input, - .direction_output = ramips_gpio_direction_output, - .get = ramips_gpio_get, - .set = ramips_gpio_set, .base = 64, .ngpio = RALINK_SOC_GPIO2_COUNT, }, @@ -228,6 +216,11 @@ static __init void ramips_gpio_chip_add(struct ramips_gpio_chip *rg) rg->regs_base = ioremap(rg->map_base, rg->map_size); + rg->chip.direction_input = ramips_gpio_direction_input; + rg->chip.direction_output = ramips_gpio_direction_output; + rg->chip.get = ramips_gpio_get; + rg->chip.set = ramips_gpio_set; + /* set polarity to low for all lines */ ramips_gpio_wr(rg, RAMIPS_GPIO_REG_POL, 0); |