author | mickeyl <mickeyl> | 2006-06-09 00:21:31 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2006-06-09 00:21:31 (UTC) |
commit | ab1422b3e7df8644d6df2519f5ef5b5c831e3965 (patch) (side-by-side diff) | |
tree | 8e25b980c4898f3253a8d1f9efb23494ff4033ed | |
parent | f469b23ef6f69b379dcb75834c14d19dbc4676d0 (diff) | |
download | opie-ab1422b3e7df8644d6df2519f5ef5b5c831e3965.zip opie-ab1422b3e7df8644d6df2519f5ef5b5c831e3965.tar.gz opie-ab1422b3e7df8644d6df2519f5ef5b5c831e3965.tar.bz2 |
add brightness control for motorola ezx
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_motorola_ezx.cpp | 55 |
2 files changed, 12 insertions, 44 deletions
@@ -1,105 +1,106 @@ 2006-??-?? Opie 1.2.3 New Features ------------ Fixed Bugs ---------- * n.a. - Improved iPAQ support in ODevice and low-level applets (Slavek Banko) + * n.a. - Improved platform support for the Motorola EZX platform (mickeyl) Internal -------- 2006-05-28 Opie 1.2.2 New Features ------------ * Appearance: Added configuration options to set smallIconSize, bigIconSize, useBigPixmaps (hrw, drw) * Opie-Notes: Notes application based on NoteZ (hrw) * Opie-PackageManager: Added two configuration options: "Force recursive", "Verbose fetch" (hrw) * Added platform support for HTC Universal (ljp) * Made Opie-Bluetooth subsystem actually usable (korovkin) * Added platform support for the Motorola EZX platform (mickeyl) Fixed Bugs ---------- * #1695 - Date selector use too small fontsize on VGA screen (hrw) * #1686 - opie-console lack UI setting for switching scrollbar (hrw) * #1647 - Opie-console doesn't respect scroll-bar on left side (hrw) * #1624 - Button settngs changes are applied only after restart (hrw) * #1492 - Backup and Restore does not show list of backups to restore on start (hrw) * n.a. - remove hardcoded font size from wellenreiter (hrw) * n.a. - added patch to build Qt/E 2.3.10 with gcc 4.x.x (hrw) * n.a. - make blue-pin UI resizable to looks good in any resolution (hrw) * n.a. - fix a problem with vCard send to Sony Ericsson k600i (ar) * n.a. - add a patch to build Qt/E 2.3.10 on amd64 with gcc 4.x.x (ar) * n.a. - Opie-console fallback to FixedFont settings from qpe.conf in config (hrw) * n.a. - Update version in About applet (hrw) * n.a. - add firstusage and background pictures for 480x640 devices (mickeyl) * n.a. - many bluetooth fixes (korovkin) Internal -------- * libopiecore: /etc/oz_version renamed to /etc/openzaurus-version (hrw) * libopiecore: SL6000 (tosa) now uses corgi-bl (Dirk Opfer) * library/version.h: introduce integer version code in OPIE_VERSION for conditional compilation * g++ 4.1.1 fixes all around (no extra qualifiers allowed) (mickeyl) * update README (mickeyl) * remove libslcompat - it never worked and we don't support Sharp closed source anymore anyway (mickeyl) 2005-09-11 Opie 1.2.1 New Features ------------ * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly) * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer) * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl) * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl) * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) * Checkbook: Added configuration option to use smaller font for checkbook transaction tab (hrw) * ZSafe: Made UI conform to Opie standards (drw) * Today Addressbook plugin: Fixed configuration to show/not show birthdays, use checkboxes for selection (hrw) * Opie-Console: Read initial fixed font configuration from qpe.conf (mickeyl) * Opie-PcmciaApplet: Configure insert/resume actions and bind unsupported cards (mickeyl) * SysInfo: Remove CPU tab and add Devices tab instead (mickeyl) * Opie-smb: Added Opie front end for Samba (ljp) * Opie-Bluetooth: Replace obex send implementation and patch libopieobex and the bluetoothapplet (Michael Haynie) * Opieplayer: rudimentary podcast support (ljp) Fixed Bugs ---------- * #1377 - Suspend Powermanagement when switched to another VT (mickeyl) - We actually suspend the complete Opie now in that case. * #1384 - Battery status updated improperly when charging (skyhusker) * #1476 - Wrong order of application entries in the O-menu (skyhusker) * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl) * #1535 - Missing line break and unnecessary location shown with Today-Calendar plugin (deller) * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw) * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker) * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker) * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) * #1635 - opie-today, datebook-plugin does not show notes (skyhusker) * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker) * #1666 - Opie-IRC does not allow to add !channels in config as autojoin ones (skyhusker) * #1667 - Opie-IRC does not show messages from !channel (skyhusker) * #1679 - Security PIN plugin is QVGA sized (hrw) * #1682 - Properly resize tab control in OTabWidget (drw) * n.a. - always show volume and wireless applet popups inside visible screen (deller) * n.a. - scale O-Menu-Applets appropriately (mickeyl) * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl) * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl) * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl) * n.a. - Today Addressbook plugin fix configuration to show/not show birthdays, use checkboxes for selection (hrw) * n.a. - remove hardcoded font size from netsystemtime (hrw) * n.a. - remove hardcoded font size from checkbook graphs (hrw) * n.a. - Dagger - fixes for Sword 1.5.8, morph tag x-refs, closing last tab crash (drw) Internal diff --git a/libopie2/opiecore/device/odevice_motorola_ezx.cpp b/libopie2/opiecore/device/odevice_motorola_ezx.cpp index 69256dd..eed81ac 100644 --- a/libopie2/opiecore/device/odevice_motorola_ezx.cpp +++ b/libopie2/opiecore/device/odevice_motorola_ezx.cpp @@ -123,203 +123,170 @@ void Motorola_EZX::init(const QString& cpu_info) void Motorola_EZX::initButtons() { qDebug( "Motorola_EZX::initButtons()" ); if ( d->m_buttons ) return; d->m_buttons = new QValueList <ODeviceButton>; struct ezx_button * ezx_buttons; int buttoncount; /* switch ( d->m_model ) { case Model_Motorola_EZX_SL6000: pezx_buttons = ezx_buttons_6000; buttoncount = ARRAY_SIZE(ezx_buttons_6000); break; case Model_Motorola_EZX_SLC3100: // fallthrough case Model_Motorola_EZX_SLC3000: // fallthrough case Model_Motorola_EZX_SLC1000: // fallthrough case Model_Motorola_EZX_SLC7x0: if ( isQWS( ) ) { addPreHandler(this); } pezx_buttons = ezx_buttons_c700; buttoncount = ARRAY_SIZE(ezx_buttons_c700); break; default: pezx_buttons = ezx_buttons; buttoncount = ARRAY_SIZE(ezx_buttons); break; } for ( int i = 0; i < buttoncount; i++ ) { struct ezx_button *zb = pezx_buttons + i; ODeviceButton b; b.setKeycode( zb->code ); b.setUserText( QObject::tr( "Button", zb->utext )); b.setPixmap( OResource::loadPixmap( zb->pix )); b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); d->m_buttons->append( b ); } */ reloadButtonMapping(); } void Motorola_EZX::playAlarmSound() { #ifndef QT_NO_SOUND static Sound snd ( "alarm" ); if(!snd.isFinished()) return; changeMixerForAlarm(0, "/dev/sound/mixer", &snd ); snd. play(); #endif } QValueList <OLed> Motorola_EZX::ledList() const { QValueList <OLed> vl; vl << Led_Mail; return vl; } QValueList <OLedState> Motorola_EZX::ledStateList( OLed l ) const { QValueList <OLedState> vl; if ( l == Led_Mail ) vl << Led_Off << Led_On << Led_BlinkSlow; return vl; } OLedState Motorola_EZX::ledState( OLed which ) const { if ( which == Led_Mail ) return m_leds [0]; else return Led_Off; } bool Motorola_EZX::setLedState( OLed which, OLedState st ) { // Currently not supported qDebug( "Motorola_EZX::setLedState: ODevice handling not yet implemented" ); return false; } int Motorola_EZX::displayBrightnessResolution() const { - // Currently not supported - qDebug( "Motorola_EZX::displayBrightnessResolution: ODevice handling not yet implemented" ); - return 100; - -#if 0 int res = 1; - if (m_embedix) - { - int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK ); - if ( fd ) - { - int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 ); - ::close( fd ); - return value ? value : res; - } - } - else + int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK ); + if ( fd ) { - int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK ); - if ( fd ) - { - char buf[100]; - if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); - ::close( fd ); - } + char buf[100]; + if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); + ::close( fd ); } return res; -#endif } bool Motorola_EZX::setDisplayBrightness( int bright ) { qDebug( "Motorola_EZX::setDisplayBrightness( %d )", bright ); return false; -#if 0 bool res = false; if ( bright > 255 ) bright = 255; if ( bright < 0 ) bright = 0; int numberOfSteps = displayBrightnessResolution(); int val = ( bright == 1 ) ? 1 : ( bright * numberOfSteps ) / 255; - if ( m_embedix ) - { - int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); - if ( fd ) - { - res = ( ::ioctl( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); - ::close( fd ); - } - } - else + int fd = ::open( m_backlightdev + "brightness", O_WRONLY|O_NONBLOCK ); + if ( fd ) { - int fd = ::open( m_backlightdev + "brightness", O_WRONLY|O_NONBLOCK ); - if ( fd ) - { - char buf[100]; - int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); - res = ( ::write( fd, &buf[0], len ) == 0 ); - ::close( fd ); - } + char buf[100]; + int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); + res = ( ::write( fd, &buf[0], len ) == 0 ); + ::close( fd ); } return res; -#endif } bool Motorola_EZX::setDisplayStatus( bool on ) { bool res = false; int fd = ::open( m_backlightdev + "power", O_WRONLY|O_NONBLOCK ); if ( fd ) { char buf[10]; buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; buf[1] = '\0'; res = ( ::write( fd, &buf[0], 2 ) == 0 ); ::close( fd ); } return res; } void Motorola_EZX::systemMessage( const QCString &msg, const QByteArray & ) { if ( msg == "deviceButtonMappingChanged()" ) { reloadButtonMapping(); } } bool Motorola_EZX::suspend() { if ( !isQWS( ) ) // only qwsserver is allowed to suspend return false; bool res = false; QCopChannel::send( "QPE/System", "aboutToSuspend()" ); struct timeval tvs, tvn; ::gettimeofday ( &tvs, 0 ); ::sync(); // flush fs caches res = ( ::system ( "apm --suspend" ) == 0 ); QCopChannel::send( "QPE/System", "returnFromSuspend()" ); return res; } |