linux/arch/arm/plat-omap
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/plat OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
clock.c OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks 2010-10-08 11:40:20 -06:00
common.c Merge 'staging-next' to Linus's tree 2010-10-28 09:44:56 -07:00
counter_32k.c OMAP: split plat-omap/common.c 2010-10-08 11:40:19 -06:00
cpu-omap.c OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
debug-devices.c omap: use smc91x_platdata to setup smc91x 2009-12-11 16:16:33 -08:00
debug-leds.c Replacing LEDS_OMAP_DEBUG with OMAP_DEBUG_LEDS 2010-07-05 17:03:58 +03:00
devices.c omap: dsp: remove shm from normal memory 2010-11-10 17:54:01 -06:00
dma.c arm: omap1: make some functions static 2010-11-24 16:48:25 -08:00
dmtimer.c omap4: Fix bootup crash observed with higher CPU clocks 2010-09-24 11:30:19 +05:30
fb.c Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux 2010-10-26 10:02:39 -07:00
fb.h OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
gpio.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
i2c.c omap: Fix undefined reference to omap2_i2c_mux_pins 2010-12-07 16:25:40 -08:00
io.c Merge with mainline to remove plat-omap/Kconfig conflict 2010-03-01 14:19:05 -08:00
iommu-debug.c arm/omap: use generic_file_llseek in iommu_debug 2010-09-16 10:33:11 +02:00
iommu.c omap: iommu-load cam register before flushing the entry 2010-10-05 10:22:13 -07:00
iopgtable.h omap iommu: Rename iopte_[p,v]addr -> iopte_page_[p,v]addr 2010-06-29 07:55:05 +03:00
iovmm.c omap iommu: Fix Memory leak 2010-06-09 13:21:27 +03:00
Kconfig Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
mailbox.c omap: mailbox: reorganize headers 2010-08-04 15:50:20 +03:00
Makefile OMAP: split plat-omap/common.c 2010-10-08 11:40:19 -06:00
mcbsp.c omap: McBSP: Make the free variable update more readable 2010-12-07 16:25:41 -08:00
mux.c omap: mux: Remove old mux code 2010-07-05 16:31:40 +03:00
ocpi.c [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
omap_device.c Merge branch 'misc_2.6.37' of git://git.pwsan.com/linux-2.6 into omap-for-linus 2010-09-27 10:18:00 -07:00
omap-pm-noop.c OMAP: PM constraints: add omap_pm_set_min_clk_rate() 2010-07-26 16:34:34 -06:00
sram.c arm: omap1: make some functions static 2010-11-24 16:48:25 -08:00
sram.h OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
usb.c omap: Move omap1 USB platform init code into mach-omap1/usb.c 2010-07-05 16:31:30 +03:00