Commit Graph

15 Commits (39bd8064ab3648bc38b1a3ef507031ee6a477966)

Author SHA1 Message Date
Ben Dooks 5233c178d4 [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 <ben-linux@fluff.org>
2009-05-18 20:20:12 +01:00
Ben Dooks 9c0ec95797 [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 <ben-linux@fluff.org>
2009-05-18 20:03:23 +01:00
Ben Dooks 070276d5d0 [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 <ben-linux@fluff.org>
2009-05-18 16:26:03 +01:00
Ben Dooks fda7b2b097 [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 <ben-linux@fluff.org>
2009-05-18 16:26:02 +01:00
Ben Dooks 86c03c526e [ARM] S3C24XX: Fix missing <linux/sysdev.h>
In our recent changes, arch/arm/plat-s3c24xx/gpiolib.c needs
to have <linux/sysdev.h> 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 <ben-linux@fluff.org>
2009-05-18 16:26:01 +01:00
Ben Dooks d87964c460 [ARM] S3C: GPIO PM core GPIOlib integration
Move the GPIO suspend/resume support inline with the gpiolib support
so that it will work with both the S3C24XX and S3C64XX series.

The s3c_gpio_chip is extended to have a pm callback and a save block
to keep the state of the GPIO over suspend, and the code from the
s3c24xx implementation is added to a new common file.

The suspend process now uses the list of registered chips to go through
saving and restoring each one as appropriate, using the pm callback to
select the appropriate routine depending on the type of control register
present.

This change also means that any additional GPIO added should not require
changes to the PM.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:56 +01:00
Ben Dooks ec5cfbfc05 [ARM] S3C24XX: Fix sparse error in gpiolib.c
Fix the following sparse error generated by including
<plat/gpio-core.h> instead of <mach/gpio-core.h>

gpiolib.c:78:22: warning: symbol 's3c24xx_gpios' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-17 12:42:24 +01:00
Ben Dooks 43ae6599fe [ARM] S3C24XX: Add gpio_to_irq implementation
Add to_irq field handlers for the GPIO banks that are configurable
as interripts.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-01-08 16:24:08 +00:00
Ben Dooks 21b23664b9 [ARM] S3C: Add new GPIO configuration calls
Add new GPIO configuration calls that mesh with the
new gpiolib support.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-15 23:34:15 +00:00
Ben Dooks 7db6c82a37 [ARM] S3C: Move common GPIO code from plat-s3c24xx
Move the common parts of the GPIO code into plat-s3c
for use with both the s3c24xx and s3c64xx systems.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-15 23:33:20 +00:00
Ben Dooks f2edc7565a [ARM] S3C24XX: Reduce code lineage of gpiolib.c
All the s3c24xx gpiolib chips share the same get/set
calls and all but one bank shares the same calls for
.direction_input and .direction_output methods.

Change the initialisation process to use an new call
to register the chips that fills in any blank calls
with the default values to avoid having to fill them
in the structure initialisers.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-15 21:46:24 +00:00
Ben Dooks f4cb1a8964 [ARM] S3C24XX: Fix sparse warnings in arch/arm/plat-s3c24xx/gpiolib.c
Fix the following problems spotted by sparse:

warning: symbol 's3c24xx_gpiolib_input' was not declared. Should it be static?
warning: symbol 's3c24xx_gpiolib_output' was not declared. Should it be static?
warning: symbol 's3c24xx_gpiolib_set' was not declared. Should it be static?
warning: symbol 's3c24xx_gpiolib_get' was not declared. Should it be static?
warning: symbol 'gpios' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-08-26 22:56:20 +01:00
Russell King a09e64fbc0 [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:55:48 +01:00
Russell King be50972935 [ARM] Remove asm/hardware.h, use asm/arch/hardware.h instead
Remove includes of asm/hardware.h in addition to asm/arch/hardware.h.
Then, since asm/hardware.h only exists to include asm/arch/hardware.h,
update everything to directly include asm/arch/hardware.h and remove
asm/hardware.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:40:08 +01:00
Ben Dooks f348a2a281 [ARM] S3C24XX: Add gpiolib support
Add support for gpilib on all S3C24XX platforms.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-07-03 16:51:23 +01:00