From ec7f4d5d67ef63c724ab6d4bdc7d2ffa8861071a Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 13 May 2009 22:20:35 +0100 Subject: [ARM] S3C24XX: GPIO: Remove s3c2410_gpio_irq2pin() call Remove the s3c2410_gpio_irq2pin() function as it is not being used in any in kernel driver and the function is probably not being used anywhere else. This is also part of the effort to remove any of the s3c24xx gpio specific code that cannot be recreated by using the gpiolib framework now in the kernel. Signed-off-by: Ben Dooks Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpio.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 4a899c279eb5..65ebbaff7d50 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c @@ -199,19 +199,3 @@ int s3c2410_gpio_getirq(unsigned int pin) } EXPORT_SYMBOL(s3c2410_gpio_getirq); - -int s3c2410_gpio_irq2pin(unsigned int irq) -{ - if (irq >= IRQ_EINT0 && irq <= IRQ_EINT3) - return S3C2410_GPF0 + (irq - IRQ_EINT0); - - if (irq >= IRQ_EINT4 && irq <= IRQ_EINT7) - return S3C2410_GPF4 + (irq - IRQ_EINT4); - - if (irq >= IRQ_EINT8 && irq <= IRQ_EINT23) - return S3C2410_GPG0 + (irq - IRQ_EINT8); - - return -EINVAL; -} - -EXPORT_SYMBOL(s3c2410_gpio_irq2pin); -- cgit v1.2.2 From 9f05f6a921353f4293cda37f221b9bfa532d3c57 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 13 May 2009 21:46:15 +0100 Subject: [ARM] S3C24XX: GPIO: Remove pin specific input and output defines The use of S3C2410_GP[A-Z]x_INP and S3C2410_GP[A-Z]x_OUTP are very rare and are taking up large amounts of space in the regs-gpio.h header. The GPIO layer has had generic input and out defines called S3C2410_GPIO_INPUT and S3C2410_GPIO_OUTPUT for a while which work for all S3C24XX GPIOs. Do the following replacements: S3C2410_GP[A-Z][0-9]*_\OUTP => S3C2410_GPIO_OUTPUT S3C2410_GP[A-Z][0-9]*_\INP => /S3C2410_GPIO_INPUT S3C2410_GPA[0-9]*_OUT => S3C2410_GPIO_OUTPUT to remove any usages of these and prepare the header for the removal of these. The following command was used to acheive this: find . -type f -writable ! -name regs-gpio.h ! -name "*~" | xargs sed -i~ -e 's/S3C2410_GP[A-Z][0-9]*_\OUTP/S3C2410_GPIO_OUTPUT/g' -e 's/S3C2410_GP[A-Z][0-9]*_\INP/S3C2410_GPIO_INPUT/g' -e 's/S3C2410_GPA[0-9]*_OUT/S3C2410_GPIO_OUTPUT/g' Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/common-smdk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c index 1a8347cec20a..ef4c8fde169f 100644 --- a/arch/arm/plat-s3c24xx/common-smdk.c +++ b/arch/arm/plat-s3c24xx/common-smdk.c @@ -184,10 +184,10 @@ void __init smdk_machine_init(void) { /* Configure the LEDs (even if we have no LED support)*/ - s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); - s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); - s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); - s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); + s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPIO_OUTPUT); s3c2410_gpio_setpin(S3C2410_GPF4, 1); s3c2410_gpio_setpin(S3C2410_GPF5, 1); -- cgit v1.2.2 From ec976d6eb021dc8f2994248c310a41540f4756bd Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 13 May 2009 22:52:24 +0100 Subject: [ARM] S3C24XX: GPIO: Move gpio functions out of Move all the gpio functions out of as this file is for defining the generic IO base addresses for the kernel IO calls. Make a new header to take this and include it via the chain from which is what most of these files should be using (and will be changed as soon as possible). Note, this does make minor changes to some drivers but should not mess up any pending merges. CC: Richard Purdie Acked-by: Mark Brown CC: David Brownell Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/common-smdk.c | 1 + arch/arm/plat-s3c24xx/pm.c | 1 + arch/arm/plat-s3c24xx/setup-i2c.c | 1 + 3 files changed, 3 insertions(+) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c index ef4c8fde169f..fe658c48f724 100644 --- a/arch/arm/plat-s3c24xx/common-smdk.c +++ b/arch/arm/plat-s3c24xx/common-smdk.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c index 5135c40a1b90..16aaf36b6e5a 100644 --- a/arch/arm/plat-s3c24xx/pm.c +++ b/arch/arm/plat-s3c24xx/pm.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c index d62b7e7fb355..e0d18530555e 100644 --- a/arch/arm/plat-s3c24xx/setup-i2c.c +++ b/arch/arm/plat-s3c24xx/setup-i2c.c @@ -11,6 +11,7 @@ */ #include +#include struct platform_device; -- cgit v1.2.2 From 86c03c526e2b282846c09509a48ab8be68fe7168 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Sun, 17 May 2009 22:47:07 +0100 Subject: [ARM] S3C24XX: Fix missing In our recent changes, arch/arm/plat-s3c24xx/gpiolib.c needs to have included for it to build. This fixes the following error/warnings: arch/arm/plat-s3c/include/plat/pm.h:104: error: expected declaration specifiers or '...' before 'pm_message_t' arch/arm/plat-s3c/include/plat/pm.h:104: warning: 'struct sys_device' declared inside parameter list arch/arm/plat-s3c/include/plat/pm.h:104: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/plat-s3c/include/plat/pm.h:105: warning: 'struct sys_device' declared inside parameter list Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpiolib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 4bac12dc0733..3cbec6d3f381 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.2 From fda7b2b097fed9f88bc93ed3de0caea87ffe778e Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Sun, 17 May 2009 22:18:27 +0100 Subject: [ARM] S3C24XX: GPIO: Start removal of S3C24XX_GPIO_BASE The S3C24XX_GPIO_BASE makes it difficult to compress the GPIO number space, and is only used in a few places of which everything outside arch/arm/plat-s3c24xx/gpiolib.c will be removed as soon as possible. Change gpiolib.c to use the S3C2410_GPxCON register addresses as the base for each bank, thus eliminating S3C24XX_GPIO_BASE. Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpiolib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 3cbec6d3f381..60a9f7247205 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c @@ -79,7 +79,7 @@ static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset) struct s3c_gpio_chip s3c24xx_gpios[] = { [0] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPA0), + .base = S3C2410_GPACON, .pm = __gpio_pm(&s3c_gpio_pm_1bit), .chip = { .base = S3C2410_GPA0, @@ -91,7 +91,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { }, }, [1] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPB0), + .base = S3C2410_GPBCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { .base = S3C2410_GPB0, @@ -101,7 +101,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { }, }, [2] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPC0), + .base = S3C2410_GPCCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { .base = S3C2410_GPC0, @@ -111,7 +111,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { }, }, [3] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPD0), + .base = S3C2410_GPDCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { .base = S3C2410_GPD0, @@ -121,7 +121,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { }, }, [4] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPE0), + .base = S3C2410_GPECON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { .base = S3C2410_GPE0, @@ -131,7 +131,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { }, }, [5] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPF0), + .base = S3C2410_GPFCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { .base = S3C2410_GPF0, @@ -142,7 +142,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { }, }, [6] = { - .base = S3C24XX_GPIO_BASE(S3C2410_GPG0), + .base = S3C2410_GPGCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { .base = S3C2410_GPG0, -- cgit v1.2.2 From 070276d5d049f385763dee19112bea08f56c9a0d Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Sun, 17 May 2009 22:32:23 +0100 Subject: [ARM] S3C24XX: GPIO: Change to macros for GPIO numbering Prepare to remove the large number of S3C2410_GPxn defines by moving to S3C2410_GPx(n) in arch/arm. The following perl was used to change the files: perl -pi~ -e 's/S3C2410_GP([A-Z])([0-9]+)([^_^0-9])/S3C2410_GP\1\(\2\)\3/g' Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/common-smdk.c | 24 ++++++++++++------------ arch/arm/plat-s3c24xx/gpio.c | 14 +++++++------- arch/arm/plat-s3c24xx/gpiolib.c | 14 +++++++------- arch/arm/plat-s3c24xx/pm.c | 8 ++++---- arch/arm/plat-s3c24xx/setup-i2c.c | 4 ++-- arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c | 20 ++++++++++---------- arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c | 20 ++++++++++---------- 7 files changed, 52 insertions(+), 52 deletions(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c index fe658c48f724..aa119863c5ce 100644 --- a/arch/arm/plat-s3c24xx/common-smdk.c +++ b/arch/arm/plat-s3c24xx/common-smdk.c @@ -48,27 +48,27 @@ /* LED devices */ static struct s3c24xx_led_platdata smdk_pdata_led4 = { - .gpio = S3C2410_GPF4, + .gpio = S3C2410_GPF(4), .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led4", .def_trigger = "timer", }; static struct s3c24xx_led_platdata smdk_pdata_led5 = { - .gpio = S3C2410_GPF5, + .gpio = S3C2410_GPF(5), .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led5", .def_trigger = "nand-disk", }; static struct s3c24xx_led_platdata smdk_pdata_led6 = { - .gpio = S3C2410_GPF6, + .gpio = S3C2410_GPF(6), .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led6", }; static struct s3c24xx_led_platdata smdk_pdata_led7 = { - .gpio = S3C2410_GPF7, + .gpio = S3C2410_GPF(7), .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led7", }; @@ -185,15 +185,15 @@ void __init smdk_machine_init(void) { /* Configure the LEDs (even if we have no LED support)*/ - s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPIO_OUTPUT); - s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPIO_OUTPUT); - s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPIO_OUTPUT); - s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); + s3c2410_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); - s3c2410_gpio_setpin(S3C2410_GPF4, 1); - s3c2410_gpio_setpin(S3C2410_GPF5, 1); - s3c2410_gpio_setpin(S3C2410_GPF6, 1); - s3c2410_gpio_setpin(S3C2410_GPF7, 1); + s3c2410_gpio_setpin(S3C2410_GPF(4), 1); + s3c2410_gpio_setpin(S3C2410_GPF(5), 1); + s3c2410_gpio_setpin(S3C2410_GPF(6), 1); + s3c2410_gpio_setpin(S3C2410_GPF(7), 1); if (machine_is_smdk2443()) smdk_nand_info.twrph0 = 50; diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 65ebbaff7d50..ae0b9d6f3fb8 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c @@ -183,19 +183,19 @@ EXPORT_SYMBOL(s3c2410_modify_misccr); int s3c2410_gpio_getirq(unsigned int pin) { - if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15) + if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) return -1; /* not valid interrupts */ - if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7) + if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) return -1; /* not valid pin */ - if (pin < S3C2410_GPF4) - return (pin - S3C2410_GPF0) + IRQ_EINT0; + if (pin < S3C2410_GPF(4)) + return (pin - S3C2410_GPF(0)) + IRQ_EINT0; - if (pin < S3C2410_GPG0) - return (pin - S3C2410_GPF4) + IRQ_EINT4; + if (pin < S3C2410_GPG(0)) + return (pin - S3C2410_GPF(4)) + IRQ_EINT4; - return (pin - S3C2410_GPG0) + IRQ_EINT8; + return (pin - S3C2410_GPG(0)) + IRQ_EINT8; } EXPORT_SYMBOL(s3c2410_gpio_getirq); diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 60a9f7247205..a82adc3c98a5 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c @@ -82,7 +82,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPACON, .pm = __gpio_pm(&s3c_gpio_pm_1bit), .chip = { - .base = S3C2410_GPA0, + .base = S3C2410_GPA(0), .owner = THIS_MODULE, .label = "GPIOA", .ngpio = 24, @@ -94,7 +94,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPBCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { - .base = S3C2410_GPB0, + .base = S3C2410_GPB(0), .owner = THIS_MODULE, .label = "GPIOB", .ngpio = 16, @@ -104,7 +104,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPCCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { - .base = S3C2410_GPC0, + .base = S3C2410_GPC(0), .owner = THIS_MODULE, .label = "GPIOC", .ngpio = 16, @@ -114,7 +114,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPDCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { - .base = S3C2410_GPD0, + .base = S3C2410_GPD(0), .owner = THIS_MODULE, .label = "GPIOD", .ngpio = 16, @@ -124,7 +124,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPECON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { - .base = S3C2410_GPE0, + .base = S3C2410_GPE(0), .label = "GPIOE", .owner = THIS_MODULE, .ngpio = 16, @@ -134,7 +134,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPFCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { - .base = S3C2410_GPF0, + .base = S3C2410_GPF(0), .owner = THIS_MODULE, .label = "GPIOF", .ngpio = 8, @@ -145,7 +145,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPGCON, .pm = __gpio_pm(&s3c_gpio_pm_2bit), .chip = { - .base = S3C2410_GPG0, + .base = S3C2410_GPG(0), .owner = THIS_MODULE, .label = "GPIOG", .ngpio = 10, diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c index 16aaf36b6e5a..56e5253ca02c 100644 --- a/arch/arm/plat-s3c24xx/pm.c +++ b/arch/arm/plat-s3c24xx/pm.c @@ -124,12 +124,12 @@ void s3c_pm_configure_extint(void) * and then configure it as an input if it is not */ - for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) { - s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF0); + for (pin = S3C2410_GPF(0); pin <= S3C2410_GPF(7); pin++) { + s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF(0)); } - for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) { - s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8); + for (pin = S3C2410_GPG(0); pin <= S3C2410_GPG(7); pin++) { + s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG(0))+8); } } diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c index e0d18530555e..71a6accf114e 100644 --- a/arch/arm/plat-s3c24xx/setup-i2c.c +++ b/arch/arm/plat-s3c24xx/setup-i2c.c @@ -21,6 +21,6 @@ struct platform_device; void s3c_i2c0_cfg_gpio(struct platform_device *dev) { - s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA); - s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL); + s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA); + s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL); } diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c index 8b403cbb53d2..9edf7894eedd 100644 --- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c +++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c @@ -22,16 +22,16 @@ void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi, int enable) { if (enable) { - s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPE13_SPICLK0); - s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPE12_SPIMOSI0); - s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPE11_SPIMISO0); - s3c2410_gpio_pullup(S3C2410_GPE11, 0); - s3c2410_gpio_pullup(S3C2410_GPE13, 0); + s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0); + s3c2410_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0); + s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0); + s3c2410_gpio_pullup(S3C2410_GPE(11), 0); + s3c2410_gpio_pullup(S3C2410_GPE(13), 0); } else { - s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPIO_INPUT); - s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPIO_INPUT); - s3c2410_gpio_pullup(S3C2410_GPE11, 1); - s3c2410_gpio_pullup(S3C2410_GPE12, 1); - s3c2410_gpio_pullup(S3C2410_GPE13, 1); + s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); + s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); + s3c2410_gpio_pullup(S3C2410_GPE(11), 1); + s3c2410_gpio_pullup(S3C2410_GPE(12), 1); + s3c2410_gpio_pullup(S3C2410_GPE(13), 1); } } diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c index 8fccd4e549f0..f34d0fc69ad8 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c @@ -22,16 +22,16 @@ void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, int enable) { if (enable) { - s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_SPICLK1); - s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_SPIMOSI1); - s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_SPIMISO1); - s3c2410_gpio_pullup(S3C2410_GPG5, 0); - s3c2410_gpio_pullup(S3C2410_GPG6, 0); + s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1); + s3c2410_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1); + s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1); + s3c2410_gpio_pullup(S3C2410_GPG(5), 0); + s3c2410_gpio_pullup(S3C2410_GPG(6), 0); } else { - s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPIO_INPUT); - s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPIO_INPUT); - s3c2410_gpio_pullup(S3C2410_GPG5, 1); - s3c2410_gpio_pullup(S3C2410_GPG6, 1); - s3c2410_gpio_pullup(S3C2410_GPG7, 1); + s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); + s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); + s3c2410_gpio_pullup(S3C2410_GPG(5), 1); + s3c2410_gpio_pullup(S3C2410_GPG(6), 1); + s3c2410_gpio_pullup(S3C2410_GPG(7), 1); } } -- cgit v1.2.2 From 373e9644c5f557bc8992036f9a9281e9d98aef40 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 18 May 2009 19:40:18 +0100 Subject: [ARM] S3C24XX: GPIO: Fix error returns from gpio functions Several GPIO functions have been returning -1 to indicate an error instead of returning a proper error code. Change to return -EINVAL for invalid argument(s). Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index ae0b9d6f3fb8..95df059b5a1d 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c @@ -184,10 +184,10 @@ EXPORT_SYMBOL(s3c2410_modify_misccr); int s3c2410_gpio_getirq(unsigned int pin) { if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) - return -1; /* not valid interrupts */ + return -EINVAL; /* not valid interrupts */ if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) - return -1; /* not valid pin */ + return -EINVAL; /* not valid pin */ if (pin < S3C2410_GPF(4)) return (pin - S3C2410_GPF(0)) + IRQ_EINT0; -- cgit v1.2.2 From 9c0ec95797052af84b7579e2a00ea212cebf71a8 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 18 May 2009 20:03:23 +0100 Subject: [ARM] S3C24XX: GPIO: Move gpiolib initialisation earlier The arch_initcall() is too late for board initialisation to use gpiolib when doing their machine specific initilisation via the .init_machine callback. Bring the file into line with the s3c64xx implementation and use the core_initcall() to register the GPIO chips. Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index a82adc3c98a5..9a2d114005b5 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c @@ -165,4 +165,4 @@ static __init int s3c24xx_gpiolib_init(void) return 0; } -arch_initcall(s3c24xx_gpiolib_init); +core_initcall(s3c24xx_gpiolib_init); -- cgit v1.2.2 From 5233c178d4cedad0acd0eb0f24b2e09f7fafaa1c Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 18 May 2009 20:10:43 +0100 Subject: [ARM] S3C24XX: GPIO: Fix missing GPIOs in gpiolib The GPG bank has 16 IOs, not 10. Add the missing GPH bank. Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpiolib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'arch/arm/plat-s3c24xx') diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 9a2d114005b5..6d7a961d3269 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c @@ -148,9 +148,18 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { .base = S3C2410_GPG(0), .owner = THIS_MODULE, .label = "GPIOG", - .ngpio = 10, + .ngpio = 16, .to_irq = s3c24xx_gpiolib_bankg_toirq, }, + }, { + .base = S3C2410_GPHCON, + .pm = __gpio_pm(&s3c_gpio_pm_2bit), + .chip = { + .base = S3C2410_GPH(0), + .owner = THIS_MODULE, + .label = "GPIOH", + .ngpio = 11, + }, }, }; -- cgit v1.2.2