summaryrefslogtreecommitdiff
path: root/libopie2
authorzecke <zecke>2006-04-27 10:45:16 (UTC)
committer zecke <zecke>2006-04-27 10:45:16 (UTC)
commit17191b7ae7929568b9ed87a427e2eaeb28377a00 (patch) (unidiff)
tree8a095f0ecd0b4a09f72b1e8295bfc3d8c8008524 /libopie2
parentc5e86199c46839e6952b8ec3dec1447e5f60a279 (diff)
downloadopie-17191b7ae7929568b9ed87a427e2eaeb28377a00.zip
opie-17191b7ae7929568b9ed87a427e2eaeb28377a00.tar.gz
opie-17191b7ae7929568b9ed87a427e2eaeb28377a00.tar.bz2
libopie2/opiecore/device/:
Patch by hrhr to add basic backlight support for the hx4700 series of iPAQs to ODevice
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.h2
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp13
2 files changed, 14 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index 0c78277..2566979 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -67,13 +67,13 @@ enum OModel {
67 Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), 67 Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ),
68 Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), 68 Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ),
69 Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), 69 Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ),
70 Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), 70 Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ),
71 Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), 71 Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ),
72 Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), 72 Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ),
73 73 Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ),
74 Model_Jornada = ( 6 << 16 ), 74 Model_Jornada = ( 6 << 16 ),
75 Model_Jornada_56x = ( Model_Jornada | 0x0001 ), 75 Model_Jornada_56x = ( Model_Jornada | 0x0001 ),
76 Model_Jornada_720 = ( Model_Jornada | 0x0002 ), 76 Model_Jornada_720 = ( Model_Jornada | 0x0002 ),
77 77
78 Model_Zaurus = ( 2 << 16 ), 78 Model_Zaurus = ( 2 << 16 ),
79 79
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index a221e23..e6e3145 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -150,24 +150,28 @@ void iPAQ::init(const QString& model)
150 else if ( d->m_modelstr == "H2200" ) 150 else if ( d->m_modelstr == "H2200" )
151 d->m_model = Model_iPAQ_H22xx; 151 d->m_model = Model_iPAQ_H22xx;
152 else if ( d->m_modelstr == "H1910" ) 152 else if ( d->m_modelstr == "H1910" )
153 d->m_model = Model_iPAQ_H191x; 153 d->m_model = Model_iPAQ_H191x;
154 else if ( d->m_modelstr == "H1940" ) 154 else if ( d->m_modelstr == "H1940" )
155 d->m_model = Model_iPAQ_H1940; 155 d->m_model = Model_iPAQ_H1940;
156 else if ( d->m_modelstr == "HX4700" )
157 d->m_model = Model_iPAQ_HX4700;
158
156 else 159 else
157 d->m_model = Model_Unknown; 160 d->m_model = Model_Unknown;
158 161
159 switch ( d->m_model ) { 162 switch ( d->m_model ) {
160 case Model_iPAQ_H31xx: 163 case Model_iPAQ_H31xx:
161 case Model_iPAQ_H38xx: 164 case Model_iPAQ_H38xx:
162 d->m_rotation = Rot90; 165 d->m_rotation = Rot90;
163 break; 166 break;
164 case Model_iPAQ_H5xxx: 167 case Model_iPAQ_H5xxx:
165 case Model_iPAQ_H22xx: 168 case Model_iPAQ_H22xx:
166 case Model_iPAQ_H191x: 169 case Model_iPAQ_H191x:
167 case Model_iPAQ_H1940: 170 case Model_iPAQ_H1940:
171 case Model_iPAQ_HX4700:
168 d->m_rotation = Rot0; 172 d->m_rotation = Rot0;
169 break; 173 break;
170 case Model_iPAQ_H36xx: 174 case Model_iPAQ_H36xx:
171 case Model_iPAQ_H37xx: 175 case Model_iPAQ_H37xx:
172 case Model_iPAQ_H39xx: 176 case Model_iPAQ_H39xx:
173 default: 177 default:
@@ -379,12 +383,20 @@ bool iPAQ::setDisplayBrightness ( int bright )
379 cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/pxafb/power"); 383 cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/pxafb/power");
380 else 384 else
381 cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/pxafb/power; echo %1 > /sys/class/backlight/pxafb/brightness" ).arg( bright ); 385 cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/pxafb/power; echo %1 > /sys/class/backlight/pxafb/brightness" ).arg( bright );
382 // No Global::shellQuote as we gurantee it to be sane 386 // No Global::shellQuote as we gurantee it to be sane
383 res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); 387 res = ( ::system( QFile::encodeName(cmdline) ) == 0 );
384 break; 388 break;
389
390 case Model_iPAQ_HX4700:
391 cmdline = QString::fromLatin1( "echo %1 > /sys/class/backlight/w100fb/brightness" ).arg( bright );
392 // No Global::shellQuote as we gurantee it to be sane
393 res = ( ::system( QFile::encodeName(cmdline) ) == 0 );
394 break;
395
396
385 default: 397 default:
386 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) { 398 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) {
387 FLITE_IN bl; 399 FLITE_IN bl;
388 bl. mode = 1; 400 bl. mode = 1;
389 bl. pwr = bright ? 1 : 0; 401 bl. pwr = bright ? 1 : 0;
390 bl. brightness = ( bright * ( displayBrightnessResolution() - 1 ) + 127 ) / 255; 402 bl. brightness = ( bright * ( displayBrightnessResolution() - 1 ) + 127 ) / 255;
@@ -404,12 +416,13 @@ int iPAQ::displayBrightnessResolution() const
404 return 128; // really 256, but >128 could damage the LCD 416 return 128; // really 256, but >128 could damage the LCD
405 417
406 case Model_iPAQ_H38xx: 418 case Model_iPAQ_H38xx:
407 case Model_iPAQ_H39xx: 419 case Model_iPAQ_H39xx:
408 return 64; 420 return 64;
409 case Model_iPAQ_H5xxx: 421 case Model_iPAQ_H5xxx:
422 case Model_iPAQ_HX4700:
410 return 255; 423 return 255;
411 case Model_iPAQ_H191x: 424 case Model_iPAQ_H191x:
412 return 7; 425 return 7;
413 case Model_iPAQ_H1940: 426 case Model_iPAQ_H1940:
414 return 44; 427 return 44;
415 default: 428 default: