summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_zaurus.cpp
Side-by-side diff
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
@@ -371,61 +371,24 @@ bool Zaurus::setLedState( OLed which, OLedState st )
default : ok = false;
}
if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) {
m_leds [0] = st;
return true;
}
}
}
return false;
}
-bool Zaurus::setSoftSuspend ( bool soft )
-{
- if (!m_embedix) {
- /* non-Embedix kernels dont have kernel autosuspend */
- return ODevice::setSoftSuspend( soft );
- }
-
- bool res = false;
- int fd;
-
- if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) ||
- (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) {
-
- int sources = ::ioctl( fd, APM_IOCGEVTSRC, 0 ); // get current event sources
-
- if ( sources >= 0 ) {
- if ( soft )
- sources &= ~APM_EVT_POWER_BUTTON;
- else
- sources |= APM_EVT_POWER_BUTTON;
-
- if ( ::ioctl( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources
- res = true;
- else
- perror ( "APM_IOCGEVTSRC" );
- }
- else
- perror ( "APM_IOCGEVTSRC" );
-
- ::close( fd );
- }
- else
- perror( "/dev/apm_bios or /dev/misc/apm_bios" );
-
- return res;
-}
-
int Zaurus::displayBrightnessResolution() const
{
int res = 1;
if (m_embedix)
{
int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK );
if ( fd )
{
int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 );
::close( fd );
return value ? value : res;
}
@@ -531,52 +494,49 @@ bool Zaurus::suspend()
::gettimeofday ( &tvn, 0 );
} while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 );
}
QCopEnvelope ( "QPE/Rotation", "rotateDefault()" );
return res;
}
Transformation Zaurus::rotation() const
{
Transformation rot;
- int handle = 0;
- int retval = 0;
-
+
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0:
OHingeStatus hs = readHingeSensor();
if ( hs == CASE_PORTRAIT ) rot = Rot0;
else if ( hs == CASE_UNKNOWN ) rot = Rot0;
else rot = Rot270;
break;
case Model_Zaurus_SL6000:
case Model_Zaurus_SLB600:
case Model_Zaurus_SLA300:
case Model_Zaurus_SL5500:
case Model_Zaurus_SL5000:
default:
rot = d->m_rotation;
break;
}
return rot;
}
ODirection Zaurus::direction() const
{
ODirection dir;
- int handle = 0;
- int retval = 0;
+
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0:
OHingeStatus hs = readHingeSensor();
if ( hs == CASE_PORTRAIT ) dir = CCW;
else if ( hs == CASE_UNKNOWN ) dir = CCW;
else dir = CW;
break;
case Model_Zaurus_SL6000:
case Model_Zaurus_SLA300:
case Model_Zaurus_SLB600:
case Model_Zaurus_SL5500: