static void __init tegra_mot_init(void) { tegra_common_init(); tegra_setup_nvodm(true, true); tegra_register_socdev(); #ifdef CONFIG_APANIC_RAM apanic_ram_init(); #endif #ifdef CONFIG_APANIC_MMC apanic_mmc_init(); #endif mot_setup_power(); mot_setup_lights(&tegra_i2c_bus0_board_info[BACKLIGHT_DEV]); mot_setup_touch(&tegra_i2c_bus0_board_info[TOUCHSCREEN_DEV]); mot_sec_init(); mot_tcmd_init(); mot_setup_gadget(); if(machine_is_olympus()) { tegra_uart_platform[UART_IPC_OLYMPUS].uart_ipc = 1; tegra_uart_platform[UART_IPC_OLYMPUS].uart_wake_host = TEGRA_GPIO_PA0; tegra_uart_platform[UART_IPC_OLYMPUS].uart_wake_request = TEGRA_GPIO_PF1; tegra_uart_platform[UART_IPC_OLYMPUS].peer_register = mot_mdm_ctrl_peer_register; } else if(machine_is_etna()) { if (HWREV_TYPE_IS_BRASSBOARD(system_rev)) { /* The modem is dead on S2, which makes the UART angry. */ tegra_uart_platform[UART_IPC_ETNA].uart_ipc = 0; tegra_uart_platform[UART_IPC_ETNA].p.irq = ~0; } else { tegra_uart_platform[UART_IPC_ETNA].uart_ipc = 1; tegra_uart_platform[UART_IPC_ETNA].uart_wake_host = TEGRA_GPIO_PA0; tegra_uart_platform[UART_IPC_ETNA].uart_wake_request = TEGRA_GPIO_PF1; tegra_uart_platform[UART_IPC_ETNA].peer_register = mot_mdm_ctrl_peer_register; } } else if(machine_is_tegra_daytona()) { tegra_uart_platform[UART_IPC_DAYTONA].uart_ipc = 1; tegra_uart_platform[UART_IPC_DAYTONA].uart_wake_host = TEGRA_GPIO_PA0; tegra_uart_platform[UART_IPC_DAYTONA].uart_wake_request = TEGRA_GPIO_PF1; tegra_uart_platform[UART_IPC_DAYTONA].peer_register = mot_mdm_ctrl_peer_register; } else if(machine_is_sunfire()) { tegra_uart_platform[UART_IPC_SUNFIRE].uart_ipc = 1; tegra_uart_platform[UART_IPC_SUNFIRE].uart_wake_host = TEGRA_GPIO_PA0; tegra_uart_platform[UART_IPC_SUNFIRE].uart_wake_request = TEGRA_GPIO_PF1; tegra_uart_platform[UART_IPC_SUNFIRE].peer_register = mot_mdm_ctrl_peer_register; } if( (bi_powerup_reason() & PWRUP_FACTORY_CABLE) && (bi_powerup_reason() != PWRUP_INVALID) ){ #ifdef NEED_FACT_BUSY_HINT FactoryBusyHint(); //factory workaround no longer needed #endif } mot_modem_init(); (void) platform_driver_register(&cpcap_usb_connected_driver); #ifdef CONFIG_MOT_WIMAX mot_wimax_gpio_init(); #endif mot_wlan_init(); mot_sensors_init(); mot_nvodmcam_init(); printk("%s: registering i2c devices...\n", __func__); if(!(bi_powerup_reason() & PWRUP_BAREBOARD)) { printk("bus 0: %d devices\n", ARRAY_SIZE(tegra_i2c_bus0_board_info)); i2c_register_board_info(0, tegra_i2c_bus0_board_info, ARRAY_SIZE(tegra_i2c_bus0_board_info)); } if (machine_is_etna() || machine_is_tegra_daytona() || machine_is_sunfire()) { printk("bus 2: %d devices\n", ARRAY_SIZE(tegra_i2c_bus2_board_info)); i2c_register_board_info(2, tegra_i2c_bus2_board_info, ARRAY_SIZE(tegra_i2c_bus2_board_info)); } printk("bus 3: %d devices\n", ARRAY_SIZE(tegra_i2c_bus3_board_info)); i2c_register_board_info(3, tegra_i2c_bus3_board_info, ARRAY_SIZE(tegra_i2c_bus3_board_info)); if (machine_is_olympus()){ /* console UART can be routed to 'headset jack by setting HSJ mux to 0*/ short hsj_mux_gpio=1; if ( HWREV_TYPE_IS_DEBUG(system_rev) ){ printk("%s: Enabling console on headset jack\n", __FUNCTION__); hsj_mux_gpio=0; } mot_set_hsj_mux( hsj_mux_gpio ); } pm_power_off = mot_system_power_off; tegra_setup_bluesleep(); /* Configure SPDIF_OUT as GPIO by default, it can be later controlled as needed. When SPDIF_OUT is enabled and if HDMI is connected, it can interefere with CPCAP ID pin, as SPDIF_OUT and ID are coupled. */ tegra_gpio_enable(TEGRA_GPIO_PD4); gpio_request(TEGRA_GPIO_PD4, "spdif_enable"); gpio_direction_output(TEGRA_GPIO_PD4, 0); gpio_export(TEGRA_GPIO_PD4, false); if (machine_is_olympus() && (HWREV_TYPE_IS_PORTABLE(system_rev) || HWREV_TYPE_IS_FINAL(system_rev))) { if (HWREV_REV(system_rev) >= HWREV_REV_1 && HWREV_REV(system_rev) < HWREV_REV_2) { // Olympus P1 config_unused_pins(oly_unused_pins_p1, ARRAY_SIZE(oly_unused_pins_p1)); } else if (HWREV_REV(system_rev) >= HWREV_REV_2 && HWREV_REV(system_rev) < HWREV_REV_3) { // Olympus P2 config_unused_pins(oly_unused_pins_p2, ARRAY_SIZE(oly_unused_pins_p2)); } else if (HWREV_REV(system_rev) >= HWREV_REV_3 || HWREV_TYPE_IS_FINAL(system_rev)) { // Olympus P3 and newer config_unused_pins(oly_unused_pins_p3, ARRAY_SIZE(oly_unused_pins_p3)); } } if (machine_is_etna()) { if (HWREV_TYPE_IS_PORTABLE(system_rev) && (HWREV_REV(system_rev) >= HWREV_REV_2) && (HWREV_REV(system_rev) < HWREV_REV_2C)) { config_unused_pins(etna_unused_pins_p2a, ARRAY_SIZE(etna_unused_pins_p2a)); } else if ((HWREV_TYPE_IS_PORTABLE(system_rev) && HWREV_REV(system_rev) >= HWREV_REV_2C) || (HWREV_TYPE_IS_MORTABLE(system_rev) && HWREV_REV(system_rev) >= HWREV_REV_3) || HWREV_TYPE_IS_FINAL(system_rev)) { config_unused_pins(etna_unused_pins_p2c, ARRAY_SIZE(etna_unused_pins_p2c)); } } if (machine_is_tegra_daytona()) config_unused_pins(daytona_unused_pins_p1, ARRAY_SIZE(daytona_unused_pins_p1)); if (machine_is_etna() || machine_is_tegra_daytona() || machine_is_sunfire()) // UTS tool support mot_keymap_update_init(); }
static void __init tegra_mot_init(void) { get_gpio_settings(); tegra_common_init(); get_gpio_settings(); tegra_setup_nvodm(true, true); get_gpio_settings(); tegra_register_socdev(); get_gpio_settings(); #if 0 #ifdef CONFIG_APANIC_RAM apanic_ram_init(); #endif #endif #ifdef CONFIG_APANIC_MMC apanic_mmc_init(); #endif get_gpio_settings(); mot_setup_power(); /* mot_setup_lights(&tegra_i2c_bus0_board_info[BACKLIGHT_DEV]); mot_setup_touch(&tegra_i2c_bus0_board_info[TOUCHSCREEN_DEV]);*/ /* mot_sec_init(); mot_tcmd_init();*/ get_gpio_settings(); mot_setup_gadget(); tegra_uart_platform[UART_IPC_OLYMPUS].uart_ipc = 1; tegra_uart_platform[UART_IPC_OLYMPUS].uart_wake_host = TEGRA_GPIO_PA0; tegra_uart_platform[UART_IPC_OLYMPUS].uart_wake_request = TEGRA_GPIO_PF1; #ifdef CONFIG_MDM_CTRL tegra_uart_platform[UART_IPC_OLYMPUS].peer_register = mot_mdm_ctrl_peer_register; #endif #ifdef CONFIG_BOOTINFO if( (bi_powerup_reason() & PWRUP_FACTORY_CABLE) && (bi_powerup_reason() != PWRUP_INVALID) ){ #ifdef NEED_FACT_BUSY_HINT FactoryBusyHint(); //factory workaround no longer needed #endif } #endif /* mot_modem_init();*/ (void) platform_driver_register(&cpcap_usb_connected_driver); /* mot_wlan_init(); mot_sensors_init(); mot_nvodmcam_init();*/ printk("%s: registering i2c devices...\n", __func__); #ifdef CONFIG_BOOTINFO if(!(bi_powerup_reason() & PWRUP_BAREBOARD)) { printk("bus 0: %d devices\n", ARRAY_SIZE(tegra_i2c_bus0_board_info)); i2c_register_board_info(0, tegra_i2c_bus0_board_info, ARRAY_SIZE(tegra_i2c_bus0_board_info)); } #else printk("bus 0: %d devices\n", ARRAY_SIZE(tegra_i2c_bus0_board_info)); i2c_register_board_info(0, tegra_i2c_bus0_board_info, ARRAY_SIZE(tegra_i2c_bus0_board_info)); #endif printk("bus 3: %d devices\n", ARRAY_SIZE(tegra_i2c_bus3_board_info)); i2c_register_board_info(3, tegra_i2c_bus3_board_info, ARRAY_SIZE(tegra_i2c_bus3_board_info)); /* console UART can be routed to 'headset jack by setting HSJ mux to 0*/ short hsj_mux_gpio=1; if ( HWREV_TYPE_IS_DEBUG(system_rev) || ENABLE_JACK_UART ){ printk("%s: Enabling console on headset jack\n", __FUNCTION__); hsj_mux_gpio=0; } mot_set_hsj_mux( hsj_mux_gpio ); pm_power_off = mot_system_power_off; tegra_setup_bluesleep(); /* Configure SPDIF_OUT as GPIO by default, it can be later controlled as needed. When SPDIF_OUT is enabled and if HDMI is connected, it can interefere with CPCAP ID pin, as SPDIF_OUT and ID are coupled. */ tegra_gpio_enable(TEGRA_GPIO_PD4); gpio_request(TEGRA_GPIO_PD4, "spdif_enable"); gpio_direction_output(TEGRA_GPIO_PD4, 0); gpio_export(TEGRA_GPIO_PD4, false); if ((HWREV_TYPE_IS_PORTABLE(system_rev) || HWREV_TYPE_IS_FINAL(system_rev))) { if (HWREV_REV(system_rev) >= HWREV_REV_1 && HWREV_REV(system_rev) < HWREV_REV_2) { // Olympus P1 config_unused_pins(oly_unused_pins_p1, ARRAY_SIZE(oly_unused_pins_p1)); } else if (HWREV_REV(system_rev) >= HWREV_REV_2 && HWREV_REV(system_rev) < HWREV_REV_3) { // Olympus P2 config_unused_pins(oly_unused_pins_p2, ARRAY_SIZE(oly_unused_pins_p2)); } else if (HWREV_REV(system_rev) >= HWREV_REV_3 || HWREV_TYPE_IS_FINAL(system_rev)) { // Olympus P3 and newer config_unused_pins(oly_unused_pins_p3, ARRAY_SIZE(oly_unused_pins_p3)); } } get_gpio_settings(); }