[PATCH] libopie2: Initial h4000 support

Paul Sokolovsky <[email protected]>
Newsgroups gmane.comp.handhelds.opie.devel
Message-ID <[email protected]>
Hello opie-devel,

  Attached a patch to add initial h4000 support to Opie. With it, at
least keys work out fo the box. Baclight control, etc. still need
work.

-- 
Best regards,
 Paul                          mailto:[email protected]

_______________________________________________

http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex

Opie-devel mailing list
[email protected]
https://handhelds.org/mailman/listinfo/opie-devel
h4000.diff (application/octet-stream, 4.7 KB)
? .diff
? h4000.diff
Index: opiecore/device/odevice.h
===================================================================
RCS file: /cvs/opie/libopie2/opiecore/device/odevice.h,v
retrieving revision 1.30
diff -u -r1.30 odevice.h
--- opiecore/device/odevice.h	14 Jul 2006 20:15:58 -0000	1.30
+++ opiecore/device/odevice.h	17 Jul 2006 11:10:52 -0000
@@ -71,6 +71,7 @@
     Model_iPAQ_H191x    = ( Model_iPAQ | 0x0008 ),
     Model_iPAQ_H1940    = ( Model_iPAQ | 0x0009 ),
     Model_iPAQ_HX4700   = ( Model_iPAQ | 0x000A ),
+    Model_iPAQ_H4xxx    = ( Model_iPAQ | 0x000b ),
     Model_Jornada       = ( 6 << 16 ),
     Model_Jornada_56x   = ( Model_Jornada | 0x0001 ),
     Model_Jornada_720   = ( Model_Jornada | 0x0002 ),
Index: opiecore/device/odevice_ipaq.cpp
===================================================================
RCS file: /cvs/opie/libopie2/opiecore/device/odevice_ipaq.cpp,v
retrieving revision 1.25
diff -u -r1.25 odevice_ipaq.cpp
--- opiecore/device/odevice_ipaq.cpp	9 Jun 2006 08:27:01 -0000	1.25
+++ opiecore/device/odevice_ipaq.cpp	17 Jul 2006 11:10:52 -0000
@@ -85,12 +85,12 @@
 #define FLITE_ON  OD_IOW( 'f', 7, FLITE_IN )
 
 struct i_button ipaq_buttons [] = {
-    { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x,
+    { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x | Model_iPAQ_H4xxx,
     Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
     "devicebuttons/ipaq_calendar",
     "datebook", "nextView()",
     "today", "raise()" },
-    { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x,
+    { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x | Model_iPAQ_H4xxx,
     Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
     "devicebuttons/ipaq_contact",
     "addressbook", "raise()",
@@ -105,7 +105,7 @@
     "devicebuttons/ipaq_mail",
     "opiemail", "raise()",
     "opiemail", "newMail()" },
-    { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x,
+    { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x | Model_iPAQ_H4xxx,
     Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
     "devicebuttons/ipaq_home",
     "QPE/Launcher", "home()",
@@ -116,12 +116,12 @@
     "QPE/VMemo", "toggleRecord()",
     "sound", "raise()" },
 
-    { Model_iPAQ_H191x,
+    { Model_iPAQ_H191x | Model_iPAQ_H4xxx,
     Qt::Key_F8, QT_TRANSLATE_NOOP("Button", "Mail Button"),
     "devicebuttons/ipaq_mail",
     "opiemail", "raise()",
     "opiemail", "newMail()" },
-    { Model_iPAQ_H191x,
+    { Model_iPAQ_H191x | Model_iPAQ_H4xxx,
     Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Record Button"),
     "devicebuttons/ipaq_record",
     "QPE/VMemo", "toggleRecord()",
@@ -156,6 +156,8 @@
         d->m_model = Model_iPAQ_H1940;
     else if ( d->m_modelstr == "HX4700" )
         d->m_model = Model_iPAQ_HX4700;
+    else if ( d->m_modelstr == "H4000" )
+        d->m_model = Model_iPAQ_H4xxx;
 
     else
         d->m_model = Model_Unknown;
@@ -170,6 +172,7 @@
         case Model_iPAQ_H191x:
         case Model_iPAQ_H1940:
 	case Model_iPAQ_HX4700:
+	case Model_iPAQ_H4xxx:
             d->m_rotation = Rot0;
             break;
         case Model_iPAQ_H36xx:
@@ -309,6 +312,7 @@
             // add the offset to the Key_Left key
             if (( d->m_model == Model_iPAQ_H5xxx ) ||
 		( d->m_model == Model_iPAQ_H191x ) ||
+		( d->m_model == Model_iPAQ_H4xxx ) ||
 		( d->m_model == Model_iPAQ_H1940 ))
                 newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4;
             break;
@@ -316,7 +320,7 @@
 
         // map Power Button short/long press to F6 for h191x
         case Key_F6:
-            if ( d->m_model != Model_iPAQ_H191x )
+            if ( d->m_model != Model_iPAQ_H191x && d->m_model != Model_iPAQ_H4xxx )
                 break;
         // map Power Button short/long press to F34/F35
         case Key_SysReq: {
@@ -380,6 +384,7 @@
 
     switch ( model()) {
     case Model_iPAQ_H191x:
+    case Model_iPAQ_H4xxx:
 	{
 	    QDir sysClass( "/sys/class/backlight/pxafb/" );
 	    sysClass.setFilter(QDir::Dirs);
@@ -439,6 +444,7 @@
             return 64;
         case Model_iPAQ_H5xxx:
 	case Model_iPAQ_HX4700:
+	case Model_iPAQ_H4xxx:
             return 255;
         case Model_iPAQ_H191x:
             return 7;
@@ -483,6 +489,7 @@
 {
     switch (model()) {
 	case Model_iPAQ_H191x:
+	case Model_iPAQ_H4xxx:
 	    return false;
 	default:
 	    return true;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.