ARM: tegra: make i2c driver as tegra12-i2c for T124
Laxman Dewangan [Thu, 22 Aug 2013 11:22:48 +0000 (16:22 +0530)]
Make Tegra I2C driver name as tegra12-i2c for the T124 SoCs.

Change-Id: Ib05b0e5ca61bb8bff97ff0bea533c5a822ed642f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/264893

arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-bonaire.c
arch/arm/mach-tegra/board-loki.c
arch/arm/mach-tegra/devices.c
arch/arm/mach-tegra/devices.h
arch/arm/mach-tegra/tegra12_clocks.c

index 9663a43..fe15479 100644 (file)
@@ -238,39 +238,21 @@ static void ardbeg_i2c_init(void)
 {
        struct board_info board_info;
        tegra_get_board_info(&board_info);
-#ifdef CONFIG_ARCH_TEGRA_11x_SOC
-#ifndef CONFIG_USE_OF
-       tegra11_i2c_device1.dev.platform_data = &ardbeg_i2c1_platform_data;
-       tegra11_i2c_device2.dev.platform_data = &ardbeg_i2c2_platform_data;
-       tegra11_i2c_device3.dev.platform_data = &ardbeg_i2c3_platform_data;
-       tegra11_i2c_device4.dev.platform_data = &ardbeg_i2c4_platform_data;
-       tegra11_i2c_device5.dev.platform_data = &ardbeg_i2c5_platform_data;
-
-       platform_device_register(&tegra11_i2c_device5);
-       platform_device_register(&tegra11_i2c_device4);
-       platform_device_register(&tegra11_i2c_device3);
-       platform_device_register(&tegra11_i2c_device2);
-       platform_device_register(&tegra11_i2c_device1);
-#endif
-#else
-       /* T124 does not use device tree as of now */
-       tegra14_i2c_device1.dev.platform_data = &ardbeg_i2c1_platform_data;
-       tegra14_i2c_device2.dev.platform_data = &ardbeg_i2c2_platform_data;
-       tegra14_i2c_device3.dev.platform_data = &ardbeg_i2c3_platform_data;
-       tegra14_i2c_device4.dev.platform_data = &ardbeg_i2c4_platform_data;
-       tegra14_i2c_device5.dev.platform_data = &ardbeg_i2c5_platform_data;
-
-       platform_device_register(&tegra14_i2c_device5);
-       platform_device_register(&tegra14_i2c_device4);
-       platform_device_register(&tegra14_i2c_device3);
-       platform_device_register(&tegra14_i2c_device2);
-       platform_device_register(&tegra14_i2c_device1);
-#endif
 
-#if defined(CONFIG_ARCH_TEGRA_12x_SOC) || !defined(CONFIG_USE_OF)
+       tegra12_i2c_device1.dev.platform_data = &ardbeg_i2c1_platform_data;
+       tegra12_i2c_device2.dev.platform_data = &ardbeg_i2c2_platform_data;
+       tegra12_i2c_device3.dev.platform_data = &ardbeg_i2c3_platform_data;
+       tegra12_i2c_device4.dev.platform_data = &ardbeg_i2c4_platform_data;
+       tegra12_i2c_device5.dev.platform_data = &ardbeg_i2c5_platform_data;
+
+       platform_device_register(&tegra12_i2c_device5);
+       platform_device_register(&tegra12_i2c_device4);
+       platform_device_register(&tegra12_i2c_device3);
+       platform_device_register(&tegra12_i2c_device2);
+       platform_device_register(&tegra12_i2c_device1);
+
        i2c_register_board_info(0, &rt5639_board_info, 1);
        i2c_register_board_info(0, &rt5645_board_info, 1);
-#endif
 
        if (board_info.board_id == BOARD_PM359 ||
                        board_info.board_id == BOARD_PM358 ||
index e20f5b0..f58fc86 100644 (file)
@@ -203,21 +203,21 @@ static struct tegra_i2c_platform_data bonaire_i2c6_platform_data = {
 
 static void bonaire_i2c_init(void)
 {
-       tegra14_i2c_device1.dev.platform_data = &bonaire_i2c1_platform_data;
-       tegra14_i2c_device2.dev.platform_data = &bonaire_i2c2_platform_data;
-       tegra14_i2c_device3.dev.platform_data = &bonaire_i2c3_platform_data;
-       tegra14_i2c_device4.dev.platform_data = &bonaire_i2c4_platform_data;
-       tegra14_i2c_device5.dev.platform_data = &bonaire_i2c5_platform_data;
-       tegra14_i2c_device6.dev.platform_data = &bonaire_i2c6_platform_data;
+       tegra12_i2c_device1.dev.platform_data = &bonaire_i2c1_platform_data;
+       tegra12_i2c_device2.dev.platform_data = &bonaire_i2c2_platform_data;
+       tegra12_i2c_device3.dev.platform_data = &bonaire_i2c3_platform_data;
+       tegra12_i2c_device4.dev.platform_data = &bonaire_i2c4_platform_data;
+       tegra12_i2c_device5.dev.platform_data = &bonaire_i2c5_platform_data;
+       tegra12_i2c_device6.dev.platform_data = &bonaire_i2c6_platform_data;
 
        i2c_register_board_info(0, bonaire_i2c_bus1_board_info, 1);
 
-       platform_device_register(&tegra14_i2c_device6);
-       platform_device_register(&tegra14_i2c_device5);
-       platform_device_register(&tegra14_i2c_device4);
-       platform_device_register(&tegra14_i2c_device3);
-       platform_device_register(&tegra14_i2c_device2);
-       platform_device_register(&tegra14_i2c_device1);
+       platform_device_register(&tegra12_i2c_device6);
+       platform_device_register(&tegra12_i2c_device5);
+       platform_device_register(&tegra12_i2c_device4);
+       platform_device_register(&tegra12_i2c_device3);
+       platform_device_register(&tegra12_i2c_device2);
+       platform_device_register(&tegra12_i2c_device1);
 }
 
 static void bonaire_apbdma_init(void)
index 1960412..83ef8af 100644 (file)
@@ -235,32 +235,20 @@ static void loki_i2c_init(void)
 {
        struct board_info board_info;
        tegra_get_board_info(&board_info);
-       /* T124 does not use device tree as of now */
-       tegra14_i2c_device1.dev.platform_data = &loki_i2c1_platform_data;
-       tegra14_i2c_device2.dev.platform_data = &loki_i2c2_platform_data;
-       tegra14_i2c_device3.dev.platform_data = &loki_i2c3_platform_data;
-       tegra14_i2c_device4.dev.platform_data = &loki_i2c4_platform_data;
-       tegra14_i2c_device5.dev.platform_data = &loki_i2c5_platform_data;
-
-       platform_device_register(&tegra14_i2c_device5);
-       platform_device_register(&tegra14_i2c_device4);
-       platform_device_register(&tegra14_i2c_device3);
-       platform_device_register(&tegra14_i2c_device2);
-       platform_device_register(&tegra14_i2c_device1);
 
-#if defined(CONFIG_ARCH_TEGRA_12x_SOC) || !defined(CONFIG_USE_OF)
-       i2c_register_board_info(0, &rt5639_board_info, 1);
-#endif
+       tegra12_i2c_device1.dev.platform_data = &loki_i2c1_platform_data;
+       tegra12_i2c_device2.dev.platform_data = &loki_i2c2_platform_data;
+       tegra12_i2c_device3.dev.platform_data = &loki_i2c3_platform_data;
+       tegra12_i2c_device4.dev.platform_data = &loki_i2c4_platform_data;
+       tegra12_i2c_device5.dev.platform_data = &loki_i2c5_platform_data;
 
-       if (board_info.board_id == BOARD_PM359 ||
-                       board_info.board_id == BOARD_PM358 ||
-                       board_info.board_id == BOARD_PM363) {
-               i2c_keyboard_board_info.irq = gpio_to_irq(I2C_KB_IRQ);
-               i2c_register_board_info(1, &i2c_keyboard_board_info , 1);
+       platform_device_register(&tegra12_i2c_device5);
+       platform_device_register(&tegra12_i2c_device4);
+       platform_device_register(&tegra12_i2c_device3);
+       platform_device_register(&tegra12_i2c_device2);
+       platform_device_register(&tegra12_i2c_device1);
 
-               i2c_touchpad_board_info.irq = gpio_to_irq(I2C_TP_IRQ);
-               i2c_register_board_info(1, &i2c_touchpad_board_info , 1);
-       }
+       i2c_register_board_info(0, &rt5639_board_info, 1);
 }
 
 #ifndef CONFIG_USE_OF
index f44b438..22f2f37 100644 (file)
@@ -579,7 +579,7 @@ struct platform_device tegra11_i2c_device5 = {
 };
 #endif
 
-#if defined(CONFIG_ARCH_TEGRA_14x_SOC) || defined(CONFIG_ARCH_TEGRA_12x_SOC)
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
 
 struct platform_device tegra14_i2c_device1 = {
        .name           = "tegra14-i2c",
@@ -643,6 +643,68 @@ struct platform_device tegra14_i2c_device6 = {
 
 #endif
 
+#if defined(CONFIG_ARCH_TEGRA_12x_SOC)
+struct platform_device tegra12_i2c_device1 = {
+       .name           = "tegra12-i2c",
+       .id             = 0,
+       .resource       = i2c_resource1,
+       .num_resources  = ARRAY_SIZE(i2c_resource1),
+       .dev = {
+               .platform_data = 0,
+       },
+};
+
+struct platform_device tegra12_i2c_device2 = {
+       .name           = "tegra12-i2c",
+       .id             = 1,
+       .resource       = i2c_resource2,
+       .num_resources  = ARRAY_SIZE(i2c_resource2),
+       .dev = {
+               .platform_data = 0,
+       },
+};
+
+struct platform_device tegra12_i2c_device3 = {
+       .name           = "tegra12-i2c",
+       .id             = 2,
+       .resource       = i2c_resource3,
+       .num_resources  = ARRAY_SIZE(i2c_resource3),
+       .dev = {
+               .platform_data = 0,
+       },
+};
+
+struct platform_device tegra12_i2c_device4 = {
+       .name           = "tegra12-i2c",
+       .id             = 3,
+       .resource       = i2c_resource4,
+       .num_resources  = ARRAY_SIZE(i2c_resource4),
+       .dev = {
+               .platform_data = 0,
+       },
+};
+
+struct platform_device tegra12_i2c_device5 = {
+       .name           = "tegra12-i2c",
+       .id             = 4,
+       .resource       = i2c_resource5,
+       .num_resources  = ARRAY_SIZE(i2c_resource5),
+       .dev = {
+               .platform_data = 0,
+       },
+};
+
+struct platform_device tegra12_i2c_device6 = {
+       .name           = "tegra12-i2c",
+       .id             = 5,
+       .resource       = i2c_resource6,
+       .num_resources  = ARRAY_SIZE(i2c_resource6),
+       .dev = {
+               .platform_data = 0,
+       },
+};
+#endif
+
 #if defined(CONFIG_ARCH_TEGRA_14x_SOC)
 
 static struct tegra_mipi_bif_platform_data mipi_bif_pdata = {
index 87e2335..c3b3ca7 100644 (file)
@@ -179,13 +179,13 @@ extern struct platform_device tegra14_i2c_device6;
 extern struct platform_device tegra_mipi_bif_device;
 #endif
 
-#if defined(CONFIG_ARCH_TEGRA_14x_SOC) || defined(CONFIG_ARCH_TEGRA_12x_SOC)
-extern struct platform_device tegra14_i2c_device1;
-extern struct platform_device tegra14_i2c_device2;
-extern struct platform_device tegra14_i2c_device3;
-extern struct platform_device tegra14_i2c_device4;
-extern struct platform_device tegra14_i2c_device5;
-extern struct platform_device tegra14_i2c_device6;
+#if defined(CONFIG_ARCH_TEGRA_12x_SOC)
+extern struct platform_device tegra12_i2c_device1;
+extern struct platform_device tegra12_i2c_device2;
+extern struct platform_device tegra12_i2c_device3;
+extern struct platform_device tegra12_i2c_device4;
+extern struct platform_device tegra12_i2c_device5;
+extern struct platform_device tegra12_i2c_device6;
 #endif
 
 void __init tegra_init_debug_uart_rate(void);
index bcf219d..af41b61 100644 (file)
@@ -7179,12 +7179,12 @@ struct clk tegra_list_clks[] = {
        PERIPH_CLK("owr",       "tegra_w1",             NULL,   71,     0x1cc,  26000000,  mux_pllp_pllc_pllm_clkm,     MUX | DIV_U71 | PERIPH_ON_APB),
        PERIPH_CLK("nor",       "tegra-nor",            NULL,   42,     0x1d0,  127000000, mux_pllp_pllc_pllm_clkm,     MUX | DIV_U71),
        PERIPH_CLK("mipi",      "mipi",                 NULL,   50,     0x174,  60000000,  mux_pllp_pllc_pllm_clkm,     MUX | DIV_U71 | PERIPH_ON_APB),
-       PERIPH_CLK("i2c1",      "tegra14-i2c.0",        "div-clk",      12,     0x124,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
-       PERIPH_CLK("i2c2",      "tegra14-i2c.1",        "div-clk",      54,     0x198,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
-       PERIPH_CLK("i2c3",      "tegra14-i2c.2",        "div-clk",      67,     0x1b8,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
-       PERIPH_CLK("i2c4",      "tegra14-i2c.3",        "div-clk",      103,    0x3c4,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
-       PERIPH_CLK("i2c5",      "tegra14-i2c.4",        "div-clk",      47,     0x128,  58300000,  mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
-       PERIPH_CLK("i2c6",      "tegra14-i2c.5",        "div-clk",      166,    0x65c,  58300000,  mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
+       PERIPH_CLK("i2c1",      "tegra12-i2c.0",        "div-clk",      12,     0x124,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
+       PERIPH_CLK("i2c2",      "tegra12-i2c.1",        "div-clk",      54,     0x198,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
+       PERIPH_CLK("i2c3",      "tegra12-i2c.2",        "div-clk",      67,     0x1b8,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
+       PERIPH_CLK("i2c4",      "tegra12-i2c.3",        "div-clk",      103,    0x3c4,  136000000, mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
+       PERIPH_CLK("i2c5",      "tegra12-i2c.4",        "div-clk",      47,     0x128,  58300000,  mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
+       PERIPH_CLK("i2c6",      "tegra12-i2c.5",        "div-clk",      166,    0x65c,  58300000,  mux_pllp_clkm,       MUX | DIV_U16 | PERIPH_ON_APB),
        PERIPH_CLK("mipi-cal",  "mipi-cal",             NULL,   56,     0,      60000000,  mux_clk_m,   0),
        PERIPH_CLK("mipi-cal-fixed", "mipi-cal-fixed",  NULL,   0,      0,      108000000, mux_pllp_out3,       PERIPH_NO_ENB),
        PERIPH_CLK("uarta",     "serial-tegra.0",               NULL,   6,      0x178,  800000000, mux_pllp_pllc_pllm_clkm,     MUX | DIV_U151 | DIV_U151_UART | PERIPH_ON_APB),