summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2016-01-26 13:43:39 +0000
committerZhao Wei Liew <zhaoweiliew@gmail.com>2017-02-12 06:22:39 +0000
commit6fd80f6984e41544ec4e3d88257c876eb799930f (patch)
tree6e4860feb0ae8b8d86d973895217f5e1199c0558
parentf1322916455687edeb528717a6bed184a892f334 (diff)
downloadandroid_hardware_qcom_fm-cm-14.1_prerebase.tar.gz
android_hardware_qcom_fm-cm-14.1_prerebase.tar.bz2
android_hardware_qcom_fm-cm-14.1_prerebase.zip
jni: Confine the firmware-load skipping to the actual loadingcm-14.1_prerebase
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
-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 59a84db..53cdf07 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -123,8 +123,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++) {
@@ -136,6 +136,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");
@@ -143,9 +148,6 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative
close(fd);
return FM_JNI_FAILURE;
}
-#else
- usleep(WAIT_TIMEOUT);
-#endif
}
return fd;
}