linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/9] S3C24XX SPI updates for 2.6.28
@ 2008-10-10 10:03 Ben Dooks
  2008-10-10 10:03 ` [patch 1/9] S3C24XX: Default SPI pin configuration for SPI Ben Dooks
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ

SPI updates for S3C24XX SPI drivers

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 1/9] S3C24XX: Default SPI pin configuration for SPI
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 2/9] S3C24XX: Fix sparse errors in platform uncompress.h Ben Dooks
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-s3c24xx-spi-default-gpios.patch --]
[-- Type: text/plain, Size: 6192 bytes --]

Add a set of default pin configuration routines for
setting up the SPI gpio configuration when using the
hardware SPI driver.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/Kconfig
===================================================================
--- linux-2.6.27-rc6-quilt4.orig/arch/arm/plat-s3c24xx/Kconfig	2008-09-16 11:57:16.000000000 +0100
+++ linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/Kconfig	2008-09-16 12:28:19.000000000 +0100
@@ -49,6 +49,22 @@ config S3C2410_DMA_DEBUG
 	  Enable debugging output for the DMA code. This option sends info
 	  to the kernel log, at priority KERN_DEBUG.
 
+# SPI default pin configuration code
+
+config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13
+	bool
+	help
+	  SPI GPIO configuration code for BUS0 when connected to
+	  GPE11, GPE12 and GPE13.
+
+config S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7
+	bool
+	help
+	  SPI GPIO configuration code for BUS 1 when connected to
+	  GPG5, GPG6 and GPG7.
+
+# common code for s3c24xx based machines, such as the SMDKs.
+
 config MACH_SMDK
 	bool
 	help
Index: linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/Makefile
===================================================================
--- linux-2.6.27-rc6-quilt4.orig/arch/arm/plat-s3c24xx/Makefile	2008-09-16 11:57:16.000000000 +0100
+++ linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/Makefile	2008-09-16 12:29:00.000000000 +0100
@@ -31,4 +31,12 @@ obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_PM)		+= sleep.o
 obj-$(CONFIG_HAVE_PWM)		+= pwm.o
 obj-$(CONFIG_S3C2410_DMA)	+= dma.o
+
+# SPI gpio central GPIO functions
+
+obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o
+obj-$(CONFIG_S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7)    += spi-bus1-gpg5_6_7.o
+
+# machine common support
+
 obj-$(CONFIG_MACH_SMDK)		+= common-smdk.o
Index: linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c	2008-09-16 12:27:15.000000000 +0100
@@ -0,0 +1,37 @@
+/* linux/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ *	http://armlinux.simtec.co.uk/
+ *	Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
+ *
+ * S3C24XX SPI - gpio configuration for bus 0 on gpe11,12,13
+ *
+ * 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.
+*/
+
+#include <linux/kernel.h>
+
+#include <mach/hardware.h>
+
+#include <mach/spi.h>
+#include <mach/regs-gpio.h>
+
+void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi,
+					  int enable)
+{
+	if (enable) {
+		s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPE13_SPICLK0);
+		s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPE12_SPIMOSI0);
+		s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPE11_SPIMISO0);
+		s3c2410_gpio_pullup(S3C2410_GPE11, 0);
+		s3c2410_gpio_pullup(S3C2410_GPE13, 0);
+	} else {
+		s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPIO_INPUT);
+		s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPIO_INPUT);
+		s3c2410_gpio_pullup(S3C2410_GPE11, 1);
+		s3c2410_gpio_pullup(S3C2410_GPE12, 1);
+		s3c2410_gpio_pullup(S3C2410_GPE13, 1);
+	}
+}
Index: linux-2.6.27-rc6-quilt4/arch/arm/mach-s3c2410/include/mach/spi.h
===================================================================
--- linux-2.6.27-rc6-quilt4.orig/arch/arm/mach-s3c2410/include/mach/spi.h	2008-09-16 12:27:07.000000000 +0100
+++ linux-2.6.27-rc6-quilt4/arch/arm/mach-s3c2410/include/mach/spi.h	2008-09-16 12:27:15.000000000 +0100
@@ -22,5 +22,12 @@ struct s3c2410_spi_info {
 	void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
 };
 
+/* Standard setup / suspend routines for SPI GPIO pins. */
+
+extern void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi,
+						 int enable);
+
+extern void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi,
+					      int enable);
 
 #endif /* __ASM_ARCH_SPI_H */
Index: linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.27-rc6-quilt4/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c	2008-09-16 12:27:15.000000000 +0100
@@ -0,0 +1,37 @@
+/* linux/arch/arm/plat-s3c24xx/spi-bus0-gpg5_6_7.c
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ *	http://armlinux.simtec.co.uk/
+ *	Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
+ *
+ * S3C24XX SPI - gpio configuration for bus 1 on gpg5,6,7
+ *
+ * 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.
+*/
+
+#include <linux/kernel.h>
+
+#include <mach/hardware.h>
+
+#include <mach/spi.h>
+#include <mach/regs-gpio.h>
+
+void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi,
+				       int enable)
+{
+	if (enable) {
+		s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_SPICLK1);
+		s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_SPIMOSI1);
+		s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_SPIMISO1);
+		s3c2410_gpio_pullup(S3C2410_GPG5, 0);
+		s3c2410_gpio_pullup(S3C2410_GPG6, 0);
+	} else {
+		s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPIO_INPUT);
+		s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPIO_INPUT);
+		s3c2410_gpio_pullup(S3C2410_GPG5, 1);
+		s3c2410_gpio_pullup(S3C2410_GPG6, 1);
+		s3c2410_gpio_pullup(S3C2410_GPG7, 1);
+	}
+}

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 2/9] S3C24XX: Fix sparse errors in platform uncompress.h
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
  2008-10-10 10:03 ` [patch 1/9] S3C24XX: Default SPI pin configuration for SPI Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 3/9] arch/arm/mach-s3c2410/pm.c: fix sparse warnings Ben Dooks
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-s3c24xx-sparse-uncompress-header.patch --]
[-- Type: text/plain, Size: 1286 bytes --]

Ensure we __force the __iomem attribute off when we use
our minimal __raw_writel() implementation.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.27-rc6-quilt3/arch/arm/plat-s3c/include/plat/uncompress.h
===================================================================
--- linux-2.6.27-rc6-quilt3.orig/arch/arm/plat-s3c/include/plat/uncompress.h	2008-09-14 23:47:23.000000000 +0100
+++ linux-2.6.27-rc6-quilt3/arch/arm/plat-s3c/include/plat/uncompress.h	2008-09-14 23:51:39.000000000 +0100
@@ -90,7 +90,7 @@ static inline void flush(void)
 {
 }
 
-#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
+#define __raw_writel(d,ad) do { *((volatile unsigned int __force *)(ad)) = (d); } while(0)
 
 /* CONFIG_S3C_BOOT_WATCHDOG
  *

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 3/9] arch/arm/mach-s3c2410/pm.c: fix sparse warnings
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
  2008-10-10 10:03 ` [patch 1/9] S3C24XX: Default SPI pin configuration for SPI Ben Dooks
  2008-10-10 10:03 ` [patch 2/9] S3C24XX: Fix sparse errors in platform uncompress.h Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 4/9] S3C24XX: AT2440EVB MMC Ben Dooks
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-sparse-s3c24xx-s3c2410-pm.patch --]
[-- Type: text/plain, Size: 3029 bytes --]

Do not use __raw_readl on straight pointers. Change the
code to using 'u32 *' as we are only accessing kernel
RAM using phys_to_virt() to find where it is.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.27-rc6-quilt3/arch/arm/mach-s3c2410/pm.c
===================================================================
--- linux-2.6.27-rc6-quilt3.orig/arch/arm/mach-s3c2410/pm.c	2008-09-16 10:29:59.000000000 +0100
+++ linux-2.6.27-rc6-quilt3/arch/arm/mach-s3c2410/pm.c	2008-09-16 10:40:20.000000000 +0100
@@ -44,6 +44,11 @@ extern void pm_dbg(const char *fmt, ...)
 #define DBG(fmt...) printk(KERN_DEBUG fmt)
 #endif
 
+static inline void write_u32(u32 value, void *to)
+{
+	*(u32 *)to = value;
+}
+
 static void s3c2410_pm_prepare(void)
 {
 	/* ensure at least GSTATUS3 has the resume address */
@@ -54,35 +59,35 @@ static void s3c2410_pm_prepare(void)
 	DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
 
 	if (machine_is_h1940()) {
-		void *base = phys_to_virt(H1940_SUSPEND_CHECK);
-		unsigned long ptr;
-		unsigned long calc = 0;
+		u32 *base = phys_to_virt(H1940_SUSPEND_CHECK);
+		unsigned  ptr;
+		u32 calc = 0;
 
 		/* generate check for the bootloader to check on resume */
 
-		for (ptr = 0; ptr < 0x40000; ptr += 0x400)
-			calc += __raw_readl(base+ptr);
+		for (ptr = 0; ptr < 0x40000/4; ptr += 0x400/4)
+			calc += base[ptr];
 
-		__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
+		write_u32(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
 	}
 
 	/* the RX3715 uses similar code and the same H1940 and the
 	 * same offsets for resume and checksum pointers */
 
 	if (machine_is_rx3715()) {
-		void *base = phys_to_virt(H1940_SUSPEND_CHECK);
-		unsigned long ptr;
-		unsigned long calc = 0;
+		u32 *base = phys_to_virt(H1940_SUSPEND_CHECK);
+		unsigned ptr;
+		u32 calc = 0;
 
 		/* generate check for the bootloader to check on resume */
 
-		for (ptr = 0; ptr < 0x40000; ptr += 0x4)
-			calc += __raw_readl(base+ptr);
+		for (ptr = 0; ptr < 0x40000/4; ptr += 0x4/4)
+			calc += base[ptr];
 
-		__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
+		write_u32(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
 	}
 
-	if ( machine_is_aml_m5900() )
+	if (machine_is_aml_m5900())
 		s3c2410_gpio_setpin(S3C2410_GPF2, 1);
 
 }
@@ -97,7 +102,7 @@ static int s3c2410_pm_resume(struct sys_
 	tmp &= S3C2410_GSTATUS2_OFFRESET;
 	__raw_writel(tmp, S3C2410_GSTATUS2);
 
-	if ( machine_is_aml_m5900() )
+	if (machine_is_aml_m5900())
 		s3c2410_gpio_setpin(S3C2410_GPF2, 0);
 
 	return 0;

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 4/9] S3C24XX: AT2440EVB MMC
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
                   ` (2 preceding siblings ...)
  2008-10-10 10:03 ` [patch 3/9] arch/arm/mach-s3c2410/pm.c: fix sparse warnings Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 5/9] AT2440EVB: LCD frame buffer support Ben Dooks
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks, Ramax Lo

[-- Attachment #1: thirdparty/at2440evb-mmc.patch --]
[-- Type: text/plain, Size: 1889 bytes --]

Add SD/MMC support for AT2440EVB board.

Signed-off-by: Ramax Lo <ramaxlo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index f5e3c7f..ce18bc3 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -45,6 +45,7 @@
 #include <plat/clock.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
+#include <asm/plat-s3c24xx/mci.h>
 
 static struct map_desc at2440evb_iodesc[] __initdata = {
 	/* Nothing here */
@@ -162,6 +163,10 @@ static struct platform_device at2440evb_device_eth = {
 	},
 };
 
+static struct s3c24xx_mci_pdata at2440evb_mci_pdata = {
+	.gpio_detect	= S3C2410_GPG10,
+};
+
 static struct platform_device *at2440evb_devices[] __initdata = {
 	&s3c_device_usb,
 	&s3c_device_wdt,
@@ -169,12 +174,15 @@ static struct platform_device *at2440evb_devices[] __initdata = {
 	&s3c_device_i2c,
 	&s3c_device_rtc,
 	&s3c_device_nand,
+	&s3c_device_sdi,
 	&at2440evb_device_eth,
 };
 
 static void __init at2440evb_map_io(void)
 {
 	s3c_device_nand.dev.platform_data = &at2440evb_nand_info;
+	s3c_device_sdi.name = "s3c2440-sdi";
+	s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata;
 
 	s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
 	s3c24xx_init_clocks(16934400);
-- 
1.5.4.3

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [patch 5/9] AT2440EVB: LCD frame buffer support.
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
                   ` (3 preceding siblings ...)
  2008-10-10 10:03 ` [patch 4/9] S3C24XX: AT2440EVB MMC Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 6/9] S3C24XX: Common ADC driver for S3C24XX archs Ben Dooks
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks, Ramax Lo

[-- Attachment #1: thirdparty/at2440evb-lcd.patch --]
[-- Type: text/plain, Size: 2683 bytes --]

Add LCD frame buffer support for AT2440EVB board.

Signed-off-by: Ramax Lo <ramaxlo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index aab014f..595fec5 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -28,6 +28,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/hardware.h>
+#include <mach/fb.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
@@ -167,6 +168,39 @@ static struct s3c24xx_mci_pdata at2440evb_mci_pdata = {
 	.gpio_detect	= S3C2410_GPG10,
 };
 
+/* 7" LCD panel */
+
+static struct s3c2410fb_display at2440evb_lcd_cfg __initdata = {
+
+	.lcdcon5	= S3C2410_LCDCON5_FRM565 |
+			  S3C2410_LCDCON5_INVVLINE |
+			  S3C2410_LCDCON5_INVVFRAME |
+			  S3C2410_LCDCON5_PWREN |
+			  S3C2410_LCDCON5_HWSWP,
+
+	.type		= S3C2410_LCDCON1_TFT,
+
+	.width		= 800,
+	.height		= 480,
+
+	.pixclock	= 33333, /* HCLK 60 MHz, divisor 2 */
+	.xres		= 800,
+	.yres		= 480,
+	.bpp		= 16,
+	.left_margin	= 88,
+	.right_margin	= 40,
+	.hsync_len	= 128,
+	.upper_margin	= 32,
+	.lower_margin	= 11,
+	.vsync_len	= 2,
+};
+
+static struct s3c2410fb_mach_info at2440evb_fb_info __initdata = {
+	.displays	= &at2440evb_lcd_cfg,
+	.num_displays	= 1,
+	.default_display = 0,
+};
+
 static struct platform_device *at2440evb_devices[] __initdata = {
 	&s3c_device_usb,
 	&s3c_device_wdt,
@@ -175,6 +209,7 @@ static struct platform_device *at2440evb_devices[] __initdata = {
 	&s3c_device_rtc,
 	&s3c_device_nand,
 	&s3c_device_sdi,
+	&s3c_device_lcd,
 	&at2440evb_device_eth,
 };
 
@@ -191,6 +226,7 @@ static void __init at2440evb_map_io(void)
 
 static void __init at2440evb_init(void)
 {
+	s3c24xx_fb_set_platdata(&at2440evb_fb_info);
 	platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices));
 }
 
-- 
1.5.4.3


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [patch 6/9] S3C24XX: Common ADC driver for S3C24XX archs
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
                   ` (4 preceding siblings ...)
  2008-10-10 10:03 ` [patch 5/9] AT2440EVB: LCD frame buffer support Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 7/9] ANUBIS: Add SM501 GPIO and update I2C setup Ben Dooks
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-s3c24xx-adc-common.patch --]
[-- Type: text/plain, Size: 12831 bytes --]

A common ADC driver to allow the hwmon and touchscreen
drivers to share the ADC block.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/Kconfig
===================================================================
--- linux-2.6.27-rc9-s3c64xx-2.orig/arch/arm/plat-s3c24xx/Kconfig	2008-10-08 15:00:20.000000000 +0100
+++ linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/Kconfig	2008-10-10 10:39:51.000000000 +0100
@@ -49,6 +49,13 @@ config S3C2410_DMA_DEBUG
 	  Enable debugging output for the DMA code. This option sends info
 	  to the kernel log, at priority KERN_DEBUG.
 
+config S3C24XX_ADC
+	bool "ADC common driver support"
+	help
+	  Core support for the ADC block found in the S3C24XX SoC systems
+	  for drivers such as the touchscreen and hwmon to use to share
+	  this resource.
+
 # SPI default pin configuration code
 
 config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13
Index: linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/Makefile
===================================================================
--- linux-2.6.27-rc9-s3c64xx-2.orig/arch/arm/plat-s3c24xx/Makefile	2008-10-08 15:00:20.000000000 +0100
+++ linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/Makefile	2008-10-10 10:39:51.000000000 +0100
@@ -31,6 +31,7 @@ obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_PM)		+= sleep.o
 obj-$(CONFIG_HAVE_PWM)		+= pwm.o
 obj-$(CONFIG_S3C2410_DMA)	+= dma.o
+obj-$(CONFIG_S3C24XX_ADC)	+= adc.o
 
 # SPI gpio central GPIO functions
 
Index: linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/adc.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/adc.c	2008-10-10 10:41:11.000000000 +0100
@@ -0,0 +1,372 @@
+/* arch/arm/plat-s3c24xx/adc.c
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ *	http://armlinux.simtec.co.uk/
+ *	Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>, <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
+ *
+ * S3C24XX ADC device core
+ *
+ * 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.
+*/
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/list.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+
+#include <plat/regs-adc.h>
+#include <plat/adc.h>
+
+/* This driver is designed to control the usage of the ADC block between
+ * the touchscreen and any other drivers that may need to use it, such as
+ * the hwmon driver.
+ *
+ * Priority will be given to the touchscreen driver, but as this itself is
+ * rate limited it should not starve other requests which are processed in
+ * order that they are received.
+ *
+ * Each user registers to get a client block which uniquely identifies it
+ * and stores information such as the necessary functions to callback when
+ * action is required.
+ */
+
+struct s3c_adc_client {
+	struct platform_device	*pdev;
+	struct list_head	 pend;
+
+	unsigned int		 nr_samples;
+	unsigned char		 is_ts;
+	unsigned char		 channel;
+
+	void	(*select_cb)(unsigned selected);
+	void	(*convert_cb)(unsigned val1, unsigned val2);
+};
+
+struct adc_device {
+	struct platform_device	*pdev;
+	struct platform_device	*owner;
+	struct clk		*clk;
+	struct s3c_adc_client	*cur;
+	struct s3c_adc_client	*ts_pend;
+	void __iomem		*regs;
+
+	unsigned int		 prescale;
+
+	int			 irq;
+};
+
+static struct adc_device *adc_dev;
+
+static LIST_HEAD(adc_pending);
+
+#define adc_dbg(_adc, msg...) dev_dbg(&(_adc)->pdev->dev, msg)
+
+static inline void s3c_adc_convert(struct adc_device *adc)
+{
+	unsigned con = readl(adc->regs + S3C2410_ADCCON);
+
+	con |= S3C2410_ADCCON_ENABLE_START;
+	writel(con, adc->regs + S3C2410_ADCCON);
+}
+
+static inline void s3c_adc_select(struct adc_device *adc,
+				  struct s3c_adc_client *client)
+{
+	unsigned con = readl(adc->regs + S3C2410_ADCCON);
+
+	client->select_cb(1);
+
+	con &= ~S3C2410_ADCCON_MUXMASK;
+	con &= ~S3C2410_ADCCON_STDBM;
+	con &= ~S3C2410_ADCCON_STARTMASK;
+
+	if (!client->is_ts)
+		con |= S3C2410_ADCCON_SELMUX(client->channel);
+
+	writel(con, adc->regs + S3C2410_ADCCON);
+}
+
+static void s3c_adc_dbgshow(struct adc_device *adc)
+{
+	adc_dbg(adc, "CON=%08x, TSC=%08x, DLY=%08x\n",
+		readl(adc->regs + S3C2410_ADCCON),
+		readl(adc->regs + S3C2410_ADCTSC),
+		readl(adc->regs + S3C2410_ADCDLY));
+}
+
+void s3c_adc_try(struct adc_device *adc)
+{
+	struct s3c_adc_client *next = adc->ts_pend;
+
+	if (!next && !list_empty(&adc_pending)) {
+		next = list_first_entry(&adc_pending,
+					struct s3c_adc_client, pend);
+		list_del(&next->pend);
+	} else
+		adc->ts_pend = NULL;
+
+	if (next) {
+		adc_dbg(adc, "new client is %p\n", next);
+		adc->cur = next;
+		s3c_adc_select(adc, next);
+		s3c_adc_convert(adc);
+		s3c_adc_dbgshow(adc);
+	}
+}
+
+int s3c_adc_start(struct s3c_adc_client *client,
+		  unsigned int channel, unsigned int nr_samples)
+{
+	struct adc_device *adc = adc_dev;
+	unsigned long flags;
+
+	if (!adc) {
+		printk(KERN_ERR "%s: failed to find adc\n", __func__);
+		return -EINVAL;
+	}
+
+	if (client->is_ts && adc->ts_pend)
+		return -EAGAIN;
+
+	local_irq_save(flags);
+
+	client->channel = channel;
+	client->nr_samples = nr_samples;
+
+	if (client->is_ts)
+		adc->ts_pend = client;
+	else
+		list_add_tail(&client->pend, &adc_pending);
+
+	if (!adc->cur)
+		s3c_adc_try(adc);
+	local_irq_restore(flags);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(s3c_adc_start);
+
+static void s3c_adc_default_select(unsigned select)
+{
+}
+
+struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev,
+					void (*select)(unsigned int selected),
+					void (*conv)(unsigned d0, unsigned d1),
+					unsigned int is_ts)
+{
+	struct s3c_adc_client *client;
+
+	WARN_ON(!pdev);
+	WARN_ON(!conv);
+
+	if (!select)
+		select = s3c_adc_default_select;
+
+	if (!conv || !pdev)
+		return ERR_PTR(-EINVAL);
+
+	client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL);
+	if (!client) {
+		dev_err(&pdev->dev, "no memory for adc client\n");
+		return ERR_PTR(-ENOMEM);
+	}
+
+	client->pdev = pdev;
+	client->is_ts = is_ts;
+	client->select_cb = select;
+	client->convert_cb = conv;
+
+	return client;
+}
+EXPORT_SYMBOL_GPL(s3c_adc_register);
+
+void s3c_adc_release(struct s3c_adc_client *client)
+{
+	/* We should really check that nothing is in progress. */
+	kfree(client);
+}
+EXPORT_SYMBOL_GPL(s3c_adc_release);
+
+static irqreturn_t s3c_adc_irq(int irq, void *pw)
+{
+	struct adc_device *adc = pw;
+	struct s3c_adc_client *client = adc->cur;
+	unsigned long flags;
+	unsigned data0, data1;
+
+	if (!client) {
+		dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__);
+		return IRQ_HANDLED;
+	}
+
+	data0 = readl(adc->regs + S3C2410_ADCDAT0);
+	data1 = readl(adc->regs + S3C2410_ADCDAT1);
+	adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1);
+
+	(client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff);
+
+	if (--client->nr_samples > 0) {
+		/* fire another conversion for this */
+
+		client->select_cb(1);
+		s3c_adc_convert(adc);
+	} else {
+		local_irq_save(flags);
+		(client->select_cb)(0);
+		adc->cur = NULL;
+
+		s3c_adc_try(adc);
+		local_irq_restore(flags);
+	}
+
+	return IRQ_HANDLED;
+}
+
+static int s3c_adc_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct adc_device *adc;
+	struct resource *regs;
+	int ret;
+
+	adc = kzalloc(sizeof(struct adc_device), GFP_KERNEL);
+	if (adc == NULL) {
+		dev_err(dev, "failed to allocate adc_device\n");
+		return -ENOMEM;
+	}
+
+	adc->pdev = pdev;
+	adc->prescale = S3C2410_ADCCON_PRSCVL(49);
+
+	adc->irq = platform_get_irq(pdev, 1);
+	if (adc->irq <= 0) {
+		dev_err(dev, "failed to get adc irq\n");
+		ret = -ENOENT;
+		goto err_alloc;
+	}
+
+	ret = request_irq(adc->irq, s3c_adc_irq, 0, dev_name(dev), adc);
+	if (ret < 0) {
+		dev_err(dev, "failed to attach adc irq\n");
+		goto err_alloc;
+	}
+
+	adc->clk = clk_get(dev, "adc");
+	if (IS_ERR(adc->clk)) {
+		dev_err(dev, "failed to get adc clock\n");
+		ret = PTR_ERR(adc->clk);
+		goto err_irq;
+	}
+
+	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!regs) {
+		dev_err(dev, "failed to find registers\n");
+		ret = -ENXIO;
+		goto err_clk;
+	}
+
+	adc->regs = ioremap(regs->start, resource_size(regs));
+	if (!adc->regs) {
+		dev_err(dev, "failed to map registers\n");
+		ret = -ENXIO;
+		goto err_clk;
+	}
+
+	clk_enable(adc->clk);
+
+	writel(adc->prescale | S3C2410_ADCCON_PRSCEN,
+	       adc->regs + S3C2410_ADCCON);
+
+	dev_info(dev, "attached adc driver\n");
+
+	platform_set_drvdata(pdev, adc);
+	adc_dev = adc;
+
+	return 0;
+
+ err_clk:
+	clk_put(adc->clk);
+
+ err_irq:
+	free_irq(adc->irq, adc);
+
+ err_alloc:
+	kfree(adc);
+	return ret;
+}
+
+static int s3c_adc_remove(struct platform_device *pdev)
+{
+	struct adc_device *adc = platform_get_drvdata(pdev);
+
+	iounmap(adc->regs);
+	free_irq(adc->irq, adc);
+	clk_disable(adc->clk);
+	clk_put(adc->clk);
+	kfree(adc);
+
+	return 0;
+}
+
+#ifdef CONFIG_PM
+static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+	struct adc_device *adc = platform_get_drvdata(pdev);
+	u32 con;
+
+	con = readl(adc->regs + S3C2410_ADCCON);
+	con |= S3C2410_ADCCON_STDBM;
+	writel(con, adc->regs + S3C2410_ADCCON);
+
+	clk_disable(adc->clk);
+
+	return 0;
+}
+
+static int s3c_adc_resume(struct platform_device *pdev)
+{
+	struct adc_device *adc = platform_get_drvdata(pdev);
+
+	clk_enable(adc->clk);
+
+	writel(adc->prescale | S3C2410_ADCCON_PRSCEN,
+	       adc->regs + S3C2410_ADCCON);
+
+	return 0;
+}
+
+#else
+#define s3c_adc_suspend NULL
+#define s3c_adc_resume NULL
+#endif
+
+static struct platform_driver s3c_adc_driver = {
+	.driver		= {
+		.name	= "s3c24xx-adc",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= s3c_adc_probe,
+	.remove		= __devexit_p(s3c_adc_remove),
+	.suspend	= s3c_adc_suspend,
+	.resume		= s3c_adc_resume,
+};
+
+static int __init adc_init(void)
+{
+	int ret;
+
+	ret = platform_driver_register(&s3c_adc_driver);
+	if (ret)
+		printk(KERN_ERR "%s: failed to add adc driver\n", __func__);
+
+	return ret;
+}
+
+arch_initcall(adc_init);
Index: linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c/include/plat/adc.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c/include/plat/adc.h	2008-10-08 15:00:20.000000000 +0100
@@ -0,0 +1,29 @@
+/* arch/arm/plat-s3c/include/plat/adc.h
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ *	http://armlinux.simnte.co.uk/
+ *	Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
+ *
+ * S3C24XX ADC driver information
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_PLAT_ADC_H
+#define __ASM_PLAT_ADC_H __FILE__
+
+struct s3c_adc_client;
+
+extern int s3c_adc_start(struct s3c_adc_client *client,
+			 unsigned int channel, unsigned int nr_samples);
+
+extern struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev,
+					       void (*select)(unsigned selected),
+					       void (*conv)(unsigned d0, unsigned d1),
+					       unsigned int is_ts);
+
+extern void s3c_adc_release(struct s3c_adc_client *client);
+
+#endif /* __ASM_PLAT_ADC_H */
Index: linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/devs.c
===================================================================
--- linux-2.6.27-rc9-s3c64xx-2.orig/arch/arm/plat-s3c24xx/devs.c	2008-10-08 15:00:20.000000000 +0100
+++ linux-2.6.27-rc9-s3c64xx-2/arch/arm/plat-s3c24xx/devs.c	2008-10-10 10:39:53.000000000 +0100
@@ -372,12 +372,20 @@ static struct resource s3c_adc_resource[
 };
 
 struct platform_device s3c_device_adc = {
-	.name		  = "s3c2410-adc",
+	.name		  = "s3c24xx-adc",
 	.id		  = -1,
 	.num_resources	  = ARRAY_SIZE(s3c_adc_resource),
 	.resource	  = s3c_adc_resource,
 };
 
+/* HWMON */
+
+struct platform_device s3c_device_hwmon = {
+	.name		= "s3c24xx-hwmon",
+	.id		= -1,
+	.dev.parent	= &s3c_device_adc.dev,
+};
+
 /* SDI */
 
 static struct resource s3c_sdi_resource[] = {

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 7/9] ANUBIS: Add SM501 GPIO and update I2C setup
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
                   ` (5 preceding siblings ...)
  2008-10-10 10:03 ` [patch 6/9] S3C24XX: Common ADC driver for S3C24XX archs Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 8/9] S3C24XX: Add extra GPIOs via Kconfig Ben Dooks
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-mach-anubis-update-sm501-gpio.patch --]
[-- Type: text/plain, Size: 1760 bytes --]

Add GPIO support to the SM501 on the Simtec Anubis,
and then add the necessary updates for allowing the
two gpio I2C busses to be used.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.26-rc8-quilt3/arch/arm/mach-s3c2440/mach-anubis.c
===================================================================
--- linux-2.6.26-rc8-quilt3.orig/arch/arm/mach-s3c2440/mach-anubis.c	2008-07-02 14:56:08.000000000 +0100
+++ linux-2.6.26-rc8-quilt3/arch/arm/mach-s3c2440/mach-anubis.c	2008-07-02 15:44:23.000000000 +0100
@@ -367,6 +367,8 @@ static struct sm501_initdata anubis_sm50
 		.mask	= 0,
 	},
 
+	.devices	= SM501_USE_GPIO,
+
 	/* set the SDRAM and bus clocks */
 	.mclk		= 72 * MHZ,
 	.m1xclk		= 144 * MHZ,
@@ -374,10 +376,12 @@ static struct sm501_initdata anubis_sm50
 
 static struct sm501_platdata_gpio_i2c anubis_sm501_gpio_i2c[] = {
 	[0] = {
+		.bus_num	= 1,
 		.pin_scl	= 44,
 		.pin_sda	= 45,
 	},
 	[1] = {
+		.bus_num	= 2,
 		.pin_scl	= 40,
 		.pin_sda	= 41,
 	},
@@ -385,6 +389,7 @@ static struct sm501_platdata_gpio_i2c an
 
 static struct sm501_platdata anubis_sm501_platdata = {
 	.init		= &anubis_sm501_initdata,
+	.gpio_base	= -1,
 	.gpio_i2c	= anubis_sm501_gpio_i2c,
 	.gpio_i2c_nr	= ARRAY_SIZE(anubis_sm501_gpio_i2c),
 };

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 8/9] S3C24XX: Add extra GPIOs via Kconfig
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
                   ` (6 preceding siblings ...)
  2008-10-10 10:03 ` [patch 7/9] ANUBIS: Add SM501 GPIO and update I2C setup Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
  2008-10-10 10:03 ` [patch 9/9] JIVE: fix spi gpio implementation Ben Dooks
       [not found] ` <20081010100344.572052114-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-s3c24xx-gpiolib-add-extra-gpios.patch --]
[-- Type: text/plain, Size: 3101 bytes --]

Add Kconfig entries to allow more GPIO space to
be specified depending on the machine(s) selected.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.26-rc9-quilt2/arch/arm/mach-s3c2440/Kconfig
===================================================================
--- linux-2.6.26-rc9-quilt2.orig/arch/arm/mach-s3c2440/Kconfig	2008-07-10 15:06:32.000000000 +0100
+++ linux-2.6.26-rc9-quilt2/arch/arm/mach-s3c2440/Kconfig	2008-07-10 16:01:32.000000000 +0100
@@ -30,6 +30,7 @@ config MACH_ANUBIS
 	select CPU_S3C2440
 	select PM_SIMTEC if PM
 	select HAVE_PATA_PLATFORM
+	select S3C24XX_GPIO_EXTRA64
 	help
 	  Say Y here if you are using the Simtec Electronics ANUBIS
 	  development system
@@ -38,6 +39,7 @@ config MACH_OSIRIS
 	bool "Simtec IM2440D20 (OSIRIS) module"
 	select CPU_S3C2440
 	select PM_SIMTEC if PM
+	select S3C24XX_GPIO_EXTRA128
 	help
 	  Say Y here if you are using the Simtec IM2440D20 module, also
 	  known as the Osiris.
Index: linux-2.6.26-rc9-quilt2/arch/arm/plat-s3c24xx/Kconfig
===================================================================
--- linux-2.6.26-rc9-quilt2.orig/arch/arm/plat-s3c24xx/Kconfig	2008-07-10 15:04:53.000000000 +0100
+++ linux-2.6.26-rc9-quilt2/arch/arm/plat-s3c24xx/Kconfig	2008-07-10 16:01:55.000000000 +0100
@@ -28,6 +28,27 @@ config S3C24XX_PWM
 	  Support for exporting the PWM timer blocks via the pwm device
 	  system.
 
+
+# gpio configurations
+
+config S3C24XX_GPIO_EXTRA
+	int
+	default 128 if S3C24XX_GPIO_EXTRA128
+	default 64 if S3C24XX_GPIO_EXTRA64
+	default 0
+
+config S3C24XX_GPIO_EXTRA64
+	bool
+	help
+	  Add an extra 64 gpio numbers to the available GPIO pool. This is
+	  available for boards that need extra gpios for external devices.
+
+config S3C24XX_GPIO_EXTRA128
+	bool
+	help
+	  Add an extra 128 gpio numbers to the available GPIO pool. This is
+	  available for boards that need extra gpios for external devices.
+
 config PM_SIMTEC
 	bool
 	help
Index: linux-2.6.26-rc9-quilt2/arch/arm/mach-s3c2410/include/mach/gpio.h
===================================================================
--- linux-2.6.26-rc9-quilt2.orig/arch/arm/mach-s3c2410/include/mach/gpio.h	2008-07-10 15:03:23.000000000 +0100
+++ linux-2.6.26-rc9-quilt2/arch/arm/mach-s3c2410/include/mach/gpio.h	2008-07-10 15:06:56.000000000 +0100
@@ -15,4 +15,10 @@
 #define gpio_set_value	__gpio_set_value
 #define gpio_cansleep	__gpio_cansleep
 
+/* some boards require extra gpio capacity to support external
+ * devices that need GPIO.
+ */
+
+#define ARCH_NR_GPIOS	(256 + CONFIG_S3C24XX_GPIO_EXTRA)
+
 #include <asm-generic/gpio.h>

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 9/9] JIVE: fix spi gpio implementation
  2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
                   ` (7 preceding siblings ...)
  2008-10-10 10:03 ` [patch 8/9] S3C24XX: Add extra GPIOs via Kconfig Ben Dooks
@ 2008-10-10 10:03 ` Ben Dooks
       [not found] ` <20081010100344.572052114-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
  9 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:03 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, Ben Dooks

[-- Attachment #1: simtec/simtec-jive-fix-gpio-spi.patch --]
[-- Type: text/plain, Size: 1787 bytes --]

Fix the name of the driver, as well as the fact we are not
passing the number of chipselects to the driver.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.27-rc7-quilt2/arch/arm/mach-s3c2412/mach-jive.c
===================================================================
--- linux-2.6.27-rc7-quilt2.orig/arch/arm/mach-s3c2412/mach-jive.c	2008-09-23 15:01:44.000000000 +0100
+++ linux-2.6.27-rc7-quilt2/arch/arm/mach-s3c2412/mach-jive.c	2008-09-23 15:01:47.000000000 +0100
@@ -402,11 +402,12 @@ static struct s3c2410_spigpio_info jive_
 	.bus_num	= 1,
 	.pin_clk	= S3C2410_GPG8,
 	.pin_mosi	= S3C2410_GPB8,
+	.num_chipselect	= 1,
 	.chip_select	= jive_lcd_spi_chipselect,
 };
 
 static struct platform_device jive_device_lcdspi = {
-	.name		= "s3c24xx-spi-gpio",
+	.name		= "spi_s3c24xx_gpio",
 	.id		= 1,
 	.num_resources  = 0,
 	.dev.platform_data = &jive_lcd_spi,
@@ -423,11 +424,12 @@ static struct s3c2410_spigpio_info jive_
 	.bus_num	= 2,
 	.pin_clk	= S3C2410_GPB4,
 	.pin_mosi	= S3C2410_GPB9,
+	.num_chipselect	= 1,
 	.chip_select	= jive_wm8750_chipselect,
 };
 
 static struct platform_device jive_device_wm8750 = {
-	.name		= "s3c24xx-spi-gpio",
+	.name		= "spi_s3c24xx_gpio",
 	.id		= 2,
 	.num_resources  = 0,
 	.dev.platform_data = &jive_wm8750_spi,

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch 0/9] S3C24XX SPI updates for 2.6.28
       [not found] ` <20081010100344.572052114-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
@ 2008-10-10 10:21   ` Ben Dooks
  0 siblings, 0 replies; 11+ messages in thread
From: Ben Dooks @ 2008-10-10 10:21 UTC (permalink / raw)
  To: Ben Dooks
  Cc: david-b-yBeKhBN/0LDR7s880joybQ,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Fri, Oct 10, 2008 at 11:03:44AM +0100, Ben Dooks wrote:
> SPI updates for S3C24XX SPI drivers

Sorry about that, this is the series that went to linux-arm-kernel.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-10-10 10:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-10 10:03 [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks
2008-10-10 10:03 ` [patch 1/9] S3C24XX: Default SPI pin configuration for SPI Ben Dooks
2008-10-10 10:03 ` [patch 2/9] S3C24XX: Fix sparse errors in platform uncompress.h Ben Dooks
2008-10-10 10:03 ` [patch 3/9] arch/arm/mach-s3c2410/pm.c: fix sparse warnings Ben Dooks
2008-10-10 10:03 ` [patch 4/9] S3C24XX: AT2440EVB MMC Ben Dooks
2008-10-10 10:03 ` [patch 5/9] AT2440EVB: LCD frame buffer support Ben Dooks
2008-10-10 10:03 ` [patch 6/9] S3C24XX: Common ADC driver for S3C24XX archs Ben Dooks
2008-10-10 10:03 ` [patch 7/9] ANUBIS: Add SM501 GPIO and update I2C setup Ben Dooks
2008-10-10 10:03 ` [patch 8/9] S3C24XX: Add extra GPIOs via Kconfig Ben Dooks
2008-10-10 10:03 ` [patch 9/9] JIVE: fix spi gpio implementation Ben Dooks
     [not found] ` <20081010100344.572052114-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-10-10 10:21   ` [patch 0/9] S3C24XX SPI updates for 2.6.28 Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).