summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2006-06-09 00:21:31 (UTC)
committer mickeyl <mickeyl>2006-06-09 00:21:31 (UTC)
commitab1422b3e7df8644d6df2519f5ef5b5c831e3965 (patch) (side-by-side diff)
tree8e25b980c4898f3253a8d1f9efb23494ff4033ed
parentf469b23ef6f69b379dcb75834c14d19dbc4676d0 (diff)
downloadopie-ab1422b3e7df8644d6df2519f5ef5b5c831e3965.zip
opie-ab1422b3e7df8644d6df2519f5ef5b5c831e3965.tar.gz
opie-ab1422b3e7df8644d6df2519f5ef5b5c831e3965.tar.bz2
add brightness control for motorola ezx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog1
-rw-r--r--libopie2/opiecore/device/odevice_motorola_ezx.cpp55
2 files changed, 12 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index 490ed17..d0bbcb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,21 +1,22 @@
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)
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
@@ -207,90 +207,57 @@ OLedState Motorola_EZX::ledState( OLed which ) const
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 );