struct device_node *tegra_panel_get_dt_node( struct tegra_dc_platform_data *pdata) { struct tegra_dc_out *dc_out = pdata->default_out; struct device_node *np_panel = NULL; struct board_info display_board; tegra_get_display_board_info(&display_board); switch (display_board.board_id) { case BOARD_E1627: tegra_panel_register_ops(dc_out, &dsi_p_wuxga_10_1_ops); np_panel = of_find_compatible_node(NULL, NULL, "p,wuxga-10-1"); break; case BOARD_E1549: tegra_panel_register_ops(dc_out, &dsi_lgd_wxga_7_0_ops); np_panel = of_find_compatible_node(NULL, NULL, "lg,wxga-7"); break; case BOARD_E1639: case BOARD_E1813: tegra_panel_register_ops(dc_out, &dsi_s_wqxga_10_1_ops); np_panel = of_find_compatible_node(NULL, NULL, "s,wqxga-10-1"); break; default: WARN(1, "Display panel not supported\n"); }; return of_device_is_available(np_panel) ? np_panel : NULL; }
static int __init ardbeg_fixed_regulator_init(void) { struct board_info pmu_board_info; struct board_info display_board_info; if ((!of_machine_is_compatible("nvidia,ardbeg")) && (!of_machine_is_compatible("nvidia,ardbeg_sata"))) return 0; tegra_get_display_board_info(&display_board_info); if (display_board_info.board_id == BOARD_E1824) platform_add_devices(fixed_reg_devs_e1824, ARRAY_SIZE(fixed_reg_devs_e1824)); tegra_get_pmu_board_info(&pmu_board_info); if (pmu_board_info.board_id == BOARD_E1733) return platform_add_devices(fixed_reg_devs_e1733, ARRAY_SIZE(fixed_reg_devs_e1733)); else if (pmu_board_info.board_id == BOARD_E1735) return platform_add_devices(fixed_reg_devs_e1735, ARRAY_SIZE(fixed_reg_devs_e1735)); else if (pmu_board_info.board_id == BOARD_E1736 || pmu_board_info.board_id == BOARD_P1761 || pmu_board_info.board_id == BOARD_E1936) return 0; else pr_warn("The PMU board id 0x%04x is not supported\n", pmu_board_info.board_id); return 0; }
static void __init tegranote7c_spi_init(void) { int i; struct clk *c; struct board_info board_info, display_board_info; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); for (i = 0; i < ARRAY_SIZE(spi_parent_clk_tegranote7c); ++i) { c = tegra_get_clock_by_name(spi_parent_clk_tegranote7c[i].name); if (IS_ERR_OR_NULL(c)) { pr_err("Not able to get the clock for %s\n", spi_parent_clk_tegranote7c[i].name); continue; } spi_parent_clk_tegranote7c[i].parent_clk = c; spi_parent_clk_tegranote7c[i].fixed_clk_rate = clk_get_rate(c); } tegranote7c_spi_pdata.parent_clk_list = spi_parent_clk_tegranote7c; tegranote7c_spi_pdata.parent_clk_count = ARRAY_SIZE(spi_parent_clk_tegranote7c); tegranote7c_spi_pdata.is_dma_based = (tegra_revision == TEGRA_REVISION_A01) ? false : true; tegra11_spi_device1.dev.platform_data = &tegranote7c_spi_pdata; platform_add_devices(tegranote7c_spi_devices, ARRAY_SIZE(tegranote7c_spi_devices)); }
void __init tn8_new_sysedp_init(void) { int r; struct board_info board; tegra_get_display_board_info(&board); /* Some TN8 boards use non-default display */ switch (board.board_id) { case BOARD_E1797: memcpy(pwm_backlight_default_states, pwm_backlight_10_states, sizeof(pwm_backlight_default_states)); break; case BOARD_E1549: case BOARD_E1807: memcpy(pwm_backlight_default_states, pwm_backlight_8_12x8_states, sizeof(pwm_backlight_default_states)); break; default: pr_warn("%s: Unknown tn8 display board id, 0x%x! Assuming E1937.\n", __func__, board.board_id); case BOARD_E1937: break; } r = platform_device_register(&tn8_sysedp_device); WARN_ON(r); }
/* Initialize the pins to desired state as per power/asic/system-eng * recomendation */ int __init cardhu_pins_state_init(void) { struct board_info board_info; struct board_info display_board_info; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); if ((board_info.board_id == BOARD_E1291) || (board_info.board_id == BOARD_E1198)) { set_unused_pin_gpio(&pin_lpm_cardhu_common[0], ARRAY_SIZE(pin_lpm_cardhu_common)); if (display_board_info.board_id != BOARD_DISPLAY_PM313) { set_unused_pin_gpio(&pin_lpm_cardhu_common_wo_pm313[0], ARRAY_SIZE(pin_lpm_cardhu_common_wo_pm313)); } } if ((board_info.board_id == BOARD_PM269) || (board_info.board_id == BOARD_E1257) || (board_info.board_id == BOARD_PM305) || (board_info.board_id == BOARD_PM311)) { set_unused_pin_gpio(&vddio_gmi_pins_pm269[0], ARRAY_SIZE(vddio_gmi_pins_pm269)); if (display_board_info.board_id != BOARD_DISPLAY_PM313) { set_unused_pin_gpio(&vddio_gmi_pins_pm269_wo_pm313[0], ARRAY_SIZE(vddio_gmi_pins_pm269_wo_pm313)); } } return 0; }
static int __init cardhu_touch_init(void) { struct board_info BoardInfo, DisplayBoardInfo; tegra_get_board_info(&BoardInfo); tegra_get_display_board_info(&DisplayBoardInfo); if (DisplayBoardInfo.board_id == BOARD_DISPLAY_PM313) { tegra_clk_init_from_table(spi_clk_init_table); touch_init_raydium(TEGRA_GPIO_PH4, TEGRA_GPIO_PH6, 2); } else { gpio_request(TEGRA_GPIO_PH4, "atmel-irq"); gpio_direction_input(TEGRA_GPIO_PH4); gpio_request(TEGRA_GPIO_PH6, "atmel-reset"); gpio_direction_output(TEGRA_GPIO_PH6, 0); msleep(1); gpio_set_value(TEGRA_GPIO_PH6, 1); msleep(100); if ((BoardInfo.sku & SKU_TOUCH_MASK) == SKU_TOUCH_2000) { atmel_mxt_info.config = config_sku2000; atmel_mxt_info.config_crc = MXT_CONFIG_CRC_SKU2000; } if (DisplayBoardInfo.board_id == BOARD_DISPLAY_E1506) i2c_register_board_info(1, e1506_atmel_i2c_info, 1); else i2c_register_board_info(1, atmel_i2c_info, 1); } return 0; }
static void __init macallan_spi_init(void) { int i; struct clk *c; struct board_info board_info, display_board_info; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); for (i = 0; i < ARRAY_SIZE(spi_parent_clk_macallan); ++i) { c = tegra_get_clock_by_name(spi_parent_clk_macallan[i].name); if (IS_ERR_OR_NULL(c)) { pr_err("Not able to get the clock for %s\n", spi_parent_clk_macallan[i].name); continue; } spi_parent_clk_macallan[i].parent_clk = c; spi_parent_clk_macallan[i].fixed_clk_rate = clk_get_rate(c); } macallan_spi_pdata.parent_clk_list = spi_parent_clk_macallan; macallan_spi_pdata.parent_clk_count = ARRAY_SIZE(spi_parent_clk_macallan); tegra11_spi_device1.dev.platform_data = &macallan_spi_pdata; platform_add_devices(macallan_spi_devices, ARRAY_SIZE(macallan_spi_devices)); }
static void pluto_panel_select(void) { struct tegra_panel *panel; struct board_info board; u8 dsi_instance = 0; tegra_get_display_board_info(&board); switch (board.board_id) { case BOARD_E1605: panel = &dsi_j_720p_4_7; dsi_instance = DSI_INSTANCE_1; break; case BOARD_E1577: panel = &dsi_s_1080p_5; break; case BOARD_E1582: default: if (tegra_get_board_panel_id()) { panel = &dsi_s_1080p_5; dsi_instance = DSI_INSTANCE_1; } else { panel = &dsi_l_720p_5; dsi_instance = DSI_INSTANCE_0; } break; } if (panel->init_sd_settings) panel->init_sd_settings(&sd_settings); if (panel->init_dc_out) { panel->init_dc_out(&pluto_disp1_out); pluto_disp1_out.dsi->dsi_instance = dsi_instance; pluto_disp1_out.dsi->dsi_panel_rst_gpio = DSI_PANEL_RST_GPIO; pluto_disp1_out.dsi->dsi_panel_bl_en_gpio = DSI_PANEL_BL_EN_GPIO; pluto_disp1_out.dsi->dsi_panel_bl_pwm_gpio = DSI_PANEL_BL_PWM_GPIO; /* update the init cmd if dependent on reset GPIO */ tegra_dsi_update_init_cmd_gpio_rst(&pluto_disp1_out); } if (panel->init_fb_data) panel->init_fb_data(&pluto_disp1_fb_data); if (panel->init_cmu_data) panel->init_cmu_data(&pluto_disp1_pdata); if (panel->set_disp_device) panel->set_disp_device(&pluto_disp1_device); tegra_dsi_resources_init(dsi_instance, pluto_disp1_resources, ARRAY_SIZE(pluto_disp1_resources)); if (panel->register_bl_dev) panel->register_bl_dev(); }
static void dsi_l_720p_5_sd_settings_init(struct tegra_dc_sd_settings *settings) { struct board_info bi; tegra_get_display_board_info(&bi); if (bi.board_id == BOARD_E1563) settings->bl_device_name = "lm3528_display_bl"; else settings->bl_device_name = "max8831_display_bl"; }
static void __init tegra_dalmore_dt_init(void) { tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); tegra_dalmore_early_init(); of_platform_populate(NULL, of_default_bus_match_table, dalmore_auxdata_lookup, &platform_bus); tegra_dalmore_late_init(); }
static void loki_panel_select(void) { struct tegra_panel *panel; struct board_info board; u8 dsi_instance = DSI_INSTANCE_0; tegra_get_display_board_info(&board); switch (board.fab) { case 0x2: panel = &dsi_j_720p_5; break; case 0x1: panel = &dsi_j_1440_810_5_8; break; case 0x0: default: panel = &dsi_l_720p_5_loki; break; } tegra_io_dpd_enable(&dsic_io); tegra_io_dpd_enable(&dsid_io); if (panel) { if (panel->init_sd_settings) panel->init_sd_settings(&sd_settings); if (panel->init_dc_out) { panel->init_dc_out(&loki_disp1_out); loki_disp1_out.dsi->dsi_instance = dsi_instance; loki_disp1_out.dsi->dsi_panel_rst_gpio = DSI_PANEL_RST_GPIO; loki_disp1_out.dsi->dsi_panel_bl_pwm_gpio = DSI_PANEL_BL_PWM_GPIO; tegra_dsi_update_init_cmd_gpio_rst(&loki_disp1_out); } if (panel->init_fb_data) panel->init_fb_data(&loki_disp1_fb_data); if (panel->init_cmu_data) panel->init_cmu_data(&loki_disp1_pdata); if (panel->set_disp_device) panel->set_disp_device(&loki_disp1_device); if (panel->register_bl_dev) panel->register_bl_dev(); } }
static void __init tegra_loki_dt_init(void) { tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); tegra_loki_early_init(); #ifdef CONFIG_USE_OF of_platform_populate(NULL, of_default_bus_match_table, loki_auxdata_lookup, &platform_bus); #endif tegra_loki_late_init(); }
static void macallan_panel_select(void) { struct tegra_panel *panel = NULL; struct board_info board; u8 dsi_instance = DSI_INSTANCE_0; tegra_get_display_board_info(&board); switch (board.board_id) { case BOARD_E1639: panel = &dsi_s_wqxga_10_1; break; default: panel = &dsi_p_wuxga_10_1; break; } if (panel) { if (panel->init_sd_settings) panel->init_sd_settings(&sd_settings); if (panel->init_dc_out) { panel->init_dc_out(&macallan_disp1_out); macallan_disp1_out.dsi->dsi_instance = dsi_instance; macallan_disp1_out.dsi->dsi_panel_rst_gpio = DSI_PANEL_RST_GPIO; macallan_disp1_out.dsi->dsi_panel_bl_pwm_gpio = DSI_PANEL_BL_PWM_GPIO; } if (panel->init_fb_data) panel->init_fb_data(&macallan_disp1_fb_data); if (panel->init_cmu_data) panel->init_cmu_data(&macallan_disp1_pdata); if (panel->set_disp_device) panel->set_disp_device(&macallan_disp1_device); tegra_dsi_resources_init(dsi_instance, macallan_disp1_resources, ARRAY_SIZE(macallan_disp1_resources)); if (panel->register_bl_dev) panel->register_bl_dev(); if (panel->register_i2c_bridge) panel->register_i2c_bridge(); } }
static void dalmore_panel_select(void) { struct tegra_panel *panel = NULL; struct board_info board; tegra_get_display_board_info(&board); switch (board.board_id) { case BOARD_E1639: panel = &dsi_s_wqxga_10_1; break; case BOARD_E1631: panel = &dsi_a_1080p_11_6; break; case BOARD_E1627: /* fall through */ default: panel = &dsi_p_wuxga_10_1; break; } if (panel) { if (panel->init_sd_settings) panel->init_sd_settings(&sd_settings); if (panel->init_dc_out) panel->init_dc_out(&dalmore_disp1_out); if (panel->init_fb_data) panel->init_fb_data(&dalmore_disp1_fb_data); if (panel->init_cmu_data) panel->init_cmu_data(&dalmore_disp1_pdata); if (panel->set_disp_device) panel->set_disp_device(&dalmore_disp1_device); if (panel->init_resources) panel->init_resources(dalmore_disp1_resources, ARRAY_SIZE(dalmore_disp1_resources)); if (panel->register_bl_dev) panel->register_bl_dev(); if (panel->register_i2c_bridge) panel->register_i2c_bridge(); } }
static void dsi_s_1080p_5_sd_settings_init (struct tegra_dc_sd_settings *settings) { struct board_info bi; struct board_info board_info; tegra_get_display_board_info(&bi); tegra_get_board_info(&board_info); settings->bl_device_name = "pwm-backlight"; #if 0 if ((bi.board_id == BOARD_E1563) || (board_info.board_id == BOARD_E1740)) settings->bl_device_name = "lm3528_display_bl"; else settings->bl_device_name = "max8831_display_bl"; #endif }
static void __init tegra_macallan_dt_init(void) { tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); tegra_macallan_early_init(); #ifdef CONFIG_USE_OF of_platform_populate(NULL, of_default_bus_match_table, macallan_auxdata_lookup, &platform_bus); #else platform_device_register(&tegra_gpio_device); #endif tegra_macallan_late_init(); }
static int __init tegratab_touch_init(void) { struct board_info board_info; tegra_get_display_board_info(&board_info); tegra_clk_init_from_table(touch_clk_init_table); rm31080ts_tegratab_data.platform_id = RM_PLATFORM_D010; mdelay(20); rm31080a_tegratab_spi_board[0].irq = gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI); touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI, TOUCH_GPIO_RST_RAYDIUM_SPI, &rm31080ts_tegratab_data, &rm31080a_tegratab_spi_board[0], ARRAY_SIZE(rm31080a_tegratab_spi_board)); return 0; }
static void __init tegra_dalmore_init(void) { struct board_info board_info; tegra_get_display_board_info(&board_info); tegra_clk_init_from_table(dalmore_clk_init_table); tegra_clk_verify_parents(); tegra_soc_device_init("dalmore"); tegra_enable_pinmux(); dalmore_pinmux_init(); dalmore_i2c_init(); dalmore_spi_init(); dalmore_usb_init(); dalmore_xusb_init(); dalmore_uart_init(); dalmore_audio_init(); platform_add_devices(dalmore_devices, ARRAY_SIZE(dalmore_devices)); tegra_ram_console_debug_init(); tegra_io_dpd_init(); dalmore_regulator_init(); dalmore_sdhci_init(); dalmore_suspend_init(); dalmore_emc_init(); dalmore_edp_init(); dalmore_touch_init(); if (board_info.board_id == BOARD_E1582) roth_panel_init(board_info.board_id); else dalmore_panel_init(); dalmore_kbc_init(); dalmore_pmon_init(); #if defined(CONFIG_BT_BLUESLEEP) || defined(CONFIG_BT_BLUESLEEP_MODULE) dalmore_setup_bluesleep(); dalmore_setup_bt_rfkill(); #elif defined CONFIG_BLUEDROID_PM dalmore_setup_bluedroid_pm(); #endif dalmore_modem_init(); #ifdef CONFIG_TEGRA_WDT_RECOVERY tegra_wdt_recovery_init(); #endif dalmore_sensors_init(); dalmore_soctherm_init(); tegra_register_fuse(); }
static void __init tegra_loki_dt_init(void) { tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); tegra_loki_early_init(); #ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT carveout_linear_set(&tegra_generic_cma_dev); carveout_linear_set(&tegra_vpr_cma_dev); #endif #ifdef CONFIG_USE_OF of_platform_populate(NULL, of_default_bus_match_table, loki_auxdata_lookup, &platform_bus); #endif tegra_loki_late_init(); }
static void __init tegra_macallan_init(void) { struct board_info board_info; macallan_sysedp_init(); tegra_get_display_board_info(&board_info); tegra_clk_init_from_table(macallan_clk_init_table); tegra_clk_verify_parents(); tegra_soc_device_init("macallan"); tegra_enable_pinmux(); macallan_pinmux_init(); macallan_i2c_init(); macallan_spi_init(); macallan_usb_init(); macallan_uart_init(); macallan_audio_init(); platform_add_devices(macallan_devices, ARRAY_SIZE(macallan_devices)); tegra_ram_console_debug_init(); tegra_io_dpd_init(); macallan_regulator_init(); macallan_sdhci_init(); macallan_suspend_init(); macallan_emc_init(); macallan_edp_init(); macallan_touch_init(); macallan_panel_init(); macallan_kbc_init(); macallan_pmon_init(); #if defined CONFIG_TI_ST || defined CONFIG_TI_ST_MODULE macallan_bt_st(); macallan_tegra_setup_st_host_wake(); #endif macallan_modem_init(); #ifdef CONFIG_TEGRA_WDT_RECOVERY tegra_wdt_recovery_init(); #endif macallan_sensors_init(); macallan_soctherm_init(); tegra_register_fuse(); macallan_sysedp_core_init(); macallan_sysedp_psydepl_init(); }
static void __init loki_revision_init(struct board_info *binf) { struct board_info disp_board_info; system_rev = P2530_LOKI; tegra_get_display_board_info(&disp_board_info); if (!binf) return; if (binf->board_id == BOARD_E2548) { system_rev = E2548; } else if (binf->board_id == BOARD_E2549) { system_rev = E2549; } else if (binf->board_id == BOARD_P2530) { if (binf->sku == BOARD_SKU_FOSTER) system_rev = P2530_FOSTER; else if (disp_board_info.fab == 0x1) system_rev = P2530_LOKI_PREM; } }
static void keenhi_t40_panel_select(void) { struct tegra_panel *panel = NULL; struct board_info board; tegra_get_display_board_info(&board); switch (board.board_id) { case BOARD_E1639: // printk("------------------->>BOARD_E1639\n"); // panel = &dsi_s_wqxga_10_1; // break; default: if(machine_is_terra7()) panel = &dsi_p_900x1440_7_0; else if(machine_is_terra10()) panel = &dsi_a_1920x1200_11_6; else if(machine_is_tb610n()) panel = &dsi_u_1080p_11_6; else if(machine_is_t8400n()|| machine_is_keenhi01n()) #if defined(CONFIG_MACH_T8400N_8_3CM) { if(get_hw_ver_lcd() == 0x02) { panel = &dsi_p_1200x1920_8_0_boe; } else if(get_hw_ver_lcd() == 0x01) { panel = &dsi_p_1200x1920_8_0_cpt; } else { panel = &dsi_p_1200x1920_8_0;//dsi_p_1200x1920_8_3&dsi_a_1080p_11_1; } } #else panel = &dsi_u_1080p_11_6; #endif else panel = &dsi_p_1280x800_7_0; break; }
static void __init tegra_tegranote7c_late_init(void) { struct board_info board_info; tegra_get_display_board_info(&board_info); platform_device_register(&tegra_pinmux_device); tegranote7c_pinmux_init(); tegranote7c_i2c_init(); tegranote7c_spi_init(); tegranote7c_usb_init(); tegranote7c_uart_init(); platform_add_devices(tegranote7c_devices, ARRAY_SIZE(tegranote7c_devices)); tegra_ram_console_debug_init(); tegra_io_dpd_init(); tegranote7c_regulator_init(); tegranote7c_power_off_init(); tegranote7c_sdhci_init(); tegranote7c_suspend_init(); tegranote7c_emc_init(); tegranote7c_edp_init(); tegranote7c_touch_init(); tegranote7c_panel_init(); tegranote7c_kbc_init(); tegranote7c_pmon_init(); #if defined CONFIG_TI_ST || defined CONFIG_TI_ST_MODULE tegranote7c_bt_st(); tegranote7c_tegra_setup_st_host_wake(); #endif tegranote7c_modem_init(); #ifdef CONFIG_TEGRA_WDT_RECOVERY tegra_wdt_recovery_init(); #endif tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1); tegranote7c_sensors_init(); tegranote7c_soctherm_init(); tegra_register_fuse(); tegranote7c_sysedp_core_init(); }
static void mpuirq_init(void) { int ret = 0; unsigned gyro_irq_gpio = MPU_GYRO_IRQ_GPIO; unsigned gyro_bus_num = MPU_GYRO_BUS_NUM; char *gyro_name = MPU_GYRO_NAME; pr_info("*** MPU START *** mpuirq_init...\n"); ret = gpio_request(gyro_irq_gpio, gyro_name); if (ret < 0) { pr_err("%s: gpio_request failed %d\n", __func__, ret); return; } ret = gpio_direction_input(gyro_irq_gpio); if (ret < 0) { pr_err("%s: gpio_direction_input failed %d\n", __func__, ret); gpio_free(gyro_irq_gpio); return; } pr_info("*** MPU END *** mpuirq_init...\n"); if (board_info.board_id == BOARD_E2549) inv_mpu6050_i2c0_board_info[0].platform_data = &mpu6050_gyro_data_t_1_95; else { struct board_info displayboard_info; tegra_get_display_board_info(&displayboard_info); if (displayboard_info.fab == 0x0) inv_mpu6050_i2c0_board_info[0].platform_data = &mpu6050_gyro_data_fab_0; } inv_mpu6050_i2c0_board_info[0].irq = gpio_to_irq(MPU_GYRO_IRQ_GPIO); i2c_register_board_info(gyro_bus_num, inv_mpu6050_i2c0_board_info, ARRAY_SIZE(inv_mpu6050_i2c0_board_info)); }
static void __init cardhu_spi_init(void) { int i; struct clk *c; struct board_info board_info, display_board_info; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); for (i = 0; i < ARRAY_SIZE(spi_parent_clk); ++i) { c = tegra_get_clock_by_name(spi_parent_clk[i].name); if (IS_ERR_OR_NULL(c)) { pr_err("Not able to get the clock for %s\n", spi_parent_clk[i].name); continue; } spi_parent_clk[i].parent_clk = c; spi_parent_clk[i].fixed_clk_rate = clk_get_rate(c); } cardhu_spi_pdata.parent_clk_list = spi_parent_clk; cardhu_spi_pdata.parent_clk_count = ARRAY_SIZE(spi_parent_clk); tegra_spi_device4.dev.platform_data = &cardhu_spi_pdata; platform_add_devices(cardhu_spi_devices, ARRAY_SIZE(cardhu_spi_devices)); if ((display_board_info.board_id == BOARD_DISPLAY_PM313) || CARDHU_DT_PLATFORM) { platform_add_devices(touch_spi_device, ARRAY_SIZE(touch_spi_device)); } if (board_info.board_id == BOARD_E1198) { tegra_spi_device2.dev.platform_data = &cardhu_spi_pdata; platform_device_register(&tegra_spi_device2); tegra_spi_slave_device1.dev.platform_data = &cardhu_spi_pdata; platform_device_register(&tegra_spi_slave_device1); } }
int __init cardhu_panel_init(void) { int err; struct resource __maybe_unused *res; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); cardhu_carveouts[1].base = tegra_carveout_start; cardhu_carveouts[1].size = tegra_carveout_size; if (board_info.board_id == BOARD_E1291 && ((board_info.sku & SKU_TOUCHSCREEN_MECH_FIX) == 0)) { /* use 55Hz panel timings to reduce noise on sensitive touch */ printk("Using cardhu_panel_modes_55hz\n"); cardhu_disp1_out.modes = cardhu_panel_modes_55hz; cardhu_disp1_out.n_modes = ARRAY_SIZE(cardhu_panel_modes_55hz); } #if defined(CONFIG_TEGRA_DC) && !defined(CONFIG_TEGRA_CARDHU_DSI) if (display_board_info.board_id == BOARD_DISPLAY_PM313) { /* initialize the values */ #if defined(PM313_LVDS_PANEL_19X12) cardhu_disp1_out.modes = panel_19X12_modes; cardhu_disp1_out.n_modes = ARRAY_SIZE(panel_19X12_modes); cardhu_disp1_out.parent_clk = "pll_d_out0"; #if (PM313_LVDS_PANEL_BPP == 1) cardhu_disp1_out.depth = 18; #else cardhu_disp1_out.depth = 24; #endif cardhu_fb_data.xres = 1920; cardhu_fb_data.yres = 1200; cardhu_disp2_out.parent_clk = "pll_d2_out0"; cardhu_hdmi_fb_data.xres = 1920; cardhu_hdmi_fb_data.yres = 1200; #endif /* lvds configuration */ err = gpio_request(pm313_R_FDE, "R_FDE"); err |= gpio_direction_output(pm313_R_FDE, 1); tegra_gpio_enable(pm313_R_FDE); err |= gpio_request(pm313_R_FB, "R_FB"); err |= gpio_direction_output(pm313_R_FB, 1); tegra_gpio_enable(pm313_R_FB); err |= gpio_request(pm313_MODE0, "MODE0"); err |= gpio_direction_output(pm313_MODE0, 1); tegra_gpio_enable(pm313_MODE0); err |= gpio_request(pm313_MODE1, "MODE1"); err |= gpio_direction_output(pm313_MODE1, 0); tegra_gpio_enable(pm313_MODE1); err |= gpio_request(pm313_BPP, "BPP"); err |= gpio_direction_output(pm313_BPP, PM313_LVDS_PANEL_BPP); tegra_gpio_enable(pm313_BPP); err = gpio_request(pm313_lvds_shutdown, "lvds_shutdown"); /* free ride provided by bootloader */ err |= gpio_direction_output(pm313_lvds_shutdown, 1); tegra_gpio_enable(pm313_lvds_shutdown); if (err) printk(KERN_ERR "ERROR(s) in LVDS configuration\n"); } /* else if ((display_board_info.board_id == BOARD_DISPLAY_E1247 && board_info.board_id == BOARD_PM269) || (board_info.board_id == BOARD_E1257) || (board_info.board_id == BOARD_PM305) || (board_info.board_id == BOARD_PM311)) { gpio_request(e1247_pm269_lvds_shutdown, "lvds_shutdown"); gpio_direction_output(e1247_pm269_lvds_shutdown, 1); tegra_gpio_enable(e1247_pm269_lvds_shutdown); } else { gpio_request(cardhu_lvds_shutdown, "lvds_shutdown"); gpio_direction_output(cardhu_lvds_shutdown, 1); tegra_gpio_enable(cardhu_lvds_shutdown); } */ #endif tegra_gpio_enable(cardhu_hdmi_enb); gpio_request(cardhu_hdmi_enb, "hdmi_5v_en"); gpio_direction_output(cardhu_hdmi_enb, 1); tegra_gpio_enable(cardhu_hdmi_hpd); gpio_request(cardhu_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(cardhu_hdmi_hpd); #ifdef CONFIG_HAS_EARLYSUSPEND cardhu_panel_early_suspender.suspend = cardhu_panel_early_suspend; cardhu_panel_early_suspender.resume = cardhu_panel_late_resume; cardhu_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB; register_early_suspend(&cardhu_panel_early_suspender); #endif err = platform_add_devices(cardhu_gfx_devices, ARRAY_SIZE(cardhu_gfx_devices)); #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&cardhu_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; #endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&cardhu_disp1_device); res = nvhost_get_resource_byname(&cardhu_disp2_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb2_start; res->end = tegra_fb2_start + tegra_fb2_size - 1; if (!err) err = nvhost_device_register(&cardhu_disp2_device); #endif #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_NVAVP) if (!err) err = nvhost_device_register(&nvavp_device); #endif return err; }
int __init cardhu_panel_init(void) { int err; struct resource __maybe_unused *res; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); #if defined(CONFIG_TEGRA_NVMAP) cardhu_carveouts[1].base = tegra_carveout_start; cardhu_carveouts[1].size = tegra_carveout_size; #endif #if defined(CONFIG_ION_TEGRA) tegra_ion_data.heaps[0].base = tegra_carveout_start; tegra_ion_data.heaps[0].size = tegra_carveout_size; #endif cardhu_panel_preinit(); if (is_dsi_panel()) { if (is_panel_1506) { /* * HACK: To be Removed */ int i; struct clk *c = tegra_get_clock_by_name("dsia"); for (i = 0; i < c->dvfs->num_freqs; i++) c->dvfs->freqs[i] = 500000000; } goto skip_lvds; } #if defined(CONFIG_TEGRA_DC) if (WARN_ON(board_info.board_id == BOARD_E1291 && ((board_info.sku & SKU_TOUCHSCREEN_MECH_FIX) == 0))) { /* use 55Hz panel timings to reduce noise on sensitive touch */ printk("Using cardhu_panel_modes_55hz\n"); cardhu_disp1_out.parent_clk = "pll_p"; cardhu_disp1_out.modes = cardhu_panel_modes_55hz; cardhu_disp1_out.n_modes = ARRAY_SIZE(cardhu_panel_modes_55hz); } if (display_board_info.board_id == BOARD_DISPLAY_PM313) { /* initialize the values */ #if defined(PM313_LVDS_PANEL_19X12) cardhu_disp1_out.modes = panel_19X12_modes; cardhu_disp1_out.n_modes = ARRAY_SIZE(panel_19X12_modes); cardhu_disp1_out.parent_clk = "pll_d_out0"; #if (PM313_LVDS_PANEL_BPP == 1) cardhu_disp1_out.depth = 18; #else cardhu_disp1_out.depth = 24; #endif cardhu_fb_data.xres = 1920; cardhu_fb_data.yres = 1200; cardhu_disp2_out.parent_clk = "pll_d2_out0"; cardhu_hdmi_fb_data.xres = 1920; cardhu_hdmi_fb_data.yres = 1200; #endif /* lvds configuration */ err = gpio_request(pm313_R_FDE, "R_FDE"); err |= gpio_direction_output(pm313_R_FDE, 1); err |= gpio_request(pm313_R_FB, "R_FB"); err |= gpio_direction_output(pm313_R_FB, 1); err |= gpio_request(pm313_MODE0, "MODE0"); err |= gpio_direction_output(pm313_MODE0, 1); err |= gpio_request(pm313_MODE1, "MODE1"); err |= gpio_direction_output(pm313_MODE1, 0); err |= gpio_request(pm313_BPP, "BPP"); err |= gpio_direction_output(pm313_BPP, PM313_LVDS_PANEL_BPP); err = gpio_request(pm313_lvds_shutdown, "lvds_shutdown"); /* free ride provided by bootloader */ err |= gpio_direction_output(pm313_lvds_shutdown, 1); if (err) printk(KERN_ERR "ERROR(s) in LVDS configuration\n"); } else if ((display_board_info.board_id == BOARD_DISPLAY_E1247 && board_info.board_id == BOARD_PM269) || (board_info.board_id == BOARD_E1257) || (board_info.board_id == BOARD_PM305) || (board_info.board_id == BOARD_PM311)) { gpio_request(e1247_pm269_lvds_shutdown, "lvds_shutdown"); gpio_direction_output(e1247_pm269_lvds_shutdown, 1); } else { gpio_request(cardhu_lvds_shutdown, "lvds_shutdown"); gpio_direction_output(cardhu_lvds_shutdown, 1); } #endif skip_lvds: gpio_request(cardhu_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(cardhu_hdmi_hpd); #if !(DC_CTRL_MODE & TEGRA_DC_OUT_ONE_SHOT_MODE) tegra_gpio_enable(e1506_lcd_te); gpio_request(e1506_lcd_te, "lcd_te"); gpio_direction_input(e1506_lcd_te); #endif #ifdef CONFIG_HAS_EARLYSUSPEND cardhu_panel_early_suspender.suspend = cardhu_panel_early_suspend; cardhu_panel_early_suspender.resume = cardhu_panel_late_resume; cardhu_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB; register_early_suspend(&cardhu_panel_early_suspender); #endif #ifdef CONFIG_TEGRA_GRHOST err = nvhost_device_register(&tegra_grhost_device); if (err) return err; #endif err = platform_add_devices(cardhu_gfx_devices, ARRAY_SIZE(cardhu_gfx_devices)); #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&cardhu_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; #endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&cardhu_disp1_device); res = nvhost_get_resource_byname(&cardhu_disp2_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb2_start; res->end = tegra_fb2_start + tegra_fb2_size - 1; /* Copy the bootloader fb to the fb2. */ tegra_move_framebuffer(tegra_fb2_start, tegra_bootloader_fb_start, min(tegra_fb2_size, tegra_bootloader_fb_size)); if (!err) err = nvhost_device_register(&cardhu_disp2_device); #endif #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_NVAVP) if (!err) err = nvhost_device_register(&nvavp_device); #endif return err; }
int __init cardhu_fixed_regulator_init(void) { int i; struct board_info board_info; struct board_info pmu_board_info; struct board_info display_board_info; struct platform_device **fixed_reg_devs; int nfixreg_devs; if (!is_cardhu_machine) return 0; tegra_get_board_info(&board_info); tegra_get_pmu_board_info(&pmu_board_info); tegra_get_display_board_info(&display_board_info); if (pmu_board_info.board_id == BOARD_PMU_PM298) return cardhu_pm298_gpio_switch_regulator_init(); if (pmu_board_info.board_id == BOARD_PMU_PM299) return cardhu_pm299_gpio_switch_regulator_init(); switch (board_info.board_id) { case BOARD_E1198: if (board_info.fab <= BOARD_FAB_A01) { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e1198_base); fixed_reg_devs = fixed_reg_devs_e1198_base; } else { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e1198_a02); fixed_reg_devs = fixed_reg_devs_e1198_a02; } break; case BOARD_E1291: if (board_info.fab == BOARD_FAB_A03) { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e1291_a03); fixed_reg_devs = fixed_reg_devs_e1291_a03; } else if ((board_info.fab == BOARD_FAB_A04) || (board_info.fab == BOARD_FAB_A05)) { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e1291_a04); fixed_reg_devs = fixed_reg_devs_e1291_a04; } else { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e1198_base); fixed_reg_devs = fixed_reg_devs_e1198_base; } break; case BOARD_PM311: case BOARD_PM305: nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_pm311); fixed_reg_devs = fixed_reg_devs_pm311; if (display_board_info.board_id == BOARD_DISPLAY_PM313) { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_pm311_pm313); fixed_reg_devs = fixed_reg_devs_pm311_pm313; } break; case BOARD_PM269: case BOARD_E1257: nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_pm269); fixed_reg_devs = fixed_reg_devs_pm269; if (display_board_info.board_id == BOARD_DISPLAY_PM313) { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_pm269_pm313); fixed_reg_devs = fixed_reg_devs_pm269_pm313; } else { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_pm269); fixed_reg_devs = fixed_reg_devs_pm269; } break; default: if (display_board_info.board_id == BOARD_DISPLAY_PM313) { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e118x_pm313); fixed_reg_devs = fixed_reg_devs_e118x_pm313; } else { nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_e118x); fixed_reg_devs = fixed_reg_devs_e118x; } break; } for (i = 0; i < nfixreg_devs; ++i) { int gpio_nr; if (!strncmp(fixed_reg_devs[i]->name, "gpio", 4)) { struct gpio_switch_regulator_platform_data *gs_pdata = fixed_reg_devs[i]->dev.platform_data; gpio_nr = gs_pdata->subdevs[0]->gpio_nr; } else { struct fixed_voltage_config *fixed_reg_pdata = fixed_reg_devs[i]->dev.platform_data; gpio_nr = fixed_reg_pdata->gpio; } if (gpio_nr < TEGRA_NR_GPIOS) tegra_gpio_enable(gpio_nr); } return platform_add_devices(fixed_reg_devs, nfixreg_devs); }
int __init cardhu_panel_init(void) { int err; struct resource __maybe_unused *res; tegra_get_board_info(&board_info); tegra_get_display_board_info(&display_board_info); #if defined(CONFIG_TEGRA_NVMAP) cardhu_carveouts[1].base = tegra_carveout_start; cardhu_carveouts[1].size = tegra_carveout_size; #endif #if defined(CONFIG_ION_TEGRA) tegra_ion_data.heaps[0].base = tegra_carveout_start; tegra_ion_data.heaps[0].size = tegra_carveout_size; #endif cardhu_panel_preinit(); if (is_dsi_panel()) goto skip_lvds; #if defined(CONFIG_TEGRA_DC) if (WARN_ON(board_info.board_id == BOARD_E1291 && ((board_info.sku & SKU_TOUCHSCREEN_MECH_FIX) == 0))) { /* use 55Hz panel timings to reduce noise on sensitive touch */ printk("Using cardhu_panel_modes_55hz\n"); cardhu_disp1_out.parent_clk = "pll_p"; cardhu_disp1_out.modes = cardhu_panel_modes_55hz; cardhu_disp1_out.n_modes = ARRAY_SIZE(cardhu_panel_modes_55hz); } if (display_board_info.board_id == BOARD_DISPLAY_PM313) { /* initialize the values */ #if defined(PM313_LVDS_PANEL_19X12) cardhu_disp1_out.modes = panel_19X12_modes; cardhu_disp1_out.n_modes = ARRAY_SIZE(panel_19X12_modes); cardhu_disp1_out.parent_clk = "pll_d_out0"; #if (PM313_LVDS_PANEL_BPP == 1) cardhu_disp1_out.depth = 18; #else cardhu_disp1_out.depth = 24; #endif /* Set height and width in mm. */ cardhu_disp1_out.height = 127; cardhu_disp1_out.width = 203; cardhu_fb_data.xres = 1920; cardhu_fb_data.yres = 1200; cardhu_disp2_out.parent_clk = "pll_d2_out0"; cardhu_hdmi_fb_data.xres = 1920; cardhu_hdmi_fb_data.yres = 1200; #endif /* lvds configuration */ err = gpio_request(pm313_R_FDE, "R_FDE"); err |= gpio_direction_output(pm313_R_FDE, 1); err |= gpio_request(pm313_R_FB, "R_FB"); err |= gpio_direction_output(pm313_R_FB, 1); err |= gpio_request(pm313_MODE0, "MODE0"); err |= gpio_direction_output(pm313_MODE0, 1); err |= gpio_request(pm313_MODE1, "MODE1"); err |= gpio_direction_output(pm313_MODE1, 0); err |= gpio_request(pm313_BPP, "BPP"); err |= gpio_direction_output(pm313_BPP, PM313_LVDS_PANEL_BPP); err = gpio_request(pm313_lvds_shutdown, "lvds_shutdown"); /* free ride provided by bootloader */ err |= gpio_direction_output(pm313_lvds_shutdown, 1); if (err) printk(KERN_ERR "ERROR(s) in LVDS configuration\n"); } /* else if ((display_board_info.board_id == BOARD_DISPLAY_E1247 && board_info.board_id == BOARD_PM269) || (board_info.board_id == BOARD_E1257) || (board_info.board_id == BOARD_PM305) || (board_info.board_id == BOARD_PM311)) { gpio_request(e1247_pm269_lvds_shutdown, "lvds_shutdown"); gpio_direction_output(e1247_pm269_lvds_shutdown, 1); } else { gpio_request(cardhu_lvds_shutdown, "lvds_shutdown"); gpio_direction_output(cardhu_lvds_shutdown, 1); } */ if ( tegra3_get_project_id() == TEGRA3_PROJECT_P1801 ){ printk("P1801 display setting, set HDMI as main display\n "); cardhu_fb_data.xres = 1920; cardhu_fb_data.yres = 1080; cardhu_disp1_pdata.default_out = &cardhu_disp1_out_P1801; cardhu_disp1_device.resource = cardhu_disp1_resources_P1801; cardhu_disp1_device.num_resources = ARRAY_SIZE(cardhu_disp1_resources_P1801); } if (tegra3_get_project_id()==0x4 ){ printk("Check TF700T setting \n "); cardhu_disp1_out.modes = panel_19X12_modes; cardhu_disp1_out.n_modes = ARRAY_SIZE(panel_19X12_modes); cardhu_disp1_out.parent_clk = "pll_d_out0"; cardhu_disp1_out.depth = 24; cardhu_fb_data.xres = 1920; cardhu_fb_data.yres = 1200; cardhu_disp2_out.parent_clk = "pll_d2_out0"; cardhu_hdmi_fb_data.xres = 1920; cardhu_hdmi_fb_data.yres = 1200; gpio_request(TEGRA_GPIO_PU5, "LDO_EN"); gpio_request(TEGRA_GPIO_PBB3, "TF700T_1.2V"); gpio_request(TEGRA_GPIO_PC6, "TF700T_1.8V"); gpio_request(TEGRA_GPIO_PX0, "TF700T_I2C_Switch"); gpio_request(TEGRA_GPIO_PD2, "TF700T_OSC"); } #endif if (tegra3_get_project_id()==0x4 ){ tegra_gpio_enable(cardhu_hdmi_enb); gpio_request(cardhu_hdmi_enb, "hdmi_5v_en"); gpio_direction_output(cardhu_hdmi_enb, 0); } else { tegra_gpio_enable(cardhu_hdmi_enb); gpio_request(cardhu_hdmi_enb, "hdmi_5v_en"); gpio_direction_output(cardhu_hdmi_enb, 1); } skip_lvds: gpio_request(cardhu_hdmi_hpd, "hdmi_hpd"); gpio_direction_input(cardhu_hdmi_hpd); #if !(DC_CTRL_MODE & TEGRA_DC_OUT_ONE_SHOT_MODE) tegra_gpio_enable(e1506_lcd_te); gpio_request(e1506_lcd_te, "lcd_te"); gpio_direction_input(e1506_lcd_te); #endif #ifdef CONFIG_HAS_EARLYSUSPEND cardhu_panel_early_suspender.suspend = cardhu_panel_early_suspend; cardhu_panel_early_suspender.resume = cardhu_panel_late_resume; cardhu_panel_early_suspender.level = EARLY_SUSPEND_LEVEL_DISABLE_FB; register_early_suspend(&cardhu_panel_early_suspender); #endif #ifdef CONFIG_TEGRA_GRHOST err = tegra3_register_host1x_devices(); if (err) return err; #endif err = platform_add_devices(cardhu_gfx_devices, ARRAY_SIZE(cardhu_gfx_devices)); #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) res = nvhost_get_resource_byname(&cardhu_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; #endif /* Copy the bootloader fb to the fb. */ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_DC) if (!err) err = nvhost_device_register(&cardhu_disp1_device); if ( tegra3_get_project_id() != TEGRA3_PROJECT_P1801 ){ res = nvhost_get_resource_byname(&cardhu_disp2_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb2_start; res->end = tegra_fb2_start + tegra_fb2_size - 1; /* Copy the bootloader fb to the fb2. */ tegra_move_framebuffer(tegra_fb2_start, tegra_bootloader_fb_start, min(tegra_fb2_size, tegra_bootloader_fb_size)); if (!err) err = nvhost_device_register(&cardhu_disp2_device); } #endif #if defined(CONFIG_TEGRA_GRHOST) && defined(CONFIG_TEGRA_NVAVP) if (!err) err = nvhost_device_register(&nvavp_device); #endif return err; }
static void dsi_hx8394a_720p_p4_sd_settings_init(struct tegra_dc_sd_settings *settings) { struct board_info bi; tegra_get_display_board_info(&bi); settings->bl_device_name = "pwm-backlight"; }