[PATCH] Qtopia - enable suspend/resume to forcibly flow-control the GSM
Mike (mwester)
mwester at dls.net
Thu Jun 12 06:47:02 CEST 2008
The following patch enables Qtopia to forcibly flow-control the GSM
as suspend, and release the flow-control upon resume. This eliminates
some race conditions, and ensures that no GSM data will be lost during
suspend and resume operations.
This patch has no effect without the kernel changes to support this
functionality; those kernel changes are currently committed on the
"andy" branch in the git repository.
Regards,
Mike (mwester)
--- git/devices/ficgta01/src/plugins/phonevendors/ficgta01/vendor_ficgta01.cpp.orig 2008-06-10 21:28:52.000000000 -0500
+++ git/devices/ficgta01/src/plugins/phonevendors/ficgta01/vendor_ficgta01.cpp 2008-06-11 18:38:16.000000000 -0500
@@ -661,6 +661,15 @@
void Ficgta01ModemService::sendSuspendDone()
{
+// set forced flow control
+ usleep(100000);
+ QFile flow( "/sys/devices/platform/neo1973-pm-gsm.0/flowcontrolled");
+ if (flow.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
+ QTextStream outf(&flow);
+ outf<<"1";
+ flow.close();
+ }
+
suspendDone();
}
@@ -683,6 +695,14 @@
{
qLog(AtChat)<<" Ficgta01ModemService::wake()";
+// release forced flow control
+ QFile flow( "/sys/devices/platform/neo1973-pm-gsm.0/flowcontrolled");
+ if (flow.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
+ QTextStream outf(&flow);
+ outf<<"0";
+ flow.close();
+ }
+
//reset modem
// chat( "AT%CWUP=1" );
More information about the openmoko-kernel
mailing list