static int rda_5990_pw_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	int ret = 0;

	switch(cmd)
	{
		case RDA_WIFI_POWER_ON_IOCTL:
            ret = rda_wifi_power_on();
			break;

		case RDA_WIFI_POWER_OFF_IOCTL:
            ret = rda_wifi_power_off();
			break;

		case RDA_WIFI_POWER_SET_TEST_MODE_IOCTL:
			wifi_in_test_mode = 1;
			printk("****set rda wifi in test mode");
			break;

		case RDA_WIFI_POWER_CANCEL_TEST_MODE_IOCTL:
			wifi_in_test_mode = 0;
			printk("****set rda wifi in normal mode");
			break;

        case RDA_WIFI_DEBUG_MODE_IOCTL:
            ret = rda_wifi_debug_en();
            break;
		case RDA_BT_POWER_ON_IOCTL:
			{
				ret = rda_bt_power_on();
				mt_combo_bgf_enable_irq();
			}
			break;

			/* should call thif function after bt_power_on*/
		case RDA_BT_EN_CLK:
			ret = RDA5990_bt_enable_clk();
			break;

		case RD_BT_RF_INIT_IOCTL:
			ret = RDA5990_bt_rf_init();
			break;

		case RD_BT_DC_CAL_IOCTL:	
			ret = RDA5990_bt_dc_cal();
			break;

		case RD_BT_DC_DIG_RESET_IOCTL:	
			ret = RDA5990_bt_dig_reset();
			break;

		case RD_BT_SET_RF_SWITCH_IOCTL:
			ret = RDA5990_bt_set_rf_switch();			
			break;

		case RDA_BT_POWER_OFF_IOCTL:
			{
				mt_combo_bgf_disable_irq();
				ret = rda_bt_power_off();               
			}
			break;

		default:
			break;
	}

	printk(KERN_INFO "rda_bt_pw_ioctl cmd=0x%02x \n", cmd);

	return ret;
}	
Ejemplo n.º 2
0
kal_uint8 rda_bt_poweron_for_test(void)
{
    // Enable 26M AUX clock
    hal_SysAuxClkOut(TRUE);

#ifdef __RDA_SHARE_CRYSTAL__
    if(bt_sleephdl == 0xff)
        bt_sleephdl = L1SM_GetHandle();
    L1SM_SleepDisable(bt_sleephdl);
#endif
    rdabt_chip_sel = 0;
    rda_bt_power_on();
    rda_bt_rf_init();
    rda_bt_uart_init();
    RDA_bt_Power_On_Reset();
    RDABT_DELAY(70);
    switch(rdabt_chip_sel)
    {
#ifdef __RDA_CHIP_R5_5868__
    case RDA_BT_R5_5868_ENUM:
        Rdabt_Pskey_Write_rf_r5();
        RDABT_DELAY(10);

        Rdabt_dut_pskey_write_r578();
        break;
#endif
#ifdef __RDA_CHIP_R7_5868plus__
    case RDA_BT_R7_5868PLUS_ENUM:
        Rdabt_Pskey_Write_rf_r7();
        RDABT_DELAY(10);
        Rdabt_dut_pskey_write_r578();
        break;
#endif
#ifdef __RDA_CHIP_R8_5870__
    case RDA_BT_R8_5870_ENUM:
        Rdabt_Pskey_Write_rf_r8();
        RDABT_DELAY(10);
        Rdabt_dut_pskey_write_r578();
        break;
#endif
#if defined( __RDA_CHIP_R10_5868E__ ) || defined(__RDA_CHIP_R10_5872__)
    case RDA_BT_R10_5872_ENUM:
    case RDA_BT_R10_5868E_ENUM:
        Rdabt_core_uart_Intialization_r10();
        RDABT_DELAY(10); //wait for first uart data
        Rdabt_Pskey_Write_rf_r10();
        Rdabt_test_pskey_write_r10();
        break;
#endif
#if defined(__RDA_CHIP_R10_5868H__) || defined(__RDA_CHIP_R10_5872H__)
    case RDA_BT_R10_AL_5868H_ENUM:
    case RDA_BT_R10_AL_5872H_ENUM:
        RDABT_rf_Intialization_r10_al();
        Rdabt_Pskey_Write_rf_r10_al();
        RDABT_DELAY(5); //wait for digi running
        rdabt_DC_write_r10_al();
        Rdabt_test_pskey_write_r10();
        break;
#endif
#ifdef __RDA_CHIP_R10_5870E__
    case RDA_BT_R10_5870E_ENUM:
        RDABT_rf_Intialization_r10_e();
        Rdabt_Pskey_Write_rf_r10_e();
        RDABT_DELAY(5); //wait for digi running
        rdabt_DC_write_r10_e();
        Rdabt_test_pskey_write_r10();
        break;
#endif
#ifdef __RDA_CHIP_R11_5872P__
    case RDA_BT_R11_5872P_ENUM:
        Rdabt_Pskey_Write_rf_r11_p();
        RDABT_rf_Intialization_r11_p();
        rda_bt_pin_to_low();
        rda_bt_ldoon_toggle_high();
        RDABT_DELAY(10); //wait for digi running
        Rdabt_Pskey_Write_rf_r11_p();
        RDABT_rf_Intialization_r11_p();
        rdabt_DC_write_r11_p();
        Rdabt_test_pskey_write_r11();

        break;
#endif
#ifdef __RDA_CHIP_R11_5875__
    case RDA_BT_R11_5875_ENUM:
        rda_bt_ldoon_toggle_high();
        RDABT_DELAY(10); //wait for digi running
        RDABT_rf_Intialization_r11();
        Rdabt_Pskey_Write_rf_r11();
        rdabt_DC_write_r11();
        Rdabt_test_pskey_write_r11();
        break;
#endif

    default:
//		ASSERT(0);	// xiaoyifeng
        break;
    }

    // Disable 26M AUX clock
    hal_SysAuxClkOut(FALSE);
    return 1;
}