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. r3796 - in
      trunk/src/target/OM-2007.2/applications/openmoko-messages2: . src
      ([EMAIL PROTECTED])
   2. r3797 - in
      trunk/src/target/OM-2007.2/applications/openmoko-messages2: .
      data ([EMAIL PROTECTED])
   3. r3798 - trunk/src/target/u-boot/patches
      ([EMAIL PROTECTED])
   4. r3799 - trunk/src/target/kernel/patches ([EMAIL PROTECTED])
   5. r3800 - trunk/src/target/kernel/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: chris
Date: 2008-01-09 16:07:31 +0100 (Wed, 09 Jan 2008)
New Revision: 3796

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-utils.c
Log:
        * src/sms-utils.c: (sms_select_contact):
        Clear current search/group and convert to filter iter before selecting
        contact


Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-01-09 14:38:23 UTC (rev 3795)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-01-09 15:07:31 UTC (rev 3796)
@@ -1,5 +1,11 @@
 2008-01-09  Chris Lord  <[EMAIL PROTECTED]>
 
+       * src/sms-utils.c: (sms_select_contact):
+       Clear current search/group and convert to filter iter before selecting
+       contact
+
+2008-01-09  Chris Lord  <[EMAIL PROTECTED]>
+
        * configure.ac:
        * data/Makefile.am:
        * data/org.openmoko.OpenmokoMessages2.service.in:

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-utils.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-utils.c  
2008-01-09 14:38:23 UTC (rev 3795)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-utils.c  
2008-01-09 15:07:31 UTC (rev 3796)
@@ -19,6 +19,8 @@
 
 #include "sms-contacts.h"
 #include "sms-utils.h"
+#include <string.h>
+#include <libmokoui2/moko-search-bar.h>
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
@@ -45,10 +47,32 @@
                        &iter, COL_UID, &iter_uid, -1);
                
                if (iter_uid && (strcmp (uid, iter_uid) == 0)) {
+                       GtkTreeIter filter_iter;
+                       
+                       /* Reset filter */
+                       if (moko_search_bar_search_visible (MOKO_SEARCH_BAR (
+                           data->contacts_search))) {
+                               gtk_entry_set_text (moko_search_bar_get_entry (
+                                       MOKO_SEARCH_BAR(data->contacts_search)),
+                                       "");
+                       } else {
+                               gtk_combo_box_set_active (
+                                       moko_search_bar_get_combo_box (
+                                       MOKO_SEARCH_BAR(data->contacts_search)),
+                                       0);
+                       }
+                       gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (
+                               data->contacts_filter));
+                       
+                       gtk_tree_model_filter_convert_child_iter_to_iter (
+                               GTK_TREE_MODEL_FILTER (data->contacts_filter),
+                               &filter_iter, &iter);
+                       
                        g_free (iter_uid);
                        selection = gtk_tree_view_get_selection (
                                GTK_TREE_VIEW (data->contacts_treeview));
-                       gtk_tree_selection_select_iter (selection, &iter);
+                       gtk_tree_selection_select_iter (
+                               selection, &filter_iter);
                        return TRUE;
                }
                




--- End Message ---
--- Begin Message ---
Author: chris
Date: 2008-01-09 17:16:51 +0100 (Wed, 09 Jan 2008)
New Revision: 3797

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
   
trunk/src/target/OM-2007.2/applications/openmoko-messages2/data/org.openmoko.OpenmokoMessages2.service.in
Log:
        * data/org.openmoko.OpenmokoMessages2.service.in:
        Correct service name


Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-01-09 15:07:31 UTC (rev 3796)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-01-09 16:16:51 UTC (rev 3797)
@@ -1,5 +1,10 @@
 2008-01-09  Chris Lord  <[EMAIL PROTECTED]>
 
+       * data/org.openmoko.OpenmokoMessages2.service.in:
+       Correct service name
+
+2008-01-09  Chris Lord  <[EMAIL PROTECTED]>
+
        * src/sms-utils.c: (sms_select_contact):
        Clear current search/group and convert to filter iter before selecting
        contact

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/data/org.openmoko.OpenmokoMessages2.service.in
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/data/org.openmoko.OpenmokoMessages2.service.in
   2008-01-09 15:07:31 UTC (rev 3796)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/data/org.openmoko.OpenmokoMessages2.service.in
   2008-01-09 16:16:51 UTC (rev 3797)
@@ -1,3 +1,3 @@
 [D-BUS Service]
-Name=org.openmoko.openmoko-messages2
+Name=org.openmoko.OpenmokoMessages2
 [EMAIL PROTECTED]@/openmoko-messages




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2008-01-09 20:15:01 +0100 (Wed, 09 Jan 2008)
New Revision: 3798

Removed:
   trunk/src/target/u-boot/patches/nand-read_write_oob.patch
   trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch
   trunk/src/target/u-boot/patches/uboot-serial_terminal.patch
Modified:
   trunk/src/target/u-boot/patches/series
Log:
remove three patches that have been merged mainline


Deleted: trunk/src/target/u-boot/patches/nand-read_write_oob.patch
===================================================================
--- trunk/src/target/u-boot/patches/nand-read_write_oob.patch   2008-01-09 
16:16:51 UTC (rev 3797)
+++ trunk/src/target/u-boot/patches/nand-read_write_oob.patch   2008-01-09 
19:15:01 UTC (rev 3798)
@@ -1,23 +0,0 @@
-Re-introduce the 'nand read.oob' and 'nand write.oob' commands
-that used to exist with the legacy NAND code
-
-Signed-off-by: Harald Welte <[EMAIL PROTECTED]>
-Index: u-boot/common/cmd_nand.c
-===================================================================
---- u-boot.orig/common/cmd_nand.c
-+++ u-boot/common/cmd_nand.c
-@@ -343,6 +343,14 @@
-                               opts.quiet      = quiet;
-                               ret = nand_write_opts(nand, &opts);
-                       }
-+              } else if (s != NULL && !strcmp(s, ".oob")) {
-+                      /* read out-of-band data */
-+                      if (read)
-+                              ret = nand->read_oob(nand, off, size, &size,
-+                                                   (u_char *) addr);
-+                      else
-+                              ret = nand->write_oob(nand, off, size, &size, 
-+                                                    (u_char *) addr);
-               } else {
-                       if (read)
-                               ret = nand_read(nand, off, &size, (u_char 
*)addr);

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2008-01-09 16:16:51 UTC (rev 
3797)
+++ trunk/src/target/u-boot/patches/series      2008-01-09 19:15:01 UTC (rev 
3798)
@@ -4,9 +4,6 @@
 
 # those we want to get mainline
 uboot-strtoul.patch
-uboot-cramfs_but_no_jffs2.patch
-nand-read_write_oob.patch
-uboot-serial_terminal.patch
 uboot-arm920t-gd_in_irq.patch
 uboot-arm920_s3c2410_irq_demux.patch
 uboot-s3c2410-nand.patch

Deleted: trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch     
2008-01-09 16:16:51 UTC (rev 3797)
+++ trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch     
2008-01-09 19:15:01 UTC (rev 3798)
@@ -1,41 +0,0 @@
-Fix building with CRAMFS but not JFFS2 support
-
-Signed-off-by: Harald Welte <[EMAIL PROTECTED]>
-
-Index: u-boot/fs/cramfs/cramfs.c
-===================================================================
---- u-boot.orig/fs/cramfs/cramfs.c     2007-02-17 11:46:26.000000000 +0100
-+++ u-boot/fs/cramfs/cramfs.c  2007-02-17 11:54:36.000000000 +0100
-@@ -27,7 +27,7 @@
- #include <common.h>
- #include <malloc.h>
- 
--#if defined(CONFIG_CMD_JFFS2)
-+#if defined(CONFIG_CMD_CRAMFS)
- 
- #include <asm/byteorder.h>
- #include <linux/stat.h>
-Index: u-boot/common/cmd_jffs2.c
-===================================================================
---- u-boot.orig/common/cmd_jffs2.c     2007-02-17 11:47:51.000000000 +0100
-+++ u-boot/common/cmd_jffs2.c  2007-02-17 14:08:25.000000000 +0100
-@@ -170,10 +170,19 @@
- static struct mtd_device *current_dev = NULL;
- static u8 current_partnum = 0;
- 
-+#if defined(CONFIG_CMD_CRAMFS)
- extern int cramfs_check (struct part_info *info);
- extern int cramfs_load (char *loadoffset, struct part_info *info, char 
*filename);
- extern int cramfs_ls (struct part_info *info, char *filename);
- extern int cramfs_info (struct part_info *info);
-+#else
-+/* defining empty macros for function names is ugly but avoids ifdef clutter
-+ * all over the code */
-+#define cramfs_check(x)               (0)
-+#define cramfs_load(x,y,z)    (-1)
-+#define cramfs_ls(x,y)                (0)
-+#define cramfs_info(x)                (0)
-+#endif
- 
- static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int 
part_num);
- 

Deleted: trunk/src/target/u-boot/patches/uboot-serial_terminal.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-serial_terminal.patch 2008-01-09 
16:16:51 UTC (rev 3797)
+++ trunk/src/target/u-boot/patches/uboot-serial_terminal.patch 2008-01-09 
19:15:01 UTC (rev 3798)
@@ -1,134 +0,0 @@
-This patch adds a 'cu' like serial terminal command to u-boot
-using which you can access other serial ports from the system console.
-
-Index: u-boot/common/Makefile
-===================================================================
---- u-boot.orig/common/Makefile
-+++ u-boot/common/Makefile
-@@ -86,6 +86,7 @@
- COBJS-y += cmd_sata.o
- COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
- COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
-+COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
- COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
- COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
- COBJS-y += cmd_vfd.o
-Index: u-boot/common/cmd_terminal.c
-===================================================================
---- /dev/null
-+++ u-boot/common/cmd_terminal.c
-@@ -0,0 +1,102 @@
-+/*
-+ * (C) Copyright 2007 OpenMoko, Inc.
-+ * Written by Harald Welte <[EMAIL PROTECTED]>
-+ *
-+ * See file CREDITS for list of people who contributed to this
-+ * project.
-+ *
-+ * 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
-+ */
-+
-+/*
-+ * Boot support
-+ */
-+#include <common.h>
-+#include <command.h>
-+#include <devices.h>
-+
-+#if defined(CONFIG_CMD_TERMINAL)
-+
-+int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
-+{
-+      int i, l;
-+      int last_tilde = 0;
-+      device_t *dev = NULL;
-+
-+      if (argc < 1)
-+              return -1;
-+
-+      /* Scan for selected output/input device */
-+      for (i = 1; i <= ListNumItems (devlist); i++) {
-+              device_t *tmp = ListGetPtrToItem (devlist, i);
-+              if (!strcmp(tmp->name, argv[1])) {
-+                      dev = tmp;
-+                      break;
-+              }
-+      }
-+      if (!dev)
-+              return -1;
-+
-+      serial_reinit_all();
-+      printf("Entering terminal mode for port %s\n", dev->name);
-+      puts("Use '~.' to leave the terminal and get back to u-boot\n");
-+
-+      while (1) {
-+              int c;
-+
-+              /* read from console and display on serial port */
-+              if (stdio_devices[0]->tstc()) {
-+                      c = stdio_devices[0]->getc();
-+                      if (last_tilde == 1) {
-+                              if (c == '.') {
-+                                      putc(c);
-+                                      putc('\n');
-+                                      break;
-+                              } else {
-+                                      last_tilde = 0;
-+                                      /* write the delayed tilde */
-+                                      dev->putc('~');
-+                                      /* fall-through to print current
-+                                       * character */
-+                              }
-+                      }
-+                      if (c == '~') {
-+                              last_tilde = 1;
-+                              puts("[u-boot]");
-+                              putc(c);
-+                      }
-+                      dev->putc(c);
-+              }
-+
-+              /* read from serial port and display on console */
-+              if (dev->tstc()) {
-+                      c = dev->getc();
-+                      putc(c);
-+              }
-+      }
-+      return 0;
-+}
-+
-+
-+/***************************************************/
-+
-+U_BOOT_CMD(
-+      terminal,       3,      1,      do_terminal,
-+      "terminal - start terminal emulator\n",
-+      ""
-+);
-+
-+#endif /* CONFIG_CMD_TERMINAL */
-Index: u-boot/include/config_cmd_all.h
-===================================================================
---- u-boot.orig/include/config_cmd_all.h
-+++ u-boot/include/config_cmd_all.h
-@@ -73,6 +73,7 @@
- #define CONFIG_CMD_SETGETDCR  /* DCR support on 4xx           */
- #define CONFIG_CMD_SNTP               /* SNTP support                 */
- #define CONFIG_CMD_SPI                /* SPI utility                  */
-+#define CONFIG_CMD_TERMINAL   /* built-in Serial Terminal     */
- #define CONFIG_CMD_UNIVERSE   /* Tundra Universe Support      */
- #define CONFIG_CMD_USB                /* USB Support                  */
- #define CONFIG_CMD_VFD                /* VFD support (TRAB)           */




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-01-09 20:53:26 +0100 (Wed, 09 Jan 2008)
New Revision: 3799

Added:
   trunk/src/target/kernel/patches/gta02-acc.patch
Modified:
   trunk/src/target/kernel/patches/series
Log:
Willie's SPI fixes for the accelerometers. This is the original patch, with a
number of bugs. I'll follow it up with corrections. The reason for splitting it
is to make it easier to show and discuss the changes.

gta02-acc.patch:
- arch/arm/mach-s3c2440/mach-gta02.c (gta02_devices): removed s3c_device_spi0
  and s3c_device_spi1, and replaced them with explicitly registered
  s3c_device_spi_acc
- arch/arm/mach-s3c2440/mach-gta02.c (gta02_spi_acc_set_cs,
  gta02_spi_acc_cfg): replaced with spi_acc_cs, spi_gpio_cfg, and
  s3c_spi_acc_resource
- drivers/spi/lis302dl.c (READ_BIT): it's 0x80, not 0x01
- drivers/spi/lis302dl.c (__reg_read, __reg_write): corrected command structure
- drivers/spi/lis302dl.c (lis302dl_probe): commented out request_irq and
  sysfs_create_group



Added: trunk/src/target/kernel/patches/gta02-acc.patch
===================================================================
--- trunk/src/target/kernel/patches/gta02-acc.patch     2008-01-09 19:15:01 UTC 
(rev 3798)
+++ trunk/src/target/kernel/patches/gta02-acc.patch     2008-01-09 19:53:26 UTC 
(rev 3799)
@@ -0,0 +1,151 @@
+Index: linux-2.6.22.5/arch/arm/mach-s3c2440/mach-gta02.c
+===================================================================
+--- linux-2.6.22.5.orig/arch/arm/mach-s3c2440/mach-gta02.c
++++ linux-2.6.22.5/arch/arm/mach-s3c2440/mach-gta02.c
+@@ -344,8 +344,6 @@
+       &s3c_device_usbgadget,
+       &s3c_device_nand,
+       &s3c_device_ts,
+-      &s3c_device_spi0,
+-      &s3c_device_spi1,
+       &gta02_nor_flash,
+ };
+ 
+@@ -522,10 +520,54 @@
+       },
+ };
+ 
+-static struct s3c2410_spi_info gta02_spi_acc_cfg = {
+-      .set_cs         = gta02_spi_acc_set_cs,
++static void spi_acc_cs(struct s3c2410_spigpio_info *spi, int cs)
++{
++      switch (cs) {
++      case BITBANG_CS_ACTIVE:
++              s3c2410_gpio_setpin(S3C2410_GPD12, 0);
++              break;
++      case BITBANG_CS_INACTIVE:
++              s3c2410_gpio_setpin(S3C2410_GPD12, 1);
++              break;
++      }
++}
++
++static struct s3c2410_spigpio_info spi_gpio_cfg = {
++      .pin_clk        = S3C2410_GPG7,
++      .pin_mosi       = S3C2410_GPG6,
++      .pin_miso       = S3C2410_GPG5,
+       .board_size     = ARRAY_SIZE(gta02_spi_acc_bdinfo),
+-      .board_info     = &gta02_spi_acc_bdinfo,
++      .board_info     = gta02_spi_acc_bdinfo,
++      .chip_select    = &spi_acc_cs,
++};
++
++static struct resource s3c_spi_acc_resource[] = {
++      [0] = {
++              .start = S3C2410_GPG3,
++              .end   = S3C2410_GPG3,
++      },
++      [1] = {
++              .start = S3C2410_GPG5,
++              .end   = S3C2410_GPG5,
++      },
++      [2] = {
++              .start = S3C2410_GPG6,
++              .end   = S3C2410_GPG6,
++      },
++      [3] = {
++              .start = S3C2410_GPG7,
++              .end   = S3C2410_GPG7,
++      },
++};
++
++static struct platform_device s3c_device_spi_acc = {
++      .name             = "s3c24xx-spi-gpio",
++      .id               = 1,
++      .num_resources    = ARRAY_SIZE(s3c_spi_acc_resource),
++      .resource         = s3c_spi_acc_resource,
++      .dev = {
++              .platform_data = &spi_gpio_cfg,
++      },
+ };
+ 
+ static struct resource gta02_led_resources[] = {
+@@ -673,7 +715,6 @@
+       s3c_device_usb.dev.platform_data = &gta02_usb_info;
+       s3c_device_nand.dev.platform_data = &gta02_nand_info;
+       s3c_device_sdi.dev.platform_data = &gta02_mmc_cfg;
+-      s3c_device_spi1.dev.platform_data = &gta02_spi_acc_cfg;
+ 
+       /* Only GTA02v1 has a SD_DETECT GPIO.  Since the slot is not
+        * hot-pluggable, this is not required anyway */
+@@ -702,6 +743,7 @@
+               break;
+       }
+ 
++      platform_device_register(&s3c_device_spi_acc);
+       platform_device_register(&gta01_button_dev);
+       platform_device_register(&gta01_pm_gsm_dev);
+ 
+@@ -721,6 +763,13 @@
+       s3c2410_gpio_cfgpin(GTA01_GPIO_LCD_RESET, S3C2410_GPIO_OUTPUT);
+       s3c2410_gpio_setpin(GTA01_GPIO_LCD_RESET, 1);
+ 
++      s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPIO_OUTPUT);
++      s3c2410_gpio_setpin(S3C2410_GPD12, 1);
++
++
++      s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPIO_OUTPUT);
++      s3c2410_gpio_setpin(S3C2410_GPD13, 1);
++
+       /* Make sure the modem can wake us up */
+       set_irq_type(GTA02_IRQ_MODEM, IRQT_RISING);
+       request_irq(GTA02_IRQ_MODEM, gta02_modem_irq,
+Index: linux-2.6.22.5/drivers/spi/lis302dl.c
+===================================================================
+--- linux-2.6.22.5.orig/drivers/spi/lis302dl.c
++++ linux-2.6.22.5/drivers/spi/lis302dl.c
+@@ -143,7 +143,7 @@
+       int rc;
+       u_int8_t cmd;
+ 
+-      cmd = (reg << ADDR_SHIFT) | READ_BIT;
++      cmd = (0x80) | (reg & 0x3F);
+ 
+       rc = spi_w8r8(lis->spi_dev, cmd);
+ 
+@@ -165,7 +165,7 @@
+ {
+       u_int8_t buf[2];
+ 
+-      buf[0] = (reg << ADDR_SHIFT);
++      buf[0] = (reg & 0x3F);
+       buf[1] = val;
+ 
+       return spi_write(lis->spi_dev, buf, sizeof(buf));
+@@ -459,12 +459,13 @@
+               kfree(lis);
+               return -ENODEV;
+       }
+-
+       /* switch interrupt to open collector */
+       reg_write(lis, LIS302DL_CTRL3_PP_OD, 0x7c);
+ 
+-      rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt, IRQF_DISABLED,
+-                       "lis302dl", NULL);
++      /* Fix me: always interrupt */
++      //rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt, IRQF_DISABLED,
++      //               "lis302dl", NULL);
++      rc = 0;
+       if (rc < 0) {
+               dev_err(&spi->dev, "error requesting IRQ %d\n",
+                       lis->spi_dev->irq);
+@@ -472,7 +473,9 @@
+               return rc;
+       }
+ 
+-      rc = sysfs_create_group(&spi->dev.kobj, &lis302dl_attr_group);
++      /* Fix me: can't create group */
++      //rc = sysfs_create_group(&spi->dev.kobj, &lis302dl_attr_group);
++      rc = 0;
+       if (rc) {
+               dev_err(&spi->dev, "error creating sysfs group\n");
+               /* FIXME */

Modified: trunk/src/target/kernel/patches/series
===================================================================
--- trunk/src/target/kernel/patches/series      2008-01-09 19:15:01 UTC (rev 
3798)
+++ trunk/src/target/kernel/patches/series      2008-01-09 19:53:26 UTC (rev 
3799)
@@ -55,4 +55,6 @@
 # merge into gta02-core as soon as compatibility issues are resolved
 gta02-nor.patch
 lis302dl.patch
+# work in progress. hangs the kernel, if enabled.
+gta02-acc.patch
 gta02-leds.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-01-09 21:14:30 +0100 (Wed, 09 Jan 2008)
New Revision: 3800

Modified:
   trunk/src/target/kernel/patches/gta02-acc.patch
Log:
Cleanup and big fixes for the accelerometer driver. Note that it still hangs
the system with what seems to be a permanently asserted interrupt. So don't
enable it yet.

gta02-acc.patch:
- arch/arm/mach-s3c2440/mach-gta02.c (gta02_spi_acc_set_cs): chip select is now
  handled by spi_acc_cs, removed
- drivers/spi/lis302dl.c (enum lis302dl_reg_ctrl3): added LIS302DL_CTRL3_IHL
- drivers/spi/lis302dl.c (READ_BIT, ADDR_MASK, __reg_read, __reg_write):
  updated, and use these symbolic names instead of numeric constants
- drivers/spi/lis302dl.c (__reg_read, __reg_write): trying to use an invalid
  register number is a BUG
- drivers/spi/lis302dl.c (lis302dl_int_mode): use "switch" instead of "if"
  cascade
- drivers/spi/lis302dl.c (lis302dl_sysfs_entries): list needs to end with a
  NULL entry
- drivers/spi/lis302dl.c (lis302dl_probe): CTRL_REG3 setting was bogus and also
  needs to include active-low
- drivers/spi/lis302dl.c (lis302dl_probe): use lis302dl_int_mode instead of
  setting the combined configuration value
- drivers/spi/lis302dl.c (lis302dl_probe): pass "lis" device pointer to
  interrupt handler
- drivers/spi/lis302dl.c (lis302dl_probe): un-commented calls to request_irq
  and sysfs_create_group



Modified: trunk/src/target/kernel/patches/gta02-acc.patch
===================================================================
--- trunk/src/target/kernel/patches/gta02-acc.patch     2008-01-09 19:53:26 UTC 
(rev 3799)
+++ trunk/src/target/kernel/patches/gta02-acc.patch     2008-01-09 20:14:30 UTC 
(rev 3800)
@@ -11,7 +11,19 @@
        &gta02_nor_flash,
  };
  
-@@ -522,10 +520,54 @@
+@@ -488,11 +486,6 @@
+ 
+ /* SPI: Accelerometers attached to SPI of s3c244x */
+ 
+-static void gta02_spi_acc_set_cs(struct s3c2410_spi_info *spi, int cs, int 
pol)
+-{
+-      s3c2410_gpio_setpin(cs, pol);
+-}
+-
+ static const struct lis302dl_platform_data lis302_pdata[] = {
+       {
+               .name           = "lis302-1 (top)"
+@@ -522,10 +515,54 @@
        },
  };
  
@@ -69,7 +81,7 @@
  };
  
  static struct resource gta02_led_resources[] = {
-@@ -673,7 +715,6 @@
+@@ -673,7 +710,6 @@
        s3c_device_usb.dev.platform_data = &gta02_usb_info;
        s3c_device_nand.dev.platform_data = &gta02_nand_info;
        s3c_device_sdi.dev.platform_data = &gta02_mmc_cfg;
@@ -77,7 +89,7 @@
  
        /* Only GTA02v1 has a SD_DETECT GPIO.  Since the slot is not
         * hot-pluggable, this is not required anyway */
-@@ -702,6 +743,7 @@
+@@ -702,6 +738,7 @@
                break;
        }
  
@@ -85,7 +97,7 @@
        platform_device_register(&gta01_button_dev);
        platform_device_register(&gta01_pm_gsm_dev);
  
-@@ -721,6 +763,13 @@
+@@ -721,6 +758,13 @@
        s3c2410_gpio_cfgpin(GTA01_GPIO_LCD_RESET, S3C2410_GPIO_OUTPUT);
        s3c2410_gpio_setpin(GTA01_GPIO_LCD_RESET, 1);
  
@@ -103,49 +115,91 @@
 ===================================================================
 --- linux-2.6.22.5.orig/drivers/spi/lis302dl.c
 +++ linux-2.6.22.5/drivers/spi/lis302dl.c
-@@ -143,7 +143,7 @@
+@@ -84,6 +84,7 @@
+ 
+ enum lis302dl_reg_ctrl3 {
+       LIS302DL_CTRL3_PP_OD            = 0x40,
++      LIS302DL_CTRL3_IHL              = 0x80,
+ };
+ 
+ enum lis302dl_reg_status {
+@@ -134,16 +135,17 @@
+ 
+ /* lowlevel register access functions */
+ 
+-#define READ_BIT      0x01
+-#define MS_BIT                0x02
+-#define ADDR_SHIFT    2
++#define READ_BIT      0x80
++#define       ADDR_MASK       0x3f
+ 
+ static inline u_int8_t __reg_read(struct lis302dl_info *lis, u_int8_t reg)
+ {
        int rc;
        u_int8_t cmd;
  
 -      cmd = (reg << ADDR_SHIFT) | READ_BIT;
-+      cmd = (0x80) | (reg & 0x3F);
++      BUG_ON(reg & ~ADDR_MASK);
++
++      cmd = reg | READ_BIT;
  
        rc = spi_w8r8(lis->spi_dev, cmd);
  
-@@ -165,7 +165,7 @@
+@@ -165,7 +167,9 @@
  {
        u_int8_t buf[2];
  
 -      buf[0] = (reg << ADDR_SHIFT);
-+      buf[0] = (reg & 0x3F);
++      BUG_ON(reg & ~ADDR_MASK);
++
++      buf[0] = reg;
        buf[1] = val;
  
        return spi_write(lis->spi_dev, buf, sizeof(buf));
-@@ -459,12 +459,13 @@
+@@ -218,10 +222,16 @@
+ {
+       struct lis302dl_info *lis = dev_get_drvdata(&spi->dev);
+ 
+-      if (int_pin == 1)
++      switch (int_pin) {
++      case 1:
+               reg_set_bit_mask(lis, LIS302DL_REG_CTRL3, 0x07, mode);
+-      else if (int_pin == 2)
++              break;
++      case 2:
+               reg_set_bit_mask(lis, LIS302DL_REG_CTRL3, 0x38, mode << 3);
++              break;
++      default:
++              BUG();
++      }
+ }
+ 
+ static void _report_btn_single(struct input_dev *inp, int btn)
+@@ -388,6 +398,7 @@
+ static struct attribute *lis302dl_sysfs_entries[] = {
+       &dev_attr_sample_rate.attr,
+       &dev_attr_full_scale.attr,
++      NULL
+ };
+ 
+ static struct attribute_group lis302dl_attr_group = {
+@@ -459,12 +470,15 @@
                kfree(lis);
                return -ENODEV;
        }
++      /* switch interrupt to open collector, active-low */
++      reg_write(lis, LIS302DL_REG_CTRL3,
++          LIS302DL_CTRL3_PP_OD | LIS302DL_CTRL3_IHL);
++      lis302dl_int_mode(spi, 1, LIX302DL_INTMODE_DATA_READY);
++      lis302dl_int_mode(spi, 2, LIX302DL_INTMODE_CLICK);
+ 
+-      /* switch interrupt to open collector */
+-      reg_write(lis, LIS302DL_CTRL3_PP_OD, 0x7c);
 -
-       /* switch interrupt to open collector */
-       reg_write(lis, LIS302DL_CTRL3_PP_OD, 0x7c);
- 
--      rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt, IRQF_DISABLED,
++      /* Fix me: always interrupt */
+       rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt, IRQF_DISABLED,
 -                       "lis302dl", NULL);
-+      /* Fix me: always interrupt */
-+      //rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt, IRQF_DISABLED,
-+      //               "lis302dl", NULL);
-+      rc = 0;
++                       "lis302dl", lis);
        if (rc < 0) {
                dev_err(&spi->dev, "error requesting IRQ %d\n",
                        lis->spi_dev->irq);
-@@ -472,7 +473,9 @@
-               return rc;
-       }
- 
--      rc = sysfs_create_group(&spi->dev.kobj, &lis302dl_attr_group);
-+      /* Fix me: can't create group */
-+      //rc = sysfs_create_group(&spi->dev.kobj, &lis302dl_attr_group);
-+      rc = 0;
-       if (rc) {
-               dev_err(&spi->dev, "error creating sysfs group\n");
-               /* FIXME */




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

Reply via email to