-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 | |||
@@ -1961,28 +1961,30 @@ bool Zaurus::setSoftSuspend ( bool soft ) | |||
1961 | return res; | 1961 | return res; |
1962 | } | 1962 | } |
1963 | 1963 | ||
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 | ||
1970 | if ( bright > 255 ) bright = 255; | 1971 | if ( bright > 255 ) bright = 255; |
1971 | if ( bright < 0 ) bright = 0; | 1972 | if ( bright < 0 ) bright = 0; |
1972 | 1973 | ||
1973 | if ( m_embedix ) | 1974 | if ( m_embedix ) |
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 | } |
1986 | return res; | 1988 | return res; |
1987 | } | 1989 | } |
1988 | else | 1990 | else |