Commit Graph

23 Commits

Author SHA1 Message Date
Vasily Khoruzhick 812c4e40c2 ARM: S3C24XX: Fix mess with gpio {set,get}_pull callbacks
Currently the {set,get}_pull callbacks of the s3c24xx_gpiocfg_default structure
are initalized via s3c_gpio_{get,set}pull_1up. This results in a linker
error when only CONFIG_CPU_S3C2442 is selected:

arch/arm/plat-s3c24xx/built-in.o:(.data+0x13f4): undefined reference to
`s3c_gpio_getpull_1up'
arch/arm/plat-s3c24xx/built-in.o:(.data+0x13f8): undefined reference to
`s3c_gpio_setpull_1up'

The s3c2442 has pulldowns instead of pullups compared to the s3c2440.
The method of controlling them is the same though.
So this patch modifies the existing s3c_gpio_{get,set}pull_1up helper functions
to take an additional parameter deciding whether the pin has a pullup or pulldown.
The s3c_gpio_{get,set}pull_1{down,up} functions then wrap that functions passing
either S3C_GPIO_PULL_UP or S3C_GPIO_PULL_DOWN.

Furthermore this patch sets up the s3c24xx_gpiocfg_default.{get,set}_pull fields
in the s3c244{0,2}_map_io function to the new pulldown helper functions.

Based on patch from "Lars-Peter Clausen" <lars@metafoo.de>

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-12-08 01:04:56 +00:00
Linus Torvalds 706d4b12f8 Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (215 commits)
  ARM: memblock: setup lowmem mappings using memblock
  ARM: memblock: move meminfo into find_limits directly
  ARM: memblock: convert free_highpages() to use memblock
  ARM: move freeing of highmem pages out of mem_init()
  ARM: memblock: convert memory detail printing to use memblock
  ARM: memblock: use memblock to free memory into arm_bootmem_init()
  ARM: memblock: use memblock when initializing memory allocators
  ARM: ensure membank array is always sorted
  ARM: 6466/1: implement flush_icache_all for the rest of the CPUs
  ARM: 6464/2: fix spinlock recursion in adjust_pte()
  ARM: fix memblock breakage
  ARM: 6465/1: Fix data abort accessing proc_info from __lookup_processor_type
  ARM: 6460/1: ixp2000: fix type of ixp2000_timer_interrupt
  ARM: 6449/1: Fix for compiler warning of uninitialized variable.
  ARM: 6445/1: fixup TCM memory types
  ARM: imx: Add wake functionality to GPIO
  ARM: mx5: Add gpio-keys to mx51 babbage board
  ARM: imx: Add gpio-keys to plat-mxc
  mx31_3ds: Fix spi registration
  mx31_3ds: Fix the logic for detecting the debug board
  ...
2010-10-30 08:26:25 -07:00
Abdoulaye Walsimou Gaye bdf5005b73 ARM: S3C2440: fix boot failure introduced by recent changes in gpiolib
Recent changes in s3c gpio break mini2440 board and may be others.
The problem is that mach-mini2440.c: mini2440_init()
(where we call s3c_gpio_setpull()) is called before s3c2440.c: s3c2440_init()
(where we initialize s3c24xx_gpiocfg_default.set_pull function pointer).
This causes dereferencing of NULL pointer at boot time and a kernel panic.

Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>

Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-30 00:21:37 +01:00
Joonyoung Shim 8ce14a221e ARM: SAMSUNG: Add common samsung_gpiolib_to_irq function
This patch adds a common callback for gpio_to_irq() for external and
gpio interrupts for Samsung SoCs.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
[kgene.kim@samsung.com: moved samsung_gpiolib_to_irq() for s3c24xx build]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2010-10-21 07:54:57 +09:00
Ben Dooks 97a339995f ARM: SAMSUNG: Add GPIO configuration read calls
Add the necessary 1,2 and 4 bit configuration read calls for the new
gpio code to allow removal of the old s3c24xx gpio code.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-05-06 10:27:16 +09:00
Ben Dooks 7ced5eab39 ARM: S3C24XX: Add extended GPIO used on S3C2443 and beyond
Add the GPIO banks that are used on the S3C2443 and above to the
list of available GPIOS.

Currently we do not have any limit on the SoC GPIO, so these are
being registered whether the SoC has them or not. It is currently
up to the user not to try and use them.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-05-06 09:32:13 +09:00
Ben Dooks 9bbb851c70 ARM: S3C24XX: Add initial s3c_gpio configuration code
Add support for s3c_gpio_setcfg() and s3c_gpio_setpull() implementations
to get ready for removal of the specific code being used by s3c24xx.

Also rename the s3c_gpio_setcfg_s3c24xx_banka to s3c_gpio_setcfg_s3c24xx_a
as seen in the header file to correct a build warning.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-05-06 09:25:50 +09:00
Ben Dooks e856bb1f8d ARM: SAMSUNG: Remove empty gpio-core.h and use central plat/gpio-core.h
Rename mach-s3c2410/include/mach/gpio-core.h to mach/gpio-track.h so that
it can be included by <plat/gpio-core.h> when needed.

Eliminate all other empty gpio-core.h files and just include the
<plat/gpio-core.h> as necessary.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-19 18:46:02 +09:00
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