Compare commits
10 Commits
ics
...
experiment
Author | SHA1 | Date | |
---|---|---|---|
|
c8b6a23850 | ||
|
c017fabcb6 | ||
|
1a10008f85 | ||
|
f02e3d17d6 | ||
|
69731609e9 | ||
|
8fea24f772 | ||
|
625c8174cb | ||
|
9e3f7b59d7 | ||
|
acd1c1032f | ||
|
3f02397d56 |
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 32
|
||||
EXTRAVERSION = -ics
|
||||
EXTRAVERSION = -gb
|
||||
NAME = Man-Eating Seals of Antiquity
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.32-ics
|
||||
# Tue Feb 28 17:02:10 CST 2012
|
||||
# Linux kernel version: 2.6.32-gb
|
||||
# Wed Mar 7 22:35:16 2012
|
||||
#
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
||||
@ -31,7 +31,7 @@ CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_BROKEN_ON_SMP=y
|
||||
CONFIG_LOCK_KERNEL=y
|
||||
CONFIG_INIT_ENV_ARG_LIMIT=32
|
||||
CONFIG_LOCALVERSION="_htcleo_r1"
|
||||
CONFIG_LOCALVERSION="_cmhtcleo"
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_HAVE_KERNEL_GZIP=y
|
||||
CONFIG_HAVE_KERNEL_BZIP2=y
|
||||
@ -203,6 +203,7 @@ CONFIG_ARCH_MSM=y
|
||||
CONFIG_ARCH_QSD8X50=y
|
||||
CONFIG_ARCH_MSM_SCORPION=y
|
||||
CONFIG_MSM_MDP31=y
|
||||
CONFIG_FORCE_FAST_CHARGE=y
|
||||
# CONFIG_PERFLOCK is not set
|
||||
CONFIG_MSM_AMSS_VERSION=1550
|
||||
# CONFIG_MSM_AMSS_VERSION_6210 is not set
|
||||
@ -425,9 +426,9 @@ CONFIG_CPU_FREQ_STAT_DETAILS=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE is not set
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVEX is not set
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS is not set
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS2 is not set
|
||||
|
@ -63,6 +63,15 @@ config MSM_MDP40
|
||||
bool
|
||||
depends on ARCH_MSM7X30
|
||||
default y
|
||||
|
||||
config FORCE_FAST_CHARGE
|
||||
bool "Force AC charge mode at will"
|
||||
default n
|
||||
help
|
||||
Enable support in kernel for user to override FAST CHARGE,
|
||||
using a simple sysfs interface. It is disabled by default on boot
|
||||
Enabling this will only provide an option for user to override default settings
|
||||
under standard disclaimer of no implied or explicit warranty.
|
||||
|
||||
config TURBO_MODE
|
||||
bool "Turbo mode"
|
||||
|
@ -251,3 +251,5 @@ obj-$(CONFIG_MACH_MAHIMAHI) += board-mahimahi-smb329.o
|
||||
obj-$(CONFIG_MSM_SSBI) += ssbi.o
|
||||
|
||||
obj-$(CONFIG_HTC_FB_CONSOLE) += htc_fb_console.o
|
||||
|
||||
obj-$(CONFIG_FORCE_FAST_CHARGE) += fastchg.o
|
||||
|
70
arch/arm/mach-msm/fastchg.c
Normal file
70
arch/arm/mach-msm/fastchg.c
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Author: Chad Froebel <chadfroebel@gmail.com>
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/fastchg.h>
|
||||
|
||||
int force_fast_charge;
|
||||
|
||||
/* sysfs interface */
|
||||
static ssize_t force_fast_charge_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", force_fast_charge);
|
||||
}
|
||||
|
||||
static ssize_t force_fast_charge_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
sscanf(buf, "%du", &force_fast_charge);
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct kobj_attribute force_fast_charge_attribute =
|
||||
__ATTR(force_fast_charge, 0666, force_fast_charge_show, force_fast_charge_store);
|
||||
|
||||
static struct attribute *attrs[] = {
|
||||
&force_fast_charge_attribute.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct attribute_group attr_group = {
|
||||
.attrs = attrs,
|
||||
};
|
||||
|
||||
static struct kobject *force_fast_charge_kobj;
|
||||
|
||||
int force_fast_charge_init(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
force_fast_charge = 0;
|
||||
|
||||
force_fast_charge_kobj = kobject_create_and_add("fast_charge", kernel_kobj);
|
||||
if (!force_fast_charge_kobj) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
retval = sysfs_create_group(force_fast_charge_kobj, &attr_group);
|
||||
if (retval)
|
||||
kobject_put(force_fast_charge_kobj);
|
||||
return retval;
|
||||
}
|
||||
/* end sysfs interface */
|
||||
|
||||
void force_fast_charge_exit(void)
|
||||
{
|
||||
kobject_put(force_fast_charge_kobj);
|
||||
}
|
||||
|
||||
module_init(force_fast_charge_init);
|
||||
module_exit(force_fast_charge_exit);
|
@ -32,6 +32,7 @@
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/tps65200.h>
|
||||
#include <linux/fastchg.h>
|
||||
#ifdef CONFIG_HTC_BATTCHG_SMEM
|
||||
#include "smd_private.h"
|
||||
#endif
|
||||
@ -502,15 +503,14 @@ static int htc_cable_status_update(int status)
|
||||
}
|
||||
|
||||
mutex_lock(&htc_batt_info.lock);
|
||||
#if 1
|
||||
pr_info("batt: %s: %d -> %d\n", __func__, htc_batt_info.rep.charging_source, status);
|
||||
if (status == htc_batt_info.rep.charging_source) {
|
||||
/* When cable overvoltage(5V => 7V) A9 will report the same source, so only sent the uevent */
|
||||
if (status == CHARGER_USB) {
|
||||
power_supply_changed(&htc_power_supplies[CHARGER_USB]);
|
||||
if (htc_batt_debug_mask & HTC_BATT_DEBUG_UEVT)
|
||||
BATT_LOG("batt:(htc_cable_status_update)power_supply_changed: OverVoltage");
|
||||
}
|
||||
power_supply_changed(&htc_power_supplies[CHARGER_USB]);
|
||||
if (htc_batt_debug_mask & HTC_BATT_DEBUG_UEVT)
|
||||
BATT_LOG("batt:(htc_cable_status_update)power_supply_changed: OverVoltage");
|
||||
}
|
||||
mutex_unlock(&htc_batt_info.lock);
|
||||
return 0;
|
||||
}
|
||||
@ -524,7 +524,7 @@ static int htc_cable_status_update(int status)
|
||||
update_wake_lock(status);
|
||||
/*ARM9 report CHARGER_AC while plug in htc_adaptor which is identify by usbid*/
|
||||
/*don't need to notify usb driver*/
|
||||
if ((htc_batt_info.guage_driver == GUAGE_MODEM) && (status == CHARGER_AC)) {
|
||||
if (((htc_batt_info.guage_driver == GUAGE_MODEM) && (status == CHARGER_AC)) || (force_fast_charge != 0)) {
|
||||
htc_set_smem_cable_type(CHARGER_AC);
|
||||
power_supply_changed(&htc_power_supplies[CHARGER_AC]);
|
||||
} else
|
||||
@ -542,62 +542,6 @@ static int htc_cable_status_update(int status)
|
||||
if (htc_batt_debug_mask & HTC_BATT_DEBUG_UEVT)
|
||||
BATT_LOG("batt:(htc_cable_status_update)power_supply_changed: battery");
|
||||
}
|
||||
|
||||
#else
|
||||
/* A9 reports USB charging when helf AC cable in and China AC charger. */
|
||||
/* notify userspace USB charging first,
|
||||
and then usb driver will notify AC while D+/D- Line short. */
|
||||
/* China AC detection:
|
||||
* Write SMEM as USB first, and update SMEM to AC
|
||||
* if receives AC notification */
|
||||
last_source = htc_batt_info.rep.charging_source;
|
||||
if (status == CHARGER_USB && g_usb_online == 0) {
|
||||
htc_set_smem_cable_type(CHARGER_USB);
|
||||
htc_batt_info.rep.charging_source = CHARGER_USB;
|
||||
} else {
|
||||
htc_set_smem_cable_type(status);
|
||||
htc_batt_info.rep.charging_source = status;
|
||||
/* usb driver will not notify usb offline. */
|
||||
if (status == CHARGER_BATTERY && g_usb_online != 0)
|
||||
g_usb_online = 0;
|
||||
}
|
||||
|
||||
msm_hsusb_set_vbus_state(status == CHARGER_USB);
|
||||
if (htc_batt_info.guage_driver == GUAGE_DS2784 ||
|
||||
htc_batt_info.guage_driver == GUAGE_DS2746)
|
||||
blocking_notifier_call_chain(&cable_status_notifier_list,
|
||||
htc_batt_info.rep.charging_source, NULL);
|
||||
|
||||
if (htc_batt_info.rep.charging_source != last_source) {
|
||||
#if 1 //JH //this is for packet filter (notify port list while USB in/out)
|
||||
update_port_list_charging_state(!(htc_batt_info.rep.charging_source == CHARGER_BATTERY));
|
||||
#endif
|
||||
/* Lock suspend only when USB in for ADB or other USB functions. */
|
||||
if (htc_batt_info.rep.charging_source == CHARGER_USB) {
|
||||
wake_lock(&vbus_wake_lock);
|
||||
} else if (__htc_power_policy()) {
|
||||
/* Lock suspend for DOPOD charging animation */
|
||||
wake_lock(&vbus_wake_lock);
|
||||
} else {
|
||||
if (htc_batt_info.rep.charging_source == CHARGER_AC
|
||||
&& last_source == CHARGER_USB)
|
||||
BATT_ERR("%s: USB->AC\n", __func__);
|
||||
/* give userspace some time to see the uevent and update
|
||||
* LED state or whatnot...
|
||||
*/
|
||||
wake_lock_timeout(&vbus_wake_lock, HZ * 5);
|
||||
}
|
||||
if (htc_batt_info.rep.charging_source == CHARGER_BATTERY || last_source == CHARGER_BATTERY)
|
||||
power_supply_changed(&htc_power_supplies[CHARGER_BATTERY]);
|
||||
if (htc_batt_info.rep.charging_source == CHARGER_USB || last_source == CHARGER_USB)
|
||||
power_supply_changed(&htc_power_supplies[CHARGER_USB]);
|
||||
if (htc_batt_info.rep.charging_source == CHARGER_AC || last_source == CHARGER_AC)
|
||||
power_supply_changed(&htc_power_supplies[CHARGER_AC]);
|
||||
if (htc_batt_debug_mask & HTC_BATT_DEBUG_UEVT)
|
||||
BATT_LOG("power_supply_changed: %s -> %s",
|
||||
charger_tags[last_source], charger_tags[htc_batt_info.rep.charging_source]);
|
||||
}
|
||||
#endif
|
||||
mutex_unlock(&htc_batt_info.lock);
|
||||
|
||||
return rc;
|
||||
@ -642,7 +586,6 @@ EXPORT_SYMBOL(htc_get_usb_accessory_adc_level);
|
||||
and then usb driver will notify AC while D+/D- Line short. */
|
||||
static void usb_status_notifier_func(int online)
|
||||
{
|
||||
#if 1
|
||||
pr_info("batt:online=%d",online);
|
||||
/* TODO: replace charging_source to usb_status */
|
||||
htc_batt_info.rep.charging_source = online;
|
||||
@ -661,20 +604,6 @@ static void usb_status_notifier_func(int online)
|
||||
pr_err("\n\n ### htc_battery_code is not inited yet! ###\n\n");
|
||||
}
|
||||
update_wake_lock(htc_batt_info.rep.charging_source);
|
||||
#else
|
||||
mutex_lock(&htc_batt_info.lock);
|
||||
if (htc_batt_debug_mask & HTC_BATT_DEBUG_USB_NOTIFY)
|
||||
BATT_LOG("%s: online=%d, g_usb_online=%d", __func__, online, g_usb_online);
|
||||
if (g_usb_online != online) {
|
||||
g_usb_online = online;
|
||||
if (online == CHARGER_AC && htc_batt_info.rep.charging_source == CHARGER_USB) {
|
||||
mutex_unlock(&htc_batt_info.lock);
|
||||
htc_cable_status_update(CHARGER_AC);
|
||||
mutex_lock(&htc_batt_info.lock);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&htc_batt_info.lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int htc_get_batt_info(struct battery_info_reply *buffer)
|
||||
@ -985,7 +914,7 @@ static int htc_power_get_property(struct power_supply *psy,
|
||||
|
||||
switch (psp) {
|
||||
case POWER_SUPPLY_PROP_ONLINE:
|
||||
if (psy->type == POWER_SUPPLY_TYPE_MAINS) {
|
||||
if (psy->type == POWER_SUPPLY_TYPE_MAINS || (force_fast_charge != 0)) {
|
||||
val->intval = (charger == CHARGER_AC ? 1 : 0);
|
||||
if (htc_batt_debug_mask & HTC_BATT_DEBUG_USER_QUERY)
|
||||
BATT_LOG("%s: %s: online=%d", __func__, psy->name, val->intval);
|
||||
|
@ -368,12 +368,12 @@ static void remove_35mm_do_work(struct work_struct *work)
|
||||
|
||||
if (hi->usb_dev_type == USB_HEADSET) {
|
||||
hi->usb_dev_status = STATUS_CONNECTED_ENABLED;
|
||||
state &= ~BIT_HEADSET;
|
||||
state &= ~(BIT_35MM_HEADSET | BIT_HEADSET);
|
||||
state |= BIT_HEADSET_NO_MIC;
|
||||
switch_set_state(&hi->sdev, state);
|
||||
mutex_unlock(&hi->mutex_lock);
|
||||
} else if (hi->usb_dev_type == H2W_TVOUT) {
|
||||
state &= ~BIT_HEADSET;
|
||||
state &= ~(BIT_HEADSET | BIT_35MM_HEADSET);
|
||||
state |= BIT_HEADSET_NO_MIC;
|
||||
switch_set_state(&hi->sdev, state);
|
||||
#if 0
|
||||
@ -384,7 +384,7 @@ static void remove_35mm_do_work(struct work_struct *work)
|
||||
HS_DELAY_ZERO_JIFFIES);
|
||||
#endif
|
||||
} else {
|
||||
state &= ~(BIT_HEADSET | BIT_HEADSET_NO_MIC);
|
||||
state &= ~(BIT_HEADSET | BIT_HEADSET_NO_MIC | BIT_35MM_HEADSET);
|
||||
switch_set_state(&hi->sdev, state);
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ static void insert_35mm_do_work(struct work_struct *work)
|
||||
state |= BIT_HEADSET;
|
||||
printk(KERN_INFO "3.5mm_headset with microphone\n");
|
||||
}
|
||||
|
||||
state |= BIT_35MM_HEADSET;
|
||||
switch_set_state(&hi->sdev, state);
|
||||
if (state & BIT_HEADSET_NO_MIC)
|
||||
hi->ext_35mm_status = HTC_35MM_NO_MIC;
|
||||
|
@ -154,37 +154,24 @@ ENTRY(v7_coherent_kern_range)
|
||||
* - the Icache does not read data from the write buffer
|
||||
*/
|
||||
ENTRY(v7_coherent_user_range)
|
||||
UNWIND(.fnstart )
|
||||
dcache_line_size r2, r3
|
||||
sub r3, r2, #1
|
||||
bic r0, r0, r3
|
||||
1:
|
||||
USER( mcr p15, 0, r0, c7, c11, 1 ) @ clean D line to the point of unification
|
||||
dsb
|
||||
USER( mcr p15, 0, r0, c7, c5, 1 ) @ invalidate I line
|
||||
add r0, r0, r2
|
||||
2:
|
||||
cmp r0, r1
|
||||
blo 1b
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB
|
||||
dsb
|
||||
isb
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
* Fault handling for the cache operation above. If the virtual address in r0
|
||||
* isn't mapped, just try the next page.
|
||||
*/
|
||||
9001:
|
||||
mov r0, r0, lsr #12
|
||||
mov r0, r0, lsl #12
|
||||
add r0, r0, #4096
|
||||
b 2b
|
||||
UNWIND(.fnend )
|
||||
dcache_line_size r2, r3
|
||||
sub r3, r2, #1
|
||||
bic r0, r0, r3
|
||||
1: mcr p15, 0, r0, c7, c11, 1
|
||||
dsb
|
||||
mcr p15, 0, r0, c7, c5, 1
|
||||
add r0, r0, r2
|
||||
cmp r0, r1
|
||||
blo 1b
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c5, 6
|
||||
dsb
|
||||
isb
|
||||
mov pc, lr
|
||||
ENDPROC(v7_coherent_kern_range)
|
||||
ENDPROC(v7_coherent_user_range)
|
||||
|
||||
|
||||
/*
|
||||
* v7_flush_kern_dcache_page(kaddr)
|
||||
*
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/switch.h>
|
||||
|
||||
#include <linux/fastchg.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <mach/board.h>
|
||||
@ -1793,7 +1795,11 @@ static void charger_detect(struct usb_info *ui)
|
||||
return;
|
||||
msleep(10);
|
||||
/* detect shorted D+/D-, indicating AC power */
|
||||
#ifdef CONFIG_FORCE_FAST_CHARGE
|
||||
if (((readl(USB_PORTSC) & PORTSC_LS) != PORTSC_LS) || (force_fast_charge == 0)) {
|
||||
#else
|
||||
if ((readl(USB_PORTSC) & PORTSC_LS) != PORTSC_LS) {
|
||||
#endif
|
||||
printk(KERN_INFO "usb: not AC charger\n");
|
||||
ui->connect_type = CONNECT_TYPE_UNKNOWN;
|
||||
queue_delayed_work(ui->usb_wq, &ui->chg_work,
|
||||
|
21
include/linux/fastchg.h
Normal file
21
include/linux/fastchg.h
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Author: Chad Froebel <chadfroebel@gmail.com>
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LINUX_FASTCHG_H
|
||||
#define _LINUX_FASTCHG_H
|
||||
|
||||
extern int force_fast_charge;
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user