Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r1786 - in
      trunk/src/target/OM-2007/applications/openmoko-contacts: .        src
      ([EMAIL PROTECTED])
   2. r1787 - in
      trunk/src/target/OM-2007/applications/openmoko-contacts: .        src
      ([EMAIL PROTECTED])
   3. r1788 -
      trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src
      ([EMAIL PROTECTED])
   4. r1789 - trunk/oe/packages/vte ([EMAIL PROTECTED])
   5. r1790 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   6. r1791 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: thomas
Date: 2007-04-17 16:38:18 +0200 (Tue, 17 Apr 2007)
New Revision: 1786

Modified:
   trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
   
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
Log:
* src/contacts-contact-pane.c: (make_widget), (update_ui): Add photo chooser. 
Closes bug 473.


Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog   
2007-04-16 19:06:08 UTC (rev 1785)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog   
2007-04-17 14:38:18 UTC (rev 1786)
@@ -1,3 +1,7 @@
+2007-04-17  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * src/contacts-contact-pane.c: (make_widget), (update_ui): Add photo 
chooser. Closes bug 473.
+
 2007-04-16  Thomas Wood  <[EMAIL PROTECTED]>
 
        * src/contacts-omoko.c: (create_contacts_list),

Modified: 
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
===================================================================
--- 
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
 2007-04-16 19:06:08 UTC (rev 1785)
+++ 
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
 2007-04-17 14:38:18 UTC (rev 1786)
@@ -22,6 +22,7 @@
 #include <gtk/gtk.h>
 #include <libebook/e-book.h>
 #include "contacts-contact-pane.h"
+#include "contacts-utils.h"
 
 G_DEFINE_TYPE (ContactsContactPane, contacts_contact_pane, GTK_TYPE_VBOX);
 
@@ -472,7 +473,10 @@
 
   box = gtk_hbox_new (FALSE, 0);
 
-  type = get_type (attr);
+  if (attr)
+    type = get_type (attr);
+  else
+    type = NULL;
 
 
   if (type == NULL && info->types != NULL)
@@ -570,16 +574,19 @@
   /* load the attribute value, returning a semicolon seperated string for
    * multivalue attributes
    */
-  GList *l = e_vcard_attribute_get_values (attr);
-  if (l)
+  if (attr)
   {
-    attr_value = g_strdup (l->data);
+    GList *l = e_vcard_attribute_get_values (attr);
+    if (l)
+    {
+      attr_value = g_strdup (l->data);
 
-    while ((l = g_list_next (l)))
-    {
-      gchar *old = attr_value;
-      attr_value = g_strdup_printf ("%s; %s", old, (gchar*) l->data);
-      g_free (old);
+      while ((l = g_list_next (l)))
+      {
+        gchar *old = attr_value;
+        attr_value = g_strdup_printf ("%s; %s", old, (gchar*) l->data);
+        g_free (old);
+      }
     }
   }
 
@@ -600,6 +607,8 @@
     g_signal_connect (value, "focus-in-event", G_CALLBACK (field_focus_in), 
info);
     g_signal_connect (value, "focus-out-event", G_CALLBACK (field_focus_out), 
info);
   } else {
+    if (!attr_value)
+      attr_value = g_strdup ("");
     if (info->format)
     {
       escaped_str = g_markup_printf_escaped (info->format, attr_value);
@@ -631,6 +640,8 @@
 update_ui (ContactsContactPane *pane)
 {
   int i;
+  GtkWidget *w;
+    EVCardAttribute *attr;
 
   g_assert (CONTACTS_IS_CONTACT_PANE (pane));
 
@@ -645,7 +656,6 @@
       /* TODO: check for error here */
       e_book_add_contact (e_book_view_get_book (pane->priv->bookview), 
pane->priv->contact, NULL);
     } else {
-      GtkWidget *w;
       w = gtk_label_new ("No contact to display");
       gtk_widget_show (w);
       gtk_box_pack_start (GTK_BOX (pane), w, TRUE, TRUE, 0);
@@ -655,10 +665,54 @@
 
   pane->priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
-  for (i = 0; i < G_N_ELEMENTS (fields); i++) {
+  /* Add Name, Organisation and Photo fields into a special arrangement */
+  GtkWidget *table = gtk_table_new (2, 4, FALSE);
+  gtk_box_pack_start (GTK_BOX (pane), table, FALSE, FALSE, 4);
+
+  /* Fast path unique fields, no need to search the entire contact */
+  attr = e_vcard_get_attribute (E_VCARD (pane->priv->contact), 
fields[0].vcard_field);
+  if (!attr && pane->priv->editable) {
+    attr = e_vcard_attribute_new ("", fields[0].vcard_field);
+    e_vcard_add_attribute (E_VCARD (pane->priv->contact), attr);
+  }
+  w = make_widget (pane, attr, &fields[0]);
+  gtk_table_attach_defaults (GTK_TABLE (table), w, 1, 2, 0, 1);
+
+  attr = e_vcard_get_attribute (E_VCARD (pane->priv->contact), 
fields[1].vcard_field);
+  if (!attr && pane->priv->editable) {
+    attr = e_vcard_attribute_new ("", fields[1].vcard_field);
+    e_vcard_add_attribute (E_VCARD (pane->priv->contact), attr);
+  }
+  gboolean has_org_field = FALSE;
+  if (attr || pane->priv->editable)
+  {
+    w = make_widget (pane, attr, &fields[1]);
+    gtk_table_attach_defaults (GTK_TABLE (table), w, 1, 2, 1, 2);
+    has_org_field = TRUE;
+  }
+
+  GtkWidget *photo = contacts_load_photo (pane->priv->contact);
+  if (pane->priv->editable)
+  {
+    w = gtk_button_new ();
+    gtk_widget_set_name (w, "mokofingerbutton-big");
+    gtk_container_add (GTK_CONTAINER (w), photo);
+    g_signal_connect (w, "clicked", contacts_choose_photo, 
pane->priv->contact);
+  }
+  else
+  {
+    w = photo;
+  }
+  if (has_org_field)
+    gtk_table_attach (GTK_TABLE (table), w, 0, 1, 0, 2, 0, 0, 6, 6);
+  else
+    gtk_table_attach (GTK_TABLE (table), w, 0, 1, 0, 1, 0, 0, 6, 6);
+
+  gtk_widget_show_all (table);
+
+
+  for (i = 2; i < G_N_ELEMENTS (fields); i++) {
     FieldInfo *info;
-    EVCardAttribute *attr;
-    GtkWidget *w;
 
     info = &fields[i];
     if (info->unique) {




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-04-17 16:55:55 +0200 (Tue, 17 Apr 2007)
New Revision: 1787

Modified:
   trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
   
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
Log:
* src/contacts-contact-pane.c: (choose_photo_cb), (update_ui): Make
sure the contact is committed when the photo is changed.


Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog   
2007-04-17 14:38:18 UTC (rev 1786)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog   
2007-04-17 14:55:55 UTC (rev 1787)
@@ -1,5 +1,10 @@
 2007-04-17  Thomas Wood  <[EMAIL PROTECTED]>
 
+       * src/contacts-contact-pane.c: (choose_photo_cb), (update_ui): Make
+       sure the contact is committed when the photo is changed.
+
+2007-04-17  Thomas Wood  <[EMAIL PROTECTED]>
+
        * src/contacts-contact-pane.c: (make_widget), (update_ui): Add photo 
chooser. Closes bug 473.
 
 2007-04-16  Thomas Wood  <[EMAIL PROTECTED]>

Modified: 
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
===================================================================
--- 
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
 2007-04-17 14:38:18 UTC (rev 1786)
+++ 
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
 2007-04-17 14:55:55 UTC (rev 1787)
@@ -633,6 +633,13 @@
   return box;
 }
 
+static void
+choose_photo_cb (GtkWidget *button, ContactsContactPane *pane)
+{
+       pane->priv->dirty = TRUE;
+       contacts_choose_photo (button, pane->priv->contact);
+}
+
 /*
  * Update the widgets, called when the contact or editable mode has changed.
  */
@@ -641,7 +648,7 @@
 {
   int i;
   GtkWidget *w;
-    EVCardAttribute *attr;
+  EVCardAttribute *attr;
 
   g_assert (CONTACTS_IS_CONTACT_PANE (pane));
 
@@ -691,17 +698,17 @@
     has_org_field = TRUE;
   }
 
-  GtkWidget *photo = contacts_load_photo (pane->priv->contact);
+  GtkImage *photo = contacts_load_photo (pane->priv->contact);
   if (pane->priv->editable)
   {
     w = gtk_button_new ();
     gtk_widget_set_name (w, "mokofingerbutton-big");
-    gtk_container_add (GTK_CONTAINER (w), photo);
-    g_signal_connect (w, "clicked", contacts_choose_photo, 
pane->priv->contact);
+    gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (photo));
+    g_signal_connect (w, "clicked", (GCallback) choose_photo_cb, pane);
   }
   else
   {
-    w = photo;
+    w = GTK_WIDGET (photo);
   }
   if (has_org_field)
     gtk_table_attach (GTK_TABLE (table), w, 0, 1, 0, 2, 0, 0, 6, 6);




--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-17 18:53:36 +0200 (Tue, 17 Apr 2007)
New Revision: 1788

Modified:
   
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/buttonactions.c
Log:
openmoko-panel-mainmenu: make AUX/POWER button menu appear if button is held >= 
1 seconds instead of always waiting for releaseing
NOTE: Thanks LaF0rge for spotting my bogus UI :D


Modified: 
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/buttonactions.c
===================================================================
--- 
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/buttonactions.c
  2007-04-17 14:55:55 UTC (rev 1787)
+++ 
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/buttonactions.c
  2007-04-17 16:53:36 UTC (rev 1788)
@@ -32,7 +32,7 @@
 #include <linux/input.h>
 
 #undef DEBUG_THIS_FILE
-//#define DEBUG_THIS_FILE 1
+//#define DEBUG_THIS_FILE
 
 //FIXME find out through sysfs
 #ifndef DEBUG_THIS_FILE
@@ -50,8 +50,8 @@
 GPollFD aux_fd;
 GPollFD power_fd;
 
-GTimer* aux_timer = 0;
-GTimer* power_timer = 0;
+int aux_timer = -1;
+int power_timer = -1;
 
 GtkWidget* aux_menu = 0;
 GtkWidget* power_menu = 0;
@@ -81,12 +81,10 @@
     aux_fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
     aux_fd.revents = 0;
     g_source_add_poll( button_watcher, &aux_fd );
-    aux_timer = g_timer_new();
     power_fd.fd = powerfd;
     power_fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
     power_fd.revents = 0;
     g_source_add_poll( button_watcher, &power_fd );
-    power_timer = g_timer_new();
     g_source_attach( button_watcher, NULL );
     return TRUE;
 }
@@ -94,39 +92,40 @@
 
 gboolean panel_mainmenu_input_prepare( GSource* source, gint* timeout )
 {
-    g_debug( "prepare" );
     return FALSE;
 }
 
 
 gboolean panel_mainmenu_input_check( GSource* source )
 {
-    g_debug( "check" );
     return ( ( aux_fd.revents & G_IO_IN ) || ( power_fd.revents & G_IO_IN ) );
 }
 
 
 gboolean panel_mainmenu_input_dispatch( GSource* source, GSourceFunc callback, 
gpointer data )
 {
-    g_debug( "dispatch" );
     if ( aux_fd.revents & G_IO_IN )
     {
         struct input_event event;
         int size = read( aux_fd.fd, &event, sizeof( struct input_event ) );
         g_debug( "read %d bytes from aux_fd %d", size, aux_fd.fd );
         g_debug( "input event = ( %0x, %0x, %0x )", event.type, event.code, 
event.value );
-        //g_timeout_add( 1 * 1000, (GSourceFunc) panel_mainmenu_input_timeout, 
NULL);
         if ( event.type == 1 && event.code == AUX_BUTTON_KEYCODE )
         {
             if ( event.value == 1 ) /* pressed */
             {
-                g_debug( "resetting aux timer" );
-                g_timer_reset( aux_timer );
+                g_debug( "triggering aux timer" );
+                aux_timer = g_timeout_add( 1 * 1000, (GSourceFunc) 
panel_mainmenu_aux_timeout, (gpointer)1 );
             }
             else if ( event.value == 0 ) /* released */
             {
-                g_debug( "triggering aux function" );
-                panel_mainmenu_aux_timeout( g_timer_elapsed( aux_timer, NULL ) 
);
+                g_debug( "resetting aux timer" );
+                if ( aux_timer != -1 )
+                {
+                    g_source_remove( aux_timer );
+                    panel_mainmenu_aux_timeout( 0 );
+                }
+                aux_timer = -1;
             }
         }
     }
@@ -136,18 +135,22 @@
         int size = read( power_fd.fd, &event, sizeof( struct input_event ) );
         g_debug( "read %d bytes from power_fd %d", size, power_fd.fd );
         g_debug( "input event = ( %0x, %0x, %0x )", event.type, event.code, 
event.value );
-        //g_timeout_add( 1 * 1000, (GSourceFunc) panel_mainmenu_power_timeout, 
NULL);
         if ( event.type == 1 && event.code == POWER_BUTTON_KEYCODE )
         {
             if ( event.value == 1 ) /* pressed */
             {
-                g_debug( "resetting power timer" );
-                g_timer_reset( power_timer );
+                g_debug( "triggering power timer" );
+                power_timer = g_timeout_add( 1 * 1000, (GSourceFunc) 
panel_mainmenu_power_timeout, (gpointer)1 );
             }
             else if ( event.value == 0 ) /* released */
             {
-                g_debug( "triggering power function" );
-                panel_mainmenu_power_timeout( g_timer_elapsed( power_timer, 
NULL ) );
+                g_debug( "resetting power timer" );
+                if ( power_timer != -1 )
+                {
+                    g_source_remove( power_timer );
+                    panel_mainmenu_power_timeout( 0 );
+                }
+                power_timer = -1;
             }
         }
     }
@@ -157,6 +160,7 @@
 gboolean panel_mainmenu_aux_timeout( guint timeout )
 {
     g_debug( "aux pressed for %d", timeout );
+    aux_timer = -1;
     if ( timeout < 1 )
     {
         // make dialer interface show up
@@ -216,6 +220,7 @@
 gboolean panel_mainmenu_power_timeout( guint timeout )
 {
     g_debug( "power pressed for %d", timeout );
+    power_timer = -1;
     if ( timeout < 1 )
     {
         // close current application




--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-17 23:46:24 +0200 (Tue, 17 Apr 2007)
New Revision: 1789

Modified:
   trunk/oe/packages/vte/vte_0.11.15.bb
Log:
oe: increase package granularity, libvte4 is now packages individually


Modified: trunk/oe/packages/vte/vte_0.11.15.bb
===================================================================
--- trunk/oe/packages/vte/vte_0.11.15.bb        2007-04-17 16:53:36 UTC (rev 
1788)
+++ trunk/oe/packages/vte/vte_0.11.15.bb        2007-04-17 21:46:24 UTC (rev 
1789)
@@ -1,6 +1,6 @@
 DESCRIPTION = "vte is a virtual terminal emulator"
 LICENSE = "LGPL"
-PR = "r1"
+PR = "r2"
 
 inherit gnome
 
@@ -9,3 +9,7 @@
 do_stage() {
     autotools_stage_all
 }
+
+PACKAGES =+ "libvte"
+FILES_libvte = "${libdir}/*.so*"
+




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2007-04-18 05:37:33 +0200 (Wed, 18 Apr 2007)
New Revision: 1790

Added:
   trunk/src/target/u-boot/patches/nand-otp.patch
Log:
- new file board/neo1973/nand.c with board-specific NAND functions, including 
  OTP support and board_nand_init
- common/cmd_nand.c (do_nand): added read.otp and write.otp
- common/cmd_nand.c (U_BOOT_CMD): cleaned up read and write synopsis, added
  .otp and .oob
- cpu/arm920t/s3c24x0/nand.c (board_nand_init): renamed to s3c24x0_nand_init
- drivers/nand/nand_base.c: added nand_read_otp and nand_write_otp
- include/linux/mtd/mtd.h (struct mtd_info): new functions read_otp and 
  write_otp
- include/linux/mtd/nand.h (struct nand_chip): new functions read_otp and
  write_otp



Added: trunk/src/target/u-boot/patches/nand-otp.patch
===================================================================
--- trunk/src/target/u-boot/patches/nand-otp.patch      2007-04-17 21:46:24 UTC 
(rev 1789)
+++ trunk/src/target/u-boot/patches/nand-otp.patch      2007-04-18 03:37:33 UTC 
(rev 1790)
@@ -0,0 +1,258 @@
+Index: u-boot/board/neo1973/Makefile
+===================================================================
+--- u-boot.orig/board/neo1973/Makefile
++++ u-boot/board/neo1973/Makefile
+@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
+ 
+ LIB   = lib$(BOARD).a
+ 
+-OBJS  := neo1973.o pcf50606.o cmd_neo1973.o jbt6k74.o udc.o bootmenu.o
++OBJS  := neo1973.o pcf50606.o cmd_neo1973.o jbt6k74.o udc.o bootmenu.o nand.o
+ SOBJS := lowlevel_init.o
+ 
+ .PHONY:       all
+Index: u-boot/board/neo1973/nand.c
+===================================================================
+--- /dev/null
++++ u-boot/board/neo1973/nand.c
+@@ -0,0 +1,121 @@
++/*
++ * nand.c - Board-specific NAND setup
++ *
++ * Copyright (C) 2007 by OpenMoko, Inc.
++ * Written by Werner Almesberger <[EMAIL PROTECTED]>
++ * All Rights Reserved
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++
++#include "config.h" /* nand.h needs NAND_MAX_CHIPS */
++#include "linux/mtd/mtd.h"
++#include "linux/mtd/nand.h"
++#include "asm/errno.h"
++
++
++int s3c24x0_nand_init(struct nand_chip *nand);
++
++
++static void samsung_nand_begin_otp(struct mtd_info *mtd)
++{
++      struct nand_chip *this = mtd->priv;
++
++      /* @@@FIXME: this is ugly - we select the NAND chip to send the
++         mode switch commands, knowing that it will be switched off later */
++      this->select_chip(mtd, 0);
++      /* "magic" mode change */
++      this->cmdfunc(mtd, 0x30, -1, -1);
++      this->cmdfunc(mtd, 0x65, -1, -1);
++}
++
++
++static void samsung_nand_end_otp(struct mtd_info *mtd)
++{
++      struct nand_chip *this = mtd->priv;
++
++      /* read/write deselected the chip so now we need to select again */
++      this->select_chip(mtd, 0);
++      this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
++      this->select_chip(mtd, -1);
++}
++
++
++static loff_t otp_page[] = {
++      0x15,   /* 00-XX-00-00, with XX = 15h-19h */
++      0x16,
++      0x17,
++      0x18,
++      0x19,
++      0x1b,   /* 00-1B-00-00 */
++};
++
++#define OTP_PAGES (sizeof(otp_page)/sizeof(*otp_page))
++
++
++static int convert_otp_address(loff_t *addr, size_t *len)
++{
++      int page;
++
++      if (*len && *addr >> 9 != (*addr+*len-1) >> 9)
++              return -EINVAL;
++      if (*len > 512)
++              return -EINVAL;
++      page = *addr >> 9;
++      if (page >= OTP_PAGES)
++              return -EINVAL;
++      *addr = otp_page[page] << 9;
++      return 0;
++}
++
++
++static int samsung_nand_read_otp(struct mtd_info *mtd, loff_t from,
++    size_t len, size_t *retlen, u_char *buf)
++{
++      int ret;
++
++      ret = convert_otp_address(&from, &len);
++      if (ret)
++              return ret;
++      samsung_nand_begin_otp(mtd);
++      ret = mtd->read(mtd, from, len, retlen, buf);
++      samsung_nand_end_otp(mtd);
++      return ret;
++}
++
++
++static int samsung_nand_write_otp(struct mtd_info *mtd, loff_t to,
++    size_t len, size_t *retlen, const u_char *buf)
++{
++      int ret;
++
++      ret = convert_otp_address(&to, &len);
++      if (ret)
++              return ret;
++      samsung_nand_begin_otp(mtd);
++      ret = mtd->write(mtd, to, len, retlen, buf);
++      samsung_nand_end_otp(mtd);
++      return ret;
++}
++
++
++int board_nand_init(struct nand_chip *nand)
++{
++      nand->read_otp = samsung_nand_read_otp;
++      nand->write_otp = samsung_nand_write_otp;
++      return s3c24x0_nand_init(nand);
++}
+Index: u-boot/common/cmd_nand.c
+===================================================================
+--- u-boot.orig/common/cmd_nand.c
++++ u-boot/common/cmd_nand.c
+@@ -392,6 +392,14 @@ int do_nand(cmd_tbl_t * cmdtp, int flag,
+                       else
+                               ret = nand->write_oob(nand, off, size, &size, 
+                                                     (u_char *) addr);
++              } else if (s != NULL && !strcmp(s, ".otp")) {
++                      /* read out-of-band data */
++                      if (read)
++                              ret = nand->read_otp(nand, off, size, &size,
++                                                   (u_char *) addr);
++                      else
++                              ret = nand->write_otp(nand, off, size, &size,
++                                                    (u_char *) addr);
+               } else {
+                       if (read)
+                               ret = nand_read(nand, off, &size, (u_char 
*)addr);
+@@ -527,8 +535,9 @@ U_BOOT_CMD(nand, 5, 1, do_nand,
+       "nand    - NAND sub-system\n",
+       "info                  - show available NAND devices\n"
+       "nand device [dev]     - show or set current device\n"
+-      "nand read[.jffs2]     - addr off|partition size\n"
+-      "nand write[.jffs2]    - addr off|partiton size - read/write `size' 
bytes starting\n"
++      "nand read[.jffs2, .oob, .otp] addr off|partition size\n"
++      "nand write[.jffs2, .oob, .otp] addr off|partiton size\n"
++      "  - read/write `size' bytes starting\n"
+       "    at offset `off' to/from memory address `addr'\n"
+       "nand erase [clean] [off size] - erase `size' bytes from\n"
+       "    offset `off' (entire device if not specified)\n"
+Index: u-boot/cpu/arm920t/s3c24x0/nand.c
+===================================================================
+--- u-boot.orig/cpu/arm920t/s3c24x0/nand.c
++++ u-boot/cpu/arm920t/s3c24x0/nand.c
+@@ -167,7 +167,7 @@ int s3c2410_nand_correct_data(struct mtd
+ }
+ #endif
+ 
+-int board_nand_init(struct nand_chip *nand)
++int s3c24x0_nand_init(struct nand_chip *nand)
+ {
+       u_int32_t cfg;
+       u_int8_t tacls, twrph0, twrph1;
+Index: u-boot/drivers/nand/nand_base.c
+===================================================================
+--- u-boot.orig/drivers/nand/nand_base.c
++++ u-boot/drivers/nand/nand_base.c
+@@ -2042,6 +2042,32 @@ out:
+ }
+ #endif
+ 
++/*
++ * See nand_read_oob and nand_write_oob
++ */
++
++static int nand_read_otp(struct mtd_info *mtd, loff_t from, size_t len,
++    size_t *retlen, u_char *buf)
++{
++      struct nand_chip *this = mtd->priv;
++
++      if (!this->read_otp)
++              return -ENOSYS;
++      return this->read_otp(mtd, from, len, retlen, buf);
++
++}
++
++static int nand_write_otp(struct mtd_info *mtd, loff_t to, size_t len,
++    size_t *retlen, const u_char *buf)
++{
++      struct nand_chip *this = mtd->priv;
++
++      if (!this->write_otp)
++              return -ENOSYS;
++      return this->write_otp(mtd, to, len, retlen, buf);
++}
++
++
+ /**
+  * single_erease_cmd - [GENERIC] NAND standard block erase command function
+  * @mtd:      MTD device structure
+@@ -2613,6 +2639,8 @@ int nand_scan (struct mtd_info *mtd, int
+       mtd->write_ecc = nand_write_ecc;
+       mtd->read_oob = nand_read_oob;
+       mtd->write_oob = nand_write_oob;
++      mtd->read_otp = nand_read_otp;
++      mtd->write_otp = nand_write_otp;
+ /* XXX U-BOOT XXX */
+ #if 0
+       mtd->readv = NULL;
+Index: u-boot/include/linux/mtd/mtd.h
+===================================================================
+--- u-boot.orig/include/linux/mtd/mtd.h
++++ u-boot/include/linux/mtd/mtd.h
+@@ -95,6 +95,9 @@ struct mtd_info {
+       int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t 
*retlen, u_char *buf);
+       int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t 
*retlen, const u_char *buf);
+ 
++      int (*read_otp) (struct mtd_info *mtd, loff_t from, size_t len, size_t 
*retlen, u_char *buf);
++      int (*write_otp) (struct mtd_info *mtd, loff_t to, size_t len, size_t 
*retlen, const u_char *buf);
++
+       /*
+        * Methods to access the protection register area, present in some
+        * flash devices. The user data is one time programmable but the
+Index: u-boot/include/linux/mtd/nand.h
+===================================================================
+--- u-boot.orig/include/linux/mtd/nand.h
++++ u-boot/include/linux/mtd/nand.h
+@@ -307,6 +307,10 @@ struct nand_chip {
+       void            (*enable_hwecc)(struct mtd_info *mtd, int mode);
+       void            (*erase_cmd)(struct mtd_info *mtd, int page);
+       int             (*scan_bbt)(struct mtd_info *mtd);
++      int             (*read_otp)(struct mtd_info *mtd, loff_t from,
++                          size_t len, size_t *retlen, u_char *buf);
++        int           (*write_otp) (struct mtd_info *mtd, loff_t to,
++                          size_t len, size_t *retlen, const u_char *buf);
+       int             eccmode;
+       int             eccsize;
+       int             eccbytes;




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2007-04-18 07:43:06 +0200 (Wed, 18 Apr 2007)
New Revision: 1791

Added:
   trunk/src/target/u-boot/patches/unbusy-i2c.patch
Log:
board/neo1973/neo1973.c: added logic to detect pending PMU interrupts
board/neo1973/neo1973.c (neo1973_new_second, neo1973_on_key_pressed): only poll
  PMU if there is a pending interrupt
board/neo1973/pcf50606.c (pcf50606_initial_regs): cleared (unmasked) SECONDM in
  INT1M



Added: trunk/src/target/u-boot/patches/unbusy-i2c.patch
===================================================================
--- trunk/src/target/u-boot/patches/unbusy-i2c.patch    2007-04-18 03:37:33 UTC 
(rev 1790)
+++ trunk/src/target/u-boot/patches/unbusy-i2c.patch    2007-04-18 05:43:06 UTC 
(rev 1791)
@@ -0,0 +1,92 @@
+board/neo1973/neo1973.c: added logic to detect pending PMU interrupts
+board/neo1973/neo1973.c (neo1973_new_second, neo1973_on_key_pressed): only poll
+  PMU if there is a pending interrupt
+board/neo1973/pcf50606.c (pcf50606_initial_regs): cleared (unmasked) SECONDM in
+  INT1M
+
+- Werner Almesberger <[EMAIL PROTECTED]>
+
+Index: u-boot/board/neo1973/neo1973.c
+===================================================================
+--- u-boot.orig/board/neo1973/neo1973.c
++++ u-boot/board/neo1973/neo1973.c
+@@ -374,19 +374,64 @@ void neo1973_vibrator(int on)
+ #endif
+ }
+ 
++static int pwr_int_pending(void)
++{
++      S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
++
++#if defined(CONFIG_ARCH_GTA01B_v4)
++      /*
++       * @@@FIXME: Untested and probably doesn't work. We have to check for
++       * the presence of EINT9 instead.
++       */
++      return !(gpio->GPGDAT & (1 << 1));      /* EINT9/GPG1 */
++#else
++      return !(gpio->GPGDAT & (1 << 8));      /* EINT16/GPG8 */
++#endif /* !CONFIG_ARCH_GTA01B_v4 */
++}
++
++static int have_int1(uint8_t mask)
++{
++      static uint8_t pending = 0;
++
++      if (pwr_int_pending()) {
++              /*
++               * We retrieve all interupts, so that we clear any stray ones
++               * in INT2 and INT3.
++               */
++              uint8_t int1,int2,int3;
++
++              int1 = pcf50606_reg_read(PCF50606_REG_INT1);
++              int2 = pcf50606_reg_read(PCF50606_REG_INT2);
++              int3 = pcf50606_reg_read(PCF50606_REG_INT3);
++              pending |= int1;
++      }
++      if (!(pending & mask))
++              return 0;
++      pending &= ~mask;
++      return 1;
++}
++
+ int neo1973_new_second(void)
+ {
+-      return pcf50606_reg_read(PCF50606_REG_INT1) & PCF50606_INT1_SECOND;
++      return have_int1(PCF50606_INT1_SECOND);
+ }
+ 
+ int neo1973_on_key_pressed(void)
+ {
+-      return !(pcf50606_reg_read(PCF50606_REG_OOCS) & PFC50606_OOCS_ONKEY);
++      static int pressed = -1;
++
++      if (pressed == -1 ||
++          have_int1(PCF50606_INT1_ONKEYF | PCF50606_INT1_ONKEYR)) {
++              pressed = !(pcf50606_reg_read(PCF50606_REG_OOCS) &
++                   PFC50606_OOCS_ONKEY);
++}
++      return pressed;
+ }
+ 
+ int neo1973_aux_key_pressed(void)
+ {
+       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
++
+       if (gpio->GPFDAT & (1 << 6))
+               return 0;
+       return 1;
+Index: u-boot/board/neo1973/pcf50606.c
+===================================================================
+--- u-boot.orig/board/neo1973/pcf50606.c
++++ u-boot/board/neo1973/pcf50606.c
+@@ -6,7 +6,7 @@
+ const u_int8_t pcf50606_initial_regs[__NUM_PCF50606_REGS] = {
+       [PCF50606_REG_OOCS]     = 0x00,
+       /* gap */
+-      [PCF50606_REG_INT1M]    = PCF50606_INT1_SECOND,
++      [PCF50606_REG_INT1M]    = 0x00,
+       [PCF50606_REG_INT2M]    = 0x00,
+       [PCF50606_REG_INT3M]    = PCF50606_INT3_TSCPRES,
+       [PCF50606_REG_OOCC1]    = PCF50606_OOCC1_RTCWAK |




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to