static void loki_modem_init(void) { int modem_id = tegra_get_modem_id(); struct board_info board_info; int usb_port_owner_info = tegra_get_usb_port_owner_info(); tegra_get_board_info(&board_info); pr_info("%s: modem_id = %d\n", __func__, modem_id); switch (modem_id) { case TEGRA_BB_BRUCE: if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) platform_device_register(&icera_bruce_device); break; case TEGRA_BB_HSIC_HUB: /* HSIC hub */ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_smsc_hub_pdata; platform_device_register(&tegra_ehci2_device); } break; default: return; } }
static void loki_usb_init(void) { int usb_port_owner_info = tegra_get_usb_port_owner_info(); int modem_id = tegra_get_modem_id(); /* Device cable is detected through PMU Interrupt */ tegra_udc_pdata.support_pmu_vbus = true; tegra_udc_pdata.vbus_extcon_dev_name = "palmas-extcon"; tegra_ehci1_utmi_pdata.support_pmu_vbus = true; tegra_ehci1_utmi_pdata.vbus_extcon_dev_name = "palmas-extcon"; if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) { tegra_otg_device.dev.platform_data = &tegra_otg_pdata; platform_device_register(&tegra_otg_device); /* Setup the udc platform data */ tegra_udc_device.dev.platform_data = &tegra_udc_pdata; } if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) { if (!modem_id) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata; platform_device_register(&tegra_ehci2_device); } } if (!(usb_port_owner_info & UTMI3_PORT_OWNER_XUSB)) { tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata; platform_device_register(&tegra_ehci3_device); } }
static void enterprise_baseband_init(void) { int modem_id = tegra_get_modem_id(); switch (modem_id) { case TEGRA_BB_PH450: /* PH450 ULPI */ enterprise_modem_init(); break; case TEGRA_BB_XMM6260: /* XMM6260 HSIC */ /* baseband-power.ko will register ehci2 device */ tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_xmm_pdata; tegra_baseband_power_data.hsic_register = &tegra_usb_hsic_host_register; tegra_baseband_power_data.hsic_unregister = &tegra_usb_hsic_host_unregister; platform_device_register(&tegra_baseband_power_device); platform_device_register(&tegra_baseband_power2_device); break; #ifdef CONFIG_TEGRA_BB_M7400 case TEGRA_BB_M7400: /* M7400 HSIC */ tegra_ehci2_hsic_xmm_pdata.u_data.host.power_off_on_suspend = 0; tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_xmm_pdata; platform_device_register(&tegra_baseband_m7400_device); break; #endif } }
static void __init tegra_whistler_init(void) { int modem_id = tegra_get_modem_id(); tegra_clk_init_from_table(whistler_clk_init_table); whistler_emc_init(); tegra_soc_device_init("whistler"); tegra_enable_pinmux(); whistler_pinmux_init(); whistler_i2c_init(); whistler_uart_init(); platform_add_devices(whistler_devices, ARRAY_SIZE(whistler_devices)); tegra_ram_console_debug_init(); whistler_sdhci_init(); whistler_regulator_init(); whistler_panel_init(); whistler_sensors_init(); whistler_touch_init(); whistler_kbc_init(); whistler_usb_init(); whistler_emc_init(); if (modem_id == 0x1) whistler_baseband_init(); whistler_setup_bluesleep(); tegra_release_bootloader_fb(); }
static void cardhu_modem_init(void) { struct board_info board_info; int w_disable_gpio, ret; int modem_id = tegra_get_modem_id(); tegra_get_board_info(&board_info); switch (board_info.board_id) { case BOARD_E1291: case BOARD_E1198: if (((board_info.board_id == BOARD_E1291) && (board_info.fab < BOARD_FAB_A03)) || ((board_info.board_id == BOARD_E1198) && (board_info.fab < BOARD_FAB_A02))) { w_disable_gpio = TEGRA_GPIO_PH5; } else { w_disable_gpio = TEGRA_GPIO_PDD5; } ret = gpio_request(w_disable_gpio, "w_disable_gpio"); if (ret < 0) pr_err("%s: gpio_request failed for gpio %d\n", __func__, w_disable_gpio); else gpio_direction_input(w_disable_gpio); /* E1291-A04 & E1198:A02: Set PERST signal to high */ if (((board_info.board_id == BOARD_E1291) && (board_info.fab >= BOARD_FAB_A04)) || ((board_info.board_id == BOARD_E1198) && (board_info.fab >= BOARD_FAB_A02))) { ret = gpio_request(TEGRA_GPIO_PH7, "modem_perst"); if (ret < 0) { pr_err("%s(): Error in allocating gpio " "TEGRA_GPIO_PH7\n", __func__); break; } gpio_direction_output(TEGRA_GPIO_PH7, 1); } break; case BOARD_E1186: platform_device_register(&tegra_baseband_power_device); platform_device_register(&tegra_baseband_power2_device); break; default: break; } if (modem_id == TEGRA_BB_TANGO) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata; platform_device_register(&tegra_ehci2_device); } }
static void macallan_modem_init(void) { int modem_id = tegra_get_modem_id(); int usb_port_owner_info = tegra_get_usb_port_owner_info(); switch (modem_id) { case TEGRA_BB_NEMO: /* on board i500 HSIC */ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) platform_device_register(&icera_nemo_device); break; } }
static void kai_modem_init(void) { int ret; int modem_id = tegra_get_modem_id(); if (modem_id == TEGRA_BB_TANGO) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata; platform_device_register(&tegra_ehci2_device); } ret = gpio_request(TEGRA_GPIO_W_DISABLE, "w_disable_gpio"); if (ret < 0) pr_err("%s: gpio_request failed for gpio %d\n", __func__, TEGRA_GPIO_W_DISABLE); else { ret = gpio_direction_output(TEGRA_GPIO_W_DISABLE, 1); if (ret < 0) { pr_err("%s: gpio_direction_output failed %d\n", __func__, ret); gpio_free(TEGRA_GPIO_W_DISABLE); } } ret = gpio_request(TEGRA_GPIO_MODEM_RSVD1, "Port_V_PIN_0"); if (ret < 0) pr_err("%s: gpio_request failed for gpio %d\n", __func__, TEGRA_GPIO_MODEM_RSVD1); else { ret = gpio_direction_input(TEGRA_GPIO_MODEM_RSVD1); if (ret < 0) { pr_err("%s: gpio_direction_output failed %d\n", __func__, ret); gpio_free(TEGRA_GPIO_MODEM_RSVD1); } } ret = gpio_request(TEGRA_GPIO_MODEM_RSVD2, "Port_H_PIN_7"); if (ret < 0) pr_err("%s: gpio_request failed for gpio %d\n", __func__, TEGRA_GPIO_MODEM_RSVD2); else { ret = gpio_direction_output(TEGRA_GPIO_MODEM_RSVD2, 1); if (ret < 0) { pr_err("%s: gpio_direction_output failed %d\n", __func__, ret); gpio_free(TEGRA_GPIO_MODEM_RSVD2); } } }
static void pluto_modem_init(void) { int modem_id = tegra_get_modem_id(); struct board_info board_info; int usb_port_owner_info = tegra_get_usb_port_owner_info(); tegra_get_board_info(&board_info); pr_info("%s: modem_id = %d\n", __func__, modem_id); switch (modem_id) { case TEGRA_BB_I500: /* on board i500 HSIC */ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) { platform_device_register(&icera_baseband_device); } break; case TEGRA_BB_I500SWD: /* i500 SWD HSIC */ if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) { platform_device_register(&icera_baseband2_device); } break; #ifdef CONFIG_TEGRA_BB_OEM1 case TEGRA_BB_OEM1: /* OEM1 HSIC */ if ((board_info.board_id == BOARD_E1575) || ((board_info.board_id == BOARD_E1580) && (board_info.fab >= BOARD_FAB_A03))) { tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPIO_X1_AUD, TEGRA_TRI_NORMAL); bb_gpio_oem1.oem1.pwron = BB_OEM1_GPIO_ON_V; } if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) { tegra_hsic_pdata.ops = &oem1_hsic_pops; tegra_ehci3_device.dev.platform_data = &tegra_hsic_pdata; platform_device_register(&tegra_bb_oem1); } break; #endif case TEGRA_BB_HSIC_HUB: /* i500 SWD HSIC */ if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) { tegra_ehci3_device.dev.platform_data = &tegra_ehci3_hsic_smsc_hub_pdata; platform_device_register(&tegra_ehci3_device); } break; default: return; } }
static void enterprise_baseband_init(void) { int modem_id = tegra_get_modem_id(); #ifdef CONFIG_MODEM_ICERA_E450 printk(KERN_INFO "enterprise_baseband_init modem_id %d", modem_id); modem_id = 1; printk(KERN_INFO "set modem_id to %d", modem_id); #endif switch (modem_id) { case TEGRA_BB_PH450: /* PH450 ULPI */ enterprise_modem_init(); break; case TEGRA_BB_XMM6260: /* XMM6260 HSIC */ /* baseband-power.ko will register ehci2 device */ tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_xmm_pdata; /* enable XMM6260 baseband gpio(s) */ tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm_reset); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm_on); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .ap2mdm_ack); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm2ap_ack); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .ap2mdm_ack2); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm2ap_ack2); tegra_baseband_power_data.hsic_register = &tegra_usb_hsic_host_register; tegra_baseband_power_data.hsic_unregister = &tegra_usb_hsic_host_unregister; platform_device_register(&tegra_baseband_power_device); platform_device_register(&tegra_baseband_power2_device); break; #ifdef CONFIG_TEGRA_BB_M7400 case TEGRA_BB_M7400: /* M7400 HSIC */ tegra_ehci2_hsic_xmm_pdata.u_data.host.power_off_on_suspend = 0; tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_xmm_pdata; platform_device_register(&tegra_baseband_m7400_device); break; #endif } }
static void tegratab_modem_init(void) { int modem_id = tegra_get_modem_id(); int usb_port_owner_info = tegra_get_usb_port_owner_info(); switch (modem_id) { case TEGRA_BB_NEMO: /* on board i500 HSIC */ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) { if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) && (tegra_revision == TEGRA_REVISION_A02)) tegra_ehci2_hsic_baseband_pdata \ .unaligned_dma_buf_supported = true; platform_device_register(&icera_nemo_device); } break; } }
static void loki_usb_init(void) { int usb_port_owner_info = tegra_get_usb_port_owner_info(); int modem_id = tegra_get_modem_id(); int rc = 0; /* Device cable is detected through PMU Interrupt */ tegra_udc_pdata.support_pmu_vbus = true; tegra_udc_pdata.vbus_extcon_dev_name = "palmas-extcon"; tegra_ehci1_utmi_pdata.support_pmu_vbus = true; tegra_ehci1_utmi_pdata.vbus_extcon_dev_name = "palmas-extcon"; if (board_info.board_id == BOARD_P2530 && board_info.sku == BOARD_SKU_FOSTER && board_info.fab >= 0xC0) { rc = gpio_request(TEGRA_GPIO_PK5, "r8152_rst"); if (rc) pr_warn("RTL8152 gpio request failed:%d\n", rc); rc = gpio_direction_output(TEGRA_GPIO_PK5, 0); if (rc) pr_warn("RTL8152 gpio direction failed:%d\n", rc); rc = gpio_direction_output(TEGRA_GPIO_PK5, 1); if (rc) pr_warn("RTL8152 gpio direction failed:%d\n", rc); } /* Enable Y-Cable support */ tegra_ehci1_utmi_pdata.u_data.host.support_y_cable = true; if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) { tegra_otg_device.dev.platform_data = &tegra_otg_pdata; platform_device_register(&tegra_otg_device); /* Setup the udc platform data */ tegra_udc_device.dev.platform_data = &tegra_udc_pdata; } if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) { if (!modem_id) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata; platform_device_register(&tegra_ehci2_device); } } if (!(usb_port_owner_info & UTMI3_PORT_OWNER_XUSB)) { tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata; platform_device_register(&tegra_ehci3_device); } }
static void enterprise_baseband_init(void) { int modem_id = tegra_get_modem_id(); switch (modem_id) { case TEGRA_BB_PH450: /* PH450 ULPI */ enterprise_modem_init(); break; case TEGRA_BB_XMM6260: /* XMM6260 HSIC */ /* xmm baseband - do not switch off phy during suspend */ tegra_ehci_uhsic_pdata.power_down_on_bus_suspend = 0; uhsic_phy_config.postsuspend = enterprise_usb_hsic_postsupend; uhsic_phy_config.preresume = enterprise_usb_hsic_preresume; uhsic_phy_config.usb_phy_ready = enterprise_usb_hsic_phy_ready; uhsic_phy_config.post_phy_off = enterprise_usb_hsic_phy_off; /* enable XMM6260 baseband gpio(s) */ tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm_reset); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm_on); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .ap2mdm_ack); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm2ap_ack); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .ap2mdm_ack2); tegra_gpio_enable(tegra_baseband_power_data.modem.generic .mdm2ap_ack2); tegra_baseband_power_data.hsic_register = &tegra_usb_hsic_host_register; tegra_baseband_power_data.hsic_unregister = &tegra_usb_hsic_host_unregister; platform_device_register(&tegra_baseband_power_device); platform_device_register(&tegra_baseband_power2_device); break; #ifdef CONFIG_TEGRA_BB_M7400 case TEGRA_BB_M7400: /* M7400 HSIC */ tegra_ehci_uhsic_pdata.power_down_on_bus_suspend = 0; tegra_ehci2_device.dev.platform_data = &tegra_ehci_uhsic_pdata; platform_device_register(&tegra_baseband_m7400_device); break; #endif } }
static void enterprise_baseband_init(void) { struct board_info board_info; int modem_id = tegra_get_modem_id(); tegra_get_board_info(&board_info); switch (modem_id) { case TEGRA_BB_PH450: /* PH450 ULPI */ enterprise_modem_init(); break; case TEGRA_BB_XMM6260: /* XMM6260 HSIC */ /* baseband-power.ko will register ehci2 device */ tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_xmm_pdata; tegra_baseband_power_data.hsic_register = &tegra_usb_hsic_host_register; tegra_baseband_power_data.hsic_unregister = &tegra_usb_hsic_host_unregister; if ((board_info.board_id == BOARD_E1239) && (board_info.fab <= BOARD_FAB_A02)) { tegra_baseband_power_data.modem. xmm.ipc_hsic_active = BB_GPIO_LCD_PWR2; tegra_baseband_power_data.modem. xmm.ipc_hsic_sus_req = BB_GPIO_LCD_PWR1; } platform_device_register(&tegra_baseband_power_device); platform_device_register(&tegra_baseband_power2_device); break; #ifdef CONFIG_TEGRA_BB_M7400 case TEGRA_BB_M7400: /* M7400 HSIC */ tegra_ehci2_hsic_xmm_pdata.u_data.host.power_off_on_suspend = 0; tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_xmm_pdata; platform_device_register(&tegra_baseband_m7400_device); break; #endif } }
static void ardbeg_modem_init(void) { int modem_id = tegra_get_modem_id(); struct board_info board_info; struct board_info pmu_board_info; int usb_port_owner_info = tegra_get_usb_port_owner_info(); tegra_get_board_info(&board_info); tegra_get_pmu_board_info(&pmu_board_info); pr_info("%s: modem_id = %d\n", __func__, modem_id); switch (modem_id) { case TEGRA_BB_BRUCE: if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) { /* Set specific USB wake source for Ardbeg */ if (board_info.board_id == BOARD_E1780) tegra_set_wake_source(42, INT_USB2); if (pmu_board_info.board_id == BOARD_E1736 || pmu_board_info.board_id == BOARD_E1769 || pmu_board_info.board_id == BOARD_E1936) baseband_pdata.regulator_name = NULL; platform_device_register(&icera_bruce_device); } break; case TEGRA_BB_HSIC_HUB: /* HSIC hub */ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_hsic_smsc_hub_pdata; /* Set specific USB wake source for Ardbeg */ if (board_info.board_id == BOARD_E1780) tegra_set_wake_source(42, INT_USB2); platform_device_register(&tegra_ehci2_device); } else xusb_pdata.pretend_connect_0 = true; break; default: return; } }
static void ardbeg_usb_init(void) { int usb_port_owner_info = tegra_get_usb_port_owner_info(); int modem_id = tegra_get_modem_id(); struct board_info bi; tegra_get_pmu_board_info(&bi); if (board_info.sku == 1100 || board_info.board_id == BOARD_P1761 || board_info.board_id == BOARD_E1784) tegra_ehci1_utmi_pdata.u_data.host.turn_off_vbus_on_lp0 = true; if (board_info.board_id == BOARD_PM359 || board_info.board_id == BOARD_PM358 || board_info.board_id == BOARD_PM370 || board_info.board_id == BOARD_PM374 || board_info.board_id == BOARD_PM363) { /* Laguna */ /* Host cable is detected through AMS PMU Interrupt */ tegra_udc_pdata.id_det_type = TEGRA_USB_PMU_ID; tegra_ehci1_utmi_pdata.id_det_type = TEGRA_USB_PMU_ID; tegra_ehci1_utmi_pdata.id_extcon_dev_name = "as3722-extcon"; } else { /* Ardbeg and TN8 */ /* Need these settings for HS USB EMI on T124 */ tegra_udc_pdata.u_cfg.utmi.xcvr_hsslew_lsb = 0x3; tegra_udc_pdata.u_cfg.utmi.xcvr_hsslew_msb = 0xf; tegra_ehci1_utmi_pdata.u_cfg.utmi.xcvr_hsslew_lsb = 0x3; tegra_ehci1_utmi_pdata.u_cfg.utmi.xcvr_hsslew_msb = 0xf; tegra_ehci2_utmi_pdata.u_cfg.utmi.xcvr_hsslew_lsb = 0x3; tegra_ehci2_utmi_pdata.u_cfg.utmi.xcvr_hsslew_msb = 0xf; tegra_ehci3_utmi_pdata.u_cfg.utmi.xcvr_hsslew_lsb = 0x3; tegra_ehci3_utmi_pdata.u_cfg.utmi.xcvr_hsslew_msb = 0xf; /* * TN8 supports vbus changing and it can handle * vbus voltages larger then 5V. Enable this. */ if (board_info.board_id == BOARD_P1761 || board_info.board_id == BOARD_E1784 || board_info.board_id == BOARD_E1780) { /* * Set the maximum voltage that can be supplied * over USB vbus that the board supports if we use * a quick charge 2 wall charger. */ tegra_udc_pdata.qc2_voltage = TEGRA_USB_QC2_12V; tegra_udc_pdata.u_data.dev.qc2_current_limit_ma = 1300; /* charger needs to be set to 3A - h/w will do 2A */ tegra_udc_pdata.u_data.dev.dcp_current_limit_ma = 3000; } switch (bi.board_id) { case BOARD_E1733: /* Host cable is detected through PMU Interrupt */ tegra_udc_pdata.id_det_type = TEGRA_USB_PMU_ID; tegra_ehci1_utmi_pdata.id_det_type = TEGRA_USB_PMU_ID; tegra_ehci1_utmi_pdata.id_extcon_dev_name = "as3722-extcon"; break; case BOARD_E1736: case BOARD_E1769: case BOARD_E1735: case BOARD_E1936: case BOARD_P1761: /* Device cable is detected through PMU Interrupt */ tegra_udc_pdata.support_pmu_vbus = true; tegra_udc_pdata.vbus_extcon_dev_name = "palmas-extcon"; tegra_ehci1_utmi_pdata.support_pmu_vbus = true; tegra_ehci1_utmi_pdata.vbus_extcon_dev_name = "palmas-extcon"; /* Host cable is detected through PMU Interrupt */ tegra_udc_pdata.id_det_type = TEGRA_USB_PMU_ID; tegra_ehci1_utmi_pdata.id_det_type = TEGRA_USB_PMU_ID; tegra_ehci1_utmi_pdata.id_extcon_dev_name = "palmas-extcon"; } /* Enable Y-Cable support */ if (bi.board_id == BOARD_P1761) tegra_ehci1_utmi_pdata.u_data.host.support_y_cable = true; } if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) { tegra_otg_pdata.is_xhci = false; tegra_udc_pdata.u_data.dev.is_xhci = false; } else { tegra_otg_pdata.is_xhci = true; tegra_udc_pdata.u_data.dev.is_xhci = true; } tegra_otg_device.dev.platform_data = &tegra_otg_pdata; platform_device_register(&tegra_otg_device); /* Setup the udc platform data */ tegra_udc_device.dev.platform_data = &tegra_udc_pdata; if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) { if (!modem_id) { if ((bi.board_id != BOARD_P1761) && (bi.board_id != BOARD_E1922) && (bi.board_id != BOARD_E1784)) { tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata; platform_device_register(&tegra_ehci2_device); } } } if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) { if ((bi.board_id != BOARD_P1761) && (bi.board_id != BOARD_E1922) && (bi.board_id != BOARD_E1784)) { tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata; platform_device_register(&tegra_ehci3_device); } } }
static void pluto_modem_init(void) { int modem_id = tegra_get_modem_id(); struct board_info board_info; int usb_port_owner_info = tegra_get_usb_port_owner_info(); tegra_get_board_info(&board_info); pr_info("%s: modem_id = %d\n", __func__, modem_id); switch (modem_id) { case TEGRA_BB_I500: /* on board i500 HSIC */ if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) { platform_device_register(&icera_baseband_device); } break; case TEGRA_BB_I500SWD: /* i500 SWD HSIC */ if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) { platform_device_register(&icera_baseband2_device); } break; case TEGRA_BB_OEM1: /* OEM1 HSIC */ if ((board_info.board_id == BOARD_E1575) || ((board_info.board_id == BOARD_E1580) && (board_info.fab >= BOARD_FAB_A03))) { tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPIO_X1_AUD, TEGRA_TRI_NORMAL); bb_gpio_oem1.oem1.pwron = BB_OEM1_GPIO_ON_V; } if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) { tegra_hsic_pdata.ops = &oem1_hsic_pops; tegra_ehci3_device.dev.platform_data = &tegra_hsic_pdata; platform_device_register(&tegra_bb_oem1); } break; case TEGRA_BB_OEM2: /* XMM6260/XMM6360 HSIC */ /* fix wrong wiring in Pluto A02 */ if ((board_info.board_id == BOARD_E1580) && (board_info.fab == BOARD_FAB_A02)) { pr_info( "%s: Pluto A02: replace MDM2_PWR_ON with MDM2_PWR_ON_FOR_PLUTO_A02\n", __func__); if (tegra_baseband_xmm_power_data.modem.xmm.bb_on != MDM2_PWR_ON) pr_err( "%s: expected MDM2_PWR_ON default gpio for XMM bb_on\n", __func__); tegra_baseband_xmm_power_data.modem.xmm.bb_on = MDM2_PWR_ON_FOR_PLUTO_A02; } /* baseband-power.ko will register ehci3 device */ tegra_hsic_pdata.ops = &oem2_plat_ops; tegra_hsic_pdata.u_data.host.remote_wakeup_supported = false; tegra_hsic_pdata.u_data.host.power_off_on_suspend = false; tegra_ehci3_device.dev.platform_data = &tegra_hsic_pdata; tegra_baseband_xmm_power_data.hsic_register = &tegra_usb_hsic_host_register; tegra_baseband_xmm_power_data.hsic_unregister = &tegra_usb_hsic_host_unregister; tegra_baseband_xmm_power_data.ehci_device = &tegra_ehci3_device; platform_device_register(&tegra_baseband_xmm_power_device); platform_device_register(&tegra_baseband_xmm_power2_device); /* override audio settings - use 8kHz */ pluto_audio_pdata.i2s_param[BASEBAND].audio_port_id = 2; pluto_audio_pdata.i2s_param[BASEBAND].is_i2s_master = 1; pluto_audio_pdata.i2s_param[BASEBAND].i2s_mode = TEGRA_DAIFMT_I2S; pluto_audio_pdata.i2s_param[BASEBAND].sample_size = 16; pluto_audio_pdata.i2s_param[BASEBAND].rate = 8000; pluto_audio_pdata.i2s_param[BASEBAND].channels = 2; break; case TEGRA_BB_HSIC_HUB: /* HSIC hub */ if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) { tegra_ehci3_device.dev.platform_data = &tegra_ehci3_hsic_smsc_hub_pdata; platform_device_register(&tegra_ehci3_device); } break; default: return; } }
static void __init uart_debug_init(void) { unsigned long rate; struct clk *debug_uart_clk; struct clk *c; int modem_id = tegra_get_modem_id(); if (modem_id == 0x1) { /* UARTB is the debug port. */ pr_info("Selecting UARTB as the debug console\n"); whistler_uart_devices[1] = &debug_uartb_device; debug_uart_port_base = ((struct plat_serial8250_port *)( debug_uartb_device.dev.platform_data))->mapbase; debug_uart_clk = clk_get_sys("serial8250.0", "uartb"); /* Clock enable for the debug channel */ if (!IS_ERR_OR_NULL(debug_uart_clk)) { rate = ((struct plat_serial8250_port *)( debug_uartb_device.dev.platform_data))->uartclk; pr_info("The debug console clock name is %s\n", debug_uart_clk->name); c = tegra_get_clock_by_name("pll_p"); if (IS_ERR_OR_NULL(c)) pr_err("Not getting the parent clock pll_p\n"); else clk_set_parent(debug_uart_clk, c); clk_enable(debug_uart_clk); clk_set_rate(debug_uart_clk, rate); } else { pr_err("Not getting the clock %s for debug console\n", debug_uart_clk->name); } } else { /* UARTA is the debug port. */ pr_info("Selecting UARTA as the debug console\n"); whistler_uart_devices[0] = &debug_uarta_device; debug_uart_port_base = ((struct plat_serial8250_port *)( debug_uarta_device.dev.platform_data))->mapbase; debug_uart_clk = clk_get_sys("serial8250.0", "uarta"); /* Clock enable for the debug channel */ if (!IS_ERR_OR_NULL(debug_uart_clk)) { rate = ((struct plat_serial8250_port *)( debug_uarta_device.dev.platform_data))->uartclk; pr_info("The debug console clock name is %s\n", debug_uart_clk->name); c = tegra_get_clock_by_name("pll_p"); if (IS_ERR_OR_NULL(c)) pr_err("Not getting the parent clock pll_p\n"); else clk_set_parent(debug_uart_clk, c); clk_enable(debug_uart_clk); clk_set_rate(debug_uart_clk, rate); } else { pr_err("Not getting the clock %s for debug console\n", debug_uart_clk->name); } } }
void __init p1859_audio_init(void) { int is_e1860_b00 = tegra_is_board(NULL, "61860", NULL, "300", NULL); int modem_id = tegra_get_modem_id(); int is_e1892 = 0, i; struct device_node *np; static struct property tegra_audio_property = { .name = "platform_data", .value = &tegra_e1860_b00_pdata, .length = sizeof(tegra_e1860_b00_pdata), }; /* check the version of embedded breakout board */ is_e1892 = tegra_is_board(NULL, "61892", NULL, NULL, NULL); /* set max9485 addr as priv data for a0x and b00 */ tegra_e1860_a0x_pdata.priv_data = tegra_e1860_b00_pdata.priv_data = tegra_voice_call_pdata.priv_data = (void *)(is_e1892 ? 0x70 : 0x60); np = of_find_compatible_node(NULL, NULL, "nvidia,tegra-audio-vcm30t124"); if (NULL != np) { if (is_e1860_b00) { if (modem_id) { tegra_audio_property.value = (void *)(&tegra_voice_call_pdata); tegra_audio_property.length = sizeof(tegra_voice_call_pdata); } } else { tegra_audio_property.value = (void *)(&tegra_e1860_a0x_pdata); tegra_audio_property.length = sizeof(tegra_e1860_a0x_pdata); } of_update_property(np, &tegra_audio_property); } for (i = 0; i < ARRAY_SIZE(tegra_spdif_dit); i++) platform_device_register(&tegra_spdif_dit[i]); } void __init p1859_audio_dap_d_sel(void) { int modem_id = tegra_get_modem_id(); struct device_node *np; int gpio; if (modem_id) { np = of_find_compatible_node(NULL, NULL, "nvidia,dap-d-mux"); if (NULL != np) { gpio = of_get_named_gpio(np, "nvidia,dap-d-sel-gpio", 0); pr_info("dap-d-sel-gpio:%d\n", gpio); if (gpio_is_valid(gpio)) gpio_direction_output(gpio, 1); } } }