arm: tegra: cardhu: enabling bt auto power save
[linux-2.6.git] / arch / arm / mach-tegra / board-cardhu-pinmux.c
index 4c35cd7..9056887 100644 (file)
@@ -120,8 +120,7 @@ static __initdata struct tegra_drive_pingroup_config cardhu_drive_pinmux[] = {
                .ioreset        = TEGRA_PIN_IO_RESET_##_ioreset \
        }
 
-/* !!!FIXME!!!! POPULATE THIS TABLE */
-static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
+static __initdata struct tegra_pingroup_config cardhu_pinmux_common[] = {
        /* SDMMC1 pinmux */
        DEFAULT_PINMUX(SDMMC1_CLK,      SDMMC1,          NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(SDMMC1_CMD,      SDMMC1,          PULL_UP,    NORMAL,     INPUT),
@@ -154,24 +153,24 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
        DEFAULT_PINMUX(SDMMC4_RST_N,    RSVD1,           PULL_DOWN,    NORMAL,     INPUT),
 
        /* I2C1 pinmux */
-       I2C_PINMUX(GEN1_I2C_SCL,        I2C1,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
-       I2C_PINMUX(GEN1_I2C_SDA,        I2C1,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
+       I2C_PINMUX(GEN1_I2C_SCL,        I2C1,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(GEN1_I2C_SDA,        I2C1,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
 
        /* I2C2 pinmux */
-       I2C_PINMUX(GEN2_I2C_SCL,        I2C2,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
-       I2C_PINMUX(GEN2_I2C_SDA,        I2C2,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
+       I2C_PINMUX(GEN2_I2C_SCL,        I2C2,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(GEN2_I2C_SDA,        I2C2,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
 
        /* I2C3 pinmux */
-       I2C_PINMUX(CAM_I2C_SCL,         I2C3,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
-       I2C_PINMUX(CAM_I2C_SDA,         I2C3,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
+       I2C_PINMUX(CAM_I2C_SCL,         I2C3,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(CAM_I2C_SDA,         I2C3,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
 
        /* I2C4 pinmux */
-       I2C_PINMUX(DDC_SCL,             I2C4,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
-       I2C_PINMUX(DDC_SDA,             I2C4,           PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
+       I2C_PINMUX(DDC_SCL,             I2C4,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(DDC_SDA,             I2C4,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
 
        /* Power I2C pinmux */
-       I2C_PINMUX(PWR_I2C_SCL,         I2CPWR,         PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
-       I2C_PINMUX(PWR_I2C_SDA,         I2CPWR,         PULL_UP,        NORMAL, INPUT,  DISABLE,        DISABLE),
+       I2C_PINMUX(PWR_I2C_SCL,         I2CPWR,         NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(PWR_I2C_SDA,         I2CPWR,         NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
 
        DEFAULT_PINMUX(ULPI_DATA0,      UARTA,           NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(ULPI_DATA1,      UARTA,           NORMAL,    NORMAL,     INPUT),
@@ -254,12 +253,12 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
        DEFAULT_PINMUX(UART3_CTS_N,     UARTC,           NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(UART3_RTS_N,     UARTC,           NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(GPIO_PU0,        RSVD1,           NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(GPIO_PU1,        RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PU1,        RSVD1,           NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(GPIO_PU2,        RSVD1,           NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(GPIO_PU3,        PWM0,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GPIO_PU3,        RSVD1,           NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(GPIO_PU4,        PWM1,            NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(GPIO_PU5,        PWM2,            NORMAL,    NORMAL,     OUTPUT),
-       DEFAULT_PINMUX(GPIO_PU6,        PWM3,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GPIO_PU6,        RSVD1,           NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(DAP4_FS,         I2S3,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(DAP4_DIN,        I2S3,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(DAP4_DOUT,       I2S3,            NORMAL,    NORMAL,     INPUT),
@@ -268,7 +267,7 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
        DEFAULT_PINMUX(CLK3_REQ,        DEV3,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(GMI_WP_N,        RSVD1,           NORMAL,    NORMAL,     INPUT),
 
-#if defined(CONFIG_MTD_NAND_TEGRA)
+#if 0 /* for testing on Verbier */
        DEFAULT_PINMUX(GMI_WAIT,        NAND,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(GMI_ADV_N,       NAND,            NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(GMI_CLK,         NAND,            NORMAL,    NORMAL,     OUTPUT),
@@ -298,7 +297,7 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
        DEFAULT_PINMUX(GMI_OE_N,        NAND,            NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(GMI_DQS,         NAND,            NORMAL,    NORMAL,     INPUT),
 #else
-       DEFAULT_PINMUX(GMI_CS2_N,       GMI,             NORMAL,    NORMAL,     OUTPUT), /* EN_VDD_BL1 */
+       DEFAULT_PINMUX(GMI_CS2_N,       RSVD1,           PULL_UP,   NORMAL,     INPUT), /* EN_VDD_BL1 */
        DEFAULT_PINMUX(GMI_AD8,         PWM0,            NORMAL,    NORMAL,     OUTPUT), /* LCD1_BL_PWM */
        DEFAULT_PINMUX(GMI_AD10,        NAND,            NORMAL,    NORMAL,     OUTPUT), /* LCD1_BL_EN */
 #endif
@@ -355,15 +354,11 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
        DEFAULT_PINMUX(DAP2_DOUT,       I2S1,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(DAP2_SCLK,       I2S1,            NORMAL,    NORMAL,     INPUT),
 #endif
-       DEFAULT_PINMUX(SPI2_MOSI,       SPI6,            NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(SPI2_MISO,       SPI6,            NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(SPI2_CS0_N,      SPI6,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_CS1_N,      SPI2,            PULL_UP,   NORMAL,     INPUT),
        DEFAULT_PINMUX(SPI1_MOSI,       SPI1,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(SPI1_SCK,        SPI1,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(SPI1_CS0_N,      SPI1,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(SPI1_MISO,       SPI1,            NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(SPI2_CS1_N,      SPI3,            NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(SPI2_CS2_N,      SPI3,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(PEX_L0_PRSNT_N,  PCIE,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(PEX_L0_RST_N,    PCIE,            NORMAL,    NORMAL,     OUTPUT),
        DEFAULT_PINMUX(PEX_L0_CLKREQ_N, PCIE,            NORMAL,    NORMAL,     INPUT),
@@ -386,9 +381,6 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
 
        /* Power rails GPIO */
        DEFAULT_PINMUX(SPI2_SCK,        GMI,             NORMAL,    NORMAL,     INPUT),
-       DEFAULT_PINMUX(GMI_CS2_N,       NAND,            NORMAL,    NORMAL,     OUTPUT),
-       DEFAULT_PINMUX(GMI_RST_N,       RSVD3,           PULL_UP,   TRISTATE,   INPUT),
-       DEFAULT_PINMUX(GMI_AD15,        NAND,            PULL_UP,   TRISTATE,   INPUT),
        DEFAULT_PINMUX(GPIO_PBB4,       VGP4,            NORMAL,    NORMAL,     INPUT),
        DEFAULT_PINMUX(KB_ROW8,         KBC,             PULL_UP,   NORMAL,     INPUT),
        DEFAULT_PINMUX(SDMMC3_DAT5,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
@@ -396,16 +388,71 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = {
        VI_PINMUX(VI_D6,           VI,              NORMAL,    NORMAL,     OUTPUT, DISABLE, DISABLE),
        VI_PINMUX(VI_D8,           SDMMC2,          NORMAL,    NORMAL,     INPUT,  DISABLE, DISABLE),
        VI_PINMUX(VI_D9,           SDMMC2,          NORMAL,    NORMAL,     INPUT,  DISABLE, DISABLE),
-       VI_PINMUX(VI_PCLK,         RSVD1,           PULL_UP,   TRISTATE,   INPUT,  DISABLE, ENABLE),
+       VI_PINMUX(VI_PCLK,         RSVD1,           PULL_UP,   TRISTATE,   INPUT,  DISABLE, DISABLE),
        VI_PINMUX(VI_HSYNC,        RSVD1,           NORMAL,    NORMAL,     INPUT,  DISABLE, DISABLE),
        VI_PINMUX(VI_VSYNC,        RSVD1,           NORMAL,    NORMAL,     INPUT,  DISABLE, DISABLE),
 };
 
+static __initdata struct tegra_pingroup_config cardhu_pinmux_e118x[] = {
+       /* Power rails GPIO */
+       DEFAULT_PINMUX(SPI2_SCK,        SPI2,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GMI_CS2_N,       NAND,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_RST_N,       RSVD3,           PULL_UP,   TRISTATE,   INPUT),
+       DEFAULT_PINMUX(GMI_AD15,        NAND,            PULL_UP,   TRISTATE,   INPUT),
+};
+
+static __initdata struct tegra_pingroup_config cardhu_pinmux_cardhu[] = {
+       /* Power rails GPIO */
+       DEFAULT_PINMUX(GMI_CS2_N,       NAND,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_RST_N,       RSVD3,           PULL_UP,   TRISTATE,   INPUT),
+       DEFAULT_PINMUX(GMI_AD15,        NAND,            PULL_UP,   TRISTATE,   INPUT),
+};
+
+static __initdata struct tegra_pingroup_config cardhu_pinmux_cardhu_a03[] = {
+       /* Power rails GPIO */
+       DEFAULT_PINMUX(PEX_L0_PRSNT_N,  PCIE,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(PEX_L0_CLKREQ_N, PCIE,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(PEX_L1_CLKREQ_N, RSVD3,           PULL_UP,   TRISTATE,   INPUT),
+       DEFAULT_PINMUX(PEX_L1_PRSNT_N,  NAND,            PULL_UP,   TRISTATE,   INPUT),
+};
+
+static __initdata struct tegra_pingroup_config cardhu_pinmux_e1198[] = {
+       /* SPI2 */
+       DEFAULT_PINMUX(SPI2_SCK,        SPI2,            PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_MOSI,       SPI2,            PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_MISO,       SPI2,            PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_CS0_N,      SPI2,            PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_CS2_N,      SPI2,            PULL_UP,    NORMAL,     INPUT),
+};
+
 int __init cardhu_pinmux_init(void)
 {
-       tegra_pinmux_config_table(cardhu_pinmux, ARRAY_SIZE(cardhu_pinmux));
+       struct board_info board_info;
+       tegra_pinmux_config_table(cardhu_pinmux_common, ARRAY_SIZE(cardhu_pinmux_common));
        tegra_drive_pinmux_config_table(cardhu_drive_pinmux,
                                        ARRAY_SIZE(cardhu_drive_pinmux));
+
+       tegra_get_board_info(&board_info);
+       switch (board_info.board_id) {
+       case BOARD_E1198:
+               tegra_pinmux_config_table(cardhu_pinmux_cardhu,
+                                       ARRAY_SIZE(cardhu_pinmux_cardhu));
+               tegra_pinmux_config_table(cardhu_pinmux_e1198,
+                                       ARRAY_SIZE(cardhu_pinmux_e1198));
+               break;
+       case BOARD_E1291:
+               if (board_info.fab < 0x3)
+                       tegra_pinmux_config_table(cardhu_pinmux_cardhu,
+                                       ARRAY_SIZE(cardhu_pinmux_cardhu));
+               else
+                       tegra_pinmux_config_table(cardhu_pinmux_cardhu_a03,
+                                       ARRAY_SIZE(cardhu_pinmux_cardhu_a03));
+               break;
+       default:
+               tegra_pinmux_config_table(cardhu_pinmux_e118x,
+                                       ARRAY_SIZE(cardhu_pinmux_e118x));
+               break;
+       }
        return 0;
 }