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; }
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; }
int xmd_ch_reset(void) { int ch_i; int size = ARRAY_SIZE(hsi_all_channels); // #if defined (ENABLE_RECOVERY_WAKE_LOCK) wake_lock_timeout(&xmd_recovery_wake_lock, RECOVERY_WAKELOCK_TIME); #endif // // #if 0 if( hsi_mcm_state == HSI_MCM_STATE_ERR_RECOVERY) { #if MCM_DBG_ERR_RECOVERY_LOG printk("\nmcm: xmd_ch_reset already HSI_MCM_STATE_ERR_RECOVERY in progress\n"); #endif return -1; } hsi_mcm_state = HSI_MCM_STATE_ERR_RECOVERY; #endif // // #if defined(CONFIG_MACH_LGE) /*Modem Reset */ printk("\nmcm: [MIPI-HSI] ifx_pmu_reset.\n"); ifx_pmu_reset(); //RIP-11203 #endif // #if MCM_DBG_ERR_RECOVERY_LOG printk("\nmcm: HSI DLP Error Recovery initiated.\n"); #endif for (ch_i=0; ch_i < size; ch_i++) { if (hsi_channels[ch_i].write_happening == HSI_TRUE) { hsi_channels[ch_i].write_happening = HSI_FALSE; wake_up(&hsi_channels[ch_i].write_wait); } } flush_workqueue(hsi_write_wq); hsi_ll_reset(); flush_workqueue(hsi_read_wq); for (ch_i=0; ch_i < size; ch_i++) { init_q(ch_i); } // #if defined(CONFIG_MACH_LGE) /* TODO: Fine tune to required value. */ msleep(5000); #endif // #if MCM_DBG_ERR_RECOVERY_LOG printk("\nmcm: HSI DLP Error Recovery completed waiting for CP ready indication from RIL.\n"); #endif /* Change MCM state to initilized when CP ready indication from tty ctrl channel is issued */ return 0; }