From 56aad1fd46fa288477406ef92ff7cab9ca0e72e3 Mon Sep 17 00:00:00 2001 From: Jon Benson Date: Mon, 18 Oct 2010 17:30:15 +1100 Subject: [PATCH] Changed battery driver to just charge FAST/SLOW to 100% rather than 99% I am assuming overcharge/overheat/etc protection will kick in and stop charging worst case. Updated overclocking code based on huanyu and michyprima's versions. Still overclocked by default to 1113MHz but can be pushed to 1152MHz with SetCPU. Custom compiling with EXOVERCLOCK can now go to 1305MHz though I wouldn't recommend it. I find it unlikely any gain would be worth the risk of shortening the life of your CPU. --- arch/arm/mach-msm/acpuclock-scorpion.c | 14 ++++++++++---- arch/arm/mach-msm/board-htcleo-battery.c | 4 ---- arch/arm/mach-msm/cpufreq.c | 6 ++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-msm/acpuclock-scorpion.c b/arch/arm/mach-msm/acpuclock-scorpion.c index 807ec605..6d8ff358 100644 --- a/arch/arm/mach-msm/acpuclock-scorpion.c +++ b/arch/arm/mach-msm/acpuclock-scorpion.c @@ -170,23 +170,29 @@ struct clkctl_acpu_speed acpu_freq_tbl[] = { { 1036800, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1B, 0, 1225, 128000 }, { 1075200, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1C, 0, 1250, 128000 }, { 1113600, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1D, 0, 1275, 128000 }, + { 1152000, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1E, 0, 1300, 128000 }, #elif CONFIG_HTCLEO_UNDERVOLT_925 { 1036800, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1B, 0, 1225, 128000 }, { 1075200, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1C, 0, 1250, 128000 }, { 1113600, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1D, 0, 1275, 128000 }, + { 1152000, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1E, 0, 1300, 128000 }, #elif CONFIG_HTCLEO_UNDERVOLT_800 { 1036800, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1B, 0, 1225, 128000 }, { 1075200, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1C, 0, 1250, 128000 }, { 1113600, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1D, 0, 1275, 128000 }, + { 1152000, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1E, 0, 1300, 128000 }, #else { 1036800, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1B, 0, 1300, 128000 }, { 1075200, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1C, 0, 1300, 128000 }, { 1113600, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1D, 0, 1300, 128000 }, + { 1152000, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1E, 0, 1325, 128000 }, #endif #endif #ifdef CONFIG_HTCLEO_EXOVERCLOCK - { 1152000, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1E, 0, 1300, 128000 }, - { 1190400, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1F, 0, 1300, 128000 }, + { 1190400, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x1F, 0, 1325, 128000 }, + { 1228800, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x20, 0, 1325, 128000 }, + { 1267200, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x21, 0, 1350, 128000 }, + { 1305600, CCTL(CLK_TCXO, 1), SRC_SCPLL, 0x22, 0, 1350, 128000 }, #endif { 0 }, }; @@ -530,9 +536,9 @@ void __init acpu_freq_tbl_fixup(void) case 0x30: case 0x00: #ifdef CONFIG_HTCLEO_EXOVERCLOCK - max_acpu_khz = 1190400; + max_acpu_khz = 1305600; #elif CONFIG_HTCLEO_OVERCLOCK - max_acpu_khz = 1113600; + max_acpu_khz = 1152000; #else max_acpu_khz = 998400; #endif diff --git a/arch/arm/mach-msm/board-htcleo-battery.c b/arch/arm/mach-msm/board-htcleo-battery.c index 3cead6f2..0247f1e7 100644 --- a/arch/arm/mach-msm/board-htcleo-battery.c +++ b/arch/arm/mach-msm/board-htcleo-battery.c @@ -561,10 +561,6 @@ static int battery_adjust_charge_state(struct htcleo_device_info *di) { di->status.battery_full = 0; } - if((di->status.percentage > 98) && (charge_mode == CHARGE_FAST)) - { - charge_mode = CHARGE_SLOW; - } #else // CotullaTODO: add DS274X check code here di->status.battery_full = 0; diff --git a/arch/arm/mach-msm/cpufreq.c b/arch/arm/mach-msm/cpufreq.c index 53179912..dd75afe7 100644 --- a/arch/arm/mach-msm/cpufreq.c +++ b/arch/arm/mach-msm/cpufreq.c @@ -90,6 +90,12 @@ static int __init msm_cpufreq_init(struct cpufreq_policy *policy) BUG_ON(cpufreq_frequency_table_cpuinfo(policy, table)); policy->cur = acpuclk_get_rate(); +#ifdef CONFIG_HTCLEO_OVERCLOCK + policy->max = 1113600; +#endif +#ifdef CONFIG_HTCLEO_EXOVERCLOCK + policy->max = 1113600; +#endif policy->cpuinfo.transition_latency = acpuclk_get_switch_time() * NSEC_PER_USEC; return 0;