author | mickeyl <mickeyl> | 2005-06-09 09:14:22 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-09 09:14:22 (UTC) |
commit | 9a4b3a90fdd4ac0288034657d4818e3d10ed0193 (patch) (unidiff) | |
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,27 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
5 | =. | 4 | =. |
6 | .=l. | 5 | .=l. |
7 | Â Â Â Â Â Â .>+-= | 6 | .>+-= |
8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, Â Â .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; version 2 of the License. |
13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. | 12 | ._= =} : |
14 | Â Â .%`+i> Â Â Â _;_. | 13 | .%`+i> _;_. |
15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. Â Â .:, Â Â . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
21 | ++= Â -. Â Â .` Â Â .: details. | 20 | ++= -. .` .: details. |
22 | : Â Â = Â ...= . :.=- | 21 | : = ...= . :.=- |
23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | Â -_. . . Â )=. Â = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
@@ -121,5 +120,5 @@ struct z_button z_buttons_c700 [] = { | |||
121 | // Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) | 120 | // Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) |
122 | // Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) | 121 | // Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) |
123 | // Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000) | 122 | // Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100) |
124 | // Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) | 123 | // Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) |
125 | 124 | ||
@@ -200,4 +199,18 @@ void Zaurus::init(const QString& cpu_info) | |||
200 | } | 199 | } |
201 | 200 | ||
201 | // set path to backlight device in kernel 2.6 | ||
202 | switch ( d->m_model ) { | ||
203 | case Model_Zaurus_SLB600: // fallthrough | ||
204 | case Model_Zaurus_SL5500: | ||
205 | m_backlightdev = "/sys/class/backlight/locomo-backlight/"; | ||
206 | break; | ||
207 | case Model_Zaurus_SL6000: | ||
208 | m_backlightdev = "/sys/class/backlight/tosa-bl/"; | ||
209 | break; | ||
210 | default: | ||
211 | m_backlightdev = "/sys/class/backlight/corgi-bl/"; | ||
212 | break; | ||
213 | } | ||
214 | |||
202 | // set initial rotation | 215 | // set initial rotation |
203 | switch( d->m_model ) { | 216 | switch( d->m_model ) { |
@@ -412,5 +425,5 @@ int Zaurus::displayBrightnessResolution() const | |||
412 | else | 425 | else |
413 | { | 426 | { |
414 | int fd = ::open( "/sys/class/backlight/corgi-bl/max_brightness", O_RDONLY|O_NONBLOCK ); | 427 | int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK ); |
415 | if ( fd ) | 428 | if ( fd ) |
416 | { | 429 | { |
@@ -445,5 +458,5 @@ bool Zaurus::setDisplayBrightness( int bright ) | |||
445 | else | 458 | else |
446 | { | 459 | { |
447 | int fd = ::open( "/sys/class/backlight/corgi-bl/brightness", O_WRONLY|O_NONBLOCK ); | 460 | int fd = ::open( m_backlightdev + "brightness", O_WRONLY|O_NONBLOCK ); |
448 | if ( fd ) | 461 | if ( fd ) |
449 | { | 462 | { |
@@ -472,5 +485,5 @@ bool Zaurus::setDisplayStatus( bool on ) | |||
472 | else | 485 | else |
473 | { | 486 | { |
474 | int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); | 487 | int fd = ::open( m_backlightdev + "power", O_WRONLY|O_NONBLOCK ); |
475 | if ( fd ) | 488 | if ( fd ) |
476 | { | 489 | { |
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 | |||
@@ -9,6 +9,6 @@ | |||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; version 2 of the License. |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
@@ -126,4 +126,5 @@ class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter | |||
126 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 126 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
127 | 127 | ||
128 | QString m_backlightdev; | ||
128 | OLedState m_leds[1]; | 129 | OLedState m_leds[1]; |
129 | bool m_embedix; | 130 | bool m_embedix; |