summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device
Unidiff
Diffstat (limited to 'libopie2/opiecore/device') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.h1
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp46
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h1
3 files changed, 36 insertions, 12 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
@@ -80,6 +80,7 @@ enum OModel {
80 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), 80 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ),
81 Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), 81 Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ),
82 Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ), 82 Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ),
83 Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x000007 ),
83 84
84 Model_SIMpad = ( 3 << 24 ), 85 Model_SIMpad = ( 3 << 24 ),
85 86
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
@@ -169,6 +169,9 @@ void Zaurus::init(const QString& cpu_info)
169 } else if ( model == "SHARP Husky" ) { 169 } else if ( model == "SHARP Husky" ) {
170 d->m_model = Model_Zaurus_SLC7x0; 170 d->m_model = Model_Zaurus_SLC7x0;
171 d->m_modelstr = "Zaurus SL-C760 or SL-C860"; 171 d->m_modelstr = "Zaurus SL-C760 or SL-C860";
172 } else if ( model == "SHARP Boxer" ) {
173 d->m_model = Model_Zaurus_SLC7x0;
174 d->m_modelstr = "Zaurus SL-C760 or SL-C860";
172 } else if ( model == "SHARP Poodle" ) { 175 } else if ( model == "SHARP Poodle" ) {
173 d->m_model = Model_Zaurus_SLB600; 176 d->m_model = Model_Zaurus_SLB600;
174 d->m_modelstr = "Zaurus SL-B500 or SL-5600"; 177 d->m_modelstr = "Zaurus SL-B500 or SL-5600";
@@ -178,9 +181,12 @@ void Zaurus::init(const QString& cpu_info)
178 } else if ( model == "SHARP Tosa" ) { 181 } else if ( model == "SHARP Tosa" ) {
179 d->m_model = Model_Zaurus_SL6000; 182 d->m_model = Model_Zaurus_SL6000;
180 d->m_modelstr = "Zaurus SL-6000"; 183 d->m_modelstr = "Zaurus SL-6000";
184 } else if ( model == "SHARP Spitz" ) {
185 d->m_model = Model_Zaurus_SLC3000;
186 d->m_modelstr = "Zaurus SL-C3000";
181 } else { 187 } else {
182 d->m_model = Model_Zaurus_SL5500; 188 d->m_model = Model_Zaurus_SL5500;
183 d->m_modelstr = "Unkown Zaurus"; 189 d->m_modelstr = "Unknown Zaurus";
184 } 190 }
185 191
186 // set initial rotation 192 // set initial rotation
@@ -189,13 +195,14 @@ void Zaurus::init(const QString& cpu_info)
189 case Model_Zaurus_SLA300: 195 case Model_Zaurus_SLA300:
190 d->m_rotation = Rot0; 196 d->m_rotation = Rot0;
191 break; 197 break;
198 case Model_Zaurus_SLC3000: // fallthrough
192 case Model_Zaurus_SLC7x0: 199 case Model_Zaurus_SLC7x0:
193 d->m_rotation = rotation(); 200 d->m_rotation = rotation();
194 d->m_direction = direction(); 201 d->m_direction = direction();
195 break; 202 break;
196 case Model_Zaurus_SLB600: // fallthrough 203 case Model_Zaurus_SLB600: // fallthrough
204 case Model_Zaurus_SL5000: // fallthrough
197 case Model_Zaurus_SL5500: // fallthrough 205 case Model_Zaurus_SL5500: // fallthrough
198 case Model_Zaurus_SL5000:
199 default: 206 default:
200 d->m_rotation = Rot270; 207 d->m_rotation = Rot270;
201 break; 208 break;
@@ -253,10 +260,9 @@ void Zaurus::buzzer( int sound )
253#ifndef QT_NO_SOUND 260#ifndef QT_NO_SOUND
254 Sound *snd = 0; 261 Sound *snd = 0;
255 262
256 // Not all devices have real sound 263 // All devices except SL5500 have a DSP device
257 if ( d->m_model == Model_Zaurus_SLC7x0 264 if ( d->m_model != Model_Zaurus_SL5000
258 || d->m_model == Model_Zaurus_SLB600 265 && d->m_model != Model_Zaurus_SL5500 ) {
259 || d->m_model == Model_Zaurus_SL6000 ) {
260 266
261 switch ( sound ){ 267 switch ( sound ){
262 case SHARP_BUZ_TOUCHSOUND: { 268 case SHARP_BUZ_TOUCHSOUND: {
@@ -339,8 +345,12 @@ OLedState Zaurus::ledState ( OLed which ) const
339 345
340bool Zaurus::setLedState ( OLed which, OLedState st ) 346bool Zaurus::setLedState ( OLed which, OLedState st )
341{ 347{
342 if (!m_embedix) // Currently not supported on non_embedix kernels 348 // Currently not supported on non_embedix kernels
349 if (!m_embedix)
350 {
351 qDebug( "Zaurus::setLedState: ODevice handling for non-embedix kernels not yet implemented" );
343 return false; 352 return false;
353 }
344 354
345 static int fd = ::open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); 355 static int fd = ::open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK );
346 356
@@ -425,7 +435,7 @@ bool Zaurus::setDisplayBrightness( int bright )
425 } 435 }
426 else 436 else
427 { 437 {
428 qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); 438 qDebug( "Zaurus::setDisplayBrightness: ODevice handling for non-embedix kernels not yet implemented" );
429 } 439 }
430 return res; 440 return res;
431} 441}
@@ -445,7 +455,7 @@ bool Zaurus::setDisplayStatus( bool on )
445 } 455 }
446 else 456 else
447 { 457 {
448 qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); 458 qDebug( "Zaurus::setDisplayStatus: ODevice handling for non-embedix kernels not yet implemented" );
449 } 459 }
450 return res; 460 return res;
451} 461}
@@ -489,6 +499,7 @@ Transformation Zaurus::rotation() const
489 int retval = 0; 499 int retval = 0;
490 500
491 switch ( d->m_model ) { 501 switch ( d->m_model ) {
502 case Model_Zaurus_SLC3000: // fallthrough
492 case Model_Zaurus_SLC7x0: 503 case Model_Zaurus_SLC7x0:
493 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); 504 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK);
494 if (handle == -1) { 505 if (handle == -1) {
@@ -503,8 +514,9 @@ Transformation Zaurus::rotation() const
503 rot = Rot270; 514 rot = Rot270;
504 } 515 }
505 break; 516 break;
506 case Model_Zaurus_SLA300: 517 case Model_Zaurus_SL6000:
507 case Model_Zaurus_SLB600: 518 case Model_Zaurus_SLB600:
519 case Model_Zaurus_SLA300:
508 case Model_Zaurus_SL5500: 520 case Model_Zaurus_SL5500:
509 case Model_Zaurus_SL5000: 521 case Model_Zaurus_SL5000:
510 default: 522 default:
@@ -520,6 +532,7 @@ ODirection Zaurus::direction() const
520 int handle = 0; 532 int handle = 0;
521 int retval = 0; 533 int retval = 0;
522 switch ( d->m_model ) { 534 switch ( d->m_model ) {
535 case Model_Zaurus_SLC3000: // fallthrough
523 case Model_Zaurus_SLC7x0: 536 case Model_Zaurus_SLC7x0:
524 handle = ::open( "/dev/apm_bios", O_RDWR|O_NONBLOCK ); 537 handle = ::open( "/dev/apm_bios", O_RDWR|O_NONBLOCK );
525 if (handle == -1) { 538 if (handle == -1) {
@@ -533,6 +546,7 @@ ODirection Zaurus::direction() const
533 dir = CW; 546 dir = CW;
534 } 547 }
535 break; 548 break;
549 case Model_Zaurus_SL6000:
536 case Model_Zaurus_SLA300: 550 case Model_Zaurus_SLA300:
537 case Model_Zaurus_SLB600: 551 case Model_Zaurus_SLB600:
538 case Model_Zaurus_SL5500: 552 case Model_Zaurus_SL5500:
@@ -554,18 +568,20 @@ int Zaurus::displayBrightnessResolution() const
554 } 568 }
555 else 569 else
556 { 570 {
557 qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); 571 qDebug( "Zaurus::displayBrightnessResolution: ODevice handling for non-embedix kernels not yet implemented" );
558 return 1; 572 return 1;
559 } 573 }
560} 574}
561 575
562bool Zaurus::hasHingeSensor() const 576bool Zaurus::hasHingeSensor() const
563{ 577{
564 return d->m_model == Model_Zaurus_SLC7x0; 578 return d->m_model == Model_Zaurus_SLC7x0 || d->m_model == Model_Zaurus_SLC3000;
565} 579}
566 580
567OHingeStatus Zaurus::readHingeSensor() 581OHingeStatus Zaurus::readHingeSensor()
568{ 582{
583 if (m_embedix)
584 {
569 int handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); 585 int handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK);
570 if (handle == -1) 586 if (handle == -1)
571 { 587 {
@@ -588,3 +604,9 @@ OHingeStatus Zaurus::readHingeSensor()
588 } 604 }
589 } 605 }
590} 606}
607 else
608 {
609 qDebug( "Zaurus::readHingeSensor: ODevice handling for non-embedix kernels not yet implemented" );
610 return CASE_UNKNOWN;
611 }
612}
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
@@ -86,6 +86,7 @@
86namespace Opie { 86namespace Opie {
87namespace Core { 87namespace Core {
88namespace Internal { 88namespace Internal {
89
89class Zaurus : public ODevice 90class Zaurus : public ODevice
90{ 91{
91 protected: 92 protected: