Esempio n. 1
0
static void modem_detect(struct work_struct *work)
{
	struct cbp_reset *cbp_rst_ind = NULL;
	int ret;
	int level = 0;

	LOGPRT(LOG_NOTICE,  "%s %d .\n",__func__,__LINE__);
	cbp_rst_ind = container_of(work, struct cbp_reset, reset_work);
	if((cbp_rst_ind->host == NULL)){/*for first detection and ipoh*/
         LOGPRT(LOG_NOTICE,  "%s %d modem_detect_card.\n",__func__,__LINE__);
        ret = modem_detect_card(cbp_rst_ind);
		if (ret){
			LOGPRT(LOG_ERR,  "%s: modem detect failed.\n", __func__);
		}
	}
	else{/*for device reset*/
		level = !!oem_gpio_get_value(cbp_rst_ind->rst_ind_gpio);
		if(level == cbp_rst_ind->rst_ind_polar){
			LOGPRT(LOG_NOTICE,  "%s %d power on sdio host\n", __func__, __LINE__);
            oem_wake_host(1);
		}
		else{
			LOGPRT(LOG_NOTICE,  "%s %d power off sdio host\n", __func__, __LINE__);
			//oem_gpio_direction_output(GPIO_VIATEL_MDM_PWR_EN, 1);
			modem_reset_handler();
			oem_wake_host(0);
		}
	}
}
Esempio n. 2
0
static void modem_detect(struct work_struct *work)
{
	struct cbp_reset *cbp_rst_ind = NULL;
	int ret;
	int level = 0;

	LOGPRT(LOG_NOTICE,  "%s %d.\n",__func__,__LINE__);
	cbp_rst_ind = container_of(work, struct cbp_reset, reset_work);
	ret = modem_detect_card(cbp_rst_ind);
	if (ret){
		LOGPRT(LOG_ERR,  "%s: modem detect failed.\n", __func__);
	}
}