static ssize_t fota_test_proc_write(struct file *filp, const char *buf,
				    size_t len, loff_t * off)
{
	char messages[10];
	char cmd;

	if (len > 10)
		len = 10;

	if (copy_from_user(messages, buf, len))
		return -EFAULT;

	sscanf(buf, "%c", &cmd);

	pr_info("fota: %s: FOTA_proc_write \n", __func__);

	switch (cmd) {
	case '0':
		ifx_power_low();
		break;
	case '1':
		ifx_power_high();
		break;
	case '2':
		ifx_reset_low();
		break;
	case '3':
		ifx_reset_high();
		break;
	case '4':
		ifx_uart_sw_ctrl();
		break;
	case '5':
		ifx_fota_reset();
		break;
	case '6':
		ifx_pmu_reset();
		break;
#if defined ( TARGET_CARRIER_LGU )
	case '7':
	       ifx_fota_ready_low();
            break;	
	case '8':
	       ifx_fota_ready_high();
            break;	
#endif
	default:
		pr_warning("fota: FOTA Driver invalid arg\n");
		break;
	}
	return len;
}
Exemple #2
0
static ssize_t fota_test_proc_write(struct file *filp, const char *buf, size_t len, loff_t *off)
{
    char messages[10];
    u32 reg, val;
    int err;
    char cmd;

    if (len > 10)
        len = 10;

    if (copy_from_user(messages, buf, len))
        return -EFAULT;

    sscanf(buf, "%c", &cmd);

    printk("%s: FOTA_proc_write \n", __func__);

    switch(cmd){
        case '0':
            ifx_power_low();
            break;
        case '1':
            ifx_power_high();
            break;
        case '2':
            ifx_reset_low();
            break;
        case '3':
            ifx_reset_high();
            break;
        case '4':
	    ifx_uart_sw_ctrl();
            break;
        case '5':
	    ifx_fota_reset();
            break;	    
        case '6':
	    ifx_pmu_reset();
            break;	    
		case '7':
	    ifx_fota_reset_long();
            break;	   

	default :
            printk("FOTA Driver invalid arg\n");
            break;
    }
    return len;
}