-rw-r--r-- | libopie2/opiecore/device/odevice.h | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 96 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 5 |
3 files changed, 64 insertions, 40 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 93d7d22..bbc32fa 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h @@ -82,2 +82,3 @@ enum OModel { Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ), + Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x000007 ), @@ -363,3 +364,3 @@ class ODeviceData { QStrList *m_cpu_frequencies; - bool m_initializedButtonQcop : 1; + bool m_initializedButtonQcop : 1; diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index fb23e1d..75a2fdc 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -171,2 +171,5 @@ void Zaurus::init(const QString& cpu_info) d->m_modelstr = "Zaurus SL-C760 or SL-C860"; + } else if ( model == "SHARP Boxer" ) { + d->m_model = Model_Zaurus_SLC7x0; + d->m_modelstr = "Zaurus SL-C760 or SL-C860"; } else if ( model == "SHARP Poodle" ) { @@ -180,5 +183,8 @@ void Zaurus::init(const QString& cpu_info) d->m_modelstr = "Zaurus SL-6000"; + } else if ( model == "SHARP Spitz" ) { + d->m_model = Model_Zaurus_SLC3000; + d->m_modelstr = "Zaurus SL-C3000"; } else { d->m_model = Model_Zaurus_SL5500; - d->m_modelstr = "Unkown Zaurus"; + d->m_modelstr = "Unknown Zaurus"; } @@ -191,2 +197,3 @@ void Zaurus::init(const QString& cpu_info) break; + case Model_Zaurus_SLC3000: // fallthrough case Model_Zaurus_SLC7x0: @@ -196,4 +203,4 @@ void Zaurus::init(const QString& cpu_info) case Model_Zaurus_SLB600: // fallthrough + case Model_Zaurus_SL5000: // fallthrough case Model_Zaurus_SL5500: // fallthrough - case Model_Zaurus_SL5000: default: @@ -202,3 +209,3 @@ void Zaurus::init(const QString& cpu_info) } - m_leds [0] = Led_Off; + m_leds[0] = Led_Off; } @@ -255,6 +262,5 @@ void Zaurus::buzzer( int sound ) - // Not all devices have real sound - if ( d->m_model == Model_Zaurus_SLC7x0 - || d->m_model == Model_Zaurus_SLB600 - || d->m_model == Model_Zaurus_SL6000 ) { + // All devices except SL5500 have a DSP device + if ( d->m_model != Model_Zaurus_SL5000 + && d->m_model != Model_Zaurus_SL5500 ) { @@ -264,3 +270,3 @@ void Zaurus::buzzer( int sound ) snd = &touch_sound; - } + } break; @@ -269,3 +275,3 @@ void Zaurus::buzzer( int sound ) snd = &key_sound; - } + } break; @@ -275,3 +281,3 @@ void Zaurus::buzzer( int sound ) snd = &alarm_sound; - } + } break; @@ -322,3 +328,3 @@ QValueList <OLed> Zaurus::ledList() const -QValueList <OLedState> Zaurus::ledStateList ( OLed l ) const +QValueList <OLedState> Zaurus::ledStateList( OLed l ) const { @@ -331,3 +337,3 @@ QValueList <OLedState> Zaurus::ledStateList ( OLed l ) const -OLedState Zaurus::ledState ( OLed which ) const +OLedState Zaurus::ledState( OLed which ) const { @@ -339,6 +345,10 @@ OLedState Zaurus::ledState ( OLed which ) const -bool Zaurus::setLedState ( OLed which, OLedState st ) +bool Zaurus::setLedState( OLed which, OLedState st ) { - if (!m_embedix) // Currently not supported on non_embedix kernels + // Currently not supported on non_embedix kernels + if (!m_embedix) + { + qDebug( "Zaurus::setLedState: ODevice handling for non-embedix kernels not yet implemented" ); return false; + } @@ -417,3 +427,3 @@ bool Zaurus::setDisplayBrightness( int bright ) int numberOfSteps = displayBrightnessResolution(); - int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); + int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); if ( fd ) @@ -427,3 +437,3 @@ bool Zaurus::setDisplayBrightness( int bright ) { - qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); + qDebug( "Zaurus::setDisplayBrightness: ODevice handling for non-embedix kernels not yet implemented" ); } @@ -437,3 +447,3 @@ bool Zaurus::setDisplayStatus( bool on ) { - int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); + int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); if ( fd ) @@ -447,6 +457,6 @@ bool Zaurus::setDisplayStatus( bool on ) { - qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); + qDebug( "Zaurus::setDisplayStatus: ODevice handling for non-embedix kernels not yet implemented" ); } return res; -} +} @@ -491,2 +501,3 @@ Transformation Zaurus::rotation() const switch ( d->m_model ) { + case Model_Zaurus_SLC3000: // fallthrough case Model_Zaurus_SLC7x0: @@ -505,4 +516,5 @@ Transformation Zaurus::rotation() const break; - case Model_Zaurus_SLA300: + case Model_Zaurus_SL6000: case Model_Zaurus_SLB600: + case Model_Zaurus_SLA300: case Model_Zaurus_SL5500: @@ -522,2 +534,3 @@ ODirection Zaurus::direction() const switch ( d->m_model ) { + case Model_Zaurus_SLC3000: // fallthrough case Model_Zaurus_SLC7x0: @@ -535,2 +548,3 @@ ODirection Zaurus::direction() const break; + case Model_Zaurus_SL6000: case Model_Zaurus_SLA300: @@ -539,3 +553,3 @@ ODirection Zaurus::direction() const case Model_Zaurus_SL5000: - default: dir = d->m_direction; + default: dir = d->m_direction; break; @@ -556,3 +570,3 @@ int Zaurus::displayBrightnessResolution() const { - qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); + qDebug( "Zaurus::displayBrightnessResolution: ODevice handling for non-embedix kernels not yet implemented" ); return 1; @@ -563,3 +577,3 @@ bool Zaurus::hasHingeSensor() const { - return d->m_model == Model_Zaurus_SLC7x0; + return d->m_model == Model_Zaurus_SLC7x0 || d->m_model == Model_Zaurus_SLC3000; } @@ -568,16 +582,9 @@ OHingeStatus Zaurus::readHingeSensor() { - int handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); - if (handle == -1) - { - qWarning("Zaurus::readHingeSensor() - failed (%s)", "unknown reason" ); //FIXME: use strerror - return CASE_UNKNOWN; - } - else + if (m_embedix) { - int retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION); - ::close (handle); - if ( retval == CASE_CLOSED || retval == CASE_PORTRAIT || retval == CASE_LANDSCAPE ) + int handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); + if (handle == -1) { - qDebug( "Zaurus::readHingeSensor() - result = %d", retval ); - return static_cast<OHingeStatus>( retval ); + qWarning("Zaurus::readHingeSensor() - failed (%s)", "unknown reason" ); //FIXME: use strerror + return CASE_UNKNOWN; } @@ -585,6 +592,21 @@ OHingeStatus Zaurus::readHingeSensor() { - qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" ); - return CASE_UNKNOWN; + int retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION); + ::close (handle); + if ( retval == CASE_CLOSED || retval == CASE_PORTRAIT || retval == CASE_LANDSCAPE ) + { + qDebug( "Zaurus::readHingeSensor() - result = %d", retval ); + return static_cast<OHingeStatus>( retval ); + } + else + { + qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" ); + return CASE_UNKNOWN; + } } } + else + { + qDebug( "Zaurus::readHingeSensor: ODevice handling for non-embedix kernels not yet implemented" ); + return CASE_UNKNOWN; + } } diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index 37ab876..ed9cf67 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h @@ -88,2 +88,3 @@ namespace Core { namespace Internal { + class Zaurus : public ODevice @@ -118,5 +119,5 @@ class Zaurus : public ODevice protected: - virtual void buzzer ( int snd ); + virtual void buzzer( int snd ); - OLedState m_leds [1]; + OLedState m_leds[1]; bool m_embedix; |