1
0
Fork 0
alistair23-linux/arch/arm/mach-omap1
Varadarajan, Charulatha 77640aabd7 OMAP: GPIO: Implement GPIO as a platform device
Implement GPIO as a platform device.

GPIO APIs are used in machine_init functions. Hence it is
required to complete GPIO probe before board_init. Therefore
GPIO device register and driver register are implemented as
postcore_initcalls.

omap_gpio_init() does nothing now and this function would be
removed in the next patch as it's usage is spread across most
of the board files.

Inorder to convert GPIO as platform device, modifications are
required in clockxxxx_data.c file for OMAP1 so that device names
can be used to obtain clock instead of getting clocks by
name/NULL ptr.

Use runtime pm APIs (pm_runtime_put*/pm_runtime_get*) for enabling
or disabling the clocks, modify sysconfig settings and remove usage
of clock FW APIs.
Note 1: Converting GPIO driver to use runtime PM APIs is not done as a
separate patch because GPIO clock names are different for various OMAPs
and are different for some of the banks in the same CPU. This would need
usage of cpu_is checks and bank id checks while using clock FW APIs in
the gpio driver. Hence while making GPIO a platform driver framework,
PM runtime APIs are used directly.

Note 2: While implementing GPIO as a platform device, pm runtime APIs
are used as mentioned above and modification is not done in gpio's
prepare for idle/ resume after idle functions. This would be done
in the next patch series and GPIO driver would be made to use dev_pm_ops
instead of sysdev_class in that series only.

Due to the above, the GPIO driver implicitly relies on
CM_AUTOIDLE = 1 on its iclk for power management to work, since the
driver never disables its iclk.
This would be taken care in the next patch series (see Note 3 below).

Refer to
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg39112.html
for more details.

Note 3: only pm_runtime_get_sync is called in gpio's probe() and
pm_runtime_put* is never called. This is to make the implementation
similar to the existing GPIO code. Another patch series would be sent
to correct this.

In OMAP3 and OMAP4 gpio's debounce clocks are optional clocks. They
are enabled/ disabled whenever required using clock framework APIs

TODO:
1. Cleanup the GPIO driver. Use function pointers and register
offest pointers instead of using hardcoded values
2. Remove all cpu_is_ checks and OMAP specific macros
3. Remove usage of gpio_bank array so that only
   instance specific information is used in driver code
4. Rename 'method'/ avoid it's usage
5. Fix the non-wakeup gpios handling for OMAP2430, OMAP3 & OMAP4
6. Modify gpio's prepare for idle/ resume after idle functions
   to use runtime pm implentation.

Signed-off-by: Charulatha V <charu@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Reviewed-by: Basak, Partha <p-basak2@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
[tony@atomide.com: updated for bank specific revision and updated boards]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2010-12-07 16:26:57 -08:00
..
include/mach ARM: 6484/1: fix compile warning in mm/init.c 2010-11-21 22:05:56 +00:00
Kconfig OMAP1: drop AMS_DELTA_FIQ config option 2010-11-30 13:48:46 -08:00
Makefile OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
Makefile.boot [PATCH] ARM: 2798/1: OMAP update 2/11: Change ARM Kconfig to support omap1 and omap2 2005-07-10 19:58:08 +01:00
ams-delta-fiq-handler.S OMAP1: Amstrad Delta: add FIQ handler for serial keyboardport interrupt processing 2010-05-05 11:11:10 -07:00
ams-delta-fiq.c OMAP1: Amstrad Delta: add a handler for processing interruptsgenerated by the FIQ routine 2010-05-05 11:11:10 -07:00
board-ams-delta.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-fsample.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-generic.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
board-h2-mmc.c omap: Fix spotty MMC voltages 2010-10-12 16:07:51 -07:00
board-h2.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-h2.h ARM: OMAP: No need to include board-h2.h from hardware.h 2009-03-23 18:07:33 -07:00
board-h3-mmc.c omap: Fix spotty MMC voltages 2010-10-12 16:07:51 -07:00
board-h3.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-h3.h ARM: OMAP: No need to include board-h3.h from hardware.h 2009-03-23 18:07:33 -07:00
board-htcherald.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-innovator.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-nokia770.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-osk.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-palmte.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-palmtt.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
board-palmz71.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-perseus2.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-sx1-mmc.c omap: Fix spotty MMC voltages 2010-10-12 16:07:51 -07:00
board-sx1.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-voiceblue.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
clock.c OMAP1: clock: some cleanup 2010-07-26 16:34:28 -06:00
clock.h OMAP1: clock: some cleanup 2010-07-26 16:34:28 -06:00
clock_data.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
devices.c arm: omap1: add missing includes 2010-11-24 16:46:48 -08:00
flash.c arm: omap1: add missing includes 2010-11-24 16:46:48 -08:00
fpga.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
gpio7xx.c OMAP7xx: GPIO: Introduce support for GPIO init 2010-12-07 16:26:56 -08:00
gpio15xx.c OMAP15xx: GPIO: Introduce support for GPIO init 2010-12-07 16:26:56 -08:00
gpio16xx.c OMAP16xx: GPIO: Introduce support for GPIO init 2010-12-07 16:26:56 -08:00
i2c.c omap: i2c: Fix muxing for command line enabled bus 2010-02-25 14:45:08 -08:00
id.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
io.c ARM: OMAP: Convert to use ->reserve method to reserve boot time memory 2010-07-16 11:06:41 +01:00
irq.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
lcd_dma.c omap1: LCD_DMA: Use some define rather than a hexadecimal 2009-12-11 16:16:36 -08:00
leds-h2p2-debug.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
leds-innovator.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
leds-osk.c ARM: OMAP: switch to standard gpio get/set calls 2008-12-10 17:35:25 -08:00
leds.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
leds.h [PATCH] ARM: 2799/1: OMAP update 4/11: Move OMAP1 LED code into mach-omap1 directory 2005-07-10 19:58:10 +01:00
mailbox.c arm: omap1: mbox: delete unused variable 2010-11-24 16:48:47 -08:00
mcbsp.c arm: omap1: make some functions static 2010-11-24 16:48:25 -08:00
mux.c arm: omap1: make some functions static 2010-11-24 16:48:25 -08:00
opp.h OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c 2009-12-11 17:00:40 -07:00
opp_data.c OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c 2009-12-11 17:00:40 -07:00
pm.c omap: headers: Move remaining headers from include/mach to include/plat 2009-10-20 09:40:47 -07:00
pm.h OMAP850: PM: Add an ARCH_OMAP850 check 2009-10-07 23:14:08 +01:00
pm_bus.c OMAP1: PM: add simple runtime PM layer to manage clocks 2010-09-21 11:51:23 -07:00
serial.c Merge branches 'devel-cleanup', 'devel-serial' and 'devel-board' into omap-for-linus 2010-11-30 14:13:15 -08:00
sleep.S OMAP7XX: Rename all the rest of the omap730 references in omap1 core 2009-10-07 23:14:06 +01:00
sram.S OMAP: Remove OMAP_IO_ADDRESS, use OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS instead 2009-08-28 10:50:33 -07:00
time.c arm: omap1: add missing includes 2010-11-24 16:46:48 -08:00
timer32k.c arm: omap1: remove dead code from timer32k.c 2010-04-22 17:32:36 -07:00
usb.c omap: Move omap1 USB platform init code into mach-omap1/usb.c 2010-07-05 16:31:30 +03:00