-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index e75e777..fb23e1d 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -389,65 +389,65 @@ bool Zaurus::setSoftSuspend ( bool soft ) | |||
389 | sources |= APM_EVT_POWER_BUTTON; | 389 | sources |= APM_EVT_POWER_BUTTON; |
390 | 390 | ||
391 | if ( ::ioctl ( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources | 391 | if ( ::ioctl ( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources |
392 | res = true; | 392 | res = true; |
393 | else | 393 | else |
394 | perror ( "APM_IOCGEVTSRC" ); | 394 | perror ( "APM_IOCGEVTSRC" ); |
395 | } | 395 | } |
396 | else | 396 | else |
397 | perror ( "APM_IOCGEVTSRC" ); | 397 | perror ( "APM_IOCGEVTSRC" ); |
398 | 398 | ||
399 | ::close ( fd ); | 399 | ::close ( fd ); |
400 | } | 400 | } |
401 | else | 401 | else |
402 | perror ( "/dev/apm_bios or /dev/misc/apm_bios" ); | 402 | perror ( "/dev/apm_bios or /dev/misc/apm_bios" ); |
403 | 403 | ||
404 | return res; | 404 | return res; |
405 | } | 405 | } |
406 | 406 | ||
407 | bool Zaurus::setDisplayBrightness( int bright ) | 407 | bool Zaurus::setDisplayBrightness( int bright ) |
408 | { | 408 | { |
409 | //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); | 409 | //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); |
410 | bool res = false; | 410 | bool res = false; |
411 | 411 | ||
412 | if ( bright > 255 ) bright = 255; | 412 | if ( bright > 255 ) bright = 255; |
413 | if ( bright < 0 ) bright = 0; | 413 | if ( bright < 0 ) bright = 0; |
414 | 414 | ||
415 | if ( m_embedix ) | 415 | if ( m_embedix ) |
416 | { | 416 | { |
417 | int numberOfSteps = displayBrightnessResolution(); | 417 | int numberOfSteps = displayBrightnessResolution(); |
418 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); | 418 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); |
419 | if ( fd ) | 419 | if ( fd ) |
420 | { | 420 | { |
421 | int val = ( numberOfSteps * 255 ) / 255; | 421 | int val = ( bright * numberOfSteps ) / 255; |
422 | res = ( ::ioctl ( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); | 422 | res = ( ::ioctl ( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); |
423 | ::close ( fd ); | 423 | ::close ( fd ); |
424 | } | 424 | } |
425 | } | 425 | } |
426 | else | 426 | else |
427 | { | 427 | { |
428 | qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); | 428 | qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); |
429 | } | 429 | } |
430 | return res; | 430 | return res; |
431 | } | 431 | } |
432 | 432 | ||
433 | bool Zaurus::setDisplayStatus( bool on ) | 433 | bool Zaurus::setDisplayStatus( bool on ) |
434 | { | 434 | { |
435 | bool res = false; | 435 | bool res = false; |
436 | if ( m_embedix ) | 436 | if ( m_embedix ) |
437 | { | 437 | { |
438 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); | 438 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); |
439 | if ( fd ) | 439 | if ( fd ) |
440 | { | 440 | { |
441 | int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF; | 441 | int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF; |
442 | res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 ); | 442 | res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 ); |
443 | ::close ( fd ); | 443 | ::close ( fd ); |
444 | } | 444 | } |
445 | } | 445 | } |
446 | else | 446 | else |
447 | { | 447 | { |
448 | qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); | 448 | qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); |
449 | } | 449 | } |
450 | return res; | 450 | return res; |
451 | } | 451 | } |
452 | 452 | ||
453 | bool Zaurus::suspend() | 453 | bool Zaurus::suspend() |