original_kernel/arch/arm
Stephen Warren 4b91b6fb86 arm/tegra: Don't create duplicate gpio and pinmux devices
*_pinmux_init() register the GPIO and pinmux devices so that they're ready
before any other device needs them.

*_pinmux_init() are also called by board-dt.c in order to set up the GPIO
and pinmux configurations. In this case, if we register the devices, they
end up being probed once due to this registration, and a second time due
to a device-tree node (or vice-versa). The second probe fails since the
memory regions are already requested. Besides, we don't actually want the
duplicated devices.

To avoid this duplicate registration, modify *_pinmux_init() to check
whether it's running on a DT machine. If not, register the pinmux devices.
If so, don't register them.

Finally, modify board-dt.c to call the *_pinmux_init() after all devices have
been instantiated from device-tree. This allows the GPIO and pinmux devices
to be instantiated and initialized before calling functions to configure the
hardware.

This has one disadvantage: The pinmux and GPIO initialization now happens
after /all/ devices are instantiated, rather than after just gpio and
pinmux but before anything else. So the correct HW configuration is not
in place when e.g. the SD/MMC device is probed. Long-term, this should be
solved by doing both:

a) Initializing the HW state from DT nodes during GPIO and pinmux device
   probe.
b) Using the deferred driver probe mechanism, so that drivers can defer
   their probe until after the gpio and pinmux drivers have probed.

v2: s/int is_dt/bool is_dt/
v3: Use of_machine_is_compatible inside *_pinmux_init() rather than passing
an explicit parameter into the function from outside.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2011-11-09 10:38:56 -08:00
..
boot
common
configs
include/asm
kernel
lib
mach-at91
mach-bcmring
mach-clps711x
mach-cns3xxx
mach-davinci
mach-dove
mach-ebsa110
mach-ep93xx
mach-exynos
mach-footbridge
mach-gemini
mach-h720x
mach-highbank
mach-imx
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-ixp23xx
mach-ixp2000
mach-kirkwood
mach-ks8695
mach-l7200/include/mach
mach-lpc32xx
mach-mmp
mach-msm
mach-mv78xx0
mach-mx5
mach-mxs
mach-netx
mach-nomadik
mach-omap1 Merge branch 'fixes-modulesplit' into fixes 2011-11-07 12:27:23 -08:00
mach-omap2 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 2011-11-07 16:14:26 -08:00
mach-orion5x
mach-picoxcell
mach-pnx4008
mach-prima2
mach-pxa
mach-realview
mach-rpc
mach-s3c64xx
mach-s3c2410
mach-s3c2412
mach-s3c2416
mach-s3c2440
mach-s3c2443
mach-s5p64x0
mach-s5pc100
mach-s5pv210
mach-sa1100
mach-shark
mach-shmobile
mach-spear3xx
mach-spear6xx
mach-tcc8k
mach-tegra arm/tegra: Don't create duplicate gpio and pinmux devices 2011-11-09 10:38:56 -08:00
mach-u300
mach-ux500
mach-versatile
mach-vexpress
mach-vt8500
mach-w90x900
mach-zynq
mm
nwfpe
oprofile
plat-iop
plat-mxc
plat-nomadik
plat-omap Merge branch 'fixes-modulesplit' into fixes 2011-11-07 12:27:23 -08:00
plat-orion
plat-pxa
plat-s3c24xx
plat-s5p
plat-samsung arm: Add export.h to recently added files for EXPORT_SYMBOL 2011-11-07 10:28:58 -08:00
plat-spear
plat-tcc
plat-versatile
tools
vfp
Kconfig
Kconfig-nommu
Kconfig.debug
Makefile