summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2015-11-22 21:16:20 -0500
committerArne Coucheron <arco68@gmail.com>2017-01-02 14:39:50 +0100
commitc2e2c49bcc26aec6b916eb960ef5eae4fa6cce56 (patch)
tree9c027011213508f7e81b535020e273cbde4a4302
parent09a9d74b0f911cddff8256add40b3b4c35f14e63 (diff)
downloadandroid_hardware_qcom_fm-c2e2c49bcc26aec6b916eb960ef5eae4fa6cce56.tar.gz
android_hardware_qcom_fm-c2e2c49bcc26aec6b916eb960ef5eae4fa6cce56.tar.bz2
android_hardware_qcom_fm-c2e2c49bcc26aec6b916eb960ef5eae4fa6cce56.zip
libfm_jni: Skip loading FM firmware if requested
Not all boards require a firmware download for FM. Set TARGET_QCOM_NO_FM_FIRMWARE if the device doesn't require a fw image to run FM. Adapted for libfm_jni by Sultan Qasim Khan. Change-Id: I31fee137a59256c2b2907b5ff7212327299a9646
-rw-r--r--libfm_jni/Android.mk4
-rw-r--r--libfm_jni/FmIoctlsInterface.cpp13
2 files changed, 17 insertions, 0 deletions
diff --git a/libfm_jni/Android.mk b/libfm_jni/Android.mk
index 8016c73..fad1e22 100644
--- a/libfm_jni/Android.mk
+++ b/libfm_jni/Android.mk
@@ -27,6 +27,10 @@ ifeq ($(TARGET_FM_LEGACY_PATCHLOADER),true)
LOCAL_CFLAGS += -DFM_LEGACY_PATCHLOADER
endif
+ifeq ($(TARGET_QCOM_NO_FM_FIRMWARE),true)
+ LOCAL_CFLAGS += -DQCOM_NO_FM_FIRMWARE
+endif
+
LOCAL_MODULE := libfmjni
#include $(BUILD_SHARED_LIBRARY)
diff --git a/libfm_jni/FmIoctlsInterface.cpp b/libfm_jni/FmIoctlsInterface.cpp
index fbe035c..d0e50f0 100644
--- a/libfm_jni/FmIoctlsInterface.cpp
+++ b/libfm_jni/FmIoctlsInterface.cpp
@@ -49,6 +49,7 @@ int FmIoctlsInterface :: start_fm_patch_dl
char prop_value[PROPERTY_VALUE_MAX] = {'\0'};
struct v4l2_capability cap;
+#ifndef QCOM_NO_FM_FIRMWARE
ALOGE("start_fm_patch_dl = %d\n",fd);
ret = ioctl(fd, VIDIOC_QUERYCAP, &cap);
ALOGE("executed cmd\n");
@@ -91,6 +92,10 @@ int FmIoctlsInterface :: start_fm_patch_dl
}else {
return FM_FAILURE;
}
+#else
+ usleep(INIT_WAIT_TIMEOUT);
+ return FM_SUCCESS;
+#endif
}
int FmIoctlsInterface :: close_fm_patch_dl
@@ -100,12 +105,16 @@ int FmIoctlsInterface :: close_fm_patch_dl
{
int ret;
+#ifndef QCOM_NO_FM_FIRMWARE
ret = property_set(SCRIPT_STOP_PROP, SOC_PATCH_DL_SCRPT);
if(ret != PROP_SET_SUCC) {
return FM_FAILURE;
}else {
return FM_SUCCESS;
}
+#else
+ return FM_SUCCESS;
+#endif
}
int FmIoctlsInterface :: get_cur_freq
@@ -176,6 +185,7 @@ int FmIoctlsInterface :: set_calibration
struct v4l2_ext_controls v4l2_ctls;
char cal_data[CAL_DATA_SIZE] = {0};
+#ifndef QCOM_NO_FM_FIRMWARE
cal_fp = fopen(CALIB_DATA_NAME, "r");
if(cal_fp != NULL) {
if(fread(&cal_data[0], 1, CAL_DATA_SIZE, cal_fp)
@@ -198,6 +208,9 @@ int FmIoctlsInterface :: set_calibration
}else {
return FM_FAILURE;
}
+#else
+ return FM_SUCCESS;
+#endif
}
int FmIoctlsInterface :: get_control