Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index b22ee70..cbc7a24 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -379,45 +379,8 @@ bool Zaurus::setLedState( OLed which, OLedState st ) | |||
379 | } | 379 | } |
380 | return false; | 380 | return false; |
381 | } | 381 | } |
382 | 382 | ||
383 | bool Zaurus::setSoftSuspend ( bool soft ) | ||
384 | { | ||
385 | if (!m_embedix) { | ||
386 | /* non-Embedix kernels dont have kernel autosuspend */ | ||
387 | return ODevice::setSoftSuspend( soft ); | ||
388 | } | ||
389 | |||
390 | bool res = false; | ||
391 | int fd; | ||
392 | |||
393 | if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) || | ||
394 | (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) { | ||
395 | |||
396 | int sources = ::ioctl( fd, APM_IOCGEVTSRC, 0 ); // get current event sources | ||
397 | |||
398 | if ( sources >= 0 ) { | ||
399 | if ( soft ) | ||
400 | sources &= ~APM_EVT_POWER_BUTTON; | ||
401 | else | ||
402 | sources |= APM_EVT_POWER_BUTTON; | ||
403 | |||
404 | if ( ::ioctl( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources | ||
405 | res = true; | ||
406 | else | ||
407 | perror ( "APM_IOCGEVTSRC" ); | ||
408 | } | ||
409 | else | ||
410 | perror ( "APM_IOCGEVTSRC" ); | ||
411 | |||
412 | ::close( fd ); | ||
413 | } | ||
414 | else | ||
415 | perror( "/dev/apm_bios or /dev/misc/apm_bios" ); | ||
416 | |||
417 | return res; | ||
418 | } | ||
419 | |||
420 | int Zaurus::displayBrightnessResolution() const | 383 | int Zaurus::displayBrightnessResolution() const |
421 | { | 384 | { |
422 | int res = 1; | 385 | int res = 1; |
423 | if (m_embedix) | 386 | if (m_embedix) |
@@ -539,11 +502,9 @@ bool Zaurus::suspend() | |||
539 | 502 | ||
540 | Transformation Zaurus::rotation() const | 503 | Transformation Zaurus::rotation() const |
541 | { | 504 | { |
542 | Transformation rot; | 505 | Transformation rot; |
543 | int handle = 0; | 506 | |
544 | int retval = 0; | ||
545 | |||
546 | switch ( d->m_model ) { | 507 | switch ( d->m_model ) { |
547 | case Model_Zaurus_SLC3000: // fallthrough | 508 | case Model_Zaurus_SLC3000: // fallthrough |
548 | case Model_Zaurus_SLC7x0: | 509 | case Model_Zaurus_SLC7x0: |
549 | OHingeStatus hs = readHingeSensor(); | 510 | OHingeStatus hs = readHingeSensor(); |
@@ -565,10 +526,9 @@ Transformation Zaurus::rotation() const | |||
565 | } | 526 | } |
566 | ODirection Zaurus::direction() const | 527 | ODirection Zaurus::direction() const |
567 | { | 528 | { |
568 | ODirection dir; | 529 | ODirection dir; |
569 | int handle = 0; | 530 | |
570 | int retval = 0; | ||
571 | switch ( d->m_model ) { | 531 | switch ( d->m_model ) { |
572 | case Model_Zaurus_SLC3000: // fallthrough | 532 | case Model_Zaurus_SLC3000: // fallthrough |
573 | case Model_Zaurus_SLC7x0: | 533 | case Model_Zaurus_SLC7x0: |
574 | OHingeStatus hs = readHingeSensor(); | 534 | OHingeStatus hs = readHingeSensor(); |