| 
      
      
      From: <hap...@us...> - 2007-09-17 19:42:02
      
     | 
| Revision: 1329
          http://hackndev.svn.sourceforge.net/hackndev/?rev=1329&view=rev
Author:   happy-slapin
Date:     2007-09-17 12:41:58 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
cleanup: getting from hh.org
Modified Paths:
--------------
    linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig
    linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c
    linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c
    linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c
    linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig	2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/Kconfig	2007-09-17 19:41:58 UTC (rev 1329)
@@ -810,23 +810,19 @@
 	  via the file /proc/rtc and its behaviour is set by various ioctls on
 	  /dev/rtc.
 
-#
-# This is a weird duplicate copy of the driver, please update your config to use
-# RTC_DRV_SA1100 instead! 
-#
-#config SA1100_RTC
-#	tristate "SA11x0/PXA2xx RTC support"
-#	depends on ARCH_SA1100 || ARCH_PXA
-#	help
-#	  If you say Y here and create a character special file /dev/rtc with
-#	  major number 10 and minor number 135 using mknod ("man mknod"), you
-#	  will get access to the real time clock built into your SA11x0 or
-#	  PXA2xx CPU. It reports status information via the file /proc/rtc
-#	  and its behaviour is set by various ioctls on /dev/rtc.
-#
-#	  To compile this driver as a module, choose M here: the
-#	  module will be called sa1100-rtc.
+config SA1100_RTC
+	tristate "SA11x0/PXA2xx RTC support"
+	depends on ARCH_SA1100 || ARCH_PXA
+	help
+	  If you say Y here and create a character special file /dev/rtc with
+	  major number 10 and minor number 135 using mknod ("man mknod"), you
+	  will get access to the real time clock built into your SA11x0 or
+	  PXA2xx CPU. It reports status information via the file /proc/rtc
+	  and its behaviour is set by various ioctls on /dev/rtc.
 
+	  To compile this driver as a module, choose M here: the
+	  module will be called sa1100-rtc.
+
 config GEN_RTC
 	tristate "Generic /dev/rtc emulation"
 	depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c	2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/char/sa1100-rtc.c	2007-09-17 19:41:58 UTC (rev 1329)
@@ -1,16 +1,4 @@
 /*
- *
- * NOTE: The file you're looking for is in drivers/rtc, please don't use this one
- * it'll be removed eventually.
- *
- *
- *
- *
- */
-#error This is a weird duplicate copy of the driver, please update your config to use \
-RTC_DRV_SA1100 instead!
-
-/*
  * linux/drivers/char/sa1100-rtc.c
  *
  * Real Time Clock interface for Linux on StrongARM SA1x00
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c	2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/htc-egpio.c	2007-09-17 19:41:58 UTC (rev 1329)
@@ -11,6 +11,7 @@
 #include <linux/errno.h> /* ENODEV */
 #include <linux/interrupt.h> /* enable_irq_wake */
 #include <linux/spinlock.h> /* spinlock_t */
+#include <linux/platform_device.h> /* platform_device */
 #include <linux/module.h>
 #include <linux/gpiodev2.h>
 #include <linux/mfd/htc-egpio.h>
@@ -138,12 +139,9 @@
 	for (i=0; i<pdata->nr_pins; i++) {
 		struct htc_egpio_pinInfo *pi = &pdata->pins[i];
 		if (pi->type == HTC_EGPIO_TYPE_INPUT
-		    && pi->pin_nr == (gpio_no & GPIO_BASE_MASK)
+		    && pi->gpio == gpio_no
 		    && pi->input_irq >= 0)
-			return pi->input_irq + ei->irqStart;
-		if (pi->type == HTC_EGPIO_TYPE_IRQ
-		    && pi->pin_nr == (gpio_no & GPIO_BASE_MASK))
-			return pi->pin_nr + ei->irqStart;
+			return (pi->input_irq & 0xf) + ei->irqStart;
 	}
 	return -ENODEV;
 }
@@ -181,10 +179,10 @@
 
 static void setup_pin(struct egpio_info *ei, struct htc_egpio_pinInfo *pi)
 {
-	struct htc_egpio_pinInfo dummy;
+	int pin = pi->gpio & GPIO_BASE_MASK;
 
-	if (pi->pin_nr < 0 || pi->pin_nr > 16*MAX_EGPIO_REGS) {
-		printk(KERN_ERR "EGPIO invalid pin %d\n", pi->pin_nr);
+	if (pi->gpio < 0 || pin > 16*MAX_EGPIO_REGS) {
+		printk(KERN_ERR "EGPIO invalid pin %d\n", pi->gpio);
 		return;
 	}
 
@@ -192,24 +190,19 @@
 	case HTC_EGPIO_TYPE_INPUT:
 		if (pi->input_irq < 0)
 			break;
-		dummy.pin_nr = pi->input_irq;
-		pi = &dummy;
-		/* NO BREAK */
-	case HTC_EGPIO_TYPE_IRQ:
-		if (ei->ackRegister != u16pos(pi->pin_nr)) {
+		pin = pi->input_irq & GPIO_BASE_MASK;
+		if (ei->ackRegister != u16pos(pin)) {
 			printk(KERN_ERR "EGPIO irq conflict %d vs %d\n"
-			       , ei->ackRegister, u16pos(pi->pin_nr));
+			       , ei->ackRegister, u16pos(pin));
 			return;
 		}
 		break;
-	case HTC_EGPIO_TYPE_OUTPUT: {
-		int pin = pi->pin_nr;
+	case HTC_EGPIO_TYPE_OUTPUT:
 		if (ei->maxRegs < u16pos(pin))
 			ei->maxRegs = u16pos(pin);
 		if (pi->output_initial)
 			ei->cached_values[u16pos(pin)] |= u16bit(pin);
 		break;
-	}
 	default:
 		printk(KERN_ERR "EGPIO unknown type %d\n", pi->type);
 	}
@@ -221,6 +214,7 @@
 	struct resource *res;
 	struct egpio_info *ei;
 	int irq, i, ret;
+	struct gpio_ops ops;
 
 	/* Initialize ei data structure. */
 	ei = kzalloc(sizeof(*ei), GFP_KERNEL);
@@ -247,18 +241,12 @@
 	       , res->start, ei->addrBase);
 	ei->bus_shift = pdata->bus_shift;
 
-	pdata->ops.get = egpio_get;
-	pdata->ops.set = egpio_set;
-	pdata->ops.to_irq = egpio_to_irq;
 	platform_set_drvdata(pdev, ei);
 
-	{
-	struct gpio_ops ops;
 	ops.get_value = egpio_get;
 	ops.set_value = egpio_set;
 	ops.to_irq = egpio_to_irq;
 	gpiodev_register(pdata->gpio_base, &pdev->dev, &ops);
-	}
 
 	/* Go through list of pins. */
 	ei->irqStart = pdata->irq_base;
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c	2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/pasic3_base.c	2007-09-17 19:41:58 UTC (rev 1329)
@@ -94,13 +94,10 @@
 	struct device *dev = ds1wm_dev->dev.parent;
 	int c;
 
-	/* FIXME: use this to detect magician/pasic3 for now */
-	if (ds1wm_clk.rate == 4000000) {
-		c = pasic3_read_register(dev, 0x28);
-		pasic3_write_register(dev, 0x28, c & 0x7f);
+	c = pasic3_read_register(dev, 0x28);
+	pasic3_write_register(dev, 0x28, c & 0x7f);
 
-		pr_debug ("pasic3: DS1WM OWM_EN low (active) %02x\n", c & 0x7f);
-	}
+	pr_debug ("pasic3: DS1WM OWM_EN low (active) %02x\n", c & 0x7f);
 }
 
 static void ds1wm_disable(struct platform_device *ds1wm_dev)
@@ -108,13 +105,10 @@
 	struct device *dev = ds1wm_dev->dev.parent;
 	int c;
 
-	/* FIXME: use this to detect magician/pasic3 for now */
-	if (ds1wm_clk.rate == 4000000) {
-		c = pasic3_read_register(dev, 0x28);
-		pasic3_write_register(dev, 0x28, c | 0x80);
+	c = pasic3_read_register(dev, 0x28);
+	pasic3_write_register(dev, 0x28, c | 0x80);
 
-		pr_debug ("pasic3: DS1WM OWM_EN high (inactive) %02x\n", c | 0x80);
-	}
+	pr_debug ("pasic3: DS1WM OWM_EN high (inactive) %02x\n", c | 0x80);
 }
 
 static struct ds1wm_platform_data __devinit ds1wm_platform_data = {
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c	2007-09-17 15:37:25 UTC (rev 1328)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/drivers/mfd/samcop_base.c	2007-09-17 19:41:58 UTC (rev 1329)
@@ -54,9 +54,11 @@
 #include <asm/hardware/ipaq-samcop.h>
 #include <linux/mfd/samcop_base.h>
 #include <asm/hardware/samcop-sdi.h>
+#include <asm/hardware/samcop-fsi.h>
 #include <asm/hardware/samcop-dma.h>
 #include <asm/arch/pxa-dmabounce.h>
 #include "../mmc/samcop_sdi.h"
+#include "../misc/samcop_fsi.h"
 
 #include <asm/arch/irq.h>
 #include <asm/arch/clock.h>
@@ -581,7 +583,31 @@
 	set_irq_chained_handler(samcop->irq_nr, samcop_irq_demux);
 }
 
+
 /*************************************************************
+ * SAMCOP FS interface hooks and initialization
+ *************************************************************/
+
+static u32 samcop_fsi_read_register(struct device *dev, u32 reg)
+{
+	struct samcop_data *samcop = dev->parent->driver_data;
+
+	return samcop_read_register(samcop, _SAMCOP_FSI_Base + reg);
+}
+
+static void samcop_fsi_write_register(struct device *dev, u32 reg, u32 val)
+{
+	struct samcop_data *samcop = dev->parent->driver_data;
+
+	samcop_write_register(samcop, _SAMCOP_FSI_Base + reg, val);
+}
+
+static struct samcop_fsi_data samcop_fsi_data = {
+	.read_reg = samcop_fsi_read_register,
+	.write_reg = samcop_fsi_write_register,
+};
+
+/*************************************************************
  * SAMCOP SD interface hooks and initialization
  *************************************************************/
 int samcop_dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
@@ -1125,6 +1151,7 @@
 		.start = _SAMCOP_FSI_Base,
 		.end = _SAMCOP_FSI_Base + 0x1f,
 		.irq = _IRQ_SAMCOP_FCD,
+		.platform_data = &samcop_fsi_data,
 	},
 	{
 		.id = { -1 },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |