static int __init dalmore_fixed_regulator_init(void) { struct board_info board_info; u8 power_config; int ret; int usb_port_owner_info; if (!machine_is_dalmore()) return 0; /* * XUSB hardware controls VBUS directly. * XHCI driver will not use regulator_enable()/regulator_disable() to * control VBUS. Furthermore, XUSB hardware requires GPIO_PK6 to be * disabled. Thus, register usb3_vbus fixed regulator only when XUSB * doesn't own UTMI2. */ usb_port_owner_info = tegra_get_usb_port_owner_info(); if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) { ret = platform_device_register(ADD_FIXED_REG(usb3_vbus)); if (ret) return ret; } power_config = get_power_config(); tegra_get_board_info(&board_info); /* Fab05 and power-type2 have the same fixed regs */ if (board_info.fab == BOARD_FAB_A05 || power_config & POWER_CONFIG2) platform_add_devices(fixed_reg_devs_dalmore_config2, ARRAY_SIZE(fixed_reg_devs_dalmore_config2)); if (board_info.board_id == BOARD_E1611 || board_info.board_id == BOARD_P2454) return platform_add_devices(fixed_reg_devs_e1611_a00, ARRAY_SIZE(fixed_reg_devs_e1611_a00)); else return platform_add_devices(fixed_reg_devs_e1612_a00, ARRAY_SIZE(fixed_reg_devs_e1612_a00)); }
TEGRA_GPIO_PF2, true, 2850, 0, 0); FIXED_REG(8, lcd_1v8_en, NULL, TEGRA_GPIO_PB2, true, 1800, 0, 0); #define ADD_FIXED_REG(_name) (&fixed_reg_##_name##_dev) #define FIXED_REGS_COMMON \ ADD_FIXED_REG(pmu_5v15_en), \ ADD_FIXED_REG(pmu_hdmi_5v0_en), \ ADD_FIXED_REG(vdd_fuse_en), \ ADD_FIXED_REG(cam_ldo_2v8_en), \ ADD_FIXED_REG(cam_ldo_1v8_en) static struct platform_device *fixed_regs_devices_a02[] = { FIXED_REGS_COMMON, ADD_FIXED_REG(pmu_3v3_en), }; static struct platform_device *fixed_regs_devices_a03[] = { FIXED_REGS_COMMON, ADD_FIXED_REG(vdd_sdmmc3_2v85_en), ADD_FIXED_REG(lcd_1v8_en), }; #define ADD_GPIO_REG(_name) (&gpio_reg_##_name##_dev) static struct platform_device *gpio_regs_devices[] = { ADD_GPIO_REG(sdmmc3_vdd_sel), }; static int __init enterprise_fixed_regulator_init(void) {
palmas_rails(smps10), 0, 0, TEGRA_GPIO_PK6, true, true, 0, 5000); FIXED_REG(5, vddio_sd_slot, vddio_sd_slot, palmas_rails(smps9), 0, 0, TEGRA_GPIO_PK1, false, true, 0, 2900); FIXED_REG(6, vd_cam_1v8, vd_cam_1v8, palmas_rails(smps8), 0, 0, PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO6, false, true, 0, 1800); #define ADD_FIXED_REG(_name) (&fixed_reg_##_name##_dev) /* Gpio switch regulator platform data for Macallan E1545 */ static struct platform_device *fixed_reg_devs[] = { ADD_FIXED_REG(dvdd_lcd_1v8), ADD_FIXED_REG(vdd_lcd_bl_en), ADD_FIXED_REG(dvdd_ts), ADD_FIXED_REG(vdd_hdmi_5v0), ADD_FIXED_REG(vddio_sd_slot), ADD_FIXED_REG(vd_cam_1v8), }; int __init macallan_palmas_regulator_init(void) { void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); u32 pmc_ctrl; int i; struct board_info board_info;
FIXED_REG(7, vdd_sdmmc3_2v85_en, NULL, TEGRA_GPIO_PF2, true, 2850, 0, 0); FIXED_REG(8, lcd_1v8_en, NULL, TEGRA_GPIO_PB2, true, 1800, 0, 0); #define ADD_FIXED_REG(_name) (&fixed_reg_##_name##_dev) #define FIXED_REGS_COMMON \ ADD_FIXED_REG(pmu_5v15_en), \ ADD_FIXED_REG(pmu_hdmi_5v0_en), \ ADD_FIXED_REG(vdd_fuse_en), \ ADD_FIXED_REG(cam_ldo_2v8_en), \ ADD_FIXED_REG(cam_ldo_1v8_en) static struct platform_device *fixed_regs_devices_a02[] = { ADD_FIXED_REG(pmu_5v15_en), \ ADD_FIXED_REG(pmu_3v3_en), \ ADD_FIXED_REG(pmu_hdmi_5v0_en), \ ADD_FIXED_REG(vdd_fuse_en), \ ADD_FIXED_REG(cam_ldo_2v8_en), \ ADD_FIXED_REG(cam_ldo_1v8_en) }; static struct platform_device *fixed_regs_devices_a03[] = { FIXED_REGS_COMMON, ADD_FIXED_REG(vdd_sdmmc3_2v85_en), ADD_FIXED_REG(lcd_1v8_en), }; #define ADD_GPIO_REG(_name) (&gpio_reg_##_name##_dev) static struct platform_device *gpio_regs_devices[] = {
/* Fixed regulator devices for E1186/E1187/E1256 */ static struct platform_device *fixed_reg_devs_e118x_pm313[] = { E118x_FIXED_REG PM313_DISPLAY_FIXED_REG }; /* Fixed regulator devices for E1198 and E1291 */ static struct platform_device *fixed_reg_devs_e1198_base[] = { COMMON_FIXED_REG E1291_1198_A00_FIXED_REG E1198_FIXED_REG }; static struct platform_device *fixed_reg_devs_e1198_a02[] = { ADD_FIXED_REG(en_5v_cp), ADD_FIXED_REG(en_5v0), ADD_FIXED_REG(en_ddr_a04), ADD_FIXED_REG(en_3v3_sys_a04), ADD_FIXED_REG(en_3v3_modem), ADD_FIXED_REG(en_vdd_pnl1), ADD_FIXED_REG(cam3_ldo_en), ADD_FIXED_REG(en_vdd_com), ADD_FIXED_REG(en_3v3_fuse), ADD_FIXED_REG(en_3v3_emmc), ADD_FIXED_REG(en_vdd_sdmmc1), ADD_FIXED_REG(en_3v3_pex_hvdd), ADD_FIXED_REG(en_1v8_cam), ADD_FIXED_REG(en_vdd_bl1_a03), ADD_FIXED_REG(en_vdd_bl2_a03), ADD_FIXED_REG(cam1_ldo_en),
#define ROTH_COMMON_FIXED_REG \ ADD_FIXED_REG(usb1_vbus), \ ADD_FIXED_REG(usb3_vbus), \ ADD_FIXED_REG(vdd_hdmi_5v0), #define E1612_FIXED_REG \ ADD_FIXED_REG(avdd_usb_hdmi), \ ADD_FIXED_REG(en_1v8_cam), \ ADD_FIXED_REG(vpp_fuse), \ #define ROTH_FIXED_REG \ ADD_FIXED_REG(en_1v8_cam_roth), /* Gpio switch regulator platform data for Roth */ static struct platform_device *fixed_reg_devs_roth[] = { ADD_FIXED_REG(fan_5v0), ADD_FIXED_REG(vdd_hdmi_5v0), ADD_FIXED_REG(lcd_bl_en), ADD_FIXED_REG(avdd_ts), ADD_FIXED_REG(dvdd_ts), ADD_FIXED_REG(com_3v3), ADD_FIXED_REG(sd_3v3), ADD_FIXED_REG(com_1v8), }; int __init roth_palmas_regulator_init(void) { void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); u32 pmc_ctrl; int i;
FIXED_REG(0, pmu_5v15_en, NULL, ENT_TPS80031_GPIO_REGEN1, true, 5000, 0 ); FIXED_REG(1, pmu_3v3_en, "fixed_reg_pmu_5v15_en", ENT_TPS80031_GPIO_REGEN2, true, 3300, 0); FIXED_REG(2, pmu_hdmi_5v0_en, "fixed_reg_pmu_5v15_en", ENT_TPS80031_GPIO_SYSEN, true, 5000, 0); FIXED_REG(3, vdd_fuse_en, "fixed_reg_pmu_3v3_en", TEGRA_GPIO_PM0, true, 3300, 0); FIXED_REG(5, cam_ldo_2v8_en, NULL, TEGRA_GPIO_PM7, true, 2800, 0); FIXED_REG(6, cam_ldo_1v8_en, NULL, TEGRA_GPIO_PF1, true, 1800, 0); #define ADD_FIXED_REG(_name) (&fixed_reg_##_name##_dev) static struct platform_device *fixed_regs_devices[] = { ADD_FIXED_REG(pmu_5v15_en), ADD_FIXED_REG(pmu_3v3_en), ADD_FIXED_REG(pmu_hdmi_5v0_en), ADD_FIXED_REG(vdd_fuse_en), ADD_FIXED_REG(cam_ldo_2v8_en), ADD_FIXED_REG(cam_ldo_1v8_en), }; #define ADD_GPIO_REG(_name) (&gpio_reg_##_name##_dev) static struct platform_device *gpio_regs_devices[] = { ADD_GPIO_REG(sdmmc3_vdd_sel), }; static int __init enterprise_fixed_regulator_init(void) { int i;