Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update 5 to get camera working. based on Tilal6991 and blefish work f…

…or huawei phones
  • Loading branch information...
commit 69b61c96fedea15197d699357c43f851552f0fe4 1 parent 5ff0191
@joilaroi authored
Showing with 8,081 additions and 20,381 deletions.
  1. +14 −8 Android.mk
  2. +0 −4 AndroidBoard.mk
  3. +2 −5 AndroidProducts.mk
  4. +64 −76 BoardConfig.mk
  5. +11 −12 keyfiles/qwerty2.idc → FileManager/Android.mk
  6. 0  {prebuilt → FileManager}/FileManager.apk
  7. +4 −0 FileManager/README
  8. +11 −12 keyfiles/qwerty.idc → GooManager/Android.mk
  9. BIN  GooManager/GooManager.apk
  10. +4 −0 GooManager/README
  11. +6 −13 README
  12. +0 −70 UsbController.cpp
  13. +0 −3  board-info.txt
  14. +7 −14 cm.mk
  15. +41 −0 copy-files.sh
  16. +99 −129 device.mk
  17. +0 −2  egl.cfg
  18. +29 −72 extract-files.sh
  19. BIN  firmware/bcm4329.hcd
  20. BIN  firmware/data.patch.hw2_0.bin.ar6102
  21. 0  firmware/eeprom.bin
  22. 0  firmware/eeprom.data
  23. +1 −1  firmware/softmac
  24. +401 −0 include/hardware_legacy/AudioPolicyManagerBase.h
  25. +20 −1 include/linux/android_pmem.h
  26. +0 −50 include/linux/ashmem.h
  27. +0 −45 include/linux/genlock.h
  28. +0 −556 include/linux/ion.h
  29. +5 −132 include/linux/msm_mdp.h
  30. +0 −80 include/linux/msm_rotator.h
  31. +0 −526 include/linux/msm_vidc_dec.h
  32. +0 −592 include/linux/msm_vidc_enc.h
  33. +0 −151 include/linux/spi_aic3254.h
  34. +0 −52 include/linux/tpa2051d3.h
  35. +0 −203 include/qcom_ui.h
  36. +0 −15 include/recovery/font_7x16.h
  37. +0 −42 include/tilerenderer.h
  38. +0 −53 keyfiles/7k_handset.idc
  39. +0 −29 keyfiles/7k_handset.kl
  40. +0 −672 keyfiles/Generic.kcm
  41. +0 −422 keyfiles/Generic.kl
  42. +0 −544 keyfiles/Virtual.kcm
  43. +0 −7 keyfiles/atmel-touchscreen.idc
  44. +0 −2  keyfiles/atmel-touchscreen.kcm
  45. +0 −4 keyfiles/atmel-touchscreen.kl
  46. +0 −1  keyfiles/cypress-ts-innolux_Ver04.idc
  47. +0 −4 keyfiles/cypress-ts-innolux_Ver04.kl
  48. +0 −9 keyfiles/h2w_headset.kl
  49. +0 −1  keyfiles/melfas-touchscreen.Ver23.idc
  50. +0 −4 keyfiles/melfas-touchscreen.Ver23.kl
  51. +0 −7 keyfiles/melfas-touchscreen.idc
  52. +0 −1  keyfiles/melfas-touchscreen.kcm
  53. +0 −6 keyfiles/melfas-touchscreen.kl
  54. +0 −4 keyfiles/melfas-touchscreen_ver23.kl
  55. +0 −8 keyfiles/msm_touchscreen.idc
  56. +0 −1  keyfiles/msm_touchscreen.kcm
  57. +0 −12 keyfiles/msm_touchscreen.kl
  58. +0 −2  keyfiles/ofn_ok_key.idc
  59. +0 −508 keyfiles/qwerty.kcm
  60. +0 −112 keyfiles/qwerty.kl
  61. +0 −505 keyfiles/qwerty2.kcm
  62. +0 −53 keyfiles/sensors.idc
  63. +0 −83 keyfiles/surf_keypad.kcm
  64. +0 −106 keyfiles/surf_keypad.kl
  65. +0 −1  keyfiles/synaptics-rmi-touchscreen.idc
  66. +0 −2  keyfiles/synaptics-rmi-touchscreen.kcm
  67. +0 −2  keyfiles/synaptics.idc
  68. +0 −2  keyfiles/synaptics.kcm
  69. +0 −83 keyfiles/ts_test_input.kcm
  70. +0 −12 keyfiles/ts_test_input.kl
  71. +0 −4 ldpi/packages/inputmethods/LatinIME/java/res/values/dimens.xml
  72. +2 −2 libaudio/Android.mk
  73. +1,288 −1,184 libaudio/AudioHardware.cpp
  74. +410 −331 libaudio/AudioHardware.h
  75. +296 −256 libaudio/AudioPolicyManager.cpp
  76. +51 −49 libaudio/AudioPolicyManager.h
  77. +0 −316 libaudio/msm_audio.h
  78. +0 −94 libaudio/msm_audio_voicememo.h
  79. +21 −0 libcamera/Android.mk
  80. 0  {libcamerahal → libcamera}/CameraHardwareInterface.h
  81. +1 −0  libcamera/README
  82. +290 −82 {libcamerahal → libcamera}/cameraHal.cpp
  83. +0 −22 libcamerahal/Android.mk
  84. +0 −1  libcamerahal/README
  85. BIN  libcamerahal/libcamera.so
  86. BIN  libcamerahal/prebuilt/libcamera.so
  87. BIN  libcamerahal/prebuilt/libqcamera.so
  88. 0  libcopybit/Android.mk
  89. 0  libcopybit/MODULE_LICENSE_APACHE2
  90. 0  libcopybit/NOTICE
  91. 0  libcopybit/copybit.cpp
  92. 0  libgralloc/Android.mk
  93. 0  libgralloc/MODULE_LICENSE_APACHE2
  94. 0  libgralloc/NOTICE
  95. 0  libgralloc/allocator.cpp
  96. 0  libgralloc/allocator.h
  97. +188 −0 libgralloc/android_pmem.h
  98. 0  libgralloc/framebuffer.cpp
  99. 0  libgralloc/gr.h
  100. 0  libgralloc/gralloc.cpp
  101. 0  libgralloc/gralloc_priv.h
  102. 0  libgralloc/mapper.cpp
  103. +1 −1  liblights/Android.mk
  104. 0  liblights/MODULE_LICENSE_APACHE2
  105. 0  liblights/NOTICE
  106. 0  liblights/lights.c
  107. +18 −9 keyfiles/AVRCP.kl → liblights_msm7k/Android.mk
  108. 0  liblights_msm7k/MODULE_LICENSE_APACHE2
  109. +190 −0 liblights_msm7k/NOTICE
  110. +421 −0 liblights_msm7k/lights.c
  111. +0 −71 libomxcore/Android.mk
  112. +0 −1,311 libomxcore/inc/OMX_Audio.h
  113. +0 −579 libomxcore/inc/OMX_Component.h
  114. +0 −195 libomxcore/inc/OMX_ContentPipe.h
  115. +0 −1,431 libomxcore/inc/OMX_Core.h
  116. +0 −920 libomxcore/inc/OMX_IVCommon.h
  117. +0 −328 libomxcore/inc/OMX_Image.h
  118. +0 −258 libomxcore/inc/OMX_Index.h
  119. +0 −337 libomxcore/inc/OMX_Other.h
  120. +0 −689 libomxcore/inc/OMX_QCOMExtns.h
  121. +0 −347 libomxcore/inc/OMX_Types.h
  122. +0 −1,060 libomxcore/inc/OMX_Video.h
  123. +0 −181 libomxcore/inc/QOMX_AudioExtensions.h
  124. +0 −77 libomxcore/inc/QOMX_AudioIndexExtensions.h
  125. +0 −65 libomxcore/inc/qc_omx_common.h
  126. +0 −183 libomxcore/inc/qc_omx_component.h
  127. +0 −58 libomxcore/inc/qc_omx_msg.h
  128. +0 −407 libomxcore/src/common/omx_core_cmp.cpp
  129. +0 −160 libomxcore/src/common/omx_core_cmp.h
  130. +0 −847 libomxcore/src/common/qc_omx_core.c
  131. +0 −72 libomxcore/src/common/qc_omx_core.h
  132. +0 −364 libomxcore/src/msm7k/qc_registry_table.c
  133. +0 −221 libomxcore/src/msm7k/qc_registry_table_android.c
  134. 0  libopencorehw/Android.mk
  135. 0  libopencorehw/MODULE_LICENSE_APACHE2
  136. 0  libopencorehw/NOTICE
  137. 0  libopencorehw/android_surface_output_msm72xx.cpp
  138. 0  libopencorehw/android_surface_output_msm72xx.h
  139. 0  librpc/Android.mk
  140. 0  librpc/MODULE_LICENSE_APACHE2
  141. 0  librpc/NOTICE
  142. 0  librpc/clnt.c
  143. 0  librpc/debug.h
  144. 0  librpc/librpc.h
  145. 0  librpc/ops.c
  146. 0  librpc/rpc.c
  147. 0  librpc/rpc/clnt.h
  148. 0  librpc/rpc/pmap_clnt.h
  149. 0  librpc/rpc/rpc.h
  150. 0  librpc/rpc/rpc_router_ioctl.h
  151. 0  librpc/rpc/svc.h
  152. 0  librpc/rpc/types.h
  153. 0  librpc/rpc/xdr.h
  154. 0  librpc/svc.c
  155. 0  librpc/svc_clnt_common.c
  156. 0  librpc/xdr.c
  157. 0  libstagefrighthw/Android.mk
  158. 0  libstagefrighthw/MODULE_LICENSE_APACHE2
  159. 0  libstagefrighthw/NOTICE
  160. 0  libstagefrighthw/QComOMXPlugin.cpp
  161. 0  libstagefrighthw/QComOMXPlugin.h
  162. BIN  overlay/frameworks/base/core/res/res/drawable-ldpi/usb_android.png
  163. BIN  overlay/frameworks/base/core/res/res/drawable-ldpi/usb_android_connected.png
  164. BIN  overlay/frameworks/base/core/res/res/drawable-mdpi/usb_android.png
  165. BIN  overlay/frameworks/base/core/res/res/drawable-mdpi/usb_android_connected.png
  166. +86 −0 overlay/frameworks/base/core/res/res/layout/recent_apps_dialog.xml
  167. +21 −0 overlay/frameworks/base/core/res/res/layout/recent_apps_icon.xml
  168. +65 −161 overlay/frameworks/base/core/res/res/values/config.xml
  169. +11 −0 overlay/frameworks/base/core/res/res/values/dimens.xml
  170. +0 −79 overlay/frameworks/base/core/res/res/xml/power_profile.xml
  171. +4 −19 overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  172. BIN  overlay/frameworks/base/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png
  173. +0 −21 overlay/packages/apps/CMParts/res/values/config.xml
  174. +2 −2 overlay/packages/apps/Mms/res/xml/mms_config.xml
  175. +135 −0 overlay/packages/apps/Music/res/layout-land/audio_player.xml
  176. +127 −0 overlay/packages/apps/Music/res/layout/audio_player.xml
  177. 0  overlay/packages/apps/Phone/res/drawable/dial_num_0_no_plus_wht.xml
  178. 0  overlay/packages/apps/Phone/res/drawable/dial_num_1_no_vm_wht.xml
  179. +3 −125 overlay/packages/apps/Phone/res/values/config.xml
  180. +10 −0 overlay/packages/apps/Trebuchet/res/values-port/dimens.xml
  181. +2 −0  overlay/packages/apps/Trebuchet/res/values/config.xml
  182. +9 −0 overlay/packages/apps/Trebuchet/res/values/dimens.xml
  183. +21 −0 overlay/packages/apps/Trebuchet/res/values/styles.xml
  184. +6 −1 overlay/packages/inputmethods/LatinIME/java/res/values/dimens.xml
  185. BIN  prebuilt/app/HuaweiBackupV2.1.8.apk
  186. BIN  prebuilt/app/HuaweiLauncher2.apk
  187. BIN  prebuilt/app/HwWallpaperChooser.apk
  188. BIN  prebuilt/bin/rmt_storage
  189. +0 −387 prebuilt/bin/wlan_tool
  190. BIN  prebuilt/cdrom/autorun.iso
  191. +0 −1  prebuilt/etc/01_qc.cfg
  192. +3 −9 prebuilt/etc/AudioFilter.csv
  193. +0 −12 prebuilt/etc/AudioFilterU8120.csv
  194. +1 −1  prebuilt/etc/AutoVolumeControl.txt
  195. +0 −42 prebuilt/etc/bluetooth/audio.conf
  196. +0 −9 prebuilt/etc/check_property.sh
  197. BIN  prebuilt/etc/fw_4319.bin
  198. BIN  prebuilt/etc/fw_4319_apsta.bin
  199. +0 −5 prebuilt/etc/init.d/01sysctl
  200. +16 −8 prebuilt/etc/init.d/02huawei
  201. +75 −39 { → prebuilt/etc}/media_profiles.xml
  202. +61 −0 prebuilt/etc/nv_4319.txt
  203. +4 −0 prebuilt/etc/start_usb0.sh
  204. +0 −20 prebuilt/etc/sysctl.conf
  205. 0  prebuilt/{ → etc}/vold.fstab
  206. +1 −1  prebuilt/etc/wifi/wpa_supplicant.conf
  207. BIN  prebuilt/hostapd
  208. +0 −7 prebuilt/hostapd.conf
  209. +251 −0 prebuilt/init.qcom.rc
  210. +21 −3 prebuilt/{init.u8120.usb.rc → init.qcom.usb.rc}
  211. +0 −196 prebuilt/init.u8120.rc
  212. BIN  prebuilt/kernel
  213. +1 −2  prebuilt/lib/egl/egl.cfg
  214. BIN  prebuilt/lib/hw/audio.primary.u8120.so
  215. BIN  prebuilt/lib/hw/audio_policy.u8120.so
  216. BIN  prebuilt/lib/hw/copybit.msm7x27.so
  217. BIN  prebuilt/lib/hw/gralloc.msm7x27.so
  218. BIN  prebuilt/lib/libOmxCore.so
  219. BIN  prebuilt/lib/libmm-omxcore.so
  220. 0  prebuilt/{ → lib}/modules/ar6000.ko
  221. 0  prebuilt/{modules/bcm4319.ko → lib/modules/dhd.ko}
  222. BIN  prebuilt/lib/modules/zram.ko
  223. BIN  prebuilt/modules/zram.ko
  224. +47 −0 prebuilt/ueventd.qcom.rc
  225. +0 −32 prebuilt/ueventd.u8120.rc
  226. 0  keyfiles/surf_keypad.idc → prebuilt/usr/idc/7k_handset.idc
  227. +9 −0 prebuilt/usr/idc/cypress-ts-innolux_Ver04.idc
  228. +4 −0 prebuilt/usr/idc/kp_test_input.idc
  229. 0  {recovery → prebuilt}/usr/idc/melfas-touchscreen.Ver23.idc
  230. 0  recovery/usr/idc/synaptics-rmi-touchscreen.idc → prebuilt/usr/idc/melfas-touchscreen.idc
  231. 0  recovery/usr/idc/melfas-touchscreen_ver23.idc → prebuilt/usr/idc/melfas-touchscreen_Ver23.idc
  232. 0  {keyfiles → prebuilt/usr/idc}/melfas-touchscreen_ver23.idc
  233. 0  keyfiles/ts_test_input.idc → prebuilt/usr/idc/msm_touchscreen.idc
  234. +10 −0 prebuilt/usr/idc/qwerty.idc
  235. +10 −0 prebuilt/usr/idc/qwerty2.idc
  236. +8 −0 prebuilt/usr/idc/sensors.idc
  237. +4 −0 prebuilt/usr/idc/surf_keypad.idc
  238. +12 −0 prebuilt/usr/idc/synaptics-rmi-touchscreen.idc
  239. 0  {recovery → prebuilt}/usr/idc/synaptics.idc
  240. 0  {keyfiles → prebuilt/usr/idc}/touchscreen-keypad.idc
  241. +8 −0 prebuilt/usr/idc/ts_test_input.idc
  242. +4 −0 prebuilt/usr/idc/u8120-keypad.idc
  243. 0  {keyfiles → prebuilt/usr/keychars}/surf_keypad.kcm.bin
  244. +9 −0 prebuilt/usr/keylayout/7k_handset.kl
  245. 0  {recovery → prebuilt}/usr/keylayout/cypress-ts-innolux_Ver04.kl
  246. 0  {recovery → prebuilt}/usr/keylayout/melfas-touchscreen.Ver23.kl
  247. 0  {recovery → prebuilt}/usr/keylayout/melfas-touchscreen_ver23.kl
  248. +7 −0 prebuilt/usr/keylayout/surf_keypad.kl
  249. +1 −0  {keyfiles → prebuilt/usr/keylayout}/synaptics-rmi-touchscreen.kl
  250. +1 −0  {keyfiles → prebuilt/usr/keylayout}/synaptics.kl
  251. +7 −0 prebuilt/usr/keylayout/touchscreen-keypad.kl
  252. +7 −0 prebuilt/usr/keylayout/u8120-keypad.kl
  253. +2 −10 proprietary-files.txt
  254. +1 −2  recovery.fstab
  255. +0 −15 recovery/font_7x16.h
  256. +0 −379 recovery/recovery_graphics.c
  257. 0  recovery/recovery_keys.c
  258. +0 −1  recovery/usr/idc/cypress-ts-innolux_Ver04.idc
  259. +0 −4 recovery/usr/keylayout/synaptics-rmi-touchscreen.kl
  260. +0 −4 recovery/usr/keylayout/synaptics.kl
  261. +456 −0 releasetools/check_target_files_signatures
  262. +850 −0 releasetools/common.py
  263. +303 −0 releasetools/edify_generator.py
  264. +210 −0 releasetools/img_from_target_files
  265. +862 −0 releasetools/ota_from_target_files
  266. +354 −0 releasetools/sign_target_files_apks
  267. +21 −37 setup-makefiles.sh
  268. +37 −84 system.prop
  269. +2 −22 u8120.mk
  270. +3 −1 vendorsetup.sh
View
22 Android.mk 100644 → 100755
@@ -1,14 +1,20 @@
LOCAL_PATH := $(my-dir)
ifeq ($(TARGET_DEVICE),u8120)
- subdir_makefiles := \
- $(LOCAL_PATH)/libaudio/Android.mk \
- $(LOCAL_PATH)/liblights/Android.mk \
- $(LOCAL_PATH)/librpc/Android.mk \
- $(LOCAL_PATH)/libcamerahal/Android.mk \
- $(LOCAL_PATH)/libstagefrighthw/Android.mk \
- $(LOCAL_PATH)/libomxcore/Android.mk \
- $(LOCAL_PATH)/libopencorehw/Android.mk
+
+subdir_makefiles := \
+ $(LOCAL_PATH)/libaudio/Android.mk \
+ $(LOCAL_PATH)/libcamera/Android.mk \
+ $(LOCAL_PATH)/libcopybit/Android.mk \
+ $(LOCAL_PATH)/libgralloc/Android.mk \
+ $(LOCAL_PATH)/liblights/Android.mk \
+ $(LOCAL_PATH)/liblights_msm7k/Android.mk \
+ $(LOCAL_PATH)/libopencorehw/Android.mk \
+ $(LOCAL_PATH)/librpc/Android.mk \
+ $(LOCAL_PATH)/libstagefrighthw/Android.mk \
+ $(LOCAL_PATH)/GooManager/Android.mk \
+ $(LOCAL_PATH)/FileManager/Android.mk
include $(subdir_makefiles)
+
endif
View
4 AndroidBoard.mk 100644 → 100755
@@ -24,9 +24,5 @@ LOCAL_PATH := $(call my-dir)
# overridden further down
include $(CLEAR_VARS)
-ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)
-$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
- $(transform-prebuilt-to-target)
-
# include the non-open-source counterpart to this file
-include vendor/huawei/u8120/AndroidBoardVendor.mk
View
7 AndroidProducts.mk 100644 → 100755
@@ -1,3 +1,4 @@
+#
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,11 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
-#
-# This file lists the product definition files that define
-# configurations which are actually buildable (e.g. through lunch)
#
PRODUCT_MAKEFILES := \
- $(LOCAL_DIR)/u8120.mk
+ $(LOCAL_DIR)/device_u8120.mk
View
140 BoardConfig.mk 100644 → 100755
@@ -23,102 +23,97 @@
# WARNING: This line must come *before* including the proprietary
# variant, so that it gets overwritten by the parent (which goes
# against the traditional rules of inheritance).
-USE_CAMERA_STUB := false
+USE_CAMERA_STUB := true
# inherit from the proprietary version
-include vendor/huawei/u8120/BoardConfigVendor.mk
TARGET_SPECIFIC_HEADER_PATH := device/huawei/u8120/include
-# ARMv6-compatible processor rev 2 (v6l)
-# CPU
-# Arch related defines
-TARGET_BOARD_PLATFORM := msm7x27
+# ARMv6-compatible processor rev 5 (v6l)
+TARGET_BOARD_PLATFORM := msm7k
TARGET_ARCH_VARIANT := armv6j
-TARGET_CPU_ABI := armeabi
+TARGET_CPU_ABI := armeabi-v6j
TARGET_CPU_ABI2 := armeabi
-# Target information
TARGET_NO_BOOTLOADER := true
-TARGET_NO_KERNEL := false
TARGET_NO_RADIOIMAGE := true
-TARGET_NO_RECOVERY := false
TARGET_BOOTLOADER_BOARD_NAME := u8120
-TARGET_OTA_ASSERT_DEVICE := u8120,u8100,u8109,u8110,ascend
-TARGET_BOARD_INFO_FILE := device/huawei/u8120/board-info.txt
+TARGET_OTA_ASSERT_DEVICE := u8120,u8100,u8109,u8110,ascend,u8160,hwu8160
-# Wifi related defines
-BOARD_WPA_SUPPLICANT_DRIVER := AWEXT
-BOARD_WLAN_DEVICE := ar6000
-WIFI_DRIVER_MODULE_PATH := "/system/wifi/ar6000.ko"
-WIFI_DRIVER_MODULE_NAME := ar6000
-WIFI_DRIVER_MODULE_ARG := "softmac_file=/system/wifi/softmac"
+# Bluetooth
+BOARD_HAVE_BLUETOOTH := true
-# Audio
-BOARD_PROVIDES_LIBAUDIO := true
-BOARD_USES_GENERIC_AUDIO := false
+# QCOM
+BOARD_USES_QCOM_LIBRPC := true
+BOARD_USES_QCOM_LIBS := true
+BOARD_USE_ADRENO_130_GPU := true
-# Camera
-BOARD_USE_FROYO_LIBCAMERA := true
+# GPS
+BOARD_USES_QCOM_GPS := true
+BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION := 1240
+BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := u8120
-# Bluetooth
-BOARD_HAVE_BLUETOOTH := true
-BOARD_HAVE_BLUETOOTH_BCM := true
+# Browser
+JS_ENGINE := v8
+HTTP := chrome
+WITH_JIT := true
+TARGET_WEBKIT_USE_MORE_MEMORY := true
+
+# USB mass storage
+TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun0/file
+BOARD_UMS_LUNFILE := "/sys/devices/platform/msm_hsusb/gadget/lun0/file"
# Sensors
TARGET_USES_OLD_LIBSENSORS_HAL := true
+BOARD_VENDOR_USE_AKMD := akm8973
+
+# ICS Stuff
+BOARD_USE_LEGACY_TOUCHSCREEN := true
+BOARD_USE_LEGACY_TRACKPAD := true
+
+# Audio
+BOARD_PROVIDES_LIBAUDIO := true
# RIL
BOARD_PROVIDES_LIBRIL := true
# Graphics
-BOARD_HAS_LIMITED_EGL := true
-BOARD_EGL_CFG := device/huawei/u8120/egl.cfg
-
-# ICS Stuff
-BOARD_USE_LEGACY_TOUCHSCREEN := true
-BOARD_USE_LEGACY_TRACKPAD := true
-DISABLE_DEXPREOPT := true
-COPYBIT_MSM7K := true
+BOARD_EGL_CFG := device/huawei/u8120/prebuilt/lib/egl/egl.cfg
+BOARD_USE_FROYO_LIBCAMERA := true
+COMMON_GLOBAL_CFLAGS += -DBINDER_COMPAT
+BOARD_USE_NASTY_PTHREAD_CREATE_HACK := true
+BOARD_USE_SKIA_LCDTEXT := true
BOARD_AVOID_DRAW_TEXTURE_EXTENSION := true
TARGET_LIBAGL_USE_GRALLOC_COPYBITS := true
+COMMON_GLOBAL_CFLAGS += -DMISSING_EGL_EXTERNAL_IMAGE -DMISSING_EGL_PIXEL_FORMAT_YV12 -DMISSING_GRALLOC_BUFFERS -DUNABLE_TO_DEQUEUE
TARGET_FORCE_CPU_UPLOAD := true
-TARGET_WEBKIT_USE_MORE_MEMORY := true
-WITH_DEXPREOPT := false
-
-# QCOM
-BOARD_USES_QCOM_LIBS := true
-BOARD_USES_LEGACY_QCOM := true
-BOARD_USES_QCOM_LIBRPC := true
-
-# GPS
-BOARD_USES_QCOM_GPS := true
-BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION := 6225
-BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := u8120
-BOARD_GPS_LIBRARIES := libloc_api
-
-# USB mass storage
-BOARD_USE_USB_MASS_STORAGE_SWITCH := true
-BOARD_HAS_SDCARD_INTERNAL := true
-BOARD_SDCARD_DEVICE_INTERNAL := /dev/block/vold/179:1
-BOARD_SDEXT_DEVICE := /dev/block/vold/179:2
-BOARD_UMS_LUNFILE := "/sys/devices/platform/msm_hsusb/gadget/lun0/file"
-TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun0/file
-BOARD_CUSTOM_USB_CONTROLLER := ../../device/huawei/u8120/UsbController.cpp
+# Wifi related defines
+BOARD_WPA_SUPPLICANT_DRIVER := AWEXT
+BOARD_WLAN_DEVICE := ar6000
+WIFI_DRIVER_MODULE_PATH := "/system/wifi/ar6000.ko"
+WIFI_DRIVER_MODULE_NAME := ar6000
+WIFI_DRIVER_MODULE_ARG := "softmac_file=/system/wifi/softmac"
-# Browser
-WITH_JIT := true
-ENABLE_JSC_JIT := true
-JS_ENGINE := v8
+# Recovery
+BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/huawei/u8120/recovery/recovery_keys.c
+BOARD_USE_CUSTOM_RECOVERY_FONT := "<font_7x16.h>"
# Kernel
+#TARGET_PREBUILT_KERNEL := device/huawei/u8120/prebuilt/kernel
+TARGET_KERNEL_SOURCE := kernel/u8120_codeaurora_ics
+TARGET_KERNEL_CONFIG := cm_u8120_defconfig
BOARD_KERNEL_BASE := 0x00200000
-BOARD_KERNEL_CMDLINE := mem=211M console=ttyMSM2,115200n8 androidboot.hardware=u8120
+BOARD_KERNEL_CMDLINE := mem=211M console=ttyMSM2,115200n8 androidboot.hardware=qcom
+BOARD_INSTALLER_CMDLINE := $(BOARD_KERNEL_CMDLINE)
BOARD_KERNEL_PAGESIZE := 4096
-# # cat /proc/mtd
+# Custom releasetools for old partition table.
+TARGET_PROVIDES_RELEASETOOLS := true
+TARGET_RELEASETOOL_OTA_FROM_TARGET_SCRIPT := ./device/huawei/u8120/releasetools/ota_from_target_files
+
# # cat /proc/mtd
# dev: size erasesize name
# mtd0: 00500000 00020000 "boot"
@@ -126,22 +121,15 @@ BOARD_KERNEL_PAGESIZE := 4096
# mtd2: 00140000 00020000 "misc"
# mtd3: 00060000 00020000 "splash"
# mtd4: 0aa00000 00020000 "system"
-# mtd5: 05d00000 00020000 "cache"
-# mtd6: 0a6a0000 00020000 "userdata"
-# mtd7: 01400000 00020000 "cust"
+# mtd5: 04600000 00020000 "cache"
+# mtd6: 0bda0000 00020000 "userdata"
+# mtd7: 01400000 00020000 "userdata2"
-BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00500000
-BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x0baa6f40
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x0a6a0000
+BOARD_BOOTIMAGE_PARTITION_SIZE := 5242880
+BOARD_RECOVERYIMAGE_PARTITION_SIZE := 5242880
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 178257920
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 198836224
+BOARD_CACHEIMAGE_PARTITION_SIZE := 73400320
# (BOARD_KERNEL_PAGESIZE * 64)
BOARD_FLASH_BLOCK_SIZE := 262144
-
-#BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x0aa00000
-
-# Recovery
-BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/huawei/u8120/recovery/recovery_keys.c
-BOARD_CUSTOM_GRAPHICS := ../../../device/huawei/u8120/recovery/recovery_graphics.c
-BOARD_LDPI_RECOVERY := true
-
View
23 keyfiles/qwerty2.idc → FileManager/Android.mk 100644 → 100755
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 The Android Open Source Project
+# Copyright (C) 2012 Goo-inside.me
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,17 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-# Emulator keyboard configuration file #2.
-#
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := FileManager
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
-touch.deviceType = touchScreen
-touch.orientationAware = 1
+LOCAL_MODULE_CLASS := APPS
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_CERTIFICATE := platform
-keyboard.layout = qwerty
-keyboard.characterMap = qwerty2
-keyboard.orientationAware = 1
-keyboard.builtIn = 1
+include $(BUILD_PREBUILT)
-cursor.mode = navigation
-cursor.orientationAware = 1
View
0  prebuilt/FileManager.apk → FileManager/FileManager.apk
File renamed without changes
View
4 FileManager/README
@@ -0,0 +1,4 @@
+Prebuilt repository for GooManager.
+
+Simply add GooManager to your product packages, and you're automatically including Goomanager in your builds.
+This repository will contain the latest apk file that is on the market.
View
23 keyfiles/qwerty.idc → GooManager/Android.mk 100644 → 100755
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 The Android Open Source Project
+# Copyright (C) 2012 Goo-inside.me
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,17 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-# Emulator keyboard configuration file #1.
-#
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := GooManager
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
-touch.deviceType = touchScreen
-touch.orientationAware = 1
+LOCAL_MODULE_CLASS := APPS
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_CERTIFICATE := platform
-keyboard.layout = qwerty
-keyboard.characterMap = qwerty
-keyboard.orientationAware = 1
-keyboard.builtIn = 1
+include $(BUILD_PREBUILT)
-cursor.mode = navigation
-cursor.orientationAware = 1
View
BIN  GooManager/GooManager.apk
Binary file not shown
View
4 GooManager/README
@@ -0,0 +1,4 @@
+Prebuilt repository for GooManager.
+
+Simply add GooManager to your product packages, and you're automatically including Goomanager in your builds.
+This repository will contain the latest apk file that is on the market.
View
19 README 100644 → 100755
@@ -1,15 +1,8 @@
-Device configuration for the Huawei U8120/U8100/U8110
+CyanogenMod device configuration for the Huawei U8150
-Check out a copy of my u8120 device tree:
-cd device/huawei
-git clone --branch=t_dev git://github.com/joilaroi/cm9_device_u8120_joil.git
+Originally designed by marcnvidic
+Changed, improved and optimized by tilal6991 and alanorth
-Copy proprietary files
-either by running extract-files.sh with a device connected in
-or by running unzip-files.sh with a u8160 Froyo stock rom placed in as u8120_update.zip
-
-Set up the build environment:
-In terminal:
-source build/envsetup.sh
-lunch cm_u8120
-make bacon
+Pre-Setup
+=========
+Execute "extract-files.sh" to extract prebuilt libraries (from a working device)
View
70 UsbController.cpp
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#define LOG_TAG "UsbController"
-#include <cutils/log.h>
-#include <cutils/properties.h>
-#include <string.h>
-
-#include "UsbController.h"
-
-
-UsbController::UsbController() {
-}
-
-UsbController::~UsbController() {
-}
-
-int UsbController::startRNDIS() {
- LOGD("Usb RNDIS start");
- return enableRNDIS(true);
-}
-
-int UsbController::stopRNDIS() {
- LOGD("Usb RNDIS stop");
- return enableRNDIS(false);
-}
-
-int UsbController::enableRNDIS(bool enable) {
- char ums;
- int fdums = open("/sys/devices/platform/msm_hsusb/gadget/lun0/file", O_RDWR);
- read(fdums, &ums, 1);
- close(fdums);
- if (ums == '/')
- return 0;
-
- char value[20];
- int fd = open("/sys/module/g_android/parameters/product_id", O_RDWR);
- int count = snprintf(value, sizeof(value), "%s\n", (enable ? "1039" : "1038"));
- write(fd, value, count);
- close(fd);
- return 0;
-}
-
-bool UsbController::isRNDISStarted() {
- char value[1];
- int fd = open("/sys/devices/platform/android_usb/functions/rndis", O_RDONLY);
- read(fd, &value, 1);
- close(fd);
- return (!strncmp(value,"1",1) ? true : false);
-}
View
3  board-info.txt
@@ -1,3 +0,0 @@
-require board=u8120
-require version-bootloader=*
-require version-baseband=*
View
21 cm.mk 100644 → 100755
@@ -15,31 +15,24 @@
# Inherit device configuration
$(call inherit-product, $(LOCAL_PATH)/u8120.mk)
-## Specify phone tech before including full_phone
-$(call inherit-product, vendor/cm/config/gsm.mk)
-
# Inherit some common CM stuff.
-$(call inherit-product, vendor/cm/config/common_full_phone.mk)
-
-# Inherit from those products. Most specific first.
-$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
-$(call inherit-product, device/common/gps/gps_eu_supl.mk)
+$(call inherit-product, vendor/cm/config/common_mini_phone.mk)
+$(call inherit-product, vendor/cm/config/gsm.mk)
+$(call inherit-product, vendor/cm/config/cm_audio.mk)
+$(call inherit-product, vendor/cm/config/themes_common.mk)
# Setup device configuration
PRODUCT_NAME := cm_u8120
PRODUCT_RELEASE_NAME := u8120
PRODUCT_DEVICE := u8120
-PRODUCT_BRAND := HUAWEI
-PRODUCT_MODEL := Joy/U8120
+PRODUCT_BRAND := Huawei
+PRODUCT_MODEL := U8120
PRODUCT_MANUFACTURER := Huawei
-PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=soju BUILD_ID=IML74K BUILD_FINGERPRINT=google/soju/crespo:4.0.3/IML74K/239410:user/release-keys PRIVATE_BUILD_DESC="soju-user 4.0.3 IML74K 239410 release-keys" BUILD_NUMBER=239410
+PRODUCT_BUILD_PROP_OVERRIDES += BUILD_FINGERPRINT=google/soju/crespo:4.0.4/IMM76D/299849:user/release-keys PRIVATE_BUILD_DESC="soju-user 4.0.4 IMM76D 299849 release-keys"
# Release name and versioning
PRODUCT_VERSION_DEVICE_SPECIFIC :=
--include vendor/cm/config/common_versions.mk
-
TARGET_BOOTANIMATION_NAME := vertical-240x320
TARGET_NO_LIVEWALLPAPERS := true
View
41 copy-files.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is generated by device/common/generate-blob-scripts.sh - DO NOT EDIT
+
+DEVICE=u8120
+MANUFACTURER=huawei
+
+BASE=../../../vendor/$MANUFACTURER/$DEVICE/proprietary
+if [ "x$1" = "x" ]; then
+ echo "You need to specifify the root of the /system directory"
+ exit
+fi
+SYSDIR=$1
+
+
+rm -rf $BASE/*
+
+for FILE in `cat proprietary-files.txt`; do
+ DIR=`dirname $FILE`
+ if [ ! -d $BASE/$DIR ]; then
+ mkdir -p $BASE/$DIR
+ fi
+ cp $SYSDIR/$FILE $BASE/$FILE
+done
+
+./setup-makefiles.sh
+
View
228 device.mk 100644 → 100755
@@ -12,45 +12,54 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Inherit from those products. Most specific first.
-$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
-
DEVICE_PACKAGE_OVERLAYS := $(LOCAL_PATH)/overlay
-DEVICE_PACKAGE_OVERLAYS += device/huawei/u8120/ldpi
-PRODUCT_PACKAGE_OVERLAYS += vendor/cm/overlay/ldpi
+# Discard inherited values and use our own instead.
+PRODUCT_NAME := huawei_u8120
+PRODUCT_DEVICE := u8120
+PRODUCT_MODEL := Huawei U8120
+
+PRODUCT_AAPT_CONFIG := mdpi hdpi
+PRODUCT_AAPT_PREF_CONFIG := mdpi
+PRODUCT_LOCALES += mdpi
+
+# Graphics
+PRODUCT_PACKAGES += \
+ gralloc.u8120 \
+ copybit.u8120
+
+# Audio
+PRODUCT_PACKAGES += \
+ audio.primary.u8120 \
+ audio_policy.u8120 \
+ audio.a2dp.default
+
+# Zram
PRODUCT_PACKAGES += \
- libRS \
hwprops \
- rzscontrol \
- librs_jni \
- lights.msm7x27\
- hwcomposer.default \
- gps.u8120 \
- audio.primary.msm7x27 \
- audio_policy.msm7x27 \
- audio.a2dp.default \
+ rzscontrol
+
+# Video decoding
+PRODUCT_PACKAGES += \
libstagefrighthw \
libopencorehw \
libmm-omxcore \
- libOmxCore \
- libOmxVdec \
- libOmxVenc \
- Gallery2 \
- abtfilt \
- libcamera \
- camera.msm7x27 \
- com.android.future.usb.accessory \
- zipalign \
- dexpreopt
-
-PRODUCT_LOCALES := en_GB
-PRODUCT_LOCALES += ldpi mdpi
-PRODUCT_AAPT_CONFIG := normal ldpi mdpi
-PRODUCT_AAPT_PREF_CONFIG := ldpi
-
-# Support files
+ libOmxCore
+
+# Other
+PRODUCT_PACKAGES += \
+ lights.u8120 \
+ lights.msm7k \
+ gps.u8120 \
+ camera.u8120 \
+ Apollo
+
+# Goomanager & FileManager
+PRODUCT_PACKAGES += \
+ GooManager \
+ FileManager
+
+# Hardware permissions
PRODUCT_COPY_FILES += \
frameworks/base/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml \
frameworks/base/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
@@ -60,87 +69,32 @@ PRODUCT_COPY_FILES += \
frameworks/base/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
frameworks/base/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/base/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
- frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.xml \
+ frameworks/base/data/etc/android.hardware.touchscreen.xml:system/etc/permissions/android.hardware.touchscreen.xml \
frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
- frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
- frameworks/base/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
- frameworks/base/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \
- frameworks/base/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml
-
-# Media configuration xml file
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/media_profiles.xml:/system/etc/media_profiles.xml
+ frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml
+# Vold and USB
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/initlogo.rle:root/initlogo.rle \
- $(LOCAL_PATH)/prebuilt/init.u8120.rc:root/init.u8120.rc \
- $(LOCAL_PATH)/prebuilt/ueventd.u8120.rc:root/ueventd.u8120.rc \
- $(LOCAL_PATH)/prebuilt/init.u8120.usb.rc:root/init.u8120.usb.rc \
- $(LOCAL_PATH)/prebuilt/vold.fstab:system/etc/vold.fstab \
- $(LOCAL_PATH)/prebuilt/FileManager.apk:system/app/FileManager.apk
-
-# Camera libs
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/libcamerahal/prebuilt/libqcamera.so:obj/lib/libqcamera.so \
- $(LOCAL_PATH)/libcamerahal/prebuilt/libqcamera.so:system/lib/libqcamera.so \
- $(LOCAL_PATH)/libcamerahal/prebuilt/libcamera.so:obj/lib/libcamera.so \
- $(LOCAL_PATH)/libcamerahal/prebuilt/libcamera.so:system/lib/libcamera.so
-
-# Zipalign and Zram tweaks and MAC
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/etc/init.d/02huawei:system/etc/init.d/02huawei \
- $(LOCAL_PATH)/prebuilt/bin/zipalign:system/bin/zipalign \
- $(LOCAL_PATH)/prebuilt/etc/init.d/70zipalign:system/etc/init.d/70zipalign \
- $(LOCAL_PATH)/prebuilt/etc/check_property.sh:system/etc/check_property.sh \
- $(LOCAL_PATH)/firmware/softmac:system/wifi/softmac
+ $(LOCAL_PATH)/prebuilt/etc/vold.fstab:system/etc/vold.fstab \
+ $(LOCAL_PATH)/prebuilt/etc/start_usb0.sh:system/etc/start_usb0.sh \
+ $(LOCAL_PATH)/prebuilt/etc/media_profiles.xml:system/etc/media_profiles.xml
-# Input device calibration files
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/keyfiles/synaptics-rmi-touchscreen.idc:system/usr/idc/synaptics-rmi-touchscreen.idc \
- $(LOCAL_PATH)/keyfiles/synaptics.idc:system/usr/idc/synaptics.idc \
- $(LOCAL_PATH)/keyfiles/msm_touchscreen.idc:system/usr/idc/msm_touchscreen.idc \
- $(LOCAL_PATH)/keyfiles/melfas-touchscreen.idc:system/usr/idc/melfas-touchscreen.idc \
- $(LOCAL_PATH)/keyfiles/surf_keypad.idc:system/usr/idc/surf_keypad.idc \
- $(LOCAL_PATH)/keyfiles/touchscreen-keypad.idc:system/usr/idc/touchscreen-keypad.idc \
- $(LOCAL_PATH)/keyfiles/ts_test_input.idc:system/usr/idc/ts_test_input.idc \
- $(LOCAL_PATH)/keyfiles/7k_handset.idc:system/usr/idc/7k_handset.idc \
-
-# Keychars and keylayout files
+# Init files
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/keyfiles/msm_touchscreen.kl:system/usr/keylayout/msm_touchscreen.kl \
- $(LOCAL_PATH)/keyfiles/msm_touchscreen.kcm:system/usr/keychars/msm_touchscreen.kcm \
- $(LOCAL_PATH)/keyfiles/synaptics-rmi-touchscreen.kl:system/usr/keylayout/synaptics-rmi-touchscreen.kl \
- $(LOCAL_PATH)/keyfiles/synaptics-rmi-touchscreen.kcm:system/usr/keychars/synaptics-rmi-touchscreen.kcm \
- $(LOCAL_PATH)/keyfiles/melfas-touchscreen.kl:system/usr/keylayout/melfas-touchscreen.kl \
- $(LOCAL_PATH)/keyfiles/melfas-touchscreen.kcm:system/usr/keychars/melfas-touchscreen.kcm \
- $(LOCAL_PATH)/keyfiles/synaptics.kl:system/usr/keylayout/synaptics.kl \
- $(LOCAL_PATH)/keyfiles/synaptics.kcm:system/usr/keychars/synaptics.kcm \
- $(LOCAL_PATH)/keyfiles/surf_keypad.kl:system/usr/keylayout/surf_keypad.kl \
- $(LOCAL_PATH)/keyfiles/surf_keypad.kcm.bin:system/usr/keychars/surf_keypad.kcm.bin \
- $(LOCAL_PATH)/keyfiles/ts_test_input.kl:system/usr/keylayout/ts_test_input.kl \
- $(LOCAL_PATH)/keyfiles/qwerty.kl:system/usr/keylayout/qwerty.kl \
- $(LOCAL_PATH)/keyfiles/qwerty.kcm:system/usr/keychars/qwerty.kcm \
- $(LOCAL_PATH)/keyfiles/qwerty2.kcm:system/usr/keychars/qwerty2.kcm \
- $(LOCAL_PATH)/keyfiles/Virtual.kcm:system/usr/keychars/Virtual.kcm \
- $(LOCAL_PATH)/keyfiles/AVRCP.kl:system/usr/keylayout/AVRCP.kl \
- $(LOCAL_PATH)/keyfiles/qwerty2.kcm:system/usr/keychars/qwerty2.kcm \
+ $(LOCAL_PATH)/prebuilt/init.qcom.usb.rc:root/init.qcom.usb.rc \
+ $(LOCAL_PATH)/prebuilt/init.qcom.rc:root/init.qcom.rc \
+ $(LOCAL_PATH)/prebuilt/ueventd.qcom.rc:root/ueventd.qcom.rc \
+ $(LOCAL_PATH)/prebuilt/initlogo.rle:root/initlogo.rle
# modules
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/modules/ar6000.ko:system/wifi/ar6000.ko \
- $(LOCAL_PATH)/prebuilt/modules/zram.ko:system/lib/modules/2.6.32.9-perf/zram.ko
-
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/lib/hw/copybit.msm7x27.so:system/lib/hw/copybit.msm7x27.so \
- $(LOCAL_PATH)/prebuilt/lib/hw/gralloc.msm7x27.so:system/lib/hw/gralloc.msm7x27.so
+ $(LOCAL_PATH)/prebuilt/lib/modules/ar6000.ko:system/wifi/ar6000.ko \
+ $(LOCAL_PATH)/prebuilt/lib/modules/zram.ko:system/lib/modules/zram.ko
# Wi-Fi related
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/prebuilt/etc/dhcpcd/dhcpcd.conf:system/etc/dhcpcd/dhcpcd.conf \
- $(LOCAL_PATH)/prebuilt/etc/dhcpcd/dhcpcd.conf:system/etc/wifi/dhcpcd.conf \
- $(LOCAL_PATH)/prebuilt/hostapd:system/bin/hostapd \
$(LOCAL_PATH)/prebuilt/etc/wifi/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
- $(LOCAL_PATH)/prebuilt/hostapd.conf:system/etc/wifi/hostapd.conf
# Firmware
PRODUCT_COPY_FILES += \
@@ -152,48 +106,64 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/firmware/data.patch.hw2_0.bin.ar6002:system/wifi/data.patch.hw2_0.bin.ar6002 \
$(LOCAL_PATH)/firmware/device.bin:system/wifi/device.bin \
$(LOCAL_PATH)/firmware/eeprom.bin:system/wifi/eeprom.bin \
- $(LOCAL_PATH)/firmware/eeprom.data:system/wifi/eeprom.data
-
-# OEM RPC
-PRODUCT_COPY_FILES += \
- vendor/huawei/u8120/proprietary/bin/modempre:system/bin/modempre \
- vendor/huawei/u8120/proprietary/bin/oem_rpc_svc:system/bin/oem_rpc_svc \
- vendor/huawei/u8120/proprietary/lib/libhwrpc.so:system/lib/libhwrpc.so \
- vendor/huawei/u8120/proprietary/lib/liboem_rapi.so:system/lib/liboem_rapi.so
+ $(LOCAL_PATH)/firmware/eeprom.data:system/wifi/eeprom.data \
+ $(LOCAL_PATH)/firmware/softmac:system/wifi/softmac
# Audio
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/etc/AudioFilter.csv:system/etc/AudioFilter.csv \
- $(LOCAL_PATH)/prebuilt/etc/AudioFilterU8120.csv:system/etc/AudioFilterU8120.csv \
$(LOCAL_PATH)/prebuilt/etc/AutoVolumeControl.txt:system/etc/AutoVolumeControl.txt \
- $(LOCAL_PATH)/prebuilt/etc/01_qc.cfg:system/etc/01_qc.cfg
+ $(LOCAL_PATH)/prebuilt/etc/AudioFilter.csv:system/etc/AudioFilter.csv
-# rmt_storage
+# surf_keypad
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/bin/rmt_storage:system/bin/rmt_storage
+ $(LOCAL_PATH)/prebuilt/usr/keychars/surf_keypad.kcm.bin:system/usr/keychars/surf_keypad.kcm.bin
-# Other
+# Decoders
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/prebuilt/lib/egl/egl.cfg:system/lib/egl/egl.cfg \
- $(LOCAL_PATH)/prebuilt/etc/sysctl.conf:system/etc/sysctl.conf \
- $(LOCAL_PATH)/prebuilt/etc/init.d/01sysctl:system/etc/init.d/01sysctl
+ $(LOCAL_PATH)/prebuilt/lib/libmm-omxcore.so:system/lib/libmm-omxcore.so \
+ $(LOCAL_PATH)/prebuilt/lib/libOmxCore.so:system/lib/libOmxCore.so
-# Sysctl
+# Zipalign and scripts
PRODUCT_COPY_FILES += \
- device/zte/common/prebuilt/etc/init.d/01sysctl:system/etc/init.d/01sysctl \
- device/zte/common/prebuilt/etc/sysctl.conf:system/etc/sysctl.conf
+ $(LOCAL_PATH)/prebuilt/etc/init.d/02huawei:system/etc/init.d/02huawei \
+ $(LOCAL_PATH)/prebuilt/etc/init.d/70zipalign:system/etc/init.d/70zipalign \
+ $(LOCAL_PATH)/prebuilt/bin/zipalign:system/bin/zipalign
+
# Bluetooth configuration files
PRODUCT_COPY_FILES += \
system/bluetooth/data/main.conf:system/etc/bluetooth/main.conf
-# For userdebug builds
-ADDITIONAL_DEFAULT_PROPERTIES += \
- ro.secure=0 \
- ro.allow.mock.location=1 \
- ro.debuggable=1
-
-TARGET_PREBUILT_KERNEL := device/huawei/u8120/prebuilt/kernel
-
-$(call inherit-product-if-exists, vendor/huawei/u8120/u8120-vendor.mk)
+# USB autorun.iso for cdrom emulation in kernel driver
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/prebuilt/cdrom/autorun.iso:system/cdrom/autorun.iso
+
+# Touchscreen
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/prebuilt/usr/idc/synaptics.idc:system/usr/idc/synaptics.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/synaptics-rmi-touchscreen.idc:system/usr/idc/synaptics-rmi-touchscreen.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/cypress-ts-innolux_Ver04.idc:system/usr/idc/cypress-ts-innolux_Ver04.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/melfas-touchscreen.Ver23.idc:system/usr/idc/melfas-touchscreen.Ver23.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/melfas-touchscreen_ver23.idc:system/usr/idc/melfas-touchscreen_ver23.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/melfas-touchscreen_Ver23.idc:system/usr/idc/melfas-touchscreen_Ver23.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/melfas-touchscreen.idc:system/usr/idc/melfas-touchscreen.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/7k_handset.idc:system/usr/idc/7k_handset.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/qwerty.idc:system/usr/idc/qwerty.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/qwerty2.idc:system/usr/idc/qwerty2.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/kp_test_input.idc:system/usr/idc/kp_test_input.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/surf_keypad.idc:system/usr/idc/surf_keypad.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/u8120-keypad.idc:system/usr/idc/u8120-keypad.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/touchscreen-keypad.idc:system/usr/idc/touchscreen-keypad.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/msm_touchscreen.idc:system/usr/idc/msm_touchscreen.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/ts_test_input.idc:system/usr/idc/ts_test_input.idc \
+ $(LOCAL_PATH)/prebuilt/usr/idc/sensors.idc:system/usr/idc/sensors.idc \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/synaptics.kl:system/usr/keylayout/synaptics.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/surf_keypad.kl:system/usr/keylayout/surf_keypad.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/u8120-keypad.kl:system/usr/keylayout/u8120-keypad.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/cypress-ts-innolux_Ver04.kl:system/usr/keylayout/cypress-ts-innolux_Ver04.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/melfas-touchscreen.Ver23.kl:system/usr/keylayout/melfas-touchscreen.Ver23.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/melfas-touchscreen_ver23.kl:system/usr/keylayout/melfas-touchscreen_ver23.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/synaptics-rmi-touchscreen.kl:system/usr/keylayout/synaptics-rmi-touchscreen.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/touchscreen-keypad.kl:system/usr/keylayout/touchscreen-keypad.kl \
+ $(LOCAL_PATH)/prebuilt/usr/keylayout/7k_handset.kl:system/usr/keylayout/7k_handset.kl
View
2  egl.cfg
@@ -1,2 +0,0 @@
-0 0 android
-
View
101 extract-files.sh 100644 → 100755
@@ -1,76 +1,33 @@
#!/bin/sh
-mkdir -p ../../../vendor/huawei/u8120/proprietary
-
-DIRS="
-bin
-etc
-lib/hw
-"
-for DIR in $DIRS; do
- mkdir -p ../../../vendor/huawei/u8120/proprietary/$DIR
-done
-
-FILES="
-bin/modempre
-bin/oem_rpc_svc
-bin/akmd2
-bin/qmuxd
-bin/hci_qcomm_init
-bin/rild
-
-lib/libaudio.so
-lib/libaudioeq.so
-lib/libOmxCore.so
-lib/libOmxH264Dec.so
-lib/libOmxMpeg4Dec.so
-lib/libOmxVidEnc.so
-lib/libOmxWmvDec.so
-lib/libmm-adspsvc.so
-lib/libmm-omxcore.so
-lib/libsnd.so
-lib/libauth.so
-lib/libril-qc-1.so
-lib/libril.so
-lib/liboncrpc.so
-lib/libdsm.so
-lib/libqueue.so
-lib/libcm.so
-lib/libdiag.so
-lib/libmmgsdilib.so
-lib/libgsdi_exp.so
-lib/libgstk_exp.so
-lib/libwms.so
-lib/libnv.so
-lib/libwmsts.so
-lib/libril-qcril-hook-oem.so
-lib/libdss.so
-lib/libdll.so
-lib/libqmi.so
-lib/libpbmlib.so
-lib/libhwrpc.so
-lib/liboem_rapi.so
-
-lib/hw/sensors.default.so
-
-lib/libomx_aacdec_sharedlibrary.so
-lib/libomx_amrdec_sharedlibrary.so
-lib/libomx_amrenc_sharedlibrary.so
-lib/libomx_avcdec_sharedlibrary.so
-lib/libomx_m4vdec_sharedlibrary.so
-lib/libomx_mp3dec_sharedlibrary.so
-lib/libomx_sharedlibrary.so
-lib/libomx_sharedlibrary_qc.so
-
-etc/init.qcom.bt.sh
-"
-for FILE in $FILES; do
- adb pull system/$FILE ../../../vendor/huawei/u8120/proprietary/
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is generated by device/common/generate-blob-scripts.sh - DO NOT EDIT
+
+DEVICE=u8120
+MANUFACTURER=huawei
+
+BASE=../../../vendor/$MANUFACTURER/$DEVICE/proprietary
+rm -rf $BASE/*
+
+for FILE in `cat proprietary-files.txt`; do
+ DIR=`dirname $FILE`
+ if [ ! -d $BASE/$DIR ]; then
+ mkdir -p $BASE/$DIR
+ fi
+ adb pull /system/$FILE $BASE/$FILE
done
-chmod 755 ../../../vendor/huawei/u8120/proprietary/modempre
-chmod 755 ../../../vendor/huawei/u8120/proprietary/oem_rpc_svc
-chmod 755 ../../../vendor/huawei/u8120/proprietary/akmd2
-chmod 755 ../../../vendor/huawei/u8120/proprietary/qmuxd
-chmod 755 ../../../vendor/huawei/u8120/proprietary/hci_qcomm_init
-chmod 755 ../../../vendor/huawei/u8120/proprietary/rild
+./setup-makefiles.sh
View
BIN  firmware/bcm4329.hcd
Binary file not shown
View
BIN  firmware/data.patch.hw2_0.bin.ar6102
Binary file not shown
View
0  firmware/eeprom.bin 100644 → 100755
File mode changed
View
0  firmware/eeprom.data 100644 → 100755
File mode changed
View
2  firmware/softmac 100644 → 100755
@@ -1 +1 @@
-4C:54:99:4F:41:54
+4c:54:99:4f:41:54
View
401 include/hardware_legacy/AudioPolicyManagerBase.h
@@ -0,0 +1,401 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <utils/Timers.h>
+#include <utils/Errors.h>
+#include <utils/KeyedVector.h>
+#include <hardware_legacy/AudioPolicyInterface.h>
+
+
+namespace android_audio_legacy {
+ using android::KeyedVector;
+
+// ----------------------------------------------------------------------------
+
+#define MAX_DEVICE_ADDRESS_LEN 20
+// Attenuation applied to STRATEGY_SONIFICATION streams when a headset is connected: 6dB
+#define SONIFICATION_HEADSET_VOLUME_FACTOR 0.5
+// Min volume for STRATEGY_SONIFICATION streams when limited by music volume: -36dB
+#define SONIFICATION_HEADSET_VOLUME_MIN 0.016
+// Time in milliseconds during which we consider that music is still active after a music
+// track was stopped - see computeVolume()
+#define SONIFICATION_HEADSET_MUSIC_DELAY 5000
+// Time in milliseconds during witch some streams are muted while the audio path
+// is switched
+#define MUTE_TIME_MS 2000
+
+#define NUM_TEST_OUTPUTS 5
+
+#define NUM_VOL_CURVE_KNEES 2
+
+// ----------------------------------------------------------------------------
+// AudioPolicyManagerBase implements audio policy manager behavior common to all platforms.
+// Each platform must implement an AudioPolicyManager class derived from AudioPolicyManagerBase
+// and override methods for which the platform specific behavior differs from the implementation
+// in AudioPolicyManagerBase. Even if no specific behavior is required, the AudioPolicyManager
+// class must be implemented as well as the class factory function createAudioPolicyManager()
+// and provided in a shared library libaudiopolicy.so.
+// ----------------------------------------------------------------------------
+
+class AudioPolicyManagerBase: public AudioPolicyInterface
+#ifdef AUDIO_POLICY_TEST
+ , public Thread
+#endif //AUDIO_POLICY_TEST
+{
+
+public:
+ AudioPolicyManagerBase(AudioPolicyClientInterface *clientInterface);
+ virtual ~AudioPolicyManagerBase();
+
+ // AudioPolicyInterface
+ virtual status_t setDeviceConnectionState(AudioSystem::audio_devices device,
+ AudioSystem::device_connection_state state,
+ const char *device_address);
+ virtual AudioSystem::device_connection_state getDeviceConnectionState(AudioSystem::audio_devices device,
+ const char *device_address);
+ virtual void setPhoneState(int state);
+ virtual void setRingerMode(uint32_t mode, uint32_t mask);
+ virtual void setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config);
+ virtual AudioSystem::forced_config getForceUse(AudioSystem::force_use usage);
+ virtual void setSystemProperty(const char* property, const char* value);
+ virtual status_t initCheck();
+ virtual audio_io_handle_t getOutput(AudioSystem::stream_type stream,
+ uint32_t samplingRate = 0,
+ uint32_t format = AudioSystem::FORMAT_DEFAULT,
+ uint32_t channels = 0,
+ AudioSystem::output_flags flags =
+ AudioSystem::OUTPUT_FLAG_INDIRECT);
+ virtual status_t startOutput(audio_io_handle_t output,
+ AudioSystem::stream_type stream,
+ int session = 0);
+ virtual status_t stopOutput(audio_io_handle_t output,
+ AudioSystem::stream_type stream,
+ int session = 0);
+ virtual void releaseOutput(audio_io_handle_t output);
+ virtual audio_io_handle_t getInput(int inputSource,
+ uint32_t samplingRate,
+ uint32_t format,
+ uint32_t channels,
+ AudioSystem::audio_in_acoustics acoustics);
+ // indicates to the audio policy manager that the input starts being used.
+ virtual status_t startInput(audio_io_handle_t input);
+ // indicates to the audio policy manager that the input stops being used.
+ virtual status_t stopInput(audio_io_handle_t input);
+ virtual void releaseInput(audio_io_handle_t input);
+ virtual void initStreamVolume(AudioSystem::stream_type stream,
+ int indexMin,
+ int indexMax);
+ virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index);
+ virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index);
+
+ // return the strategy corresponding to a given stream type
+ virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream);
+
+ // return the enabled output devices for the given stream type
+ virtual uint32_t getDevicesForStream(AudioSystem::stream_type stream);
+
+ virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc);
+ virtual status_t registerEffect(effect_descriptor_t *desc,
+ audio_io_handle_t io,
+ uint32_t strategy,
+ int session,
+ int id);
+ virtual status_t unregisterEffect(int id);
+ virtual status_t setEffectEnabled(int id, bool enabled);
+
+ virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const;
+
+ virtual status_t dump(int fd);
+
+protected:
+
+ enum routing_strategy {
+ STRATEGY_MEDIA,
+ STRATEGY_PHONE,
+ STRATEGY_SONIFICATION,
+ STRATEGY_DTMF,
+ STRATEGY_ENFORCED_AUDIBLE,
+ NUM_STRATEGIES
+ };
+
+ // 4 points to define the volume attenuation curve, each characterized by the volume
+ // index (from 0 to 100) at which they apply, and the attenuation in dB at that index.
+ // we use 100 steps to avoid rounding errors when computing the volume in volIndexToAmpl()
+
+ enum { VOLMIN = 0, VOLKNEE1 = 1, VOLKNEE2 = 2, VOLMAX = 3, VOLCNT = 4};
+
+ class VolumeCurvePoint
+ {
+ public:
+ int mIndex;
+ float mDBAttenuation;
+ };
+
+ // device categories used for volume curve management.
+ enum device_category {
+ DEVICE_CATEGORY_HEADSET,
+ DEVICE_CATEGORY_SPEAKER,
+ DEVICE_CATEGORY_EARPIECE,
+ DEVICE_CATEGORY_CNT
+ };
+
+ // default volume curve
+ static const VolumeCurvePoint sDefaultVolumeCurve[AudioPolicyManagerBase::VOLCNT];
+ // default volume curve for media strategy
+ static const VolumeCurvePoint sDefaultMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT];
+ // volume curve for media strategy on speakers
+ static const VolumeCurvePoint sSpeakerMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT];
+ // volume curve for sonification strategy on speakers
+ static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManagerBase::VOLCNT];
+ // default volume curves per strategy and device category. See initializeVolumeCurves()
+ static const VolumeCurvePoint *sVolumeProfiles[NUM_STRATEGIES][DEVICE_CATEGORY_CNT];
+
+ // descriptor for audio outputs. Used to maintain current configuration of each opened audio output
+ // and keep track of the usage of this output by each audio stream type.
+ class AudioOutputDescriptor
+ {
+ public:
+ AudioOutputDescriptor();
+
+ status_t dump(int fd);
+
+ uint32_t device();
+ void changeRefCount(AudioSystem::stream_type, int delta);
+ uint32_t refCount();
+ uint32_t strategyRefCount(routing_strategy strategy);
+ bool isUsedByStrategy(routing_strategy strategy) { return (strategyRefCount(strategy) != 0);}
+ bool isDuplicated() { return (mOutput1 != NULL && mOutput2 != NULL); }
+
+ audio_io_handle_t mId; // output handle
+ uint32_t mSamplingRate; //
+ uint32_t mFormat; //
+ uint32_t mChannels; // output configuration
+ uint32_t mLatency; //
+ AudioSystem::output_flags mFlags; //
+ uint32_t mDevice; // current device this output is routed to
+ uint32_t mRefCount[AudioSystem::NUM_STREAM_TYPES]; // number of streams of each type using this output
+ nsecs_t mStopTime[AudioSystem::NUM_STREAM_TYPES];
+ AudioOutputDescriptor *mOutput1; // used by duplicated outputs: first output
+ AudioOutputDescriptor *mOutput2; // used by duplicated outputs: second output
+ float mCurVolume[AudioSystem::NUM_STREAM_TYPES]; // current stream volume
+ int mMuteCount[AudioSystem::NUM_STREAM_TYPES]; // mute request counter
+ };
+
+ // descriptor for audio inputs. Used to maintain current configuration of each opened audio input
+ // and keep track of the usage of this input.
+ class AudioInputDescriptor
+ {
+ public:
+ AudioInputDescriptor();
+
+ status_t dump(int fd);
+
+ uint32_t mSamplingRate; //
+ uint32_t mFormat; // input configuration
+ uint32_t mChannels; //
+ AudioSystem::audio_in_acoustics mAcoustics; //
+ uint32_t mDevice; // current device this input is routed to
+ uint32_t mRefCount; // number of AudioRecord clients using this output
+ int mInputSource; // input source selected by application (mediarecorder.h)
+ };
+
+ // stream descriptor used for volume control
+ class StreamDescriptor
+ {
+ public:
+ StreamDescriptor()
+ : mIndexMin(0), mIndexMax(1), mIndexCur(1), mCanBeMuted(true) {}
+
+ void dump(char* buffer, size_t size);
+
+ int mIndexMin; // min volume index
+ int mIndexMax; // max volume index
+ int mIndexCur; // current volume index
+ bool mCanBeMuted; // true is the stream can be muted
+
+ const VolumeCurvePoint *mVolumeCurve[DEVICE_CATEGORY_CNT];
+ };
+
+ // stream descriptor used for volume control
+ class EffectDescriptor
+ {
+ public:
+
+ status_t dump(int fd);
+
+ int mIo; // io the effect is attached to
+ routing_strategy mStrategy; // routing strategy the effect is associated to
+ int mSession; // audio session the effect is on
+ effect_descriptor_t mDesc; // effect descriptor
+ bool mEnabled; // enabled state: CPU load being used or not
+ };
+
+ void addOutput(audio_io_handle_t id, AudioOutputDescriptor *outputDesc);
+
+ // return the strategy corresponding to a given stream type
+ static routing_strategy getStrategy(AudioSystem::stream_type stream);
+ // return appropriate device for streams handled by the specified strategy according to current
+ // phone state, connected devices...
+ // if fromCache is true, the device is returned from mDeviceForStrategy[], otherwise it is determined
+ // by current state (device connected, phone state, force use, a2dp output...)
+ // This allows to:
+ // 1 speed up process when the state is stable (when starting or stopping an output)
+ // 2 access to either current device selection (fromCache == true) or
+ // "future" device selection (fromCache == false) when called from a context
+ // where conditions are changing (setDeviceConnectionState(), setPhoneState()...) AND
+ // before updateDeviceForStrategy() is called.
+ virtual uint32_t getDeviceForStrategy(routing_strategy strategy, bool fromCache = true);
+ // change the route of the specified output
+ void setOutputDevice(audio_io_handle_t output, uint32_t device, bool force = false, int delayMs = 0);
+ // select input device corresponding to requested audio source
+ virtual uint32_t getDeviceForInputSource(int inputSource);
+ // return io handle of active input or 0 if no input is active
+ audio_io_handle_t getActiveInput();
+ // initialize volume curves for each strategy and device category
+ void initializeVolumeCurves();
+ // compute the actual volume for a given stream according to the requested index and a particular
+ // device
+ virtual float computeVolume(int stream, int index, audio_io_handle_t output, uint32_t device);
+ // check that volume change is permitted, compute and send new volume to audio hardware
+#ifdef WITH_QCOM_LPA
+ virtual status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false);
+#else
+ virtual status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false);
+#endif
+ // apply all stream volumes to the specified output and device
+ void applyStreamVolumes(audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false);
+ // Mute or unmute all streams handled by the specified strategy on the specified output
+ void setStrategyMute(routing_strategy strategy, bool on, audio_io_handle_t output, int delayMs = 0);
+ // Mute or unmute the stream on the specified output
+#ifdef WITH_QCOM_LPA
+ virtual void setStreamMute(int stream, bool on, audio_io_handle_t output, int delayMs = 0);
+#else
+ void setStreamMute(int stream, bool on, audio_io_handle_t output, int delayMs = 0);
+#endif
+ // handle special cases for sonification strategy while in call: mute streams or replace by
+ // a special tone in the device used for communication
+ void handleIncallSonification(int stream, bool starting, bool stateChange);
+ // true is current platform implements a back microphone
+ virtual bool hasBackMicrophone() const { return false; }
+ // true if device is in a telephony or VoIP call
+ virtual bool isInCall();
+ // true if given state represents a device in a telephony or VoIP call
+ virtual bool isStateInCall(int state);
+
+#ifdef WITH_A2DP
+ // true is current platform supports suplication of notifications and ringtones over A2DP output
+ virtual bool a2dpUsedForSonification() const { return true; }
+ status_t handleA2dpConnection(AudioSystem::audio_devices device,
+ const char *device_address);
+ status_t handleA2dpDisconnection(AudioSystem::audio_devices device,
+ const char *device_address);
+ void closeA2dpOutputs();
+ // checks and if necessary changes output (a2dp, duplicated or hardware) used for all strategies.
+ // must be called every time a condition that affects the output choice for a given strategy is
+ // changed: connected device, phone state, force use...
+ // Must be called before updateDeviceForStrategy()
+ void checkOutputForStrategy(routing_strategy strategy);
+ // Same as checkOutputForStrategy() but for a all strategies in order of priority
+ void checkOutputForAllStrategies();
+ // manages A2DP output suspend/restore according to phone state and BT SCO usage
+ void checkA2dpSuspend();
+#endif
+ // selects the most appropriate device on output for current state
+ // must be called every time a condition that affects the device choice for a given output is
+ // changed: connected device, phone state, force use, output start, output stop..
+ // see getDeviceForStrategy() for the use of fromCache parameter
+ uint32_t getNewDevice(audio_io_handle_t output, bool fromCache = true);
+ // updates cache of device used by all strategies (mDeviceForStrategy[])
+ // must be called every time a condition that affects the device choice for a given strategy is
+ // changed: connected device, phone state, force use...
+ // cached values are used by getDeviceForStrategy() if parameter fromCache is true.
+ // Must be called after checkOutputForAllStrategies()
+ void updateDeviceForStrategy();
+ // true if current platform requires a specific output to be opened for this particular
+ // set of parameters. This function is called by getOutput() and is implemented by platform
+ // specific audio policy manager.
+ virtual bool needsDirectOuput(AudioSystem::stream_type stream,
+ uint32_t samplingRate,
+ uint32_t format,
+ uint32_t channels,
+ AudioSystem::output_flags flags,
+ uint32_t device);
+ virtual uint32_t getMaxEffectsCpuLoad();
+ virtual uint32_t getMaxEffectsMemory();
+#ifdef AUDIO_POLICY_TEST
+ virtual bool threadLoop();
+ void exit();
+ int testOutputIndex(audio_io_handle_t output);
+#endif //AUDIO_POLICY_TEST
+
+ status_t setEffectEnabled(EffectDescriptor *pDesc, bool enabled);
+
+ // returns the category the device belongs to with regard to volume curve management
+ static device_category getDeviceCategory(uint32_t device);
+
+ AudioPolicyClientInterface *mpClientInterface; // audio policy client interface
+ audio_io_handle_t mHardwareOutput; // hardware output handler
+ audio_io_handle_t mA2dpOutput; // A2DP output handler
+ audio_io_handle_t mDuplicatedOutput; // duplicated output handler: outputs to hardware and A2DP.
+
+ KeyedVector<audio_io_handle_t, AudioOutputDescriptor *> mOutputs; // list of output descriptors
+ KeyedVector<audio_io_handle_t, AudioInputDescriptor *> mInputs; // list of input descriptors
+ uint32_t mAvailableOutputDevices; // bit field of all available output devices
+ uint32_t mAvailableInputDevices; // bit field of all available input devices
+ int mPhoneState; // current phone state
+ uint32_t mRingerMode; // current ringer mode
+ AudioSystem::forced_config mForceUse[AudioSystem::NUM_FORCE_USE]; // current forced use configuration
+
+ StreamDescriptor mStreams[AudioSystem::NUM_STREAM_TYPES]; // stream descriptors for volume control
+ String8 mA2dpDeviceAddress; // A2DP device MAC address
+ String8 mScoDeviceAddress; // SCO device MAC address
+ bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected
+ uint32_t mDeviceForStrategy[NUM_STRATEGIES];
+ float mLastVoiceVolume; // last voice volume value sent to audio HAL
+
+ // Maximum CPU load allocated to audio effects in 0.1 MIPS (ARMv5TE, 0 WS memory) units
+ static const uint32_t MAX_EFFECTS_CPU_LOAD = 1000;
+ // Maximum memory allocated to audio effects in KB
+ static const uint32_t MAX_EFFECTS_MEMORY = 512;
+ uint32_t mTotalEffectsCpuLoad; // current CPU load used by effects
+ uint32_t mTotalEffectsMemory; // current memory used by effects
+ KeyedVector<int, EffectDescriptor *> mEffects; // list of registered audio effects
+ bool mA2dpSuspended; // true if A2DP output is suspended
+
+#ifdef AUDIO_POLICY_TEST
+ Mutex mLock;
+ Condition mWaitWorkCV;
+
+ int mCurOutput;
+ bool mDirectOutput;
+ audio_io_handle_t mTestOutputs[NUM_TEST_OUTPUTS];
+ int mTestInput;
+ uint32_t mTestDevice;
+ uint32_t mTestSamplingRate;
+ uint32_t mTestFormat;
+ uint32_t mTestChannels;
+ uint32_t mTestLatencyMs;
+#endif //AUDIO_POLICY_TEST
+
+private:
+ static float volIndexToAmpl(uint32_t device, const StreamDescriptor& streamDesc,
+ int indexInUi);
+};
+
+};
View
21 include/linux/android_pmem.h
@@ -47,7 +47,7 @@
/* Returns the total size of the pmem region it is sent to as a pmem_region
* struct (with offset set to 0).
*/
-#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, unsigned int)
+#define PMEM_GET_TOTAL_SIZE 0
/* Revokes gpu registers and resets the gpu. Pass a pointer to the
* start of the mapped gpu regs (the vaddr returned by mmap) as the argument.
*/
@@ -101,6 +101,7 @@ enum pmem_allocator_type {
* defined
*/
PMEM_ALLOCATORTYPE_BITMAP = 0, /* forced to be zero here */
+ PMEM_ALLOCATORTYPE_SYSTEM,
PMEM_ALLOCATORTYPE_ALLORNOTHING,
PMEM_ALLOCATORTYPE_BUDDYBESTFIT,
@@ -155,6 +156,24 @@ struct android_pmem_platform_data
unsigned buffered;
/* This PMEM is on memory that may be powered off */
unsigned unstable;
+ /*
+ * function to be called when the number of allocations goes from
+ * 0 -> 1
+ */
+ void (*request_region)(void *);
+ /*
+ * function to be called when the number of allocations goes from
+ * 1 -> 0
+ */
+ void (*release_region)(void *);
+ /*
+ * function to be called upon pmem registration
+ */
+ void *(*setup_region)(void);
+ /*
+ * indicates that this region should be mapped/unmaped as needed
+ */
+ int map_on_demand;
};
int pmem_setup(struct android_pmem_platform_data *pdata,
View
50 include/linux/ashmem.h
@@ -1,50 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- *** This header was automatically generated from a Linux kernel header
- *** of the same name, to make information necessary for userspace to
- *** call into the kernel available to libc. It contains only constants,
- *** structures, and macros generated from the original header, and thus,
- *** contains no copyrightable information.
- ***
- ****************************************************************************
- ****************************************************************************/
-#ifndef _LINUX_ASHMEM_H
-#define _LINUX_ASHMEM_H
-
-#include <linux/limits.h>
-#include <linux/ioctl.h>
-
-#define ASHMEM_NAME_LEN 256
-
-#define ASHMEM_NAME_DEF "dev/ashmem"
-
-#define ASHMEM_NOT_PURGED 0
-#define ASHMEM_WAS_PURGED 1
-
-#define ASHMEM_IS_UNPINNED 0
-#define ASHMEM_IS_PINNED 1
-
-struct ashmem_pin {
- __u32 offset;
- __u32 len;
-};
-
-#define __ASHMEMIOC 0x77
-
-#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
-#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
-#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
-#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
-#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
-#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
-#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
-#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
-#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
-#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
-
-#define ASHMEM_CACHE_FLUSH_RANGE _IO(__ASHMEMIOC, 11)
-#define ASHMEM_CACHE_CLEAN_RANGE _IO(__ASHMEMIOC, 12)
-#define ASHMEM_CACHE_INV_RANGE _IO(__ASHMEMIOC, 13)
-
-#endif
View
45 include/linux/genlock.h
@@ -1,45 +0,0 @@
-#ifndef _GENLOCK_H_
-#define _GENLOCK_H_
-
-#ifdef __KERNEL__
-
-struct genlock;
-struct genlock_handle;
-
-struct genlock_handle *genlock_get_handle(void);
-struct genlock_handle *genlock_get_handle_fd(int fd);
-void genlock_put_handle(struct genlock_handle *handle);
-struct genlock *genlock_create_lock(struct genlock_handle *);
-struct genlock *genlock_attach_lock(struct genlock_handle *, int fd);
-int genlock_wait(struct genlock_handle *handle, u32 timeout);
-void genlock_release_lock(struct genlock_handle *);
-int genlock_lock(struct genlock_handle *handle, int op, int flags,
- u32 timeout);
-#endif
-
-#define GENLOCK_UNLOCK 0
-#define GENLOCK_WRLOCK 1
-#define GENLOCK_RDLOCK 2
-
-#define GENLOCK_NOBLOCK (1 << 0)
-
-struct genlock_lock {
- int fd;
- int op;
- int flags;
- int timeout;
-};
-
-#define GENLOCK_IOC_MAGIC 'G'
-
-#define GENLOCK_IOC_NEW _IO(GENLOCK_IOC_MAGIC, 0)
-#define GENLOCK_IOC_EXPORT _IOR(GENLOCK_IOC_MAGIC, 1, \
- struct genlock_lock)
-#define GENLOCK_IOC_ATTACH _IOW(GENLOCK_IOC_MAGIC, 2, \
- struct genlock_lock)
-#define GENLOCK_IOC_LOCK _IOW(GENLOCK_IOC_MAGIC, 3, \
- struct genlock_lock)
-#define GENLOCK_IOC_RELEASE _IO(GENLOCK_IOC_MAGIC, 4)
-#define GENLOCK_IOC_WAIT _IOW(GENLOCK_IOC_MAGIC, 5, \
- struct genlock_lock)
-#endif
View
556 include/linux/ion.h
@@ -1,556 +0,0 @@
-/*
- * include/linux/ion.h
- *
- * Copyright (C) 2011 Google, Inc.
- *
- * 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_ION_H
-#define _LINUX_ION_H
-
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-
-struct ion_handle;
-/**
- * enum ion_heap_types - list of all possible types of heaps
- * @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc
- * @ION_HEAP_TYPE_SYSTEM_CONTIG: memory allocated via kmalloc
- * @ION_HEAP_TYPE_CARVEOUT: memory allocated from a prereserved
- * carveout heap, allocations are physically
- * contiguous
- * @ION_HEAP_END: helper for iterating over heaps
- */
-enum ion_heap_type {
- ION_HEAP_TYPE_SYSTEM,
- ION_HEAP_TYPE_SYSTEM_CONTIG,
- ION_HEAP_TYPE_CARVEOUT,
- ION_HEAP_TYPE_CUSTOM, /* must be last so device specific heaps always
- are at the end of this enum */
- ION_NUM_HEAPS,
-};
-
-#define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM)
-#define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
-#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT)
-
-
-/**
- * These are the only ids that should be used for Ion heap ids.
- * The ids listed are the order in which allocation will be attempted
- * if specified. Don't swap the order of heap ids unless you know what
- * you are doing!
- */
-
-enum ion_heap_ids {
- ION_HEAP_SYSTEM_ID,
- ION_HEAP_SYSTEM_CONTIG_ID,
- ION_HEAP_EBI_ID,
- ION_HEAP_SMI_ID,
- ION_HEAP_ADSP_ID,
- ION_HEAP_AUDIO_ID,
-};
-
-#define ION_KMALLOC_HEAP_NAME "kmalloc"
-#define ION_VMALLOC_HEAP_NAME "vmalloc"
-#define ION_EBI1_HEAP_NAME "EBI1"
-#define ION_ADSP_HEAP_NAME "adsp"
-#define ION_SMI_HEAP_NAME "smi"
-
-#define CACHED 1
-#define UNCACHED 0
-
-#define ION_CACHE_SHIFT 0
-
-#define ION_SET_CACHE(__cache) ((__cache) << ION_CACHE_SHIFT)
-
-#define ION_IS_CACHED(__flags) ((__flags) & (1 << ION_CACHE_SHIFT))
-
-#ifdef __KERNEL__
-#include <linux/err.h>
-#include <mach/ion.h>
-struct ion_device;
-struct ion_heap;
-struct ion_mapper;
-struct ion_client;
-struct ion_buffer;
-
-/* This should be removed some day when phys_addr_t's are fully
- plumbed in the kernel, and all instances of ion_phys_addr_t should
- be converted to phys_addr_t. For the time being many kernel interfaces
- do not accept phys_addr_t's that would have to */
-#define ion_phys_addr_t unsigned long
-
-/**
- * struct ion_platform_heap - defines a heap in the given platform
- * @type: type of the heap from ion_heap_type enum
- * @id: unique identifier for heap. When allocating (lower numbers
- * will be allocated from first)
- * @name: used for debug purposes
- * @base: base address of heap in physical memory if applicable
- * @size: size of the heap in bytes if applicable
- *
- * Provided by the board file.
- */
-struct ion_platform_heap {
- enum ion_heap_type type;
- unsigned int id;
- const char *name;
- ion_phys_addr_t base;
- size_t size;
- enum ion_memory_types memory_type;
-};
-
-/**
- * struct ion_platform_data - array of platform heaps passed from board file
- * @nr: number of structures in the array
- * @request_region: function to be called when the number of allocations goes
- * from 0 -> 1
- * @release_region: function to be called when the number of allocations goes
- * from 1 -> 0
- * @setup_region: function to be called upon ion registration
- * @heaps: array of platform_heap structions
- *
- * Provided by the board file in the form of platform data to a platform device.
- */
-struct ion_platform_data {
- int nr;
- void (*request_region)(void *);
- void (*release_region)(void *);
- void *(*setup_region)(void);
- struct ion_platform_heap heaps[];
-};
-
-#ifdef CONFIG_ION
-
-/**
- * ion_client_create() - allocate a client and returns it
- * @dev: the global ion device
- * @heap_mask: mask of heaps this client can allocate from
- * @name: used for debugging
- */
-struct ion_client *ion_client_create(struct ion_device *dev,
- unsigned int heap_mask, const char *name);
-
-/**
- * msm_ion_client_create - allocate a client using the ion_device specified in
- * drivers/gpu/ion/msm/msm_ion.c
- *
- * heap_mask and name are the same as ion_client_create, return values
- * are the same as ion_client_create.
- */
-
-struct ion_client *msm_ion_client_create(unsigned int heap_mask,
- const char *name);
-
-/**
- * ion_client_destroy() - free's a client and all it's handles
- * @client: the client
- *
- * Free the provided client and all it's resources including
- * any handles it is holding.
- */
-void ion_client_destroy(struct ion_client *client);
-
-/**
- * ion_alloc - allocate ion memory
- * @client: the client
- * @len: size of the allocation
- * @align: requested allocation alignment, lots of hardware blocks have
- * alignment requirements of some kind
- * @flags: mask of heaps to allocate from, if multiple bits are set
- * heaps will be tried in order from lowest to highest order bit
- *
- * Allocate memory in one of the heaps provided in heap mask and return
- * an opaque handle to it.
- */
-struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
- size_t align, unsigned int flags);
-
-/**
- * ion_free - free a handle
- * @client: the client
- * @handle: the handle to free
- *
- * Free the provided handle.
- */
-void ion_free(struct ion_client *client, struct ion_handle *handle);
-
-/**
- * ion_phys - returns the physical address and len of a handle
- * @client: the client
- * @handle: the handle
- * @addr: a pointer to put the address in
- * @len: a pointer to put the length in
- *
- * This function queries the heap for a particular handle to get the
- * handle's physical address. It't output is only correct if
- * a heap returns physically contiguous memory -- in other cases
- * this api should not be implemented -- ion_map_dma should be used
- * instead. Returns -EINVAL if the handle is invalid. This has
- * no implications on the reference counting of the handle --
- * the returned value may not be valid if the caller is not
- * holding a reference.
- */
-int ion_phys(struct ion_client *client, struct ion_handle *handle,
- ion_phys_addr_t *addr, size_t *len);
-
-/**
- * ion_map_kernel - create mapping for the given handle
- * @client: the client
- * @handle: handle to map
- * @flags: flags for this mapping
- *
- * Map the given handle into the kernel and return a kernel address that
- * can be used to access this address. If no flags are specified, this
- * will return a non-secure uncached mapping.
- */
-void *ion_map_kernel(struct ion_client *client, struct ion_handle *handle,
- unsigned long flags);
-
-/**
- * ion_unmap_kernel() - destroy a kernel mapping for a handle
- * @client: the client
- * @handle: handle to unmap
- */
-void ion_unmap_kernel(struct ion_client *client, struct ion_handle *handle);
-
-/**
- * ion_map_dma - create a dma mapping for a given handle
- * @client: the client
- * @handle: handle to map
- *
- * Return an sglist describing the given handle
- */
-struct scatterlist *ion_map_dma(struct ion_client *client,
- struct ion_handle *handle,
- unsigned long flags);
-
-/**
- * ion_unmap_dma() - destroy a dma mapping for a handle
- * @client: the client
- * @handle: handle to unmap
- */
-void ion_unmap_dma(struct ion_client *client, struct ion_handle *handle);
-
-/**
- * ion_share() - given a handle, obtain a buffer to pass to other clients
- * @client: the client
- * @handle: the handle to share
- *
- * Given a handle, return a buffer, which exists in a global name
- * space, and can be passed to other clients. Should be passed into ion_import
- * to obtain a new handle for this buffer.
- *
- * NOTE: This function does do not an extra reference. The burden is on the
- * caller to make sure the buffer doesn't go away while it's being passed to
- * another client. That is, ion_free should not be called on this handle until
- * the buffer has been imported into the other client.
- */
-struct ion_buffer *ion_share(struct ion_client *client,
- struct ion_handle *handle);
-
-/**
- * ion_import() - given an buffer in another client, import it
- * @client: this blocks client
- * @buffer: the buffer to import (as obtained from ion_share)
- *
- * Given a buffer, add it to the client and return the handle to use to refer
- * to it further. This is called to share a handle from one kernel client to
- * another.
- */
-struct ion_handle *ion_import(struct ion_client *client,
- struct ion_buffer *buffer);
-
-/**
- * ion_import_fd() - given an fd obtained via ION_IOC_SHARE ioctl, import it
- * @client: this blocks client
- * @fd: the fd
- *
- * A helper function for drivers that will be recieving ion buffers shared
- * with them from userspace. These buffers are represented by a file
- * descriptor obtained as the return from the ION_IOC_SHARE ioctl.
- * This function coverts that fd into the underlying buffer, and returns
- * the handle to use to refer to it further.
- */
-struct ion_handle *ion_import_fd(struct ion_client *client, int fd);
-
-/**
- * ion_handle_get_flags - get the flags for a given handle
- *
- * @client - client who allocated the handle
- * @handle - handle to get the flags
- * @flags - pointer to store the flags
- *
- * Gets the current flags for a handle. These flags indicate various options
- * of the buffer (caching, security, etc.)
- */
-int ion_handle_get_flags(struct ion_client *client, struct ion_handle *handle,
- unsigned long *flags);
-
-#else
-static inline struct ion_client *ion_client_create(struct ion_device *dev,
- unsigned int heap_mask, const char *name)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline struct ion_client *msm_ion_client_create(unsigned int heap_mask,
- const char *name)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline void ion_client_destroy(struct ion_client *client) { }
-
-static inline struct ion_handle *ion_alloc(struct ion_client *client,
- size_t len, size_t align, unsigned int flags)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline void ion_free(struct ion_client *client,
- struct ion_handle *handle) { }
-
-
-static inline int ion_phys(struct ion_client *client,
- struct ion_handle *handle, ion_phys_addr_t *addr, size_t *len)
-{
- return -ENODEV;
-}
-
-static inline void *ion_map_kernel(struct ion_client *client,
- struct ion_handle *handle, unsigned long flags)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline void ion_unmap_kernel(struct ion_client *client,
- struct ion_handle *handle) { }
-
-static inline struct scatterlist *ion_map_dma(struct ion_client *client,
- struct ion_handle *handle, unsigned long flags)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline void ion_unmap_dma(struct ion_client *client,
- struct ion_handle *handle) { }
-
-static inline struct ion_buffer *ion_share(struct ion_client *client,
- struct ion_handle *handle)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline struct ion_handle *ion_import(struct ion_client *client,
- struct ion_buffer *buffer)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline struct ion_handle *ion_import_fd(struct ion_client *client,
- int fd)
-{
- return ERR_PTR(-ENODEV);
-}
-
-static inline int ion_handle_get_flags(struct ion_client *client,
- struct ion_handle *handle, unsigned long *flags)
-{
- return -ENODEV;
-}
-#endif /* CONFIG_ION */
-#endif /* __KERNEL__ */
-
-/**
- * DOC: Ion Userspace API
- *
- * create a client by opening /dev/ion
- * most operations handled via following ioctls
- *
- */
-
-/**
- * struct ion_allocation_data - metadata passed from userspace for allocations
- * @len: size of the allocation
- * @align: required alignment of the allocation
- * @flags: flags passed to heap
- * @handle: pointer that will be populated with a cookie to use to refer
- * to this allocation
- *
- * Provided by userspace as an argument to the ioctl
- */
-struct ion_allocation_data {
- size_t len;
- size_t align;
- unsigned int flags;
- struct ion_handle *handle;
-};
-
-/**
- * struct ion_fd_data - metadata passed to/from userspace for a handle/fd pair
- * @handle: a handle
- * @fd: a file descriptor representing that handle
- *
- * For ION_IOC_SHARE or ION_IOC_MAP userspace populates the handle field with
- * the handle returned from ion alloc, and the kernel returns the file
- * descriptor to share or map in the fd field. For ION_IOC_IMPORT, userspace
- * provides the file descriptor and the kernel returns the handle.
- */
-struct ion_fd_data {
- struct ion_handle *handle;
- int fd;
-};
-
-/**
- * struct ion_handle_data - a handle passed to/from the kernel
- * @handle: a handle
- */
-struct ion_handle_data {
- struct ion_handle *handle;
-};
-
-/**
- * struct ion_custom_data - metadata passed to/from userspace for a custom ioctl
- * @cmd: the custom ioctl function to call
- * @arg: additional data to pass to the custom ioctl, typically a user
- * pointer to a predefined structure
- *
- * This works just like the regular cmd and arg fields of an ioctl.
- */
-struct ion_custom_data {
- unsigned int cmd;
- unsigned long arg;
-};
-
-
-/* struct ion_flush_data - data passed to ion for flushing caches
- *
- * @handle: handle with data to flush
- * @vaddr: userspace virtual address mapped with mmap
- * @offset: offset into the handle to flush
- * @length: length of handle to flush
- *
- * Performs cache operations on the handle. If p is the start address
- * of the handle, p + offset through p + offset + length will have
- * the cache operations performed
- */
-struct ion_flush_data {
- struct ion_handle *handle;
- void *vaddr;
- unsigned int offset;
- unsigned int length;
-};
-
-/* struct ion_flag_data - information about flags for this buffer
- *
- * @handle: handle to get flags from
- * @flags: flags of this handle
- *
- * Takes handle as an input and outputs the flags from the handle
- * in the flag field.
- */
-struct ion_flag_data {
- struct ion_handle *handle;
- unsigned long flags;
-};
-
-#define ION_IOC_MAGIC 'I'
-
-/**
- * DOC: ION_IOC_ALLOC - allocate memory
- *
- * Takes an ion_allocation_data struct and returns it with the handle field
- * populated with the opaque handle for the allocation.
- */
-#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, \
- struct ion_allocation_data)
-
-/**
- * DOC: ION_IOC_FREE - free memory
- *
- * Takes an ion_handle_data struct and frees the handle.
- */
-#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, s