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. r3693 - in
      trunk/src/target/OM-2007.2/applications/openmoko-dialer2: .
      src/phone-kit ([EMAIL PROTECTED])
   2. r3694 - in
      trunk/src/target/OM-2007.2/applications/openmoko-dialer2: .
      src/phone-kit ([EMAIL PROTECTED])
   3. r3695 - in
      trunk/src/target/OM-2007.2/applications/openmoko-today2: .        src
      ([EMAIL PROTECTED])
   4. r3696 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   5. r3697 - developers/john_lee/toolkit ([EMAIL PROTECTED])
   6. r3698 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: chris
Date: 2007-12-19 16:30:17 +0100 (Wed, 19 Dec 2007)
New Revision: 3693

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
Log:
        * src/phone-kit/moko-sms.c: (moko_sms_dispose),
        (stop_notify_timeout), (update_notification), (moko_sms_init):
        Add tone/vibration notification


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-12-19 14:16:27 UTC (rev 3692)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-12-19 15:30:17 UTC (rev 3693)
@@ -1,5 +1,11 @@
 2007-12-19  Chris Lord  <[EMAIL PROTECTED]>
 
+       * src/phone-kit/moko-sms.c: (moko_sms_dispose),
+       (stop_notify_timeout), (update_notification), (moko_sms_init):
+       Add tone/vibration notification
+
+2007-12-19  Chris Lord  <[EMAIL PROTECTED]>
+
        * configure.ac:
        Add AC_GNU_SOURCE for basename(), add libnotify
 

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
   2007-12-19 14:16:27 UTC (rev 3692)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
   2007-12-19 15:30:17 UTC (rev 3693)
@@ -33,6 +33,7 @@
 #include "moko-sms.h"
 #include "moko-network.h"
 #include "moko-listener.h"
+#include "moko-notify.h"
 
 static void
 listener_interface_init (gpointer g_iface, gpointer iface_data);
@@ -70,6 +71,7 @@
   
   GList              *unread_uids;
   NotifyNotification *notification;
+  MokoNotify         *notify;
 };
 
 static void start_handling_sms (MokoSms *sms);
@@ -148,6 +150,8 @@
 
   sms = MOKO_SMS (object);
   priv = sms->priv;
+  
+  while (g_source_remove_by_user_data (object)) moko_notify_stop 
(priv->notify);
 
   if (priv->sms_store) {
     g_object_unref (priv->sms_store);
@@ -406,6 +410,14 @@
   iface->on_send_sms = on_send_sms;
 }
 
+static gboolean
+stop_notify_timeout (MokoSms *sms)
+{
+  MokoSmsPrivate *priv = sms->priv;
+  moko_notify_stop (priv->notify);
+  return FALSE;
+}
+
 static void
 update_notification (MokoSms *sms, gboolean show)
 {
@@ -423,7 +435,11 @@
   g_free (body);
   
   /* Show notification */
-  if (show) notify_notification_show (priv->notification, NULL);
+  if (show) {
+    notify_notification_show (priv->notification, NULL);
+    moko_notify_start (priv->notify);
+    g_timeout_add (1000, (GSourceFunc)stop_notify_timeout, sms);
+  }
 }
 
 static void
@@ -548,6 +564,7 @@
                                                 "",
                                                 MOKO_STOCK_SMS_NEW,
                                                 NULL);
+  priv->notify = moko_notify_get_default ();
 
   /* Get the SMS note store */
   priv->sms_store = jana_ecal_store_new (JANA_COMPONENT_NOTE);




--- End Message ---
--- Begin Message ---
Author: chris
Date: 2007-12-19 16:46:11 +0100 (Wed, 19 Dec 2007)
New Revision: 3694

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
Log:
        * src/phone-kit/moko-sms.c: (note_added_cb), (note_modified_cb):
        Don't notify on sent messages


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-12-19 15:30:17 UTC (rev 3693)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-12-19 15:46:11 UTC (rev 3694)
@@ -1,5 +1,10 @@
 2007-12-19  Chris Lord  <[EMAIL PROTECTED]>
 
+       * src/phone-kit/moko-sms.c: (note_added_cb), (note_modified_cb):
+       Don't notify on sent messages
+
+2007-12-19  Chris Lord  <[EMAIL PROTECTED]>
+
        * src/phone-kit/moko-sms.c: (moko_sms_dispose),
        (stop_notify_timeout), (update_notification), (moko_sms_init):
        Add tone/vibration notification

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
   2007-12-19 15:30:17 UTC (rev 3693)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
   2007-12-19 15:46:11 UTC (rev 3694)
@@ -453,7 +453,9 @@
     
     if (!comp) continue;
     
-    if (!jana_utils_component_has_category (comp, "Read")) {
+    if ((!jana_utils_component_has_category (comp, "Read")) &&
+       (!(jana_utils_component_has_category (comp, "Sending") ||
+        jana_utils_component_has_category (comp, "Sent")))) {
       gchar *uid = jana_component_get_uid (comp);
       priv->unread_uids = g_list_prepend (priv->unread_uids, uid);
       update = TRUE;
@@ -486,7 +488,9 @@
         priv->unread_uids = g_list_delete_link (priv->unread_uids, found);
         update = TRUE;
       }
-    } else if (!jana_utils_component_has_category (comp, "Read")) {
+    } else if ((!jana_utils_component_has_category (comp, "Read")) &&
+       (!(jana_utils_component_has_category (comp, "Sending") ||
+        jana_utils_component_has_category (comp, "Sent")))) {
       priv->unread_uids = g_list_prepend (priv->unread_uids, uid);
       update = TRUE;
     } else {




--- End Message ---
--- Begin Message ---
Author: chris
Date: 2007-12-19 18:12:19 +0100 (Wed, 19 Dec 2007)
New Revision: 3695

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog
   
trunk/src/target/OM-2007.2/applications/openmoko-today2/src/today-pim-journal.c
Log:
        * src/today-pim-journal.c: (today_pim_journal_box_new):
        Attach the messages app launcher to the correct box


Modified: trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog   
2007-12-19 15:46:11 UTC (rev 3694)
+++ trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog   
2007-12-19 17:12:19 UTC (rev 3695)
@@ -1,3 +1,8 @@
+2007-12-19  Chris Lord  <[EMAIL PROTECTED]>
+
+       * src/today-pim-journal.c: (today_pim_journal_box_new):
+        Attach the messages app launcher to the correct box
+
 2007-12-06  Chris Lord  <[EMAIL PROTECTED]>
 
        * src/today-main.c: (set_time_idle), (clock_clicked_cb),

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-today2/src/today-pim-journal.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-today2/src/today-pim-journal.c 
    2007-12-19 15:46:11 UTC (rev 3694)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-today2/src/today-pim-journal.c 
    2007-12-19 17:12:19 UTC (rev 3695)
@@ -268,7 +268,7 @@
        gtk_container_add (GTK_CONTAINER (data->unread_messages_box), hbox);
        gtk_widget_add_events (data->unread_messages_box,
                GDK_BUTTON_PRESS_MASK);
-       g_signal_connect (data->missed_calls_box, "button-press-event",
+       g_signal_connect (data->unread_messages_box, "button-press-event",
                G_CALLBACK (unread_messages_button_press_cb), data);
 
        /* Events box */




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-19 19:21:26 +0100 (Wed, 19 Dec 2007)
New Revision: 3696

Modified:
   branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch
Log:
move kconfig and makefile hunks to correct location


Modified: branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch  2007-12-19 
17:12:19 UTC (rev 3695)
+++ branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch  2007-12-19 
18:21:26 UTC (rev 3696)
@@ -722,26 +722,34 @@
 ===================================================================
 --- linux-2.6.orig/drivers/spi/Kconfig
 +++ linux-2.6/drivers/spi/Kconfig
-@@ -243,5 +243,9 @@
-       help
-         Driver for the tpo JP6K74-AS LCM SPI control interface.
+@@ -242,6 +242,15 @@
+         The control interface is required for display operation, as it
+         controls power management, display timing and gamma calibration.
  
-+config SPI_SLAVE_LIS302DL
++config SPI_LIS302DL
 +      tristate "STmicro LIS302DL 3-axis accelerometer"
 +      depends on SPI_MASTER && MACH_NEO1973_GTA02
++      help
++        SPI driver for the STmicro LIS302DL 3-axis accelerometer.
 +
- endmenu # "SPI support"
- 
++        The userspece interface is a 3-axis (X/Y/Z) relative movement
++        Linux input device, reporting REL_[XYZ] events.
++
+ #
+ # Add new SPI protocol masters in alphabetical order above this line
+ #
 Index: linux-2.6/drivers/spi/Makefile
 ===================================================================
 --- linux-2.6.orig/drivers/spi/Makefile
 +++ linux-2.6/drivers/spi/Makefile
-@@ -40,4 +40,5 @@
+@@ -34,6 +34,7 @@
+ obj-$(CONFIG_SPI_SPIDEV)      += spidev.o
+ obj-$(CONFIG_SPI_TLE62X0)     += tle62x0.o
+ obj-$(CONFIG_SPI_JBT6K74)     += jbt6k74.o
++obj-$(CONFIG_SPI_LIS302DL)    += lis302dl.o
+ #     ... add above this line ...
  
- # SPI slave drivers (protocol for that link)
- obj-$(CONFIG_SPI_SLAVE_JBT6K74)               += jbt6k74.o
-+obj-$(CONFIG_SPI_SLAVE_LIS302DL)      += lis302dl.o
- #     ... add above this line ...
+ # SPI slave controller drivers (upstream link)
 Index: linux-2.6/include/linux/lis302dl.h
 ===================================================================
 --- /dev/null




--- End Message ---
--- Begin Message ---
Author: john_lee
Date: 2007-12-20 08:04:09 +0100 (Thu, 20 Dec 2007)
New Revision: 3697

Modified:
   developers/john_lee/toolkit/README
Log:
Update README to reflact source code path change and om-conf new
feature.



Modified: developers/john_lee/toolkit/README
===================================================================
--- developers/john_lee/toolkit/README  2007-12-19 18:21:26 UTC (rev 3696)
+++ developers/john_lee/toolkit/README  2007-12-20 07:04:09 UTC (rev 3697)
@@ -19,7 +19,7 @@
 
 In your home directory:
 
-$ cp -r /usr/local/openmoko/arm/share/openmoko-sample2 ~/
+$ cp -r /usr/local/openmoko/source/openmoko-sample2 ~/
 $ . /usr/local/openmoko/arm/setup-env
 $ om-conf openmoko-sample2
 $ om-make-ipkg openmoko-sample2
@@ -34,16 +34,16 @@
 User configuraion
 =================
 
-May edit variables in scripts/script-env
+  * May edit variables in scripts/script-env
 
-If the application need extra configure or autoreconf arguments, they
-could be specified when executing `conf.sh':
+  * If the application need extra configure or autoreconf arguments,
+    they could be specified when executing `conf.sh':
 
-$ EXTRA_OECONF=" --without-foo --enable-bar" om-conf <myapp>
+    $ om-conf <myapp> --without-foo --enable-bar
 
-Can specify your own ipkg control file, if you know what you're doing:
+  * Can specify your own ipkg control file, if you know what you're doing:
 
-$ om-make-ipkg myapp myapp_control
+    $ om-make-ipkg myapp myapp_control
 
 
 Document




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-12-20 11:40:07 +0100 (Thu, 20 Dec 2007)
New Revision: 3698

Modified:
   branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch
Log:
s3c_mci:
* add support for unaligned and non-modulo-four transfers
* remove cmd2str/err2str functions, as requested by Pierre Ossmann
* remove include of linux/mmc/mmc.h, as requested by Pierre Ossmann
* cosmetic cleanup (remove {} in one-line control blocks)
* add 'do_dma' member to platform_data
* use DMACH_SDI instead of old, bogus S3CMCI_DMA
* use host->dma instead of hard-coded dma channel


Modified: branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch   2007-12-20 
07:04:09 UTC (rev 3697)
+++ branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch   2007-12-20 
10:40:07 UTC (rev 3698)
@@ -16,15 +16,17 @@
 ===================================================================
 --- linux-2.6.orig/include/asm-arm/arch-s3c2410/regs-sdi.h
 +++ linux-2.6/include/asm-arm/arch-s3c2410/regs-sdi.h
-@@ -28,9 +28,15 @@
+@@ -28,9 +28,17 @@
  #define S3C2410_SDIDCNT               (0x30)
  #define S3C2410_SDIDSTA               (0x34)
  #define S3C2410_SDIFSTA               (0x38)
 +
  #define S3C2410_SDIDATA               (0x3C)
++#define S3C2410_SDIDATA_BYTE          (0x3C)
  #define S3C2410_SDIIMSK               (0x40)
  
 +#define S3C2440_SDIDATA               (0x40)
++#define S3C2440_SDIDATA_BYTE          (0x48)
 +#define S3C2440_SDIIMSK               (0x3C)
 +
 +#define S3C2440_SDICON_SDRESET        (1<<8)
@@ -32,7 +34,7 @@
  #define S3C2410_SDICON_BYTEORDER      (1<<4)
  #define S3C2410_SDICON_SDIOIRQ        (1<<3)
  #define S3C2410_SDICON_RWAITEN        (1<<2)
-@@ -42,7 +48,8 @@
+@@ -42,7 +50,8 @@
  #define S3C2410_SDICMDCON_LONGRSP     (1<<10)
  #define S3C2410_SDICMDCON_WAITRSP     (1<<9)
  #define S3C2410_SDICMDCON_CMDSTART    (1<<8)
@@ -42,7 +44,7 @@
  
  #define S3C2410_SDICMDSTAT_CRCFAIL    (1<<12)
  #define S3C2410_SDICMDSTAT_CMDSENT    (1<<11)
-@@ -51,6 +58,9 @@
+@@ -51,6 +60,9 @@
  #define S3C2410_SDICMDSTAT_XFERING    (1<<8)
  #define S3C2410_SDICMDSTAT_INDEX      (0xff)
  
@@ -52,7 +54,7 @@
  #define S3C2410_SDIDCON_IRQPERIOD     (1<<21)
  #define S3C2410_SDIDCON_TXAFTERRESP   (1<<20)
  #define S3C2410_SDIDCON_RXAFTERCMD    (1<<19)
-@@ -59,6 +69,7 @@
+@@ -59,6 +71,7 @@
  #define S3C2410_SDIDCON_WIDEBUS       (1<<16)
  #define S3C2410_SDIDCON_DMAEN         (1<<15)
  #define S3C2410_SDIDCON_STOP          (1<<14)
@@ -60,7 +62,7 @@
  #define S3C2410_SDIDCON_DATMODE             (3<<12)
  #define S3C2410_SDIDCON_BLKNUM        (0x7ff)
  
-@@ -68,6 +79,7 @@
+@@ -68,6 +81,7 @@
  #define S3C2410_SDIDCON_XFER_RXSTART  (2<<12)
  #define S3C2410_SDIDCON_XFER_TXSTART  (3<<12)
  
@@ -68,7 +70,7 @@
  #define S3C2410_SDIDCNT_BLKNUM_SHIFT  (12)
  
  #define S3C2410_SDIDSTA_RDYWAITREQ    (1<<10)
-@@ -82,10 +94,12 @@
+@@ -82,10 +96,12 @@
  #define S3C2410_SDIDSTA_TXDATAON      (1<<1)
  #define S3C2410_SDIDSTA_RXDATAON      (1<<0)
  
@@ -87,7 +89,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/drivers/mmc/host/s3cmci.c
-@@ -0,0 +1,1409 @@
+@@ -0,0 +1,1389 @@
 +/*
 + *  linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
 + *
@@ -102,7 +104,6 @@
 +#include <linux/module.h>
 +#include <linux/dma-mapping.h>
 +#include <linux/clk.h>
-+#include <linux/mmc/mmc.h>
 +#include <linux/mmc/host.h>
 +#include <linux/platform_device.h>
 +#include <linux/irq.h>
@@ -114,6 +115,7 @@
 +#include <asm/arch/regs-sdi.h>
 +#include <asm/arch/regs-gpio.h>
 +#include <asm/arch/mci.h>
++#include <asm/arch/dma.h>
 +
 +#include "s3cmci.h"
 +
@@ -156,45 +158,6 @@
 +static void s3cmci_reset(struct s3cmci_host *host);
 +
 +#ifdef CONFIG_MMC_DEBUG
-+
-+static char *mmc_cmd2str(int cmd)
-+{
-+      switch (cmd) {
-+      case  0: return "GO_IDLE_STATE";
-+      case  1: return "ALL_SEND_OCR";
-+      case  2: return "ALL_SEND_CID";
-+      case  3: return "ALL_SEND_RELATIVE_ADD";
-+      case  6: return "ACMD: SD_SET_BUSWIDTH";
-+      case  7: return "SEL_DESEL_CARD";
-+      case  9: return "SEND_CSD";
-+      case 10: return "SEND_CID";
-+      case 11: return "READ_UNTIL_STOP";
-+      case 12: return "STOP_TRANSMISSION";
-+      case 13: return "SEND_STATUS";
-+      case 15: return "GO_INACTIVE_STATE";
-+      case 16: return "SET_BLOCKLEN";
-+      case 17: return "READ_SINGLE_BLOCK";
-+      case 18: return "READ_MULTIPLE_BLOCK";
-+      case 24: return "WRITE_SINGLE_BLOCK";
-+      case 25: return "WRITE_MULTIPLE_BLOCK";
-+      case 41: return "ACMD: SD_APP_OP_COND";
-+      case 55: return "APP_CMD";
-+      default: return "UNKNOWN";
-+      }
-+}
-+
-+static char *mmc_err2str(int err)
-+{
-+      switch (err) {
-+      case 0:                 return "OK";
-+      case -ETIMEDOUT:        return "TIMEOUT";
-+      case -EILSEQ:           return "BADCRC";
-+      case -EINVAL:           return "EINVAL";
-+      case -ENOMEDIUM:        return "NOMEDIUM";
-+      default:                return "UNKNOWN";
-+      }
-+}
-+
 +static inline void dbg_dumpregs(struct s3cmci_host *host, char *prefix)
 +{
 +      u32 con, pre, cmdarg, cmdcon, cmdsta, r0, r1, r2, r3, timer, bsize;
@@ -236,9 +199,9 @@
 +                                                              int stop)
 +{
 +      snprintf(host->dbgmsg_cmd, 300,
-+              "#%u%s op:%s(%i) arg:0x%08x flags:0x08%x retries:%u",
-+              host->ccnt, (stop?" (STOP)":""), mmc_cmd2str(cmd->opcode),
-+              cmd->opcode, cmd->arg, cmd->flags, cmd->retries);
++              "#%u%s op:CMD%d arg:0x%08x flags:0x08%x retries:%u",
++              host->ccnt, (stop?" (STOP)":""), cmd->opcode,
++              cmd->arg, cmd->flags, cmd->retries);
 +
 +      if (cmd->data) {
 +              snprintf(host->dbgmsg_dat, 300,
@@ -259,29 +222,24 @@
 +      if (!cmd)
 +              return;
 +
-+      if (cmd->error == 0) {
-+
++      if (cmd->error == 0)
 +              dbg(host, dbglvl, "CMD[OK] %s R0:0x%08x\n",
 +                      host->dbgmsg_cmd, cmd->resp[0]);
-+      } else {
-+              dbg(host, dbglvl, "CMD[%s] %s Status:%s\n",
-+                      mmc_err2str(cmd->error), host->dbgmsg_cmd,
-+                      host->status);
-+      }
++      else
++              dbg(host, dbglvl, "CMD[FAIL(%d)] %s Status:%s\n",
++                      cmd->error, host->dbgmsg_cmd, host->status);
 +
 +      if (!cmd->data)
 +              return;
 +
-+      if (cmd->data->error == 0) {
-+              dbg(host, dbglvl, "DAT[%s] %s\n",
-+                      mmc_err2str(cmd->data->error), host->dbgmsg_dat);
-+      } else {
-+              dbg(host, dbglvl, "DAT[%s] %s DCNT:0x%08x\n",
-+                      mmc_err2str(cmd->data->error), host->dbgmsg_dat,
++      if (cmd->data->error == 0)
++              dbg(host, dbglvl, "DAT[OK] %s\n", host->dbgmsg_dat);
++      else
++              dbg(host, dbglvl, "DAT[FAIL(%d)] %s DCNT:0x%08x\n",
++                      cmd->data->error, host->dbgmsg_dat,
 +                      readl(host->base + S3C2410_SDIDCNT));
-+      }
 +}
-+#endif
++#endif /* CONFIG_MMC_DEBUG */
 +
 +static inline u32 enable_imask(struct s3cmci_host *host, u32 imask)
 +{
@@ -313,7 +271,7 @@
 +}
 +
 +static inline int get_data_buffer(struct s3cmci_host *host,
-+                                u32 *words, u32 **pointer)
++                                u32 *bytes, u8 **pointer)
 +{
 +      struct scatterlist *sg;
 +
@@ -330,7 +288,7 @@
 +      }
 +      sg = &host->mrq->data->sg[host->pio_sgptr];
 +
-+      *words = sg->length >> 2;
++      *bytes = sg->length;
 +      *pointer = page_address(sg_page(sg)) + sg->offset;
 +
 +      host->pio_sgptr++;
@@ -341,15 +299,15 @@
 +      return 0;
 +}
 +
-+#define FIFO_FILL(host) ((readl(host->base + S3C2410_SDIFSTA) &       \
-+                              S3C2410_SDIFSTA_COUNTMASK) >> 2)
-+#define FIFO_FREE(host) ((63 - (readl(host->base + S3C2410_SDIFSTA)   \
-+                              & S3C2410_SDIFSTA_COUNTMASK)) >> 2)
++#define FIFO_FILL(host) (readl(host->base + S3C2410_SDIFSTA) &        \
++                              S3C2410_SDIFSTA_COUNTMASK)
++#define FIFO_FREE(host) (63 - (readl(host->base + S3C2410_SDIFSTA)    \
++                              & S3C2410_SDIFSTA_COUNTMASK))
 +
 +static inline void do_pio_read(struct s3cmci_host *host)
 +{
 +      int res;
-+      u32 fifo;
++      int fifo;
 +      void __iomem *from_ptr;
 +
 +      /* write real prescaler to host, it might be set slow to fix */
@@ -358,8 +316,8 @@
 +      from_ptr = host->base + host->sdidata;
 +
 +      while ((fifo = FIFO_FILL(host))) {
-+              if (!host->pio_words) {
-+                      res = get_data_buffer(host, &host->pio_words,
++              if (!host->pio_bytes) {
++                      res = get_data_buffer(host, &host->pio_bytes,
 +                                                      &host->pio_ptr);
 +                      if (res) {
 +                              host->pio_active = XFER_NONE;
@@ -371,25 +329,36 @@
 +                      }
 +
 +                      dbg(host, dbg_pio, "pio_read(): new target: "
-+                          "[EMAIL PROTECTED]", host->pio_words, 
host->pio_ptr);
++                          "[EMAIL PROTECTED]", host->pio_bytes, 
host->pio_ptr);
 +              }
 +
 +              dbg(host, dbg_pio, "pio_read(): fifo:[%02i] "
-+                  "buffer:[%03i] dcnt:[%08X]\n", fifo, host->pio_words,
++                  "buffer:[%03i] dcnt:[%08X]\n", fifo, host->pio_bytes,
 +                  readl(host->base + S3C2410_SDIDCNT));
 +
-+              if (fifo > host->pio_words)
-+                      fifo = host->pio_words;
++              if (fifo > host->pio_bytes)
++                      fifo = host->pio_bytes;
 +
-+              host->pio_words -= fifo;
++              host->pio_bytes -= fifo;
 +              host->pio_count += fifo;
 +
-+              while (fifo--)
-+                      *(host->pio_ptr++) = readl(from_ptr);
++              /* we might have an unaligned start of data */
++              while ((unsigned long)host->pio_ptr & 0x03)
++                      *(host->pio_ptr++) = readb(host->base + 
host->sdidata_b);
++
++              /* and a major chunk of data in the middle */
++              for (; fifo >= 4; fifo -=4) {
++                      *(host->pio_ptr) = readl(from_ptr);
++                      host->pio_ptr+= 4;
++              }
++
++              /* as well as some non-modulo-four trailer */
++              while (fifo)
++                      *(host->pio_ptr++) = readb(host->base + 
host->sdidata_b);
 +      }
 +
-+      if (!host->pio_words) {
-+              res = get_data_buffer(host, &host->pio_words, &host->pio_ptr);
++      if (!host->pio_bytes) {
++              res = get_data_buffer(host, &host->pio_bytes, &host->pio_ptr);
 +              if (res) {
 +                      dbg(host, dbg_pio, "pio_read(): "
 +                          "complete (no more buffers).\n");
@@ -407,15 +376,15 @@
 +static inline void do_pio_write(struct s3cmci_host *host)
 +{
 +      int res;
-+      u32 fifo;
++      int fifo;
 +
 +      void __iomem *to_ptr;
 +
 +      to_ptr = host->base + host->sdidata;
 +
 +      while ((fifo = FIFO_FREE(host))) {
-+              if (!host->pio_words) {
-+                      res = get_data_buffer(host, &host->pio_words,
++              if (!host->pio_bytes) {
++                      res = get_data_buffer(host, &host->pio_bytes,
 +                                                      &host->pio_ptr);
 +                      if (res) {
 +                              dbg(host, dbg_pio, "pio_write(): "
@@ -427,18 +396,29 @@
 +
 +                      dbg(host, dbg_pio, "pio_write(): "
 +                              "new source: [EMAIL PROTECTED]",
-+                              host->pio_words, host->pio_ptr);
++                              host->pio_bytes, host->pio_ptr);
 +
 +              }
 +
-+              if (fifo > host->pio_words)
-+                      fifo = host->pio_words;
++              if (fifo > host->pio_bytes)
++                      fifo = host->pio_bytes;
 +
-+              host->pio_words -= fifo;
++              host->pio_bytes -= fifo;
 +              host->pio_count += fifo;
 +
++              /* we might have an unaligned start of data */
++              while ((unsigned long)host->pio_ptr & 0x03)
++                      writeb(*(host->pio_ptr++), host->base + 
host->sdidata_b);
++
++              /* and a major chunk of data in the middle */
++              for (; fifo >= 4; fifo -=4) {
++                      writel(*(host->pio_ptr), to_ptr);
++                      host->pio_ptr += 4;
++              }
++
++              /* as well as some non-modulo-four trailer */
 +              while (fifo--)
-+                      writel(*(host->pio_ptr++), to_ptr);
++                      writeb(*(host->pio_ptr++), host->base + 
host->sdidata_b);
 +      }
 +
 +      enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
@@ -460,9 +440,9 @@
 +              clear_imask(host);
 +              if (host->pio_active != XFER_NONE) {
 +                      dbg(host, dbg_err, "unfinished %s "
-+                              "- pio_count:[%u] pio_words:[%u]\n",
++                              "- pio_count:[%u] pio_bytes:[%u]\n",
 +                              (host->pio_active == XFER_READ)?"read":"write",
-+                              host->pio_count, host->pio_words);
++                              host->pio_count, host->pio_bytes);
 +
 +                      host->mrq->data->error = -EIO;
 +              }
@@ -993,7 +973,7 @@
 +              return -EINVAL;
 +
 +      host->pio_sgptr = 0;
-+      host->pio_words = 0;
++      host->pio_bytes = 0;
 +      host->pio_count = 0;
 +      host->pio_active = rw?XFER_WRITE:XFER_READ;
 +
@@ -1216,6 +1196,7 @@
 +};
 +
 +static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
++      .do_dma         = 0,
 +      .gpio_detect    = 0,
 +      .set_power      = NULL,
 +      .ocr_avail      = MMC_VDD_32_33,
@@ -1250,18 +1231,20 @@
 +              host->is2440    = 1;
 +              host->sdiimsk   = S3C2440_SDIIMSK;
 +              host->sdidata   = S3C2440_SDIDATA;
++              host->sdidata_b = S3C2440_SDIDATA_BYTE;
 +              host->clk_div   = 1;
 +      } else {
 +              host->is2440    = 0;
 +              host->sdiimsk   = S3C2410_SDIIMSK;
 +              host->sdidata   = S3C2410_SDIDATA;
++              host->sdidata_b = S3C2410_SDIDATA_BYTE;
 +              host->clk_div   = 2;
 +      }
-+      host->dodma             = 0;
++      host->dodma             = host->pdata->do_dma;
 +      host->complete_what     = COMPLETION_NONE;
 +      host->pio_active        = XFER_NONE;
 +
-+      host->dma               = S3CMCI_DMA;
++      host->dma               = DMACH_SDI;
 +      host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect);
 +      s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ);
 +
@@ -1320,7 +1303,7 @@
 +              s3c2410_gpio_cfgpin(host->pdata->gpio_wprotect,
 +                                  S3C2410_GPIO_INPUT);
 +
-+      if (s3c2410_dma_request(S3CMCI_DMA, &s3cmci_dma_client, NULL)) {
++      if (s3c2410_dma_request(host->dma, &s3cmci_dma_client, NULL)) {
 +              dev_err(&pdev->dev, "unable to get DMA channel.\n");
 +              ret = -EBUSY;
 +              goto probe_free_irq_cd;
@@ -1403,7 +1386,7 @@
 +      mmc_remove_host(mmc);
 +      clk_disable(host->clk);
 +      clk_put(host->clk);
-+      s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client);
++      s3c2410_dma_free(host->dma, &s3cmci_dma_client);
 +      free_irq(host->irq_cd, host);
 +      free_irq(host->irq, host);
 +      iounmap(host->base);
@@ -1496,12 +1479,11 @@
 +MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
 +MODULE_LICENSE("GPL");
 +MODULE_AUTHOR("Thomas Kleffel <[EMAIL PROTECTED]>");
-+
 Index: linux-2.6/drivers/mmc/host/s3cmci.h
 ===================================================================
 --- /dev/null
 +++ linux-2.6/drivers/mmc/host/s3cmci.h
-@@ -0,0 +1,71 @@
+@@ -0,0 +1,69 @@
 +/*
 + *  linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
 + *
@@ -1512,9 +1494,6 @@
 + * published by the Free Software Foundation.
 + */
 +
-+/* FIXME: DMA Resource management ?! */
-+#define S3CMCI_DMA 0
-+
 +enum s3cmci_waitfor {
 +      COMPLETION_NONE,
 +      COMPLETION_FINALIZE,
@@ -1543,6 +1522,7 @@
 +      int                     is2440;
 +      unsigned                sdiimsk;
 +      unsigned                sdidata;
++      unsigned                sdidata_b;
 +      int                     dodma;
 +
 +      int                     dmatogo;
@@ -1556,9 +1536,9 @@
 +      int                     dma_complete;
 +
 +      u32                     pio_sgptr;
-+      u32                     pio_words;
++      u32                     pio_bytes;
 +      u32                     pio_count;
-+      u32                     *pio_ptr;
++      u8                      *pio_ptr;
 +#define XFER_NONE 0
 +#define XFER_READ 1
 +#define XFER_WRITE 2




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

Reply via email to