summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp65
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h5
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,29 +1,28 @@
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,
28 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
29*/ 28*/
@@ -119,9 +118,9 @@ struct z_button z_buttons_c700 [] = {
119// class up into individual classes. We would need three classes 118// class up into individual classes. We would need three classes
120// 119//
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
126void Zaurus::init(const QString& cpu_info) 125void Zaurus::init(const QString& cpu_info)
127{ 126{
@@ -198,8 +197,22 @@ void Zaurus::init(const QString& cpu_info)
198 d->m_model = Model_Zaurus_SL5500; 197 d->m_model = Model_Zaurus_SL5500;
199 d->m_modelstr = "Unknown Zaurus"; 198 d->m_modelstr = "Unknown Zaurus";
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 ) {
204 case Model_Zaurus_SL6000: // fallthrough 217 case Model_Zaurus_SL6000: // fallthrough
205 case Model_Zaurus_SLA300: 218 case Model_Zaurus_SLA300:
@@ -410,9 +423,9 @@ int Zaurus::displayBrightnessResolution() const
410 } 423 }
411 } 424 }
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 {
417 char buf[100]; 430 char buf[100];
418 if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); 431 if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res );
@@ -443,9 +456,9 @@ bool Zaurus::setDisplayBrightness( int bright )
443 } 456 }
444 } 457 }
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 {
450 char buf[100]; 463 char buf[100];
451 int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); 464 int len = ::snprintf( &buf[0], sizeof buf, "%d", val );
@@ -470,9 +483,9 @@ bool Zaurus::setDisplayStatus( bool on )
470 } 483 }
471 } 484 }
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 {
477 char buf[10]; 490 char buf[10];
478 buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; 491 buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
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
@@ -7,10 +7,10 @@
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
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
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
@@ -124,8 +124,9 @@ class Zaurus : public OAbstractMobileDevice, public QWSServer::KeyboardFilter
124 protected: 124 protected:
125 virtual void buzzer( int snd ); 125 virtual void buzzer( int snd );
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;
130}; 131};
131 132