summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-12 01:25:57 +0200
committerGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-12 01:25:57 +0200
commitee37dbc094501acbb5d3f14fdb87ab389a678051 (patch)
tree8760d359c91c276f5b150db29834a51e5aa260bf
parenteed58f9674b2bb9a61d622580f656e79869502ac (diff)
parentb93651bb2ab90cd41f08ca98f8cd5e76fd918375 (diff)
Merge change I49b96412 into android-tegra-2.6.29
* changes: tegra: allow native serial driver uarts to be registered
-rw-r--r--arch/arm/mach-tegra/init_common.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/init_common.c b/arch/arm/mach-tegra/init_common.c
index 33c13b035a13..fa87882fc45e 100644
--- a/arch/arm/mach-tegra/init_common.c
+++ b/arch/arm/mach-tegra/init_common.c
@@ -377,7 +377,7 @@ static void __init tegra_register_i2c(void)
}
#endif
-#if !defined(CONFIG_SERIAL_TEGRA_DDK)
+#if !(defined(CONFIG_SERIAL_TEGRA_DDK) || defined(CONFIG_SERIAL_TEGRA))
#define tegra_register_uart() do {} while (0)
#else
@@ -390,11 +390,16 @@ void __init tegra_register_uart(void)
NvU32 i;
NvOdmDebugConsole Console;
NvU32 Port = ~0;
+ const NvU32 *pPinMuxes;
+ NvU32 NumPinMuxes;
+ NvU32 Cnt = 0;
Console = NvOdmQueryDebugConsole();
NumberOfUarts = NvRmModuleGetNumInstances(s_hRmGlobal,
NvRmModuleID_Uart);
+ NvOdmQueryPinMux(NvOdmIoModule_Uart, &pPinMuxes, &NumPinMuxes);
+
/* Skip the UART port used as a debug console */
if (((NvU32)Console >= (NvU32)NvOdmDebugConsole_UartA) &&
((NvU32)Console <= (NvU32)NvOdmDebugConsole_UartE))
@@ -402,12 +407,12 @@ void __init tegra_register_uart(void)
Port = (NvU32)(Console - NvOdmDebugConsole_UartA);
}
- for (i=0; i< NumberOfUarts ; i++)
+ for (i=0; i<NumberOfUarts && i<NumPinMuxes; i++)
{
- if (i == Port)
+ if (i==Port || !pPinMuxes[i])
continue;
- pDev = platform_device_alloc("tegra_uart", i);
+ pDev = platform_device_alloc("tegra_uart", Cnt++);
if (!pDev)
goto fail;
if (platform_device_add(pDev))