static ssize_t factory_check_emmc_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { ///* char str[512]; int str_len = 0; if ( !lge_get_factory_boot() ) return -EINVAL; if ( buf[0] =='$' ) { memset(factory_check_emmc_buf, 0, 4096); check_emmc_cnt = 0; return -EINVAL; } str_len = sprintf(str, "%s", buf); if ( (check_emmc_cnt+str_len) > 4096 ) { sprintf((char *) &factory_check_emmc_buf[check_emmc_cnt], "$"); check_emmc_cnt++; return check_emmc_cnt; } sprintf((char *) &factory_check_emmc_buf[check_emmc_cnt], "%s", buf); check_emmc_cnt += str_len; //*/ return check_emmc_cnt; }
static ssize_t pre_selfd_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { char str[512]; int str_len = 0; if ( !lge_get_factory_boot() ) return -EINVAL; if ( buf[0] =='$' ) { memset(pre_selfd_buf, 0, 4096); selfd_cnt = 0; return -EINVAL; } str_len = sprintf(str, "%s", buf); if ( (selfd_cnt+str_len) > 4096 ) { sprintf((char *) &pre_selfd_buf[selfd_cnt], "$"); selfd_cnt++; return selfd_cnt; } sprintf((char *) &pre_selfd_buf[selfd_cnt], "%s", buf); selfd_cnt += str_len; return selfd_cnt; }
int siw_touch_boot_mode_check(struct device *dev) { struct siw_ts *ts = to_touch_core(dev); int ret = NORMAL_BOOT; #if defined(CONFIG_SIW_GET_FACTORY_MODE) ret = sys_get_factory_boot(); #elif defined(CONFIG_TOUCHSCREEN_SIW_LG4895_F650) || \ defined(CONFIG_TOUCHSCREEN_SIW_LG4946_F700) ret = lge_get_factory_boot(); #endif if (ret != NORMAL_BOOT) { switch (atomic_read(&ts->state.mfts)) { case MFTS_NONE : ret = MINIOS_AAT; break; case MFTS_FOLDER : ret = MINIOS_MFTS_FOLDER; break; case MFTS_FLAT : ret = MINIOS_MFTS_FLAT; break; case MFTS_CURVED : ret = MINIOS_MFTS_CURVED; break; default : ret = MINIOS_AAT; break; } } return ret; }
static int __init acpuclk_8064_probe(struct platform_device *pdev) { #ifdef CONFIG_LGE_PM if (lge_get_factory_boot()) { if(lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_56K || // #ifdef CONFIG_MACH_APQ8064_L05E lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_910K || // #endif lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_130K) { pr_info("apq8064:::select pvs_tables to factory_1026\n"); acpuclk_8064_params.pvs_tables = pvs_tables_factory_1026; } else { pr_info("select pvs_tables to original pvs_table\n"); acpuclk_8064_params.pvs_tables = pvs_tables; } } #endif // if (cpu_is_apq8064ab() || SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) { acpuclk_8064_params.hfpll_data->low_vdd_l_max = 37; acpuclk_8064_params.hfpll_data->nom_vdd_l_max = 74; } return acpuclk_krait_init(&pdev->dev, &acpuclk_8064_params); }
/** * We will reset the cpu frequencies limits here. The core online/offline * status will be carried over to the process stopping the msm_thermal, as * we dont want to online a core and bring in the thermal issues. */ static void __cpuinit disable_msm_thermal(void) { int cpu = 0; /* make sure check_temp is no longer running */ cancel_delayed_work(&check_temp_work); flush_scheduled_work(); #if defined(CONFIG_MACH_APQ8064_GK_KR) || defined(CONFIG_MACH_APQ8064_GKATT)\ || defined(CONFIG_MACH_APQ8064_GVDCM) || defined(CONFIG_MACH_APQ8064_GV_KR) || defined(CONFIG_MACH_APQ8064_GKGLOBAL) || defined(CONFIG_MACH_APQ8064_OMEGAR_KR) || defined(CONFIG_MACH_APQ8064_OMEGA_KR) if (lge_get_factory_boot()) return; if (limited_max_freq == DEF_ALLOWED_MAX_FREQ_1) { pr_info("msm_thermal: Continue to limit cpu%d max freq to %d\n", cpu, DEF_ALLOWED_MAX_FREQ_1); return; } if (limited_max_freq == DEF_ALLOWED_MAX_FREQ_2) { pr_info("msm_thermal: Continue to limit cpu%d cur freq to %d\n", cpu, DEF_ALLOWED_MAX_FREQ_2); limit_cpufreq = 1; if( timer_pending(&limit_timer)) del_timer(&limit_timer); init_timer(&limit_timer); limit_timer.function = msm_thermal_limit_holding_timer; limit_timer.expires = jiffies + msecs_to_jiffies(6000); add_timer(&limit_timer); } #endif if (limited_max_freq == MSM_CPUFREQ_NO_LIMIT) return; #if defined(CONFIG_MACH_APQ8064_GVAR_CMCC) // if (limited_max_freq == DEF_ALLOWED_MAX_FREQ) { pr_info("msm_thermal: continue max_freq = %d..\n", DEF_ALLOWED_MAX_FREQ); return; } #endif for_each_possible_cpu(cpu) { update_cpu_max_freq(cpu, MSM_CPUFREQ_NO_LIMIT); } }
static int __init acpuclk_8064_probe(struct platform_device *pdev) { #ifdef CONFIG_LGE_PM /* Krait freq table set for factory boot mode */ if (lge_get_factory_boot()) { #if defined(CONFIG_MACH_APQ8064_J1KD) || defined(CONFIG_MACH_APQ8064_J1D) if(lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_56K) { pr_info("select pvs_tables to factory 56K\n"); acpuclk_8064_params.pvs_tables = pvs_tables_factory_56k; } else { pr_info("select pvs_tables to factory\n"); acpuclk_8064_params.pvs_tables = pvs_tables_factory_1026; } #elif defined(CONFIG_MACH_APQ8064_GK_KR)||defined(CONFIG_MACH_APQ8064_GKATT)||defined(CONFIG_MACH_APQ8064_GVDCM)||defined(CONFIG_MACH_APQ8064_GV_KR)||defined(CONFIG_MACH_APQ8064_GKGLOBAL) if(lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_56K || lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_130K || lge_get_boot_cable_type() == LGE_BOOT_LT_CABLE_910K) { pr_info("select pvs_tables to factory_1026\n"); acpuclk_8064_params.pvs_tables = pvs_tables_factory_1026; } else { pr_info("select pvs_tables to factory_1134\n"); acpuclk_8064_params.pvs_tables = pvs_tables_factory_1134; } #else pr_info("select pvs_tables to factory_1026\n"); acpuclk_8064_params.pvs_tables = pvs_tables_factory_1026; #endif } #endif //CONFIG_LGE_PM if (cpu_is_apq8064ab() || SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) { acpuclk_8064_params.hfpll_data->low_vdd_l_max = 37; acpuclk_8064_params.hfpll_data->nom_vdd_l_max = 74; } return acpuclk_krait_init(&pdev->dev, &acpuclk_8064_params); }
int lge_pre_self_diagnosis(char *drv_bus_code, int func_code, char *dev_code, char *drv_code, int errno) { char str[512]; int str_len = 0; if ( !lge_get_factory_boot() ) return 1; str_len = sprintf(str, "%s|%d|%s|%s|%d\n", drv_bus_code, func_code, dev_code, drv_code, errno); if ( (selfd_cnt+str_len) > 4096 ) { sprintf((char *) &pre_selfd_buf[selfd_cnt], "$"); selfd_cnt++; return 1; } sprintf((char *) &pre_selfd_buf[selfd_cnt], "%s|%d|%s|%s|%d\n", drv_bus_code, func_code, dev_code, drv_code, errno); selfd_cnt += str_len; return 0; }
static void diag_enable(int enable) { #ifdef CONFIG_LGE_USB_DIAG_DISABLE_ONLY_MDM if(lge_get_factory_boot()) { pr_info("diag_lock : force to enable, pifcable\n"); diagfwd_hsic_enable(DIAG_ENABLE); } else { pr_info("diag_lock : enable = %d, pifcable is not\n", enable); set_diag_state(enable); diagfwd_hsic_enable(enable); } #else set_diag_state(enable); diagfwd_enable(enable); diagfwd_hsic_enable(enable); #endif }
int lge_fac_check_emmc(char *drv_bus_code, int func_code, char *dev_code, char *drv_code, int errno) { ///* char str[512]; int str_len = 0; if ( !lge_get_factory_boot() ) return 1; str_len = sprintf(str, "%s|%d|%s|%s|%d\n", drv_bus_code, func_code, dev_code, drv_code, errno); memset(str, 0, 512); str_len = 0; if ( (check_emmc_cnt+str_len) > 4096 ) { //sprintf((char *) &factory_check_emmc_buf[check_emmc_cnt], "$"); //check_emmc_cnt++; return 1; } sprintf((char *) &factory_check_emmc_buf[check_emmc_cnt], "%s|%d|%s|%s|%d\n", drv_bus_code, func_code, dev_code, drv_code, errno); memset(factory_check_emmc_buf, 0, 4096); check_emmc_cnt += str_len; //*/ return 0; }
static void __cpuinit check_temp(struct work_struct *work) { static int limit_init; struct tsens_device tsens_dev; long temp = 0; uint32_t max_freq = limited_max_freq; int cpu = 0; int ret = 0; tsens_dev.sensor_num = msm_thermal_info.sensor_id; ret = tsens_get_temp(&tsens_dev, &temp); if (ret) { pr_debug("%s: Unable to read TSENS sensor %d\n", KBUILD_MODNAME, tsens_dev.sensor_num); goto reschedule; } if (!limit_init) { ret = msm_thermal_get_freq_table(); if (ret) goto reschedule; else limit_init = 1; } #if defined(CONFIG_MACH_APQ8064_GK_KR) || defined(CONFIG_MACH_APQ8064_GKATT)\ || defined(CONFIG_MACH_APQ8064_GVDCM) || defined(CONFIG_MACH_APQ8064_GV_KR) || defined(CONFIG_MACH_APQ8064_GKGLOBAL) || defined(CONFIG_MACH_APQ8064_OMEGAR_KR) || defined(CONFIG_MACH_APQ8064_OMEGA_KR) if (lge_get_factory_boot()) return; do_core_control(temp); if (temp >= msm_thermal_info.limit_temp_degC || temp <= msm_thermal_info.limit_temp_degC_low) { max_freq = DEF_ALLOWED_MAX_FREQ_1; pr_info("msm_thermal: tsens_temp %ld\n", temp); } else if ( (temp < msm_thermal_info.limit_temp_degC - msm_thermal_info.temp_hysteresis_degC) && (temp > msm_thermal_info.limit_temp_degC_low)) { max_freq = DEF_ALLOWED_MAX_FREQ_2; } else { if(limited_max_freq == MSM_CPUFREQ_NO_LIMIT) max_freq = DEF_ALLOWED_MAX_FREQ_2; } #else do_core_control(temp); if (temp >= msm_thermal_info.limit_temp_degC #if defined(CONFIG_MACH_APQ8064_GVAR_CMCC) // || temp <= msm_thermal_info.limit_temp_degC_low #endif ) { if (limit_idx == limit_idx_low) goto reschedule; limit_idx -= msm_thermal_info.freq_step; if (limit_idx < limit_idx_low) limit_idx = limit_idx_low; max_freq = table[limit_idx].frequency; #ifdef CONFIG_LGE_PM if(max_freq >= 1026000) max_freq = DEF_ALLOWED_MAX_FREQ; pr_info("msm_thermal: tsens_temp %ld\n", temp); #endif } else if ( (temp < msm_thermal_info.limit_temp_degC - msm_thermal_info.temp_hysteresis_degC) #if defined(CONFIG_MACH_APQ8064_GVAR_CMCC) // && (temp > msm_thermal_info.limit_temp_degC_low) #endif ) { if (limit_idx == limit_idx_high) goto reschedule; limit_idx += msm_thermal_info.freq_step; if (limit_idx >= limit_idx_high) { limit_idx = limit_idx_high; max_freq = MSM_CPUFREQ_NO_LIMIT; } else max_freq = table[limit_idx].frequency; } #endif if (max_freq == limited_max_freq) goto reschedule; /* Update new limits */ for_each_possible_cpu(cpu) { ret = update_cpu_max_freq(cpu, max_freq); if (ret) pr_debug( "%s: Unable to limit cpu%d max freq to %d\n", KBUILD_MODNAME, cpu, max_freq); } reschedule: if (enabled) schedule_delayed_work(&check_temp_work, msecs_to_jiffies(msm_thermal_info.poll_ms)); }