author | mickeyl <mickeyl> | 2005-06-09 09:14:22 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-09 09:14:22 (UTC) |
commit | 9a4b3a90fdd4ac0288034657d4818e3d10ed0193 (patch) (side-by-side diff) | |
tree | b65dc74dce17f4f709242753152b53767bb1a4fc | |
parent | 15978c2609cc29d2eb2b21922dd52627015889c1 (diff) | |
download | opie-9a4b3a90fdd4ac0288034657d4818e3d10ed0193.zip opie-9a4b3a90fdd4ac0288034657d4818e3d10ed0193.tar.gz opie-9a4b3a90fdd4ac0288034657d4818e3d10ed0193.tar.bz2 |
add support for the linux 2.6 backlight interface on tosa, poodle, and collie
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 65 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 5 |
2 files changed, 42 insertions, 28 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 1742100..21d2342 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -1,26 +1,25 @@ /* - Â Â Â Â Â Â Â Â This file is part of the Opie Project - - Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> + This file is part of the Opie Project + Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> =. .=l. -Â Â Â Â Â Â .>+-= -Â _;:, Â Â .> Â Â :=|. This program is free software; you can -.> <`_, Â > Â . Â <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public -.="- .-=="i, Â Â .._ License as published by the Free Software -Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, -Â Â Â ._= =} Â Â Â : or (at your option) any later version. -Â Â .%`+i> Â Â Â _;_. -Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that -Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; - : .. Â Â .:, Â Â . . . without even the implied warranty of -Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A -Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= Â Â Â = Â Â Â ; Library General Public License for more -++= Â -. Â Â .` Â Â .: details. -: Â Â = Â ...= . :.=- -Â -. Â .:....=;==+<; You should have received a copy of the GNU -Â -_. . . Â )=. Â = Library General Public License along with -Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; version 2 of the License. + ._= =} : + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, @@ -122,3 +121,3 @@ struct z_button z_buttons_c700 [] = { // Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) -// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000) +// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100) // Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) @@ -201,2 +200,16 @@ void Zaurus::init(const QString& cpu_info) + // set path to backlight device in kernel 2.6 + switch ( d->m_model ) { + case Model_Zaurus_SLB600: // fallthrough + case Model_Zaurus_SL5500: + m_backlightdev = "/sys/class/backlight/locomo-backlight/"; + break; + case Model_Zaurus_SL6000: + m_backlightdev = "/sys/class/backlight/tosa-bl/"; + break; + default: + m_backlightdev = "/sys/class/backlight/corgi-bl/"; + break; + } + // set initial rotation @@ -413,3 +426,3 @@ int Zaurus::displayBrightnessResolution() const { - int fd = ::open( "/sys/class/backlight/corgi-bl/max_brightness", O_RDONLY|O_NONBLOCK ); + int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK ); if ( fd ) @@ -446,3 +459,3 @@ bool Zaurus::setDisplayBrightness( int bright ) { - int fd = ::open( "/sys/class/backlight/corgi-bl/brightness", O_WRONLY|O_NONBLOCK ); + int fd = ::open( m_backlightdev + "brightness", O_WRONLY|O_NONBLOCK ); if ( fd ) @@ -473,3 +486,3 @@ bool Zaurus::setDisplayStatus( bool on ) { - int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); + int fd = ::open( m_backlightdev + "power", O_WRONLY|O_NONBLOCK ); if ( fd ) diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index 4250356..4314aff 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h @@ -10,4 +10,4 @@ .="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. + - . .-<_> .<> Foundation; version 2 of the License. + ._= =} : .%`+i> _;_. @@ -127,2 +127,3 @@ class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter + QString m_backlightdev; OLedState m_leds[1]; |