summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2020-04-25 21:08:10 +0800
committerMichael Bestas <mkbestas@lineageos.org>2020-04-30 02:24:07 +0300
commit262fe40abba362782258b0043a6aa4251f0e9152 (patch)
tree66e9875fb5d71e0d77f1cf82a6ca58fd9cab299e
parent66c44aa59187ffba7bbc692a1a7f68673a6f606b (diff)
sdm660-common: Make FM radio opt-in
Change-Id: Idaebe34e18d16d042e247f0f2b06c8012fe4d287
-rw-r--r--BoardConfigCommon.mk6
-rwxr-xr-xextract-files.sh2
-rw-r--r--proprietary-files-fm.txt12
-rw-r--r--sdm660.mk12
-rwxr-xr-xsetup-makefiles.sh4
-rwxr-xr-xupdate-sha1sums.py84
6 files changed, 83 insertions, 37 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 00e36ed..d264648 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -129,6 +129,12 @@ ifeq ($(HOST_OS),linux)
endif
endif
+# FM
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
+AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
+BOARD_HAS_QCA_FM_SOC := cherokee
+endif
+
# GPS
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
LOC_HIDL_VERSION := 3.0
diff --git a/extract-files.sh b/extract-files.sh
index 88517a6..a7e88f0 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -78,6 +78,8 @@ setup_vendor "$DEVICE_COMMON" "$VENDOR" "$LINEAGE_ROOT" true $CLEAN_VENDOR
extract "$MY_DIR"/proprietary-files.txt "$SRC" \
"${KANG}" --section "${SECTION}"
+extract "$MY_DIR"/proprietary-files-fm.txt "$SRC" \
+ "${KANG}" --section "${SECTION}"
if [ -s "$MY_DIR"/../$DEVICE_SPECIFIED_COMMON/proprietary-files.txt ];then
# Reinitialize the helper for device specified common
diff --git a/proprietary-files-fm.txt b/proprietary-files-fm.txt
new file mode 100644
index 0000000..5525742
--- /dev/null
+++ b/proprietary-files-fm.txt
@@ -0,0 +1,12 @@
+# FM - from jasmine V11.0.8.0.QDIMIXM
+lib/fm_helium.so|feb4819f1898c67dfda4f965d7cc2711c74d1a99
+lib/libfm-hci.so|7700b02faa484ff682c618402f62b86bf8588db2
+lib64/fm_helium.so|bc9f6314528630c060b593cef4a8cec786b22467
+lib64/libfm-hci.so|589e9e290acfa18a49deba33606ed158d5e7f898
+-product/lib/vendor.qti.hardware.fm@1.0.so|a090651122fcad265ae7562c88dca746f893ad36
+-product/lib64/vendor.qti.hardware.fm@1.0.so|fc7ad886f82089edf36509865fadac17a7340f32
+vendor/bin/fm_qsoc_patches|b71da2de390de868251dcbf56f141c759227d6d1
+vendor/lib/hw/vendor.qti.hardware.fm@1.0-impl.so|2087fee60eb44c097ee9e6c93f4c873fff280866
+vendor/lib/vendor.qti.hardware.fm@1.0.so|89a7ec5cc673d13afc73116eccff2e58f218a34d
+vendor/lib64/hw/vendor.qti.hardware.fm@1.0-impl.so|506efd87250697bdae271f86ea472785a77b84ef
+vendor/lib64/vendor.qti.hardware.fm@1.0.so|073cace3aa8d0ffa025d9df67c45f8a907109339
diff --git a/sdm660.mk b/sdm660.mk
index 5a43a11..a9e3308 100644
--- a/sdm660.mk
+++ b/sdm660.mk
@@ -220,6 +220,18 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.broadcastradio@1.0-impl
+# FM
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
+PRODUCT_PACKAGES += \
+ FM2 \
+ libqcomfm_jni \
+ qcom.fmradio \
+ qcom.fmradio.xml
+
+PRODUCT_BOOT_JARS += \
+ qcom.fmradio
+endif
+
# fwk-detect
PRODUCT_PACKAGES += \
libqti_vndfwk_detect \
diff --git a/setup-makefiles.sh b/setup-makefiles.sh
index 70db958..e505c34 100755
--- a/setup-makefiles.sh
+++ b/setup-makefiles.sh
@@ -43,6 +43,10 @@ write_headers "jasmine_sprout jason lavender twolip wayne"
write_makefiles "$MY_DIR"/proprietary-files.txt true
+printf "\n%s\n" "ifeq (\$(BOARD_HAVE_QCOM_FM),true)" >> "$PRODUCTMK"
+write_makefiles "$MY_DIR"/proprietary-files-fm.txt true
+echo "endif" >> "$PRODUCTMK"
+
# Finish
write_footers
diff --git a/update-sha1sums.py b/update-sha1sums.py
index 56a94ff..f5623fd 100755
--- a/update-sha1sums.py
+++ b/update-sha1sums.py
@@ -20,54 +20,64 @@ import os
import sys
from hashlib import sha1
-device = 'sdm660-common'
-vendor = 'xiaomi'
+DEVICE = 'sdm660-common'
+VENDOR = 'xiaomi'
+VENDOR_PATH = os.path.join(
+ *['..', '..', '..', 'vendor', VENDOR, DEVICE, 'proprietary'])
-with open('proprietary-files.txt', 'r') as f:
- lines = f.read().splitlines()
-vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary'
-needSHA1 = False
+class Updater:
+ def __init__(self, filename):
+ self.filename = filename
+ with open(self.filename, 'r') as f:
+ self.lines = f.read().splitlines()
-def cleanup():
- for index, line in enumerate(lines):
- # Skip empty or commented lines
- if len(line) == 0 or line[0] == '#' or '|' not in line:
- continue
+ def write(self):
+ with open(self.filename, 'w') as f:
+ f.write('\n'.join(self.lines) + '\n')
- # Drop SHA1 hash, if existing
- lines[index] = line.split('|')[0]
+ def cleanup(self):
+ for index, line in enumerate(self.lines):
+ # Skip empty or commented lines
+ if len(line) == 0 or line[0] == '#' or '|' not in line:
+ continue
+ # Drop SHA1 hash, if existing
+ self.lines[index] = line.split('|')[0]
-def update():
- for index, line in enumerate(lines):
- # Skip empty lines
- if len(line) == 0:
- continue
+ self.write()
- # Check if we need to set SHA1 hash for the next files
- if line[0] == '#':
- needSHA1 = (' - from' in line)
- continue
+ def update(self):
+ need_sha1 = False
+ for index, line in enumerate(self.lines):
+ # Skip empty lines
+ if len(line) == 0:
+ continue
- if needSHA1:
- # Remove existing SHA1 hash
- line = line.split('|')[0]
+ # Check if we need to set SHA1 hash for the next files
+ if line[0] == '#':
+ need_sha1 = (' - from' in line)
+ continue
- filePath = line.split(';')[0].split(':')[-1]
- if filePath[0] == '-':
- filePath = filePath[1:]
+ if need_sha1:
+ # Remove existing SHA1 hash
+ line = line.split('|')[0]
- with open(os.path.join(vendorPath, filePath), 'rb') as f:
- hash = sha1(f.read()).hexdigest()
+ file_path = line.split(';')[0].split(':')[-1]
+ if file_path[0] == '-':
+ file_path = file_path[1:]
- lines[index] = '%s|%s' % (line, hash)
+ with open(os.path.join(VENDOR_PATH, file_path), 'rb') as f:
+ hash = sha1(f.read()).hexdigest()
+ self.lines[index] = '{}|{}'.format(line, hash)
-if len(sys.argv) == 2 and sys.argv[1] == '-c':
- cleanup()
-else:
- update()
+ self.write()
-with open('proprietary-files.txt', 'w') as file:
- file.write('\n'.join(lines) + '\n')
+
+for file in ['proprietary-files.txt', 'proprietary-files-fm.txt']:
+ updater = Updater(file)
+ if len(sys.argv) == 2 and sys.argv[1] == '-c':
+ updater.cleanup()
+ else:
+ updater.update()