static int __init test_init(void) { msleep(3000); printk("start test kernel LG API ....\n"); LGE_API_test(); printk("end test kernel LG API...\n"); return 1; }
static int __init test_init(void) { #if 0 /* Block unnecessary Delay & Function */ msleep(3000); pr_debug("start test kernel LG API ....\n"); LGE_API_test(); pr_debug("end test kernel LG API...\n"); #endif return 1; }
static int swtp_state_machine(void *handle) { int run_mode, super_mode, normal_mode; int i = 0; int timeout; init_waitqueue_head(&swtp_isr_wait); #if 0 // waiting modem working & set cable status value while(i < SWTP_MAX_TIMEOUT_SEC) { timeout = wait_event_interruptible_timeout(swtp_isr_wait, swtp_send_sig, HZ); if(swtp_mod_eint_read()) break; i++; } // ccci channel is ready, but MD L1 part is not ready yet, need to re-send more. swtp_timer.expires = jiffies + 2 * HZ; add_timer(&swtp_timer); #endif swtp_mod_eint_enable(); // state machine while(1) { wait_event_interruptible(swtp_isr_wait, swtp_send_sig || kthread_should_stop()); if(kthread_should_stop()) break; swtp_send_sig--; run_mode = super_mode = normal_mode = SWTP_CTRL_MAX_STATE; mutex_lock(&swtp_ctrl_lock); for(i=0; i < SWTP_CTRL_MAX_STATE; i++) { if(swtp_state_reg[i].enable == SWTP_MODE_OFF) continue; if(swtp_state_reg[i].mode == SWTP_SUPER_MODE) super_mode = i; else if(swtp_state_reg[i].mode == SWTP_NORMAL_MODE) normal_mode = i; else printk(KERN_ALERT "[swtp error]: need to check 0x%x 0x%x\n", i, swtp_state_reg[i].mode ); } mutex_unlock(&swtp_ctrl_lock); if(super_mode < SWTP_CTRL_MAX_STATE) run_mode = super_mode; else if(normal_mode < SWTP_CTRL_MAX_STATE) run_mode = normal_mode; else if(run_mode == SWTP_CTRL_MAX_STATE) { swtp_reset_tx_power(); printk(KERN_ALERT "[swtp]: swtp_reset_tx_power : 0x%x\n", SWTP_DEFAULT_MODE); LGE_API_test(); continue; } swtp_set_tx_power(swtp_state_reg[run_mode].setvalue); printk(KERN_ALERT "[swtp]: swtp_set_tx_power [%d]: 0x%x\n", run_mode, swtp_state_reg[run_mode].setvalue); LGE_API_test(); } return 0; }