author | chicken <chicken> | 2005-02-18 13:34:11 (UTC) |
---|---|---|
committer | chicken <chicken> | 2005-02-18 13:34:11 (UTC) |
commit | a0d6cdf75181b918775431f1de222f6906d0f40c (patch) (unidiff) | |
tree | 01ef66e2796ad1b775167b1d966851c3afed83e7 /libopie2 | |
parent | 0f1ae1478122e2f65f8d477d9baad8de15df1eb2 (diff) | |
download | opie-a0d6cdf75181b918775431f1de222f6906d0f40c.zip opie-a0d6cdf75181b918775431f1de222f6906d0f40c.tar.gz opie-a0d6cdf75181b918775431f1de222f6906d0f40c.tar.bz2 |
first bits of jornada 720 device code
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.cpp | 28 |
2 files changed, 22 insertions, 7 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 96a41fc..c434216 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -68,12 +68,13 @@ enum OModel { | |||
68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
71 | 71 | ||
72 | Model_Jornada = ( 6 << 24 ), | 72 | Model_Jornada = ( 6 << 24 ), |
73 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 73 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
74 | Model_Jornada_720 = ( Model_Jornada | 0x000002 ), | ||
74 | 75 | ||
75 | Model_Zaurus = ( 2 << 24 ), | 76 | Model_Zaurus = ( 2 << 24 ), |
76 | 77 | ||
77 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 78 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
78 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 79 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
79 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 80 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp index 7d080ba..c7ed4bc 100644 --- a/libopie2/opiecore/device/odevice_jornada.cpp +++ b/libopie2/opiecore/device/odevice_jornada.cpp | |||
@@ -105,19 +105,33 @@ struct j_button jornada56x_buttons [] = { | |||
105 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"), | 105 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"), |
106 | "devicebuttons/jornada56x_record", | 106 | "devicebuttons/jornada56x_record", |
107 | "QPE/VMemo", "toggleRecord()", | 107 | "QPE/VMemo", "toggleRecord()", |
108 | "sound", "raise()" }, | 108 | "sound", "raise()" }, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | void Jornada::init(const QString&) | 111 | void Jornada::init(const QString& cpu_info) |
112 | { | 112 | { |
113 | d->m_vendorstr = "HP"; | 113 | d->m_vendorstr = "HP"; |
114 | d->m_vendor = Vendor_HP; | 114 | d->m_vendor = Vendor_HP; |
115 | d->m_modelstr = "Jornada 56x"; | 115 | |
116 | d->m_model = Model_Jornada_56x; | 116 | QString model; |
117 | d->m_rotation = Rot0; | 117 | int loc = cpu_info.find( ":" ); |
118 | if ( loc != -1 ) | ||
119 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); | ||
120 | else | ||
121 | model = cpu_info; | ||
122 | |||
123 | if ( model == "HP Jornada 56x" ) { | ||
124 | d->m_modelstr = "Jornada 56x"; | ||
125 | d->m_model = Model_Jornada_56x; | ||
126 | } else if ( model == "HP Jornada 720" ) { | ||
127 | d->m_modelstr = "Jornada 720"; | ||
128 | d->m_model = Model_Jornada_720; | ||
129 | } | ||
130 | |||
131 | d->m_rotation = Rot0; //all Jornadas need this rotation | ||
118 | //Distribution detecting code is now in base class | 132 | //Distribution detecting code is now in base class |
119 | } | 133 | } |
120 | 134 | ||
121 | void Jornada::initButtons() | 135 | void Jornada::initButtons() |
122 | { | 136 | { |
123 | if ( d->m_buttons ) | 137 | if ( d->m_buttons ) |
@@ -157,28 +171,28 @@ bool Jornada::setDisplayBrightness( int bright ) | |||
157 | if ( bright < 0 ) | 171 | if ( bright < 0 ) |
158 | bright = 0; | 172 | bright = 0; |
159 | 173 | ||
160 | QString cmdline; | 174 | QString cmdline; |
161 | 175 | ||
162 | if ( !bright ) | 176 | if ( !bright ) |
163 | cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/sa1100fb/power"); | 177 | cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/*/power"); |
164 | else | 178 | else |
165 | cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/sa1100fb/power; echo %1 > /sys/class/backlight/sa1100fb/brightness" ).arg( bright ); | 179 | cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/*/power; echo %1 > /sys/class/backlight/*/brightness" ).arg( bright ); |
166 | 180 | ||
167 | // No Global::shellQuote as we gurantee it to be sane | 181 | // No Global::shellQuote as we gurantee it to be sane |
168 | res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); | 182 | res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); |
169 | 183 | ||
170 | return res; | 184 | return res; |
171 | } | 185 | } |
172 | 186 | ||
173 | 187 | ||
174 | bool Jornada::setDisplayStatus ( bool on ) | 188 | bool Jornada::setDisplayStatus ( bool on ) |
175 | { | 189 | { |
176 | bool res = false; | 190 | bool res = false; |
177 | 191 | ||
178 | QString cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); | 192 | QString cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/*/power; echo %2 > /sys/class/backlight/*/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); |
179 | 193 | ||
180 | res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); | 194 | res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); |
181 | 195 | ||
182 | return res; | 196 | return res; |
183 | } | 197 | } |
184 | 198 | ||