Diffstat (limited to 'libopie2/opiecore/device/odevice_jornada.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp index 8141f1c..5f95e42 100644 --- a/libopie2/opiecore/device/odevice_jornada.cpp +++ b/libopie2/opiecore/device/odevice_jornada.cpp | |||
@@ -149,56 +149,35 @@ int Jornada::displayBrightnessResolution() const | |||
149 | 149 | ||
150 | 150 | ||
151 | bool Jornada::setDisplayBrightness( int bright ) | 151 | bool Jornada::setDisplayBrightness( int bright ) |
152 | { | 152 | { |
153 | bool res = false; | 153 | bool res = false; |
154 | 154 | ||
155 | if ( bright > 255 ) | 155 | if ( bright > 255 ) |
156 | bright = 255; | 156 | bright = 255; |
157 | if ( bright < 0 ) | 157 | if ( bright < 0 ) |
158 | bright = 0; | 158 | bright = 0; |
159 | 159 | ||
160 | QString cmdline; | 160 | QString cmdline; |
161 | 161 | ||
162 | if ( !bright ) | 162 | if ( !bright ) |
163 | cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power"); | 163 | cmdline = QString().sprintf( "echo 4 > /sys/class/backlight/sa1100fb/power"); |
164 | else | 164 | else |
165 | cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright ); | 165 | cmdline = QString().sprintf( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %d > /sys/class/backlight/sa1100fb/brightness", bright ); |
166 | 166 | ||
167 | res = ( ::system( (const char*) cmdline ) == 0 ); | 167 | res = ( ::system( (const char*) cmdline ) == 0 ); |
168 | 168 | ||
169 | return res; | 169 | return res; |
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | bool Jornada::suspend( ) | ||
174 | { | ||
175 | qDebug("ODevice::suspend"); | ||
176 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | ||
177 | return false; | ||
178 | |||
179 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | ||
180 | return false; | ||
181 | |||
182 | bool res = false; | ||
183 | ODevice::sendSuspendmsg(); | ||
184 | |||
185 | struct timeval tvs; | ||
186 | ::gettimeofday ( &tvs, 0 ); | ||
187 | |||
188 | ::sync(); // flush fs caches | ||
189 | res = ( ::system ( "apm --suspend" ) == 0 ); | ||
190 | |||
191 | return res; | ||
192 | } | ||
193 | |||
194 | bool Jornada::setDisplayStatus ( bool on ) | 173 | bool Jornada::setDisplayStatus ( bool on ) |
195 | { | 174 | { |
196 | bool res = false; | 175 | bool res = false; |
197 | 176 | ||
198 | QString cmdline = QString( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); | 177 | QString cmdline = QString( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); |
199 | 178 | ||
200 | res = ( ::system( (const char*) cmdline ) == 0 ); | 179 | res = ( ::system( (const char*) cmdline ) == 0 ); |
201 | 180 | ||
202 | return res; | 181 | return res; |
203 | } | 182 | } |
204 | 183 | ||