author | zecke <zecke> | 2004-09-21 16:04:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-21 16:04:01 (UTC) |
commit | 2e877b93064d149ccafbbd86da55fbd244c3af4a (patch) (unidiff) | |
tree | 5b1d3618ea1690a6d810c21f2a73e7e8ae51b257 /libopie2/opiecore/device/odevice_simpad.cpp | |
parent | 56f3bcad1a0abd199a458a62c8bde0ebdff035d5 (diff) | |
download | opie-2e877b93064d149ccafbbd86da55fbd244c3af4a.zip opie-2e877b93064d149ccafbbd86da55fbd244c3af4a.tar.gz opie-2e877b93064d149ccafbbd86da55fbd244c3af4a.tar.bz2 |
Simpad:
-We're not a KeyFilter remove the inheritance and installing of it
-Use /proc/mq200/driver/backlight instead of PWM_CONTROL
-Soft Suspend is dead long time do not reimplement it..
Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 34876da..335e0db 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -146,11 +146,6 @@ void SIMpad::initButtons() | |||
146 | if ( d->m_buttons ) | 146 | if ( d->m_buttons ) |
147 | return; | 147 | return; |
148 | 148 | ||
149 | if ( isQWS( ) ) { | ||
150 | addPreHandler(this); | ||
151 | } | ||
152 | |||
153 | |||
154 | d->m_buttons = new QValueList <ODeviceButton>; | 149 | d->m_buttons = new QValueList <ODeviceButton>; |
155 | 150 | ||
156 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { | 151 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { |
@@ -193,8 +188,7 @@ void SIMpad::initButtons() | |||
193 | #define SIMPAD_RESET_SIMCARD 0x8000 | 188 | #define SIMPAD_RESET_SIMCARD 0x8000 |
194 | 189 | ||
195 | //SIMpad touchscreen backlight strength control | 190 | //SIMpad touchscreen backlight strength control |
196 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" | 191 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/backlight" |
197 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 | ||
198 | 192 | ||
199 | 193 | ||
200 | /* | 194 | /* |
@@ -299,13 +293,6 @@ bool SIMpad::setLedState ( OLed l, OLedState st ) | |||
299 | return false; | 293 | return false; |
300 | } | 294 | } |
301 | 295 | ||
302 | |||
303 | bool SIMpad::filter ( int /*unicode*/, int /*keycode*/, int /*modifiers*/, bool /*isPress*/, bool /*autoRepeat*/ ) | ||
304 | { | ||
305 | //TODO | ||
306 | return false; | ||
307 | } | ||
308 | |||
309 | void SIMpad::timerEvent ( QTimerEvent * ) | 296 | void SIMpad::timerEvent ( QTimerEvent * ) |
310 | { | 297 | { |
311 | killTimer ( m_power_timer ); | 298 | killTimer ( m_power_timer ); |
@@ -352,14 +339,6 @@ bool SIMpad::suspend() // Must override because SIMpad does NOT have apm | |||
352 | return res; | 339 | return res; |
353 | } | 340 | } |
354 | 341 | ||
355 | |||
356 | bool SIMpad::setSoftSuspend ( bool soft ) | ||
357 | { | ||
358 | qDebug( "ODevice for SIMpad: UNHANDLED setSoftSuspend(%s)", soft? "on" : "off" ); | ||
359 | return false; | ||
360 | } | ||
361 | |||
362 | |||
363 | bool SIMpad::setDisplayStatus ( bool on ) | 342 | bool SIMpad::setDisplayStatus ( bool on ) |
364 | { | 343 | { |
365 | qDebug( "ODevice for SIMpad: setDisplayStatus(%s)", on? "on" : "off" ); | 344 | qDebug( "ODevice for SIMpad: setDisplayStatus(%s)", on? "on" : "off" ); |
@@ -380,13 +359,8 @@ bool SIMpad::setDisplayBrightness ( int bright ) | |||
380 | bright = 0; | 359 | bright = 0; |
381 | 360 | ||
382 | if (( fd = ::open ( SIMPAD_BACKLIGHT_CONTROL, O_WRONLY )) >= 0 ) { | 361 | if (( fd = ::open ( SIMPAD_BACKLIGHT_CONTROL, O_WRONLY )) >= 0 ) { |
383 | int value = 255 - bright; | 362 | QCString str = QFile::encodeName( QString::number(bright)); |
384 | const int mask = SIMPAD_BACKLIGHT_MASK; | 363 | res = ( ::write(fd, str, str.length()) != -1 ); |
385 | value = value << 8; | ||
386 | value += mask; | ||
387 | char writeCommand[100]; | ||
388 | const int count = snprintf( writeCommand, sizeof(writeCommand), "0x%x\n", value ); | ||
389 | res = ( ::write ( fd, writeCommand, count ) != -1 ); | ||
390 | ::close ( fd ); | 364 | ::close ( fd ); |
391 | } | 365 | } |
392 | return res; | 366 | return res; |