summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2016-01-26 13:43:39 +0000
committerDan Pasanen <dan.pasanen@gmail.com>2017-02-14 16:52:50 +0000
commit63717c49972b9349006685f5326a0ba44d7b41a9 (patch)
tree735136f731e7e04a3aa900223aca7b37bc45bdb6
parent1d82f7bb1ca4336ba9e7021044d57b6796a263a3 (diff)
downloadandroid_hardware_qcom_fm-staging/cm-14.1-cafrebase.tar.gz
android_hardware_qcom_fm-staging/cm-14.1-cafrebase.tar.bz2
android_hardware_qcom_fm-staging/cm-14.1-cafrebase.zip
jni: Confine the firmware-load skipping to the actual loadingstaging/cm-14.1-cafrebase
Change If18650af934f840a54f53fa9474a3341df0e3e68 removed the property-setting steps from the initialization routine. Bring it back, as we may want to use those properties to trigger module state changes from init. The recommended flow for devices with the latest IRIS driver is the following: on property:hw.fm.init=0 write /sys/module/radio_iris_transport/parameters/fmsmd_set 0 on property:hw.fm.init=1 write /sys/module/radio_iris_transport/parameters/fmsmd_set 1 This change mirrors the change done for libfm_jni: Id1997a51d83b82425630f6975f4020d4a2a448c4 Change-Id: Ifddf678398fec2e4bfa9688c044da7d75898e056 (cherry picked from commit 6fd80f6984e41544ec4e3d88257c876eb799930f)
-rw-r--r--jni/android_hardware_fm.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index 82db430..3bb7d33 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -606,8 +606,8 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative
/*Set the mode for soc downloader*/
property_set("hw.fm.mode", "normal");
/* Need to clear the hw.fm.init firstly */
-#ifndef QCOM_NO_FM_FIRMWARE
property_set("hw.fm.init", "0");
+#ifndef QCOM_NO_FM_FIRMWARE
property_set("ctl.start", "fm_dl");
sched_yield();
for(i=0; i<45; i++) {
@@ -619,6 +619,11 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative
usleep(WAIT_TIMEOUT);
}
}
+#else
+ property_set("hw.fm.init", "1");
+ usleep(WAIT_TIMEOUT);
+ init_success = 1;
+#endif
ALOGE("init_success:%d after %f seconds \n", init_success, 0.2*i);
if(!init_success) {
property_set("ctl.stop", "fm_dl");
@@ -626,9 +631,6 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative
close(fd);
return FM_JNI_FAILURE;
}
-#else
- usleep(WAIT_TIMEOUT);
-#endif
}
return fd;
}