linux/arch/arm/mach-tegra
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
..
include/mach Merge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:31:25 -07:00
board-dt.c arm/tegra: Don't create duplicate gpio and pinmux devices 2011-11-09 10:38:56 -08:00
board-harmony-pcie.c ARM: 7094/1: arm/tegra: Move EN_VDD_1V05_GPIO to board-harmony.h 2011-09-26 12:31:45 +01:00
board-harmony-pinmux.c arm/tegra: Don't create duplicate gpio and pinmux devices 2011-11-09 10:38:56 -08:00
board-harmony-power.c arm/tegra: Harmony: Configure PMC for low-level interrupts 2011-10-13 15:04:55 -07:00
board-harmony.c Merge branch 'next/board' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:25:36 -07:00
board-harmony.h ARM: 7101/1: arm/tegra: Replace <mach/gpio.h> with <mach/gpio-tegra.h> 2011-09-27 00:20:53 +01:00
board-paz00-pinmux.c arm/tegra: Don't create duplicate gpio and pinmux devices 2011-11-09 10:38:56 -08:00
board-paz00.c Merge branch 'next/board' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:25:36 -07:00
board-paz00.h Merge branch 'depends/rmk/gpio' into next/board 2011-10-21 16:46:26 +02:00
board-seaboard-pinmux.c arm/tegra: Don't create duplicate gpio and pinmux devices 2011-11-09 10:38:56 -08:00
board-seaboard.c Merge branch 'depends/rmk/devel-stable' into next/board 2011-11-01 00:11:41 +01:00
board-seaboard.h Merge branch 'depends/rmk/gpio' into next/board 2011-10-21 16:46:26 +02:00
board-trimslice-pinmux.c arm/tegra: Don't create duplicate gpio and pinmux devices 2011-11-09 10:38:56 -08:00
board-trimslice.c Merge branch 'next/board' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:25:36 -07:00
board-trimslice.h ARM: 7101/1: arm/tegra: Replace <mach/gpio.h> with <mach/gpio-tegra.h> 2011-09-27 00:20:53 +01:00
board.h ARM: tegra: Move tegra_common_init to tegra_init_early 2011-02-22 11:25:12 -08:00
clock.c switch assorted clock drivers to debugfs_remove_recursive() 2011-07-20 20:47:51 -04:00
clock.h ARM: tegra: clock: Add function to set SDMMC tap delay 2011-02-21 00:16:47 -08:00
common.c ARM: tegra: tegra_init_cache should be static 2011-10-13 14:08:28 -07:00
cpu-tegra.c Merge branch 'next/cleanup' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:11:00 -07:00
devices.c Merge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:31:25 -07:00
devices.h arm/tegra: Prep boards for gpio/pinmux conversion to pdevs 2011-10-11 17:19:56 -07:00
dma.c ARM: tegra: dma: staticify some tables and functions 2011-10-13 14:08:29 -07:00
fuse.c [ARM] tegra: Add support for reading fuses 2010-10-21 18:12:09 -07:00
fuse.h [ARM] tegra: Add support for reading fuses 2010-10-21 18:12:09 -07:00
gpio-names.h [ARM] tegra: add GPIO support 2010-08-05 14:57:02 -07:00
headsmp.S [ARM] tegra: SMP support 2010-08-05 14:57:01 -07:00
hotplug.c ARM: fix wrongly patched constants 2011-01-14 12:06:26 +00:00
io.c ARM: tegra: annotate IO_*_VIRT pointers 2011-10-13 14:07:38 -07:00
irq.c ARM: tegra: irq: Add tegra_eoi 2011-05-11 16:04:16 +01:00
Kconfig arm/tegra: device tree support for ventana board 2011-10-13 15:04:54 -07:00
localtimer.c ARM: 6759/1: smp: Select local timers vs broadcast timer support runtime 2011-02-23 17:54:27 +00:00
Makefile arm/tegra: add support for ventana pinmuxing 2011-10-13 15:04:54 -07:00
Makefile.boot Merge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:31:25 -07:00
pcie.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
pinmux-t2-tables.c arm/tegra: pinmux: ioremap registers 2011-10-13 15:04:53 -07:00
pinmux.c arm/tegra: pinmux: ioremap registers 2011-10-13 15:04:53 -07:00
platsmp.c ARM: smp: fix clipping of number of CPUs 2011-10-20 22:06:57 +01:00
powergate.c ARM: tegra: tegra_powergate_is_powered should be static 2011-10-13 14:08:28 -07:00
tegra2_clocks.c ARM: tegra: tegra2_clocks: don't export some tables 2011-10-13 14:08:29 -07:00
tegra2_emc.c ARM: tegra: Add external memory controller driver 2011-02-21 00:16:45 -08:00
tegra2_emc.h ARM: tegra: Add external memory controller driver 2011-02-21 00:16:45 -08:00
timer.c ARM: tegra: tegra_rtc_read_ms should be static 2011-10-13 14:08:28 -07:00
usb_phy.c ARM: 7101/1: arm/tegra: Replace <mach/gpio.h> with <mach/gpio-tegra.h> 2011-09-27 00:20:53 +01:00