Exemplo n.º 1
0
static irqreturn_t modem_reset_indication_irq(int irq, void *data)
{
    if(GPIO_OEM_VALID(cbp_rst_ind_gpio )){
        printk("%s %d oem_gpio_get_value(GPIO_VIATEL_MDM_RST_IND)=%d \n",__func__,__LINE__,oem_gpio_get_value(cbp_rst_ind_gpio));
        if(oem_gpio_get_value(cbp_rst_ind_gpio)){
            if(first_irq_flag == 1){
                printk("%s %d first irq read rest_gpio is high,return. \n",__func__,__LINE__);
                return IRQ_HANDLED;
            }
            wake_lock_timeout(&vmdata->wlock, MDM_RST_LOCK_TIME * HZ);
            modem_notify_event(MDM_EVT_NOTIFY_RESET_ON);
            via_modem_state = MODEM_STATE_POWER;
            via_monitor_uevent_notify(MODEM_STATE_POWER);
        }else{
            if(first_irq_flag == 1){
                printk("%s %d set first_irq_flag=0. \n",__func__,__LINE__);
                first_irq_flag = 0;
            }
            modem_notify_event(MDM_EVT_NOTIFY_RESET_OFF);
        }
    }
    irq_set_irq_type(irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING);
    gpio_irq_cbp_rst_ind();
    oem_gpio_irq_unmask(cbp_rst_ind_gpio);
    return IRQ_HANDLED;
}
Exemplo n.º 2
0
static irqreturn_t modem_power_indication_irq(int irq, void *data)
{
    if(GPIO_OEM_VALID(GPIO_VIATEL_MDM_PWR_IND)){
        oem_gpio_set_irq_type(GPIO_VIATEL_MDM_PWR_IND, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING);
        if(oem_gpio_get_value(GPIO_VIATEL_MDM_PWR_IND)){
            modem_notify_event(MDM_EVT_NOTIFY_POWER_ON);
        }else{
            modem_notify_event(MDM_EVT_NOTIFY_POWER_OFF);
        }
    }
    
    return IRQ_HANDLED;
}
Exemplo n.º 3
0
int modem_err_indication_usr(int revocery)
{
	printk("%s %d revocery=%d\n",__func__,__LINE__,revocery);
	if(revocery){
		printk("%s %d MDM_EVT_NOTIFY_HD_ERR\n",__func__,__LINE__);
		modem_notify_event(MDM_EVT_NOTIFY_HD_ERR);
	}
	else{
		printk("%s %d MDM_EVT_NOTIFY_HD_ENHANCE\n",__func__,__LINE__);
		modem_notify_event(MDM_EVT_NOTIFY_HD_ENHANCE);
	}
	return 0;
}
Exemplo n.º 4
0
int modem_ipoh_indication_usr(void)
{
	printk("%s %d MDM_EVT_NOTIFY_IPOH\n",__func__,__LINE__);
    //oem_gpio_set_irq_type(GPIO_VIATEL_MDM_RST_IND, IRQF_TRIGGER_FALLING);
	modem_notify_event(MDM_EVT_NOTIFY_IPOH);
	return 0;
}
Exemplo n.º 5
0
static irqreturn_t modem_reset_indication_irq(int irq, void *data)
{
    printk("%s %d \n",__FUNCTION__,__LINE__);
    if(GPIO_OEM_VALID(GPIO_VIATEL_MDM_RST_IND)){
        oem_gpio_set_irq_type(GPIO_VIATEL_MDM_RST_IND, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING);
        if(oem_gpio_get_value(GPIO_VIATEL_MDM_RST_IND)){
            printk("%s %d ON\n",__FUNCTION__,__LINE__);
			wake_lock_timeout(&vmdata->wlock, MDM_RST_LOCK_TIME * HZ);
            modem_notify_event(MDM_EVT_NOTIFY_RESET_ON);
        }else{
            printk("%s %d OFF\n",__FUNCTION__,__LINE__);
            modem_notify_event(MDM_EVT_NOTIFY_RESET_OFF);
        }
    }
    gpio_irq_cbp_rst_ind();
    oem_gpio_irq_unmask(GPIO_VIATEL_MDM_RST_IND);
    return IRQ_HANDLED;
}
int modem_err_indication_usr(int revocery, struct cbp_reset_info_s resetinfo)
{
   hwlog_info("%s %d revocery=%d\n",__func__,__LINE__,revocery);
   if(revocery){
        hwlog_info("%s %d MDM_EVT_NOTIFY_HD_ERR\n",__func__,__LINE__);
        /*1, check the rst_ind*/
        /*2, set GPIO_7_3 low*/
        hwlog_info("%s %d rst_ind %d\n", __func__, __LINE__, oem_gpio_get_cbp_rst_ind_value());
        oem_cbp_reset_by_ap(resetinfo);

        //cbp_need_apr = 1;
        set_time_stamp();
        //schedule_delayed_work(&apr_log_wk, 0);
        modem_notify_event(MDM_EVT_NOTIFY_HD_ERR);
    }
    else{
        hwlog_info("%s %d MDM_EVT_NOTIFY_HD_ENHANCE\n",__func__,__LINE__);
        modem_notify_event(MDM_EVT_NOTIFY_HD_ENHANCE);
    }
    return 0;
}
Exemplo n.º 7
0
int modem_err_indication_usr(int revocery)
{
	printk("%s %d revocery=%d\n",__func__,__LINE__,revocery);
	if(revocery){
		printk("%s %d MDM_EVT_NOTIFY_HD_ERR\n",__func__,__LINE__);
		/*1, check the rst_ind*/
		/*2, set GPIO_7_3 low*/
		pr_err("%s %d rst_ind %d\n", __func__, __LINE__, oem_gpio_get_value(cbp_rst_ind_gpio));

		oem_gpio_direction_output(cbp_backup_gpio, 1);
		mdelay(150);
		oem_gpio_direction_output(cbp_backup_gpio, 0);

		//cbp_need_apr = 1;
		set_time_stamp();
		//schedule_delayed_work(&apr_log_wk, 0);
		modem_notify_event(MDM_EVT_NOTIFY_HD_ERR);
	}
	else{
		printk("%s %d MDM_EVT_NOTIFY_HD_ENHANCE\n",__func__,__LINE__);
		modem_notify_event(MDM_EVT_NOTIFY_HD_ENHANCE);
	}
	return 0;
}
Exemplo n.º 8
0
static irqreturn_t c2k_wdt_isr(int irq, void *data)
{
	unsigned long flags;
	struct cbp_platform_data *cdata = &cbp_data;
	
	LOGPRT(LOG_ERR,  "%s: receive c2k wdt interrupt, prepare to reset c2k...!\n", __func__);
	dump_c2k_iram();
	//wake_lock_timeout(&cmdata->wlock, MDM_RST_LOCK_TIME * HZ);
    modem_notify_event(MDM_EVT_NOTIFY_WDT);

	spin_lock_irqsave(&cdata->modem->status_lock, flags);
	cdata->modem->status = MD_OFF;
	spin_unlock_irqrestore(&cdata->modem->status_lock, flags);

	atomic_set(&cdata->modem->tx_fifo_cnt, TX_FIFO_SZ);
	wake_up(&cdata->modem->wait_tx_done_q);
	
	return IRQ_HANDLED;
}
Exemplo n.º 9
0
void gpio_irq_cbp_excp_ind(void)
{
	unsigned long flags;
	
	struct cbp_platform_data *cdata = &cbp_data;

	LOGPRT(LOG_ERR,  "%s: receive c2k exception interrupt...\n", __func__);
	spin_lock_irqsave(&cdata->modem->status_lock, flags);
	if(cdata->modem->status != MD_OFF){
		cdata->modem->status = MD_EXCEPTION;
		modem_notify_event(MDM_EVT_NOTIFY_EXCP);
		queue_work(cbp_excp_ind->excp_wq, &cbp_excp_ind->excp_work);
	}else{
		LOGPRT(LOG_ERR,  "%s: md off now, ignore this EE\n", __func__);
	}
	spin_unlock_irqrestore(&cdata->modem->status_lock, flags);
	c2k_gpio_irq_unmask(cbp_excp_ind->excp_ind_gpio);

}