1
linux/arch/arm/mach-omap2
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
board-2430sdp.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-3430sdp.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-3630sdp.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-4430sdp.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-am3517crane.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-am3517evm.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-apollon.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-cm-t35.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-cm-t3517.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-devkit8000.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-flash.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-flash.h OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-generic.c 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
board-h4.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-igep0020.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-igep0030.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-ldp.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-n8x0.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap3beagle.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap3evm.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap3logic.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap3pandora.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap3stalker.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap3touchbook.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-omap4panda.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-overo.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-rx51-peripherals.c OMAP: mux: Add support for control module split in several partitions 2010-11-17 12:01:49 +01:00
board-rx51-sdram.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
board-rx51-video.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-rx51.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
board-zoom-debugboard.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-zoom-peripherals.c 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
board-zoom.c OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
clkt2xxx_apll.c OMAP2 PRCM: convert OMAP2 PRCM macros to the _SHIFT/_MASK suffixes 2010-05-20 12:31:04 -06:00
clkt2xxx_dpllcore.c OMAP2xxx clock: move the DPLL+CORE composite clock code into mach-omap2/clkt2xxx_dpllcore.c 2010-01-26 20:13:06 -07:00
clkt2xxx_osc.c OMAP2xxx clock: move osc_clk code into mach-omap2/clkt2xxx_osc.c 2010-01-28 18:13:49 -07:00
clkt2xxx_sys.c OMAP2xxx clock: move sys_clk code into mach-omap2/clkt2xxx_sys.c 2010-01-28 18:13:49 -07:00
clkt2xxx_virt_prcm_set.c OMAP2 clock: fix recursive spinlock attempt when CONFIG_CPU_FREQ=y 2010-05-20 12:31:14 -06:00
clkt34xx_dpll3m2.c OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clkt_clksel.c OMAP2+ clock: clean up clkt_clksel.c 2010-05-20 12:31:06 -06:00
clkt_dpll.c OMAP2/3/4 clock: fix DPLL multiplier value errors; also copyrights, includes, documentation 2010-02-24 12:15:03 -07:00
clock2xxx.c OMAP2/3 clock: combine OMAP2 & 3 boot-time MPU rate change code 2010-02-24 17:45:15 -07:00
clock2xxx.h OMAP2 clock: split OMAP2420, OMAP2430 clock data into their own files 2010-02-24 12:29:42 -07:00
clock3xxx_data.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2010-10-24 12:44:34 -07:00
clock3xxx.c OMAP2/3 clock: combine OMAP2 & 3 boot-time MPU rate change code 2010-02-24 17:45:15 -07:00
clock3xxx.h OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock34xx.c OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock34xx.h OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock36xx.c OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock36xx.h OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock44xx_data.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
clock44xx.h OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock2420_data.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
clock2430_data.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
clock2430.c OMAP2 clock: split OMAP2420, OMAP2430 clock data into their own files 2010-02-24 12:29:42 -07:00
clock3517.c OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock3517.h OMAP3/4 clock: split into per-chip family files 2010-02-24 12:16:15 -07:00
clock_common_data.c OMAP3 clock: rename RATE_IN_343X, RATE_IN_3430ES2 to match reality 2010-05-20 12:31:07 -06:00
clock.c OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks 2010-10-08 11:40:20 -06:00
clock.h OMAP2+ clock: clean up clkt_clksel.c 2010-05-20 12:31:06 -06:00
clockdomain.c OMAP clockdomain: initialize clockdomain registers when the clockdomain layer starts 2010-09-23 17:14:12 -07:00
clockdomains44xx.h OMAP4: PRM: Remove MPU internal code name and apply PRCM naming convention 2010-05-20 12:31:11 -06:00
clockdomains.h omap2: Convert ARCH_OMAP24XX to ARCH_OMAP2 2010-02-15 09:27:01 -08:00
cm4xxx.c OMAP4: PM: Declare idle modules as functional too 2010-09-24 10:23:18 -06:00
cm44xx.h OMAP4: PM: Define additional registers for ES2 2010-09-27 14:02:56 -06:00
cm-regbits-24xx.h OMAP2xxx: hwmod: add I2C hwmods for OMAP2420, 2430 2010-11-09 09:26:08 -08:00
cm-regbits-34xx.h OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs 2010-09-29 12:43:00 -07:00
cm-regbits-44xx.h OMAP4: CM & PRM: Update PRCM register bitshifts and masks for ES2 2010-09-27 14:02:55 -06:00
cm.c OMAP24xx: CM: fix mask used for checking IDLEST status 2010-07-26 16:34:28 -06:00
cm.h OMAP4: hwmod & CM: Implement the omap4_cm_wait_module_ready function 2010-05-20 12:31:08 -06:00
common.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
control.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
control.h OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
cpuidle34xx.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
devices.c 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
dpll3xxx.c fix typos concerning "hierarchy" 2010-06-16 18:03:14 +02:00
dsp.c omap: add dsp platform device 2010-10-05 12:05:11 -07:00
emu.c omap2/3: Fix initcalls for multi-omap 2010-02-15 09:27:05 -08:00
gpio.c OMAP2+: GPIO: device registration 2010-12-07 16:26:57 -08:00
gpmc-nand.c omap3 nand: cleanup virtual address usages 2010-08-02 15:30:38 +03:00
gpmc-onenand.c
gpmc-smc91x.c
gpmc-smsc911x.c ARM: OMAP3LOGIC: Add generic smsc911x support when connected to GPMC 2010-09-28 11:39:18 -07:00
gpmc.c omap3 nand: cleanup virtual address usages 2010-08-02 15:30:38 +03:00
hsmmc.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
hsmmc.h 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
i2c.c omap: mux: Convert 2420 platform init code to use new mux code 2010-07-05 16:31:40 +03:00
id.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
io.c OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
io.h OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
iommu2.c omap iommu: move iommu_disable at fault to the above layer 2010-06-29 07:55:07 +03:00
irq.c OMAP: mach-omap2: Fix miscellaneous sparse warnings 2010-10-08 10:12:37 -07:00
Kconfig omap: Don't select mux by default for each board 2010-12-07 16:25:41 -08:00
mailbox.c arm: remove cast from void* 2010-09-28 09:54:28 -07:00
Makefile OMAP: GPIO: Implement GPIO as a platform device 2010-12-07 16:26:57 -08:00
Makefile.boot
mcbsp.c OMAP: McBSP: Remove null omap44xx ops comment 2010-10-08 11:40:21 -06:00
mux34xx.c OMAP: mux: Add __func__ macro to pr_xxx macros 2010-11-17 12:01:54 +01:00
mux34xx.h
mux44xx.c OMAP: mux: Add __func__ macro to pr_xxx macros 2010-11-17 12:01:54 +01:00
mux44xx.h OMAP4: mux: Add CBS package data for OMAP4430 ES2 2010-11-17 12:01:52 +01:00
mux2420.c OMAP: mux: Add __func__ macro to pr_xxx macros 2010-11-17 12:01:54 +01:00
mux2420.h omap: mux: Add data for 2420 2010-07-05 16:31:36 +03:00
mux2430.c OMAP: mux: Add __func__ macro to pr_xxx macros 2010-11-17 12:01:54 +01:00
mux2430.h omap: mux: Add data for 2430 2010-07-05 16:31:36 +03:00
mux.c OMAP: mux: Add __func__ macro to pr_xxx macros 2010-11-17 12:01:54 +01:00
mux.h OMAP4: mux: Add CBS package data for OMAP4430 ES2 2010-11-17 12:01:52 +01:00
omap4-common.c Merge branch 'l2x0-pull-rmk' of git://dev.omapzoom.org/pub/scm/santosh/kernel-omap4-base into devel-stable 2010-10-28 14:42:06 +01:00
omap44xx-smc.S omap4: Add smc API to read AuxCoreBoot0 register 2010-08-02 13:18:18 +03:00
omap_hwmod_3xxx_data.c OMAP3: hwmod data: Add GPIO 2010-12-07 16:26:57 -08:00
omap_hwmod_44xx_data.c OMAP4: hwmod data: Add GPIO 2010-12-07 16:26:57 -08:00
omap_hwmod_2420_data.c OMAP2420: hwmod data: Add GPIO 2010-12-07 16:26:56 -08:00
omap_hwmod_2430_data.c OMAP2430: hwmod data: Add GPIO 2010-12-07 16:26:56 -08:00
omap_hwmod_common_data.c OMAP: hwmod data: add class for IVA hwmods 2010-07-26 16:34:31 -06:00
omap_hwmod_common_data.h OMAP: hwmod data: add class for IVA hwmods 2010-07-26 16:34:31 -06:00
omap_hwmod.c omap: hwmod: Handle modules with 16bit registers 2010-10-08 10:23:22 -07:00
omap-headsmp.S omap4: Add smc API to read AuxCoreBoot0 register 2010-08-02 13:18:18 +03:00
omap-hotplug.c omap4: hotplug: Add basic CPU hotplug support 2010-08-02 13:18:19 +03:00
omap-iommu.c omap iommu: update ducati mmu irq define name 2010-06-29 07:55:08 +03:00
omap-smp.c omap: Fix sev instruction usage for multi-omap 2010-08-16 09:22:04 +03:00
opp2xxx.h omap2/3: Multiboot compile fixes to compile in omap2 and omap3 2010-02-15 09:26:55 -08:00
opp2420_data.c
opp2430_data.c
pm24xx.c OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled 2010-11-24 16:14:30 -08:00
pm34xx.c OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled 2010-11-24 16:14:30 -08:00
pm44xx.c omap4: suspend: Add basic system suspend support 2010-08-02 13:18:18 +03:00
pm_bus.c OMAP2+: PM: initial runtime PM core support 2010-09-21 11:51:23 -07:00
pm-debug.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
pm.c OMAP4: pm: Change l3_main to l3_main_1 during bus device init 2010-09-23 17:14:16 -07:00
pm.h OMAP: PM: Fix build when CONFIG_PM_DEBUG isn't set 2010-10-01 13:50:34 -07:00
powerdomain.c OMAP2: powerdomain: Add break in switch statement 2010-08-03 10:21:07 +03:00
powerdomains24xx.h omap2: Convert ARCH_OMAP24XX to ARCH_OMAP2 2010-02-15 09:27:01 -08:00
powerdomains34xx.h omap: 3630: disable TLL SAR on 3630 ES1 2010-08-04 14:43:52 +03:00
powerdomains44xx.h OMAP4: powerdomain: Update DSS logic state for ES2 2010-09-27 14:02:56 -06:00
powerdomains.h OMAP2+ powerdomains/clockdomains: prepare for multi-OMAP configs 2010-01-29 10:14:23 -07:00
prcm-common.h OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs 2010-09-29 12:43:00 -07:00
prcm.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
prm2xxx_3xxx.c OMAP2/3: PRM: add module hard reset support 2010-09-21 15:12:40 -06:00
prm44xx.c OMAP4: PRM: add module hard reset support 2010-09-21 15:12:21 -06:00
prm44xx.h OMAP4: PM: Define additional registers for ES2 2010-09-27 14:02:56 -06:00
prm-regbits-24xx.h OMAP2 PRCM: convert OMAP2 PRCM macros to the _SHIFT/_MASK suffixes 2010-05-20 12:31:04 -06:00
prm-regbits-34xx.h OMAP3: hwmod: add I2C hwmods for OMAP3430 2010-11-09 09:29:13 -08:00
prm-regbits-44xx.h OMAP4: CM & PRM: Update PRCM register bitshifts and masks for ES2 2010-09-27 14:02:55 -06:00
prm.h OMAP2/3: PRM: add module hard reset support 2010-09-21 15:12:40 -06:00
sdram-hynix-h8mbx00u0mer-0em.h
sdram-micron-mt46h32m32lf-6.h
sdram-numonyx-m65kxxxxam.h omap3: SDRC: add timing data for Numonyx M65KxxxxAM 2010-02-17 17:23:20 -08:00
sdram-qimonda-hyb18m512160af-6.h
sdrc2xxx.c
sdrc.c omap2/3/4: ioremap omap_globals module 2010-02-23 10:57:40 -08:00
sdrc.h
serial.c omap: Serial: Define register access modes in LCR 2010-11-30 14:11:49 -08:00
sleep24xx.S
sleep34xx.S OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
sram34xx.S omap3: Prevent SDRC deadlock when L3 is changing frequency 2010-09-27 14:02:59 -06:00
sram242x.S
sram243x.S
timer-gp.c arm: omap2: timer-gp: delete unused variable 2010-11-24 16:49:42 -08:00
timer-gp.h OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
timer-mpu.c omap4: Use irq line defines from irq-44xx.h 2010-02-23 15:29:08 -08:00
usb-ehci.c omap: mux: Remove old mux code 2010-07-05 16:31:40 +03:00
usb-fs.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
usb-musb.c USB: AM35x: Add musb support 2010-10-22 10:22:16 -07:00
usb-tusb6010.c omap: mux: Convert 2420 platform init code to use new mux code 2010-07-05 16:31:40 +03:00