summaryrefslogtreecommitdiff
path: root/libopie/odevice.cpp
Unidiff
Diffstat (limited to 'libopie/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 4c33a0e..d6e6892 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -754,62 +754,62 @@ bool ODevice::setLedState ( OLed which, OLedState st )
754 * @return if the device has a light sensor 754 * @return if the device has a light sensor
755 */ 755 */
756bool ODevice::hasLightSensor ( ) const 756bool ODevice::hasLightSensor ( ) const
757{ 757{
758 return false; 758 return false;
759} 759}
760 760
761/** 761/**
762 * @return a value from the light senso 762 * @return a value from the light senso
763 */ 763 */
764int ODevice::readLightSensor ( ) 764int ODevice::readLightSensor ( )
765{ 765{
766 return -1; 766 return -1;
767} 767}
768 768
769/** 769/**
770 * @return the light sensor resolution whatever that is ;) 770 * @return the light sensor resolution whatever that is ;)
771 */ 771 */
772int ODevice::lightSensorResolution ( ) const 772int ODevice::lightSensorResolution ( ) const
773{ 773{
774 return 0; 774 return 0;
775} 775}
776 776
777/** 777/**
778 * @return a list with valid CPU frequency 778 * @return a list with CPU frequencies supported by the hardware
779 */ 779 */
780QStrList &ODevice::cpuFrequencies ( ) const 780const QStrList &ODevice::allowedCpuFrequencies ( ) const
781{ 781{
782 return *d->m_cpu_frequencies; 782 return *d->m_cpu_frequencies;
783} 783}
784 784
785 785
786/** 786/**
787 * Set desired cpu frequency 787 * Set desired CPU frequency
788 * 788 *
789 * @param index index into d->m_cpu_frequencies of the frequency to be set 789 * @param index index into d->m_cpu_frequencies of the frequency to be set
790 */ 790 */
791bool ODevice::setCpuFrequency(uint index) 791bool ODevice::setCurrentCpuFrequency(uint index)
792{ 792{
793 if (index >= d->m_cpu_frequencies->count()) 793 if (index >= d->m_cpu_frequencies->count())
794 return false; 794 return false;
795 795
796 char *freq = d->m_cpu_frequencies->at(index); 796 char *freq = d->m_cpu_frequencies->at(index);
797 qWarning("set freq to %s", freq); 797 qWarning("set freq to %s", freq);
798 798
799 int fd; 799 int fd;
800 800
801 if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) { 801 if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) {
802 char writeCommand[50]; 802 char writeCommand[50];
803 const int count = sprintf(writeCommand, "%s\n", freq); 803 const int count = sprintf(writeCommand, "%s\n", freq);
804 int res = (::write(fd, writeCommand, count) != -1); 804 int res = (::write(fd, writeCommand, count) != -1);
805 ::close(fd); 805 ::close(fd);
806 return res; 806 return res;
807 } 807 }
808 808
809 return false; 809 return false;
810} 810}
811 811
812 812
813/** 813/**
814 * @return a list of hardware buttons 814 * @return a list of hardware buttons
815 */ 815 */