Exemple #1
0
INT32 mtk_wcn_hif_sdio_query_chipid(INT32 waitFlag)
{
    UINT32 timeSlotMs = 200;
    UINT32 maxTimeSlot = 15;
    UINT32 counter = 0;
    //gComboChipId = 0x6628;
    if (0 == waitFlag) {
        return gComboChipId;
    }
    if (0 <= hif_sdio_is_chipid_valid(gComboChipId)) {
        return gComboChipId;
    }
    wmt_plat_pwr_ctrl(FUNC_ON);
    wmt_plat_sdio_ctrl(WMT_SDIO_SLOT_SDIO1, FUNC_ON);
    while (counter < maxTimeSlot) {
        if (0 <= hif_sdio_is_chipid_valid(gComboChipId)) {
            break;
        }
        msleep(timeSlotMs);
        counter++;
    }

    wmt_plat_sdio_ctrl(WMT_SDIO_SLOT_SDIO1, FUNC_OFF);
    wmt_plat_pwr_ctrl(FUNC_OFF);
    return gComboChipId;
}
Exemple #2
0
INT32 wmt_ctrl_hw_pwr_on(P_WMT_CTRL_DATA pWmtCtrlData)
{
    INT32 iret;

    /*psm should be enabled right after wmt_ic_init */
    P_DEV_WMT pDev = &gDevWmt;
    if (osal_test_and_set_bit(WMT_STAT_PWR, &pDev->state)) {
        WMT_WARN_FUNC("already on\n");
        iret = 0;
    } else {
        WMT_DBG_FUNC("off->on\n");
        iret = wmt_plat_pwr_ctrl(FUNC_ON);
    }

    return iret;
}
Exemple #3
0
INT32 wmt_ctrl_hw_pwr_off(P_WMT_CTRL_DATA pWmtCtrlData)
{
    INT32 iret;

    /*psm should be disabled before wmt_ic_deinit*/
    P_DEV_WMT pDev = &gDevWmt;
    if (osal_test_and_clear_bit(WMT_STAT_PWR, &pDev->state)) {
        WMT_DBG_FUNC("on->off\n");
        iret = wmt_plat_pwr_ctrl(FUNC_OFF);
    } else {
        WMT_WARN_FUNC("already off\n");
        iret = 0;
    }

    return iret;
}
INT32  wmt_ctrl_hw_state_show(P_WMT_CTRL_DATA pWmtCtrlData)
{
    wmt_plat_pwr_ctrl(FUNC_STAT);
    return 0;
}
INT32  wmt_ctrl_hw_rst(P_WMT_CTRL_DATA pWmtCtrlData)
{
    wmt_plat_pwr_ctrl(FUNC_RST);
    return 0;
}