summaryrefslogtreecommitdiff
authorschurig <schurig>2004-09-09 09:08:36 (UTC)
committer schurig <schurig>2004-09-09 09:08:36 (UTC)
commit8df28401db620a01144ca45988837583f55e15c3 (patch) (side-by-side diff)
tree7024a45504623a81abbf58c7ab0cae08d7870bd2
parent739d8dc8d4aed25e09d43805c802e9836240655b (diff)
downloadopie-8df28401db620a01144ca45988837583f55e15c3.zip
opie-8df28401db620a01144ca45988837583f55e15c3.tar.gz
opie-8df28401db620a01144ca45988837583f55e15c3.tar.bz2
support for devfs
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 280b0c5..2355621 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -298,49 +298,53 @@ bool ODevice::suspend()
//#include <linux/fb.h> better not rely on kernel headers in userspace ...
#define FBIOBLANK OD_IO( 'F', 0x11 ) // 0x4611
/* VESA Blanking Levels */
#define VESA_NO_BLANKING 0
#define VESA_VSYNC_SUSPEND 1
#define VESA_HSYNC_SUSPEND 2
#define VESA_POWERDOWN 3
/**
* This sets the display on or off
*/
bool ODevice::setDisplayStatus ( bool on )
{
qDebug("ODevice::setDisplayStatus(%d)", on);
if ( d->m_model == Model_Unknown )
return false;
bool res = false;
int fd;
+#ifdef QT_QWS_DEVFS
+ if (( fd = ::open ( "/dev/fb/0", O_RDWR )) >= 0 ) {
+#else
if (( fd = ::open ( "/dev/fb0", O_RDWR )) >= 0 ) {
+#endif
res = ( ::ioctl ( fd, FBIOBLANK, on ? VESA_NO_BLANKING : VESA_POWERDOWN ) == 0 );
::close ( fd );
}
return res;
}
/**
* This sets the display brightness
*
* @param p The brightness to be set on a scale from 0 to 255
* @return success or failure
*/
bool ODevice::setDisplayBrightness ( int p)
{
Q_UNUSED( p )
return false;
}
/**
* @return returns the number of steppings on the brightness slider
* in the Light-'n-Power settings.
*/
int ODevice::displayBrightnessResolution() const
{