summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ipaq.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 6dc1295..b18fd32 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -428,51 +428,50 @@ int iPAQ::displayBrightnessResolution() const
428 if ( sysClass.exists() && sysClass.count() > 2 ) { 428 if ( sysClass.exists() && sysClass.count() > 2 ) {
429 QString sysClassPath = sysClass.absFilePath( sysClass[2] + "/max_brightness" ); 429 QString sysClassPath = sysClass.absFilePath( sysClass[2] + "/max_brightness" );
430 int fd = ::open( sysClassPath, O_RDONLY|O_NONBLOCK ); 430 int fd = ::open( sysClassPath, O_RDONLY|O_NONBLOCK );
431 if ( fd ) { 431 if ( fd ) {
432 char buf[100]; 432 char buf[100];
433 if ( ::read( fd, &buf[0], sizeof buf ) ) 433 if ( ::read( fd, &buf[0], sizeof buf ) )
434 ::sscanf( &buf[0], "%d", &res ); 434 ::sscanf( &buf[0], "%d", &res );
435 ::close( fd ); 435 ::close( fd );
436 } 436 }
437 return res; 437 return res;
438 } 438 }
439 439
440 switch ( model()) { 440 switch ( model()) {
441 case Model_iPAQ_H31xx: 441 case Model_iPAQ_H31xx:
442 case Model_iPAQ_H36xx: 442 case Model_iPAQ_H36xx:
443 case Model_iPAQ_H37xx: 443 case Model_iPAQ_H37xx:
444 return 128; // really 256, but >128 could damage the LCD 444 return 128; // really 256, but >128 could damage the LCD
445 445
446 case Model_iPAQ_H38xx: 446 case Model_iPAQ_H38xx:
447 case Model_iPAQ_H39xx: 447 case Model_iPAQ_H39xx:
448 return 64; 448 return 64;
449 case Model_iPAQ_H5xxx: 449 case Model_iPAQ_H5xxx:
450 case Model_iPAQ_HX4700: 450 case Model_iPAQ_HX4700:
451 case Model_iPAQ_H4xxx: 451 case Model_iPAQ_H4xxx:
452 return 255;
453 case Model_iPAQ_H191x: 452 case Model_iPAQ_H191x:
454 return 7; 453 return 255;
455 case Model_iPAQ_H1940: 454 case Model_iPAQ_H1940:
456 return 44; 455 return 44;
457 default: 456 default:
458 return 2; 457 return 2;
459 } 458 }
460} 459}
461 460
462bool iPAQ::setDisplayStatus ( bool on ) 461bool iPAQ::setDisplayStatus ( bool on )
463{ 462{
464 bool res = false; 463 bool res = false;
465 464
466 QString cmdline; 465 QString cmdline;
467 466
468 QDir sysClass( "/sys/class/lcd/" ); 467 QDir sysClass( "/sys/class/lcd/" );
469 sysClass.setFilter(QDir::Dirs); 468 sysClass.setFilter(QDir::Dirs);
470 if ( sysClass.exists() && sysClass.count() > 2 ) { 469 if ( sysClass.exists() && sysClass.count() > 2 ) {
471 QString sysClassPath = sysClass.absFilePath( sysClass[2] + "/power" ); 470 QString sysClassPath = sysClass.absFilePath( sysClass[2] + "/power" );
472 int fd = ::open( sysClassPath, O_WRONLY|O_NONBLOCK ); 471 int fd = ::open( sysClassPath, O_WRONLY|O_NONBLOCK );
473 if ( fd ) { 472 if ( fd ) {
474 char buf[10]; 473 char buf[10];
475 buf[0] = on ? 0 : 4; 474 buf[0] = on ? 0 : 4;
476 buf[1] = '\0'; 475 buf[1] = '\0';
477 res = ( ::write( fd, &buf[0], 2 ) == 0 ); 476 res = ( ::write( fd, &buf[0], 2 ) == 0 );
478 ::close( fd ); 477 ::close( fd );