summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_zaurus.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp44
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
@@ -377,49 +377,12 @@ bool Zaurus::setLedState( OLed which, OLedState st )
377 } 377 }
378 } 378 }
379 } 379 }
380 return false; 380 return false;
381} 381}
382 382
383bool 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
420int Zaurus::displayBrightnessResolution() const 383int Zaurus::displayBrightnessResolution() const
421{ 384{
422 int res = 1; 385 int res = 1;
423 if (m_embedix) 386 if (m_embedix)
424 { 387 {
425 int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK ); 388 int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK );
@@ -537,15 +500,13 @@ bool Zaurus::suspend()
537} 500}
538 501
539 502
540Transformation Zaurus::rotation() const 503Transformation 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();
550 if ( hs == CASE_PORTRAIT ) rot = Rot0; 511 if ( hs == CASE_PORTRAIT ) rot = Rot0;
551 else if ( hs == CASE_UNKNOWN ) rot = Rot0; 512 else if ( hs == CASE_UNKNOWN ) rot = Rot0;
@@ -563,14 +524,13 @@ Transformation Zaurus::rotation() const
563 524
564 return rot; 525 return rot;
565} 526}
566ODirection Zaurus::direction() const 527ODirection 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();
575 if ( hs == CASE_PORTRAIT ) dir = CCW; 535 if ( hs == CASE_PORTRAIT ) dir = CCW;
576 else if ( hs == CASE_UNKNOWN ) dir = CCW; 536 else if ( hs == CASE_UNKNOWN ) dir = CCW;