Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cm-10.1' into ubuntu
Browse files Browse the repository at this point in the history
Conflicts:
	ramdisk/init.huawei.rc
  • Loading branch information
Daz Jones committed May 2, 2013
2 parents 7f2f3ab + eae4ae0 commit 2e41f07
Show file tree
Hide file tree
Showing 12 changed files with 137 additions and 158 deletions.
12 changes: 7 additions & 5 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ TARGET_CPU_SMP := false
TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon

# cortex-a9 is used to take advantage of NEON optimizations
TARGET_ARCH_VARIANT_CPU := cortex-a9
TARGET_ARCH_VARIANT_FPU := neon

BOARD_USES_QCOM_HARDWARE := true
COMMON_GLOBAL_CFLAGS += -DQCOM_HARDWARE

TARGET_GLOBAL_CFLAGS += -mfpu=neon -mfloat-abi=softfp
TARGET_GLOBAL_CPPFLAGS += -mfpu=neon -mfloat-abi=softfp

WITH_JIT := true

# Optimisations used by Qualcomm
TARGET_CORTEX_CACHE_LINE_32 := true
TARGET_USE_SPARROW_BIONIC_OPTIMIZATION := true
TARGET_AVOID_DRAW_TEXTURE_EXTENSION := true
TARGET_USES_16BPPSURFACE_FOR_OPAQUE := true

ARCH_ARM_HAVE_32_BYTE_CACHE_LINES := true

TARGET_USES_ION := false

TARGET_BOOTLOADER_BOARD_NAME := u8815
Expand Down Expand Up @@ -69,10 +73,7 @@ TARGET_QCOM_DISPLAY_VARIANT := legacy
COMMON_GLOBAL_CFLAGS += -DQCOM_ICS_DECODERS -DQCOM_LEGACY_OMX -DQCOM_NO_SECURE_PLAYBACK

# Web Rendering
ENABLE_JSC_JIT := true
ENABLE_WEBGL := true
HTTP := chrome
JS_ENGINE := v8
TARGET_FORCE_CPU_UPLOAD := true

# USB
Expand Down Expand Up @@ -100,6 +101,7 @@ BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
BOARD_LEGACY_NL80211_STA_EVENTS := true
WIFI_DRIVER_FW_PATH_AP := "/system/etc/fw_4330_b2.bin"
WIFI_DRIVER_FW_PATH_STA := "/system/etc/fw_4330_b2.bin"
WIFI_DRIVER_FW_PATH_P2P := "/system/etc/fw_4330_b2.bin"
Expand Down
1 change: 1 addition & 0 deletions bluetooth/bdroid_buildcfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
#define _BDROID_BUILDCFG_H

#define BTM_DEF_LOCAL_NAME "Ascend G300"
#define BTA_DISABLE_DELAY 1000 /* in milliseconds */

#endif
10 changes: 5 additions & 5 deletions bluetooth/vnd_u8815.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyHS0"
FW_PATCHFILE_LOCATION = "/system/etc/bluetooth/"
BT_WAKE_VIA_PROC = TRUE
LPM_IDLE_TIMEOUT_MULTIPLE = 5
BTVND_DBG = TRUE
BTVND_DBG = FALSE
BTHW_DBG = TRUE
VNDUSERIAL_DBG = TRUE
UPIO_DBG = TRUE
FW_PATCH_SETTLEMENT_DELAY_MS = 50
LPM_SLEEP_MODE = 0
VNDUSERIAL_DBG = FALSE
UPIO_DBG = FALSE
SCO_PCM_IF_CLOCK_RATE = 2
22 changes: 22 additions & 0 deletions configs/libcm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/system/bin/sh

# Determined by arch/arm/mach-msm/hardware_self_adapt.c
cat /proc/app_info | grep -A1 "framebuffer_boosted:" | grep -q "1"
boosted=$?

mount -o remount,rw /system

if [ -f /system/lib/libcm.so ]; then
rm /system/lib/libcm.so
fi

# Link the correct libcm.so to /system/lib/libcm.so depending on framebuffer memory
# (which can be used to determine the baseband early on).
if [ $boosted == 0 ]; then
ln -s /system/lib/109808/libcm.so /system/lib/libcm.so
mount -o remount,ro /system
exit 0
fi

ln -s /system/lib/2030/libcm.so /system/lib/libcm.so
mount -o remount,ro /system
6 changes: 4 additions & 2 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ PRODUCT_PACKAGES += \
com.android.future.usb.accessory

PRODUCT_COPY_FILES += \
device/huawei/u8815/ramdisk/fstab.u8815:root/fstab.u8815 \
device/huawei/u8815/ramdisk/init.huawei.rc:root/init.huawei.rc \
device/huawei/u8815/ramdisk/ueventd.huawei.rc:root/ueventd.huawei.rc \
device/huawei/u8815/ramdisk/init.huawei.usb.rc:root/init.huawei.usb.rc
device/huawei/u8815/ramdisk/init.huawei.usb.rc:root/init.huawei.usb.rc \
device/huawei/u8815/ramdisk/ueventd.huawei.rc:root/ueventd.huawei.rc

PRODUCT_COPY_FILES += \
device/huawei/u8815/prebuilt/fw_4330_b2.bin:system/etc/fw_4330_b2.bin \
Expand All @@ -72,6 +73,7 @@ PRODUCT_COPY_FILES += \
device/huawei/u8815/configs/AutoVolumeControl.txt:system/etc/AutoVolumeControl.txt \
device/huawei/u8815/configs/media_codecs.xml:system/etc/media_codecs.xml \
device/huawei/u8815/configs/media_profiles.xml:system/etc/media_profiles.xml \
device/huawei/u8815/configs/libcm.sh:system/etc/libcm.sh \
device/huawei/u8815/configs/vold.fstab:system/etc/vold.fstab

PRODUCT_COPY_FILES += \
Expand Down
56 changes: 18 additions & 38 deletions overlay/frameworks/base/core/res/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<bool name="config_automatic_brightness_available">true</bool>

<!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
<bool name="config_unplugTurnsOnScreen">false</bool>
<bool name="config_unplugTurnsOnScreen">true</bool>

<!-- If this is true, the screen will fade off. -->
<bool name="config_animateScreenLights">false</bool>
Expand Down Expand Up @@ -142,11 +142,11 @@
Must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLevels">
<item>100</item>
<item>200</item>
<item>400</item>
<item>1000</item>
<item>3000</item>
<item>225</item>
<item>320</item>
<item>1280</item>
<item>2600</item>
<item>10240</item>
</integer-array>

<!-- Minimum screen brightness allowed by the power manager. -->
Expand All @@ -157,26 +157,22 @@
than the size of the config_autoBrightnessLevels array.
This must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>30</item>
<item>55</item>
<item>150</item>
<item>150</item>
<item>150</item>
<item>20</item>
<item>50</item>
<item>80</item>
<item>145</item>
<item>200</item>
<item>255</item>
</integer-array>

<!-- Flag indicating whether we should enable automatic brightness for
the button and keyboard backlights.
<bool name="config_autoBrightnessButtonKeyboard">false</bool> -->

<!-- Array of output values for button backlight corresponding to the LUX values
in the config_autoBrightnessLevels array. This array should have size one greater
than the size of the config_autoBrightnessLevels array.
This must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>255</item>
<item>255</item>
<item>0</item>
<item>255</item>
<item>0</item>
<item>0</item>
<item>0</item>
Expand All @@ -195,29 +191,13 @@
<item>0</item>
</integer-array>

<!-- Package name providing network location support.
<string name="config_networkLocationProviderPackageName">com.google.android.location.NetworkLocationProvider</string> -->

<!-- Package name providing geocoder API support.
<string name="config_geocodeProviderPackageName">com.google.android.location.GeocodeProvider</string> -->

<!-- Boolean indicating if current platform supports quick switch-on/off of
Bluetooth Module
<bool name="config_bluetooth_adapter_quick_switch">false</bool> -->

<!-- Set additional audio parameters for incall audio
Usage: parameter=onstring=offstring
Examples: <item>realcall=on=off</item> <item>dualmic_enabled=true=false</item> <item>mic_boost=yes=no</item>
<string-array name="config_telephony_set_audioparameters" translatable="false">
<item>dualmic_enabled=false=false</item>
</string-array> -->

<!-- Set additional audio parameters for incall audio
Usage: parameter=onstring=offstring
Examples: <item>realcall=on=off</item> <item>dualmic_enabled=true=false</item> <item>mic_boost=yes=no</item>
Examples: <item>realcall=on=off</item>
<item>dualmic_enabled=true=false</item>
<item>mic_boost=yes=no</item> -->
<string-array name="config_telephony_set_audioparameters" translatable="false">
<item>dualmic_enabled=false=false</item>
</string-array> -->
</string-array>

<!-- Hardware 'face' keys present on the device, stored as a bit field.
This integer should equal the sum of the corresponding value for each
Expand All @@ -228,7 +208,7 @@
8 - Assistant (search)
16 - App switch
For example, a device with Home, Back and Menu keys would set this
config to 7.
<integer name="config_deviceHardwareKeys">7</integer> -->
config to 7. -->
<integer name="config_deviceHardwareKeys">7</integer>

</resources>
7 changes: 7 additions & 0 deletions overlay/packages/apps/Settings/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@
<!-- LED Flashlight -->
<bool name="has_led_flash">true</bool>

<!-- Show Expanded Desktop preference -->
<bool name="config_show_expandedDesktop">true</bool>

<!-- Volume Rocker Wake Support. Some devices do not support (PMU) this.
Setting to false will disable Volume Rocker Wake support -->
<bool name="config_show_volumeRockerWake">true</bool>

</resources>
64 changes: 41 additions & 23 deletions power/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
#define SCALING_GOVERNOR_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
#define BOOSTPULSE_ONDEMAND "/sys/devices/system/cpu/cpufreq/ondemand/boostpulse"
#define BOOSTPULSE_INTERACTIVE "/sys/devices/system/cpu/cpufreq/interactive/boostpulse"
#define SAMPLING_RATE_ONDEMAND "/sys/devices/system/cpu/cpufreq/ondemand/sampling_rate"
#define SAMPLING_RATE_SCREEN_ON "50000"
#define SAMPLING_RATE_SCREEN_OFF "500000"
#define TIMER_RATE_SCREEN_ON "30000"
#define TIMER_RATE_SCREEN_OFF "500000"

struct cm_power_module {
struct power_module base;
Expand All @@ -40,6 +41,8 @@ struct cm_power_module {
int boostpulse_warned;
};

static char governor[20];

static int sysfs_read(char *path, char *s, int num_bytes)
{
char buf[80];
Expand Down Expand Up @@ -89,10 +92,9 @@ static void sysfs_write(char *path, char *s)
close(fd);
}

static int get_scaling_governor(char governor[], int size) {
static int get_scaling_governor() {
if (sysfs_read(SCALING_GOVERNOR_PATH, governor,
size) == -1) {
// Can't obtain the scaling governor. Return.
sizeof(governor)) == -1) {
return -1;
} else {
// Strip newline at the end.
Expand All @@ -107,15 +109,42 @@ static int get_scaling_governor(char governor[], int size) {
return 0;
}

static void cm_power_set_interactive(struct power_module *module, int on)
{
if (strncmp(governor, "ondemand", 8) == 0)
sysfs_write("/sys/devices/system/cpu/cpufreq/ondemand/sampling_rate",
on ? SAMPLING_RATE_SCREEN_ON : SAMPLING_RATE_SCREEN_OFF);
else if (strncmp(governor, "interactive", 11) == 0)
sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/timer_rate",
on ? TIMER_RATE_SCREEN_ON : TIMER_RATE_SCREEN_OFF);
}


static void configure_governor()
{
cm_power_set_interactive(NULL, 1);

if (strncmp(governor, "ondemand", 8) == 0) {
sysfs_write("/sys/devices/system/cpu/cpufreq/ondemand/up_threshold", "90");
sysfs_write("/sys/devices/system/cpu/cpufreq/ondemand/io_is_busy", "1");
sysfs_write("/sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor", "4");
sysfs_write("/sys/devices/system/cpu/cpufreq/ondemand/down_differential", "10");

} else if (strncmp(governor, "interactive", 11) == 0) {
sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/min_sample_time", "90000");
sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/hispeed_freq", "1134000");
sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay", "30000");
}
}

static int boostpulse_open(struct cm_power_module *cm)
{
char buf[80];
char governor[80];

pthread_mutex_lock(&cm->lock);

if (cm->boostpulse_fd < 0) {
if (get_scaling_governor(governor, sizeof(governor)) < 0) {
if (get_scaling_governor() < 0) {
ALOGE("Can't read scaling governor.");
cm->boostpulse_warned = 1;
} else {
Expand All @@ -126,10 +155,12 @@ static int boostpulse_open(struct cm_power_module *cm)

if (cm->boostpulse_fd < 0 && !cm->boostpulse_warned) {
strerror_r(errno, buf, sizeof(buf));
ALOGE("Error opening boostpulse: %s\n", buf);
ALOGV("Error opening boostpulse: %s\n", buf);
cm->boostpulse_warned = 1;
} else if (cm->boostpulse_fd > 0)
} else if (cm->boostpulse_fd > 0) {
configure_governor();
ALOGD("Opened %s boostpulse interface", governor);
}
}
}

Expand Down Expand Up @@ -176,23 +207,10 @@ static void cm_power_hint(struct power_module *module, power_hint_t hint,
}
}

static void cm_power_set_interactive(struct power_module *module, int on)
{
char governor[80];
if (strncmp(governor, "ondemand", 8) == 0)
sysfs_write(SAMPLING_RATE_ONDEMAND,
on ? SAMPLING_RATE_SCREEN_ON : SAMPLING_RATE_SCREEN_OFF);
else
ALOGV("Skipping sysfs_write to sampling_rate -- NOT using ondemand");
}

static void cm_power_init(struct power_module *module)
{
char governor[80];
if (strncmp(governor, "ondemand", 8) == 0)
sysfs_write(SAMPLING_RATE_ONDEMAND, SAMPLING_RATE_SCREEN_ON);
else
ALOGV("Skipping sysfs_write to sampling_rate -- NOT using ondemand");
get_scaling_governor();
configure_governor();
}

static struct hw_module_methods_t power_module_methods = {
Expand Down
8 changes: 8 additions & 0 deletions ramdisk/fstab.u8815
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/mmcblk0p12 /system ext4 ro,barrier=1 wait
/dev/block/mmcblk0p6 /cache ext4 nodev,barrier=1 wait,check
/dev/block/mmcblk0p19 /data ext4 nodev,noauto_da_alloc,barrier=1 wait,check
Loading

0 comments on commit 2e41f07

Please sign in to comment.