-rw-r--r-- | libopie/odevice.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index bc09e92..82a0099 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -1964,6 +1964,7 @@ bool Zaurus::setSoftSuspend ( bool soft ) | |||
1964 | 1964 | ||
1965 | bool Zaurus::setDisplayBrightness ( int bright ) | 1965 | bool Zaurus::setDisplayBrightness ( int bright ) |
1966 | { | 1966 | { |
1967 | //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); | ||
1967 | bool res = false; | 1968 | bool res = false; |
1968 | int fd; | 1969 | int fd; |
1969 | 1970 | ||
@@ -1974,12 +1975,13 @@ bool Zaurus::setDisplayBrightness ( int bright ) | |||
1974 | { | 1975 | { |
1975 | if ( d->m_model == Model_Zaurus_SLC7x0 ) | 1976 | if ( d->m_model == Model_Zaurus_SLC7x0 ) |
1976 | { | 1977 | { |
1978 | //qDebug( "using special treatment for devices with the corgi backlight interface" ); | ||
1977 | // special treatment for devices with the corgi backlight interface | 1979 | // special treatment for devices with the corgi backlight interface |
1978 | if (( fd = ::open ( "/proc/driver/fl/corgi-bl", O_WRONLY )) >= 0 ) | 1980 | if (( fd = ::open ( "/proc/driver/fl/corgi-bl", O_WRONLY )) >= 0 ) |
1979 | { | 1981 | { |
1980 | if ( bright > 0x11 ) bright = 0x11; | 1982 | int value = ( bright == 1 ) ? 1 : bright * ( 17.0 / 255.0 ); |
1981 | char writeCommand[100]; | 1983 | char writeCommand[100]; |
1982 | const int count = sprintf( writeCommand, "0x%x\n", bright ); | 1984 | const int count = sprintf( writeCommand, "0x%x\n", value ); |
1983 | res = ( ::write ( fd, writeCommand, count ) != -1 ); | 1985 | res = ( ::write ( fd, writeCommand, count ) != -1 ); |
1984 | ::close ( fd ); | 1986 | ::close ( fd ); |
1985 | } | 1987 | } |