Skip to contentSkip to conversation

SharpSL: Abstract c7x0 specifics from Corgi SSP

PATCH New Richard Purdie 1 participant 1 message Sep 9, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 SharpSL: Abstract c7x0 specifics from Corgi SSP

Separate out the Sharp Zaurus c7x0 series specific code from corgi_ssp.c so that other models such as the cxx00's can share it. Create sharpsl.h which will be used to abstract machine/model specifics.

This enables the driver to be used by the Zaurus cxx00 series.

arch/arm/mach-pxa/corgi.c +13 -0
Index: linux-2.6.13/arch/arm/mach-pxa/corgi.c
===================================================================
@@ -41,6 +41,7 @@
 #include <asm/hardware/scoop.h>
 
 #include "generic.h"
+#include "sharpsl.h"
 
 
 /*
@@ -94,6 +95,16 @@
 	.id		= -1,
 };
 
+struct corgissp_machinfo corgi_ssp_machinfo = {
+	.port		= 1,
+	.cs_lcdcon	= CORGI_GPIO_LCDCON_CS,
+	.cs_ads7846	= CORGI_GPIO_ADS7846_CS,
+	.cs_max1111	= CORGI_GPIO_MAX1111_CS,
+	.clk_lcdcon	= 76,
+	.clk_ads7846	= 2,
+	.clk_max1111	= 8,
+};
+
 
 /*
  * Corgi Backlight Device
@@ -243,6 +254,8 @@
 
 static void __init corgi_init(void)
 {
+	corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
+
 	pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
  	pxa_set_udc_info(&udc_info);
 	pxa_set_mci_info(&corgi_mci_platform_data);
arch/arm/mach-pxa/corgi_ssp.c +39 -27

159 lines not on this page · raw message

arch/arm/mach-pxa/sharpsl.h new file +15 -0
Index: linux-2.6.13/arch/arm/mach-pxa/sharpsl.h
===================================================================
@@ -0,0 +1,15 @@
+/*
+ * SharpSL SSP Driver
+ */
+
+struct corgissp_machinfo {
+	int port;
+	int cs_lcdcon;
+	int cs_ads7846;
+	int cs_max1111;
+	int clk_lcdcon;
+	int clk_ads7846;
+	int clk_max1111;
+};
+
+void corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo);
include/asm-arm/arch-pxa/corgi.h +0 -12
Index: linux-2.6.13/include/asm-arm/arch-pxa/corgi.h
===================================================================
@@ -106,17 +106,5 @@
 extern struct platform_device corgissp_device;
 extern struct platform_device corgifb_device;
 
-/*
- * External Functions
- */
-extern unsigned long corgi_ssp_ads7846_putget(unsigned long);
-extern unsigned long corgi_ssp_ads7846_get(void);
-extern void corgi_ssp_ads7846_put(unsigned long data);
-extern void corgi_ssp_ads7846_lock(void);
-extern void corgi_ssp_ads7846_unlock(void);
-extern void corgi_ssp_lcdtg_send (unsigned char adrs, unsigned char data);
-extern void corgi_ssp_blduty_set(int duty);
-extern int corgi_ssp_max1111_get(unsigned long data);
-
 #endif /* __ASM_ARCH_CORGI_H  */
 
include/asm-arm/arch-pxa/sharpsl.h new file +12 -0
Index: linux-2.6.13/include/asm-arm/arch-pxa/sharpsl.h
===================================================================
@@ -0,0 +1,12 @@
+/*
+ * SharpSL SSP Driver
+ */
+
+unsigned long corgi_ssp_ads7846_putget(unsigned long);
+unsigned long corgi_ssp_ads7846_get(void);
+void corgi_ssp_ads7846_put(unsigned long data);
+void corgi_ssp_ads7846_lock(void);
+void corgi_ssp_ads7846_unlock(void);
+void corgi_ssp_lcdtg_send (unsigned char adrs, unsigned char data);
+void corgi_ssp_blduty_set(int duty);
+int corgi_ssp_max1111_get(unsigned long data);