Exemplo n.º 1
0
static int __init modem_boot_init(void)
{
    int ret = -1;

        ret = get_modem_type( MODEM_QSC6085 );
        pr_info("MODEM#%s: get_modem_type \"%s\". %d\n",MODEM_DEVICE_BOOT(MODEM_QSC6085),MODEM_QSC6085,ret);
        if( ret<=0 ) {
            pr_err("MODEM#%s: modem \"%s\" not support on this board. %d\n",MODEM_DEVICE_BOOT(MODEM_QSC6085),MODEM_QSC6085,ret);
            return( -1 );
        }
    platform_driver_register(&modem_boot_driver);
    return 0;
}
Exemplo n.º 2
0
    if(vmdata)
        wake_lock_destroy(&vmdata->wlock);
    return 0;
}

static void modem_boot_shutdown(struct platform_device *dev)
{
    oem_power_off_modem();
}

static struct platform_driver modem_boot_driver = {
	.probe = modem_boot_probe,
	.remove = modem_boot_remove,
	.shutdown = modem_boot_shutdown,
	.driver.name = MODEM_DEVICE_BOOT(MODEM_VIACBP82D),
};

static struct platform_device platform_modem_device = {
	.name = MODEM_DEVICE_BOOT(MODEM_VIACBP82D),
};

static const struct file_operations misc_modem_fops = {
	.owner = THIS_MODULE,
	.open = misc_modem_open,
	.unlocked_ioctl = misc_modem_ioctl,
	.release = misc_modem_release,
	.fasync	= misc_modem_fasync,
};

static struct miscdevice misc_modem_device = {
Exemplo n.º 3
0
static void modem_boot_shutdown(struct platform_device *pdev)
{
    dev_dbg(&pdev->dev, "modem_boot_shutdown\n");

    dev_info(&pdev->dev, "%s. Call modem_boot_set(&pdev->dev,NULL,\"2\",1) now\n", __func__);
    if( modem_boot_set(&pdev->dev,NULL,"2",1)!=1 ) {    //power off modem at the init time;
        dev_err(&pdev->dev, "Failed to call modem_boot_set(&pdev->dev,NULL,\"2\",1)\n");
    }
}

static struct platform_driver modem_boot_driver = {
    .probe = modem_boot_probe,
    .remove = modem_boot_remove,
    .shutdown = modem_boot_shutdown,
    .driver = {
        .name = MODEM_DEVICE_BOOT(MODEM_QSC6085),
        .owner = THIS_MODULE,
    },
};

static int __init modem_boot_init(void)
{
    int ret = -1;

        ret = get_modem_type( MODEM_QSC6085 );
        pr_info("MODEM#%s: get_modem_type \"%s\". %d\n",MODEM_DEVICE_BOOT(MODEM_QSC6085),MODEM_QSC6085,ret);
        if( ret<=0 ) {
            pr_err("MODEM#%s: modem \"%s\" not support on this board. %d\n",MODEM_DEVICE_BOOT(MODEM_QSC6085),MODEM_QSC6085,ret);
            return( -1 );
        }
    platform_driver_register(&modem_boot_driver);
    unsigned long ntf_flags;//linux native
};

static struct viatel_modem_data *vmdata;
extern void oem_reset_modem(void);
extern int modem_on_off_ctrl_chan(unsigned char on);
extern void gpio_irq_cbp_rst_ind(int level);
static void cbp_backup_check_ramdump_timer(unsigned long data);

static int cbp_need_apr = 0;
static char time_buf[16] ={0};
static char g_cbp_resetinfo[MDM_RESETINFO_SIZE] = {0};
static struct mutex g_cbp_resetinfo_lock;

static struct platform_device viacbp82d_3rd_modem_info = {
    .name = MODEM_DEVICE_BOOT(MODEM_VIACBP82D),
    .id = -1,
};

static int via_resetinfo_read(void *buf, int size)
{
    int real_size = -1;
    if(!buf) {
        hwlog_err("%s %d: the pointer of buf is null\n", __func__, __LINE__);
        return -1;
    }

    mutex_lock(&g_cbp_resetinfo_lock);
    real_size = snprintf(buf, size, "%s", g_cbp_resetinfo);
    mutex_unlock(&g_cbp_resetinfo_lock);
    return real_size;