summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/device') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index e75e777..fb23e1d 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -397,49 +397,49 @@ bool Zaurus::setSoftSuspend ( bool soft )
perror ( "APM_IOCGEVTSRC" );
::close ( fd );
}
else
perror ( "/dev/apm_bios or /dev/misc/apm_bios" );
return res;
}
bool Zaurus::setDisplayBrightness( int bright )
{
//qDebug( "Zaurus::setDisplayBrightness( %d )", bright );
bool res = false;
if ( bright > 255 ) bright = 255;
if ( bright < 0 ) bright = 0;
if ( m_embedix )
{
int numberOfSteps = displayBrightnessResolution();
int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK );
if ( fd )
{
- int val = ( numberOfSteps * 255 ) / 255;
+ int val = ( bright * numberOfSteps ) / 255;
res = ( ::ioctl ( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 );
::close ( fd );
}
}
else
{
qDebug( "ODevice handling for non-embedix kernels not yet implemented" );
}
return res;
}
bool Zaurus::setDisplayStatus( bool on )
{
bool res = false;
if ( m_embedix )
{
int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK );
if ( fd )
{
int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF;
res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 );
::close ( fd );
}
}