summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ramses.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_ramses.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp
index 32467f1..7db2af1 100644
--- a/libopie2/opiecore/device/odevice_ramses.cpp
+++ b/libopie2/opiecore/device/odevice_ramses.cpp
@@ -37,107 +37,97 @@
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Internal; 57using namespace Opie::Core::Internal;
58 58
59struct r_button ramses_buttons [] = { 59struct r_button ramses_buttons [] = {
60 { Model_Ramses_MNCI, 60 { Model_Ramses_MNCI,
61 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 61 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
62 "devicebuttons/z_menu", 62 "devicebuttons/z_menu",
63 "QPE/TaskBar", "toggleMenu()", 63 "QPE/TaskBar", "toggleMenu()",
64 "QPE/TaskBar", "toggleStartMenu()" }, 64 "QPE/TaskBar", "toggleStartMenu()" },
65 { Model_Ramses_MNCI, 65 { Model_Ramses_MNCI,
66 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 66 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
67 "devicebuttons/ipaq_home", 67 "devicebuttons/ipaq_home",
68 "QPE/Launcher", "home()", 68 "QPE/Launcher", "home()",
69 "buttonsettings", "raise()" }, 69 "buttonsettings", "raise()" },
70}; 70};
71 71
72void Ramses::init(const QString&) 72void Ramses::init(const QString&)
73{ 73{
74 d->m_vendorstr = "M und N"; 74 d->m_vendorstr = "M und N";
75 d->m_vendor = Vendor_MundN; 75 d->m_vendor = Vendor_MundN;
76 76
77 QFile f("/proc/sys/board/ramses"); 77 QFile f("/proc/sys/board/ramses");
78 78
79 d->m_modelstr = "Ramses"; 79 d->m_modelstr = "Ramses";
80 d->m_model = Model_Ramses_MNCI; 80 d->m_model = Model_Ramses_MNCI;
81 81
82 d->m_rotation = Rot0; 82 d->m_rotation = Rot0;
83 d->m_holdtime = 1000; 83 d->m_holdtime = 1000;
84 84
85 f.setName("/etc/oz_version"); 85 // Distribution detection code now in the base class
86
87 if (f.open(IO_ReadOnly)) {
88 d->m_systemstr = "OpenEmbedded/Ramses";
89 d->m_system = System_OpenZaurus;
90
91 QTextStream ts(&f);
92 ts.setDevice(&f);
93 d->m_sysverstr = ts.readLine();
94 f.close();
95 }
96 86
97 m_power_timer = 0; 87 m_power_timer = 0;
98 88
99#ifdef QT_QWS_ALLOW_OVERCLOCK 89#ifdef QT_QWS_ALLOW_OVERCLOCK
100#warning *** Overclocking enabled - this may fry your hardware - you have been warned *** 90#warning *** Overclocking enabled - this may fry your hardware - you have been warned ***
101#define OC(x...) x 91#define OC(x...) x
102#else 92#else
103#define OC(x...) 93#define OC(x...)
104#endif 94#endif
105 95
106 // This table is true for a Intel XScale PXA 255 96 // This table is true for a Intel XScale PXA 255
107 97
108 d->m_cpu_frequencies->append("99000"); // mem= 99, run= 99, turbo= 99, PXbus= 50 98 d->m_cpu_frequencies->append("99000"); // mem= 99, run= 99, turbo= 99, PXbus= 50
109OC(d->m_cpu_frequencies->append("118000"); ) // mem=118, run=118, turbo=118, PXbus= 59 OC'd mem 99OC(d->m_cpu_frequencies->append("118000"); ) // mem=118, run=118, turbo=118, PXbus= 59 OC'd mem
110 d->m_cpu_frequencies->append("199100"); // mem= 99, run=199, turbo=199, PXbus= 99 100 d->m_cpu_frequencies->append("199100"); // mem= 99, run=199, turbo=199, PXbus= 99
111OC(d->m_cpu_frequencies->append("236000"); ) // mem=118, run=236, turbo=236, PXbus=118 OC'd mem 101OC(d->m_cpu_frequencies->append("236000"); ) // mem=118, run=236, turbo=236, PXbus=118 OC'd mem
112 d->m_cpu_frequencies->append("298600"); // mem= 99, run=199, turbo=298, PXbus= 99 102 d->m_cpu_frequencies->append("298600"); // mem= 99, run=199, turbo=298, PXbus= 99
113OC(d->m_cpu_frequencies->append("354000"); ) // mem=118, run=236, turbo=354, PXbus=118 OC'd mem 103OC(d->m_cpu_frequencies->append("354000"); ) // mem=118, run=236, turbo=354, PXbus=118 OC'd mem
114 d->m_cpu_frequencies->append("398099"); // mem= 99, run=199, turbo=398, PXbus= 99 104 d->m_cpu_frequencies->append("398099"); // mem= 99, run=199, turbo=398, PXbus= 99
115 d->m_cpu_frequencies->append("398100"); // mem= 99, run=398, turbo=398, PXbus=196 105 d->m_cpu_frequencies->append("398100"); // mem= 99, run=398, turbo=398, PXbus=196
116OC(d->m_cpu_frequencies->append("471000"); ) // mem=118, run=471, turbo=471, PXbus=236 OC'd mem/core/bus 106OC(d->m_cpu_frequencies->append("471000"); ) // mem=118, run=471, turbo=471, PXbus=236 OC'd mem/core/bus
117 107
118} 108}
119 109
120bool Ramses::filter(int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat) 110bool Ramses::filter(int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat)
121{ 111{
122 Q_UNUSED( keycode ); 112 Q_UNUSED( keycode );
123 Q_UNUSED( modifiers ); 113 Q_UNUSED( modifiers );
124 Q_UNUSED( isPress ); 114 Q_UNUSED( isPress );
125 Q_UNUSED( autoRepeat ); 115 Q_UNUSED( autoRepeat );
126 return false; 116 return false;
127} 117}
128 118
129void Ramses::timerEvent(QTimerEvent *) 119void Ramses::timerEvent(QTimerEvent *)
130{ 120{
131 killTimer(m_power_timer); 121 killTimer(m_power_timer);
132 m_power_timer = 0; 122 m_power_timer = 0;
133 QWSServer::sendKeyEvent(-1, HardKey_Backlight, 0, true, false); 123 QWSServer::sendKeyEvent(-1, HardKey_Backlight, 0, true, false);
134 QWSServer::sendKeyEvent(-1, HardKey_Backlight, 0, false, false); 124 QWSServer::sendKeyEvent(-1, HardKey_Backlight, 0, false, false);
135} 125}
136 126
137 127
138bool Ramses::setSoftSuspend(bool soft) 128bool Ramses::setSoftSuspend(bool soft)
139{ 129{
140 qDebug("Ramses::setSoftSuspend(%d)", soft); 130 qDebug("Ramses::setSoftSuspend(%d)", soft);
141#if 0 131#if 0
142 bool res = false; 132 bool res = false;
143 int fd; 133 int fd;