summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2006-02-06 13:40:26 (UTC)
committer mickeyl <mickeyl>2006-02-06 13:40:26 (UTC)
commitb5e868fd9f1dcc97c388f01f9b99ebfeb891133a (patch) (unidiff)
tree025a48bb1332c3114384b24979f01f51c5c3987a /libopie2
parentc5dee755c8f72f83bad3279659b58e1bd4cf28e1 (diff)
downloadopie-b5e868fd9f1dcc97c388f01f9b99ebfeb891133a.zip
opie-b5e868fd9f1dcc97c388f01f9b99ebfeb891133a.tar.gz
opie-b5e868fd9f1dcc97c388f01f9b99ebfeb891133a.tar.bz2
odevice: tosa now uses corgi-bl. patch courtesy Dirk Opfer - thanks
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 8a7e252..28a1ccf 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -149,195 +149,192 @@ struct z_button z_buttons_6000 [] = {
149 149
150// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus 150// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus
151// class up into individual classes. We would need three classes 151// class up into individual classes. We would need three classes
152// 152//
153// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) 153// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000)
154// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) 154// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600)
155// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100) 155// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100)
156// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) 156// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000)
157 157
158void Zaurus::init(const QString& cpu_info) 158void Zaurus::init(const QString& cpu_info)
159{ 159{
160 qDebug( "Zaurus::init()" ); 160 qDebug( "Zaurus::init()" );
161 // Set the time to wait until the system is really suspended 161 // Set the time to wait until the system is really suspended
162 // the delta between apm --suspend and sleeping 162 // the delta between apm --suspend and sleeping
163 setAPMTimeOut( 15000 ); 163 setAPMTimeOut( 15000 );
164 164
165 // generic distribution code already scanned /etc/issue at that point - 165 // generic distribution code already scanned /etc/issue at that point -
166 // embedix releases contain "Embedix <version> | Linux for Embedded Devices" 166 // embedix releases contain "Embedix <version> | Linux for Embedded Devices"
167 if ( d->m_sysverstr.contains( "embedix", false ) ) 167 if ( d->m_sysverstr.contains( "embedix", false ) )
168 { 168 {
169 d->m_vendorstr = "Sharp"; 169 d->m_vendorstr = "Sharp";
170 d->m_vendor = Vendor_Sharp; 170 d->m_vendor = Vendor_Sharp;
171 d->m_systemstr = "Zaurus"; 171 d->m_systemstr = "Zaurus";
172 d->m_system = System_Zaurus; 172 d->m_system = System_Zaurus;
173 m_embedix = true; 173 m_embedix = true;
174 } 174 }
175 else 175 else
176 { 176 {
177 d->m_vendorstr = "OpenZaurus Team"; 177 d->m_vendorstr = "OpenZaurus Team";
178 d->m_systemstr = "OpenZaurus"; 178 d->m_systemstr = "OpenZaurus";
179 d->m_system = System_OpenZaurus; 179 d->m_system = System_OpenZaurus;
180 // sysver already gathered 180 // sysver already gathered
181 181
182 // OpenZaurus sometimes uses the 2.4 (embedix) kernel, check if this is one 182 // OpenZaurus sometimes uses the 2.4 (embedix) kernel, check if this is one
183 FILE *uname = popen("uname -r", "r"); 183 FILE *uname = popen("uname -r", "r");
184 QFile f; 184 QFile f;
185 QString line; 185 QString line;
186 if ( f.open(IO_ReadOnly, uname) ) { 186 if ( f.open(IO_ReadOnly, uname) ) {
187 QTextStream ts ( &f ); 187 QTextStream ts ( &f );
188 line = ts.readLine(); 188 line = ts.readLine();
189 m_embedix = line.startsWith( "2.4." ); 189 m_embedix = line.startsWith( "2.4." );
190 f.close(); 190 f.close();
191 } 191 }
192 pclose(uname); 192 pclose(uname);
193 } 193 }
194 194
195 // check the Zaurus model 195 // check the Zaurus model
196 QString model; 196 QString model;
197 int loc = cpu_info.find( ":" ); 197 int loc = cpu_info.find( ":" );
198 if ( loc != -1 ) 198 if ( loc != -1 )
199 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); 199 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace();
200 else 200 else
201 model = cpu_info; 201 model = cpu_info;
202 202
203 if ( model == "SHARP Corgi" ) { 203 if ( model == "SHARP Corgi" ) {
204 d->m_model = Model_Zaurus_SLC7x0; 204 d->m_model = Model_Zaurus_SLC7x0;
205 d->m_modelstr = "Zaurus SL-C700"; 205 d->m_modelstr = "Zaurus SL-C700";
206 } else if ( model == "SHARP Shepherd" ) { 206 } else if ( model == "SHARP Shepherd" ) {
207 d->m_model = Model_Zaurus_SLC7x0; 207 d->m_model = Model_Zaurus_SLC7x0;
208 d->m_modelstr = "Zaurus SL-C750"; 208 d->m_modelstr = "Zaurus SL-C750";
209 } else if ( model == "SHARP Husky" ) { 209 } else if ( model == "SHARP Husky" ) {
210 d->m_model = Model_Zaurus_SLC7x0; 210 d->m_model = Model_Zaurus_SLC7x0;
211 d->m_modelstr = "Zaurus SL-C760 or SL-C860"; 211 d->m_modelstr = "Zaurus SL-C760 or SL-C860";
212 } else if ( model == "SHARP Boxer" ) { 212 } else if ( model == "SHARP Boxer" ) {
213 d->m_model = Model_Zaurus_SLC7x0; 213 d->m_model = Model_Zaurus_SLC7x0;
214 d->m_modelstr = "Zaurus SL-C760 or SL-C860"; 214 d->m_modelstr = "Zaurus SL-C760 or SL-C860";
215 } else if ( model == "SHARP Poodle" ) { 215 } else if ( model == "SHARP Poodle" ) {
216 d->m_model = Model_Zaurus_SLB600; 216 d->m_model = Model_Zaurus_SLB600;
217 d->m_modelstr = "Zaurus SL-B500 or SL-5600"; 217 d->m_modelstr = "Zaurus SL-B500 or SL-5600";
218 } else if ( model == "Sharp-Collie" || model == "Collie" ) { 218 } else if ( model == "Sharp-Collie" || model == "Collie" ) {
219 d->m_model = Model_Zaurus_SL5500; 219 d->m_model = Model_Zaurus_SL5500;
220 d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; 220 d->m_modelstr = "Zaurus SL-5500 or SL-5000d";
221 } else if ( model == "SHARP Tosa" ) { 221 } else if ( model == "SHARP Tosa" ) {
222 d->m_model = Model_Zaurus_SL6000; 222 d->m_model = Model_Zaurus_SL6000;
223 d->m_modelstr = "Zaurus SL-6000"; 223 d->m_modelstr = "Zaurus SL-6000";
224 } else if ( model == "SHARP Spitz" ) { 224 } else if ( model == "SHARP Spitz" ) {
225 d->m_model = Model_Zaurus_SLC3000; 225 d->m_model = Model_Zaurus_SLC3000;
226 d->m_modelstr = "Zaurus SL-C3000"; 226 d->m_modelstr = "Zaurus SL-C3000";
227 } else if ( model == "SHARP Akita" ) { 227 } else if ( model == "SHARP Akita" ) {
228 d->m_model = Model_Zaurus_SLC1000; 228 d->m_model = Model_Zaurus_SLC1000;
229 d->m_modelstr = "Zaurus SL-C1000"; 229 d->m_modelstr = "Zaurus SL-C1000";
230 } else if ( model == "SHARP Borzoi" ) { 230 } else if ( model == "SHARP Borzoi" ) {
231 d->m_model = Model_Zaurus_SLC3100; 231 d->m_model = Model_Zaurus_SLC3100;
232 d->m_modelstr = "Zaurus SL-C3100"; 232 d->m_modelstr = "Zaurus SL-C3100";
233 } else { 233 } else {
234 d->m_model = Model_Zaurus_SL5500; 234 d->m_model = Model_Zaurus_SL5500;
235 d->m_modelstr = "Unknown Zaurus"; 235 d->m_modelstr = "Unknown Zaurus";
236 } 236 }
237 237
238 // set path to backlight device in kernel 2.6 238 // set path to backlight device in kernel 2.6
239 switch ( d->m_model ) 239 switch ( d->m_model )
240 { 240 {
241 case Model_Zaurus_SLB600: // fallthrough 241 case Model_Zaurus_SLB600: // fallthrough
242 case Model_Zaurus_SL5500: 242 case Model_Zaurus_SL5500:
243 m_backlightdev = "/sys/class/backlight/locomo-backlight/"; 243 m_backlightdev = "/sys/class/backlight/locomo-backlight/";
244 break; 244 break;
245 case Model_Zaurus_SL6000:
246 m_backlightdev = "/sys/class/backlight/tosa-bl/";
247 break;
248 default: 245 default:
249 m_backlightdev = "/sys/class/backlight/corgi-bl/"; 246 m_backlightdev = "/sys/class/backlight/corgi-bl/";
250 } 247 }
251 248
252 // set initial rotation 249 // set initial rotation
253 switch( d->m_model ) 250 switch( d->m_model )
254 { 251 {
255 case Model_Zaurus_SL6000: // fallthrough 252 case Model_Zaurus_SL6000: // fallthrough
256 case Model_Zaurus_SLA300: 253 case Model_Zaurus_SLA300:
257 d->m_rotation = Rot0; 254 d->m_rotation = Rot0;
258 break; 255 break;
259 case Model_Zaurus_SLC3100: // fallthrough 256 case Model_Zaurus_SLC3100: // fallthrough
260 case Model_Zaurus_SLC3000: // fallthrough 257 case Model_Zaurus_SLC3000: // fallthrough
261 case Model_Zaurus_SLC1000: // fallthrough 258 case Model_Zaurus_SLC1000: // fallthrough
262 case Model_Zaurus_SLC7x0: 259 case Model_Zaurus_SLC7x0:
263 initHingeSensor(); 260 initHingeSensor();
264 d->m_rotation = rotation(); 261 d->m_rotation = rotation();
265 d->m_direction = direction(); 262 d->m_direction = direction();
266 break; 263 break;
267 case Model_Zaurus_SLB600: // fallthrough 264 case Model_Zaurus_SLB600: // fallthrough
268 case Model_Zaurus_SL5000: // fallthrough 265 case Model_Zaurus_SL5000: // fallthrough
269 case Model_Zaurus_SL5500: // fallthrough 266 case Model_Zaurus_SL5500: // fallthrough
270 default: 267 default:
271 d->m_rotation = Rot270; 268 d->m_rotation = Rot270;
272 } 269 }
273 270
274 // set default qte driver 271 // set default qte driver
275 switch( d->m_model ) 272 switch( d->m_model )
276 { 273 {
277 case Model_Zaurus_SLC7x0: 274 case Model_Zaurus_SLC7x0:
278 d->m_qteDriver = "W100"; 275 d->m_qteDriver = "W100";
279 break; 276 break;
280 default: 277 default:
281 d->m_qteDriver = "Transformed"; 278 d->m_qteDriver = "Transformed";
282 } 279 }
283 280
284 m_leds[0] = Led_Off; 281 m_leds[0] = Led_Off;
285 282
286 if ( m_embedix ) 283 if ( m_embedix )
287 qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr ); 284 qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr );
288 else 285 else
289 qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr ); 286 qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr );
290} 287}
291 288
292void Zaurus::initButtons() 289void Zaurus::initButtons()
293{ 290{
294 qDebug( "Zaurus::initButtons()" ); 291 qDebug( "Zaurus::initButtons()" );
295 if ( d->m_buttons ) 292 if ( d->m_buttons )
296 return; 293 return;
297 294
298 d->m_buttons = new QValueList <ODeviceButton>; 295 d->m_buttons = new QValueList <ODeviceButton>;
299 296
300 struct z_button * pz_buttons; 297 struct z_button * pz_buttons;
301 int buttoncount; 298 int buttoncount;
302 switch ( d->m_model ) 299 switch ( d->m_model )
303 { 300 {
304 case Model_Zaurus_SL6000: 301 case Model_Zaurus_SL6000:
305 pz_buttons = z_buttons_6000; 302 pz_buttons = z_buttons_6000;
306 buttoncount = ARRAY_SIZE(z_buttons_6000); 303 buttoncount = ARRAY_SIZE(z_buttons_6000);
307 break; 304 break;
308 case Model_Zaurus_SLC3100: // fallthrough 305 case Model_Zaurus_SLC3100: // fallthrough
309 case Model_Zaurus_SLC3000: // fallthrough 306 case Model_Zaurus_SLC3000: // fallthrough
310 case Model_Zaurus_SLC1000: // fallthrough 307 case Model_Zaurus_SLC1000: // fallthrough
311 case Model_Zaurus_SLC7x0: 308 case Model_Zaurus_SLC7x0:
312 if ( isQWS( ) ) 309 if ( isQWS( ) )
313 { 310 {
314 addPreHandler(this); 311 addPreHandler(this);
315 } 312 }
316 pz_buttons = z_buttons_c700; 313 pz_buttons = z_buttons_c700;
317 buttoncount = ARRAY_SIZE(z_buttons_c700); 314 buttoncount = ARRAY_SIZE(z_buttons_c700);
318 break; 315 break;
319 default: 316 default:
320 pz_buttons = z_buttons; 317 pz_buttons = z_buttons;
321 buttoncount = ARRAY_SIZE(z_buttons); 318 buttoncount = ARRAY_SIZE(z_buttons);
322 break; 319 break;
323 } 320 }
324 321
325 for ( int i = 0; i < buttoncount; i++ ) { 322 for ( int i = 0; i < buttoncount; i++ ) {
326 struct z_button *zb = pz_buttons + i; 323 struct z_button *zb = pz_buttons + i;
327 ODeviceButton b; 324 ODeviceButton b;
328 325
329 b.setKeycode( zb->code ); 326 b.setKeycode( zb->code );
330 b.setUserText( QObject::tr( "Button", zb->utext )); 327 b.setUserText( QObject::tr( "Button", zb->utext ));
331 b.setPixmap( OResource::loadPixmap( zb->pix )); 328 b.setPixmap( OResource::loadPixmap( zb->pix ));
332 b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); 329 b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction ));
333 b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); 330 b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction ));
334 d->m_buttons->append( b ); 331 d->m_buttons->append( b );
335 } 332 }
336 333
337 reloadButtonMapping(); 334 reloadButtonMapping();
338} 335}
339 336
340 337
341 338
342typedef struct sharp_led_status { 339typedef struct sharp_led_status {
343 int which; /* select which LED status is wanted. */ 340 int which; /* select which LED status is wanted. */