This huge patch mostly shuffles code. The spitz.c file contained terrible mess
and needed a cleanup, here it is:
1) Made every part modular, components are not built in if not selected.
2) Removed loads of preprocessor goo, mostly #ifdef MACH_AKITA #endif and
similar code. The kernel size will grow by a few kb now, but the file is much
more readable.
3) Reworked SD/CF power setting function and made it reentrant.
4) Add ISL6271A regulator support
5) Correctly register WM8750
Signed-off-by: Marek Vasut marek.va...@gmail.com
---
arch/arm/mach-pxa/include/mach/spitz.h |2 -
arch/arm/mach-pxa/spitz.c | 810 ++-
2 files changed, 470 insertions(+), 342 deletions(-)
diff --git a/arch/arm/mach-pxa/include/mach/spitz.h
b/arch/arm/mach-pxa/include/mach/spitz.h
index fa1998c..685749a 100644
--- a/arch/arm/mach-pxa/include/mach/spitz.h
+++ b/arch/arm/mach-pxa/include/mach/spitz.h
@@ -185,7 +185,5 @@
/*
* Shared data structures
*/
-extern struct platform_device spitzscoop_device;
-extern struct platform_device spitzscoop2_device;
extern struct platform_device spitzssp_device;
extern struct sharpsl_charger_machinfo spitz_pm_machinfo;
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 4d2413e..fa31980 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -18,14 +18,15 @@
#include linux/gpio_keys.h
#include linux/gpio.h
#include linux/leds.h
-#include linux/mtd/physmap.h
#include linux/i2c.h
#include linux/i2c/pca953x.h
#include linux/spi/spi.h
#include linux/spi/ads7846.h
#include linux/spi/corgi_lcd.h
+#include linux/mtd/physmap.h
#include linux/mtd/sharpsl.h
#include linux/input/matrix_keypad.h
+#include linux/regulator/machine.h
#include asm/setup.h
#include asm/mach-types.h
@@ -33,11 +34,9 @@
#include asm/mach/sharpsl_param.h
#include asm/hardware/scoop.h
-
#include mach/pxa27x.h
#include mach/pxa27x-udc.h
#include mach/reset.h
-#include plat/i2c.h
#include mach/irda.h
#include mach/mmc.h
#include mach/ohci.h
@@ -45,11 +44,16 @@
#include mach/pxa2xx_spi.h
#include mach/spitz.h
+#include plat/i2c.h
+
#include generic.h
#include devices.h
#include sharpsl.h
-static unsigned long spitz_pin_config[] __initdata = {
+/**
+ * Pin configuration
+
**/
+static unsigned long sharpslc_pin_config[] __initdata = {
/* Chip Selects */
GPIO78_nCS_2, /* SCOOP #2 */
GPIO79_nCS_3, /* NAND */
@@ -124,10 +128,13 @@ static unsigned long spitz_pin_config[] __initdata = {
GPIO1_GPIO | WAKEUP_ON_EDGE_FALL, /* SPITZ_GPIO_RESET */
};
-/*
- * Spitz SCOOP Device #1
- */
-static struct resource spitz_scoop_resources[] = {
+
+/**
+ * Scoop GPIO expander
+
**/
+#if defined(CONFIG_SHARP_SCOOP) || defined(CONFIG_SHARP_SCOOP_MODULE)
+/* SCOOP Device #1 */
+static struct resource sharpslc_scoop_1_resources[] = {
[0] = {
.start = 0x1080,
.end= 0x10800fff,
@@ -135,7 +142,7 @@ static struct resource spitz_scoop_resources[] = {
},
};
-static struct scoop_config spitz_scoop_setup = {
+static struct scoop_config sharpslc_scoop_1_setup = {
.io_dir = SPITZ_SCP_IO_DIR,
.io_out = SPITZ_SCP_IO_OUT,
.suspend_clr= SPITZ_SCP_SUS_CLR,
@@ -143,20 +150,18 @@ static struct scoop_config spitz_scoop_setup = {
.gpio_base = SPITZ_SCP_GPIO_BASE,
};
-struct platform_device spitzscoop_device = {
+struct platform_device sharpslc_scoop_1_device = {
.name = sharp-scoop,
.id = 0,
.dev= {
- .platform_data = spitz_scoop_setup,
+ .platform_data = sharpslc_scoop_1_setup,
},
- .num_resources = ARRAY_SIZE(spitz_scoop_resources),
- .resource = spitz_scoop_resources,
+ .num_resources = ARRAY_SIZE(sharpslc_scoop_1_resources),
+ .resource = sharpslc_scoop_1_resources,
};
-/*
- * Spitz SCOOP Device #2
- */
-static struct resource spitz_scoop2_resources[] = {
+/* SCOOP Device #2 */
+static struct resource sharpslc_scoop_2_resources[] = {
[0] = {
.start = 0x08800040,
.end= 0x08800fff,
@@ -164,7 +169,7 @@ static struct resource spitz_scoop2_resources[] = {
},
};
-static struct scoop_config spitz_scoop2_setup = {
+static struct scoop_config sharpslc_scoop_2_setup = {
.io_dir = SPITZ_SCP2_IO_DIR,
.io_out = SPITZ_SCP2_IO_OUT,
.suspend_clr= SPITZ_SCP2_SUS_CLR,
@@ -172,82 +177,110 @@ static struct scoop_config spitz_scoop2_setup = {