author | mickeyl <mickeyl> | 2005-01-29 18:37:14 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-01-29 18:37:14 (UTC) |
commit | 3f25fb92b1dde002ea0c2a3aedffd3912054c380 (patch) (unidiff) | |
tree | bb3b92f37236e516952c44fc31c16815505dd8f4 /libopie2 | |
parent | e6c61408933a3473f25f89d9ba58aceb0b2a2bee (diff) | |
download | opie-3f25fb92b1dde002ea0c2a3aedffd3912054c380.zip opie-3f25fb92b1dde002ea0c2a3aedffd3912054c380.tar.gz opie-3f25fb92b1dde002ea0c2a3aedffd3912054c380.tar.bz2 |
use FB_BLANK_UNBLANK and FB_BLANK_POWERDOWN for the 2.6 interface
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 2128d46..59f1592 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -446,33 +446,33 @@ bool Zaurus::setDisplayStatus( bool on ) | |||
446 | if ( m_embedix ) | 446 | if ( m_embedix ) |
447 | { | 447 | { |
448 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); | 448 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); |
449 | if ( fd ) | 449 | if ( fd ) |
450 | { | 450 | { |
451 | int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF; | 451 | int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF; |
452 | res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 ); | 452 | res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 ); |
453 | ::close ( fd ); | 453 | ::close ( fd ); |
454 | } | 454 | } |
455 | } | 455 | } |
456 | else | 456 | else |
457 | { | 457 | { |
458 | int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); | 458 | int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); |
459 | if ( fd ) | 459 | if ( fd ) |
460 | { | 460 | { |
461 | char buf[10]; | 461 | char buf[10]; |
462 | buf[0] = on ? '1' : '0'; | 462 | buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; |
463 | buf[1] = '\0'; | 463 | buf[1] = '\0'; |
464 | res = ( ::write( fd, &buf[0], 2 ) == 0 ); | 464 | res = ( ::write( fd, &buf[0], 2 ) == 0 ); |
465 | ::close( fd ); | 465 | ::close( fd ); |
466 | } | 466 | } |
467 | } | 467 | } |
468 | return res; | 468 | return res; |
469 | } | 469 | } |
470 | 470 | ||
471 | bool Zaurus::suspend() | 471 | bool Zaurus::suspend() |
472 | { | 472 | { |
473 | qDebug("ODevice::suspend"); | 473 | qDebug("ODevice::suspend"); |
474 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | 474 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend |
475 | return false; | 475 | return false; |
476 | 476 | ||
477 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | 477 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices |
478 | return false; | 478 | return false; |
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index 04e73c4..80593ce 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h | |||
@@ -62,40 +62,44 @@ | |||
62 | // LED | 62 | // LED |
63 | #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 63 | #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
64 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) | 64 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) |
65 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ | 65 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ |
66 | 66 | ||
67 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ | 67 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ |
68 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ | 68 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ |
69 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ | 69 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ |
70 | 70 | ||
71 | // Rotation and Power Management | 71 | // Rotation and Power Management |
72 | #define SHARP_IOCTL_GET_ROTATION 0x413c | 72 | #define SHARP_IOCTL_GET_ROTATION 0x413c |
73 | 73 | ||
74 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) | 74 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) |
75 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) | 75 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) |
76 | #define APM_EVT_POWER_BUTTON (1 << 0) | 76 | #define APM_EVT_POWER_BUTTON (1 << 0) |
77 | 77 | ||
78 | // Brightness | 78 | // Brightness Embedix |
79 | #define SHARP_FL_IOCTL_DEVICE "/dev/sharp_fl" | 79 | #define SHARP_FL_IOCTL_DEVICE "/dev/sharp_fl" |
80 | #define SHARP_FL_IOCTL_ON 1 | 80 | #define SHARP_FL_IOCTL_ON 1 |
81 | #define SHARP_FL_IOCTL_OFF 2 | 81 | #define SHARP_FL_IOCTL_OFF 2 |
82 | #define SHARP_FL_IOCTL_STEP_CONTRAST 100 | 82 | #define SHARP_FL_IOCTL_STEP_CONTRAST 100 |
83 | #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101 | 83 | #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101 |
84 | #define SHARP_FL_IOCTL_GET_STEP 102 | 84 | #define SHARP_FL_IOCTL_GET_STEP 102 |
85 | 85 | ||
86 | // Vesa Standard | ||
87 | #define FB_BLANK_UNBLANK 0 | ||
88 | #define FB_BLANK_POWERDOWN 4 | ||
89 | |||
86 | namespace Opie { | 90 | namespace Opie { |
87 | namespace Core { | 91 | namespace Core { |
88 | namespace Internal { | 92 | namespace Internal { |
89 | 93 | ||
90 | class Zaurus : public ODevice | 94 | class Zaurus : public ODevice |
91 | { | 95 | { |
92 | protected: | 96 | protected: |
93 | virtual void init(const QString&); | 97 | virtual void init(const QString&); |
94 | virtual void initButtons(); | 98 | virtual void initButtons(); |
95 | 99 | ||
96 | public: | 100 | public: |
97 | virtual bool setDisplayBrightness( int b ); | 101 | virtual bool setDisplayBrightness( int b ); |
98 | virtual bool setDisplayStatus( bool on ); | 102 | virtual bool setDisplayStatus( bool on ); |
99 | virtual int displayBrightnessResolution() const; | 103 | virtual int displayBrightnessResolution() const; |
100 | 104 | ||
101 | virtual void playAlarmSound(); | 105 | virtual void playAlarmSound(); |