aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-pxa/Kconfig1
-rw-r--r--arch/arm/mach-pxa/Makefile2
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c42
-rw-r--r--arch/arm/mach-pxa/poodle.c69
4 files changed, 97 insertions, 17 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 0104fd142e70..ea5137f319c4 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -61,6 +61,7 @@ config MACH_POODLE
61 bool "Enable Sharp SL-5600 (Poodle) Support" 61 bool "Enable Sharp SL-5600 (Poodle) Support"
62 depends PXA_SHARPSL_25x 62 depends PXA_SHARPSL_25x
63 select SHARP_LOCOMO 63 select SHARP_LOCOMO
64 select PXA_SSP
64 65
65config MACH_CORGI 66config MACH_CORGI
66 bool "Enable Sharp SL-C700 (Corgi) Support" 67 bool "Enable Sharp SL-C700 (Corgi) Support"
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 4e8a983e2b83..1610690be419 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
15obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o 15obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o
16obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o 16obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o
17obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o 17obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
18obj-$(CONFIG_MACH_POODLE) += poodle.o 18obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o
19obj-$(CONFIG_MACH_TOSA) += tosa.o 19obj-$(CONFIG_MACH_TOSA) += tosa.o
20 20
21# Support for blinky lights 21# Support for blinky lights
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index 8a25a1c8019f..f9421318cb7a 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -50,12 +50,14 @@ unsigned long corgi_ssp_ads7846_putget(ulong data)
50 unsigned long ret,flag; 50 unsigned long ret,flag;
51 51
52 spin_lock_irqsave(&corgi_ssp_lock, flag); 52 spin_lock_irqsave(&corgi_ssp_lock, flag);
53 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 53 if (ssp_machinfo->cs_ads7846 >= 0)
54 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
54 55
55 ssp_write_word(&corgi_ssp_dev,data); 56 ssp_write_word(&corgi_ssp_dev,data);
56 ret = ssp_read_word(&corgi_ssp_dev); 57 ret = ssp_read_word(&corgi_ssp_dev);
57 58
58 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 59 if (ssp_machinfo->cs_ads7846 >= 0)
60 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
59 spin_unlock_irqrestore(&corgi_ssp_lock, flag); 61 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
60 62
61 return ret; 63 return ret;
@@ -68,12 +70,14 @@ unsigned long corgi_ssp_ads7846_putget(ulong data)
68void corgi_ssp_ads7846_lock(void) 70void corgi_ssp_ads7846_lock(void)
69{ 71{
70 spin_lock(&corgi_ssp_lock); 72 spin_lock(&corgi_ssp_lock);
71 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 73 if (ssp_machinfo->cs_ads7846 >= 0)
74 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
72} 75}
73 76
74void corgi_ssp_ads7846_unlock(void) 77void corgi_ssp_ads7846_unlock(void)
75{ 78{
76 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 79 if (ssp_machinfo->cs_ads7846 >= 0)
80 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
77 spin_unlock(&corgi_ssp_lock); 81 spin_unlock(&corgi_ssp_lock);
78} 82}
79 83
@@ -110,11 +114,13 @@ unsigned long corgi_ssp_dac_put(ulong data)
110 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), sscr1, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_lcdcon)); 114 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), sscr1, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_lcdcon));
111 ssp_enable(&corgi_ssp_dev); 115 ssp_enable(&corgi_ssp_dev);
112 116
113 GPCR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); 117 if (ssp_machinfo->cs_lcdcon >= 0)
118 GPCR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon);
114 ssp_write_word(&corgi_ssp_dev,data); 119 ssp_write_word(&corgi_ssp_dev,data);
115 /* Read null data back from device to prevent SSP overflow */ 120 /* Read null data back from device to prevent SSP overflow */
116 ssp_read_word(&corgi_ssp_dev); 121 ssp_read_word(&corgi_ssp_dev);
117 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); 122 if (ssp_machinfo->cs_lcdcon >= 0)
123 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon);
118 124
119 ssp_disable(&corgi_ssp_dev); 125 ssp_disable(&corgi_ssp_dev);
120 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); 126 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846));
@@ -147,7 +153,8 @@ int corgi_ssp_max1111_get(ulong data)
147 int voltage,voltage1,voltage2; 153 int voltage,voltage1,voltage2;
148 154
149 spin_lock_irqsave(&corgi_ssp_lock, flag); 155 spin_lock_irqsave(&corgi_ssp_lock, flag);
150 GPCR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); 156 if (ssp_machinfo->cs_max1111 >= 0)
157 GPCR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111);
151 ssp_disable(&corgi_ssp_dev); 158 ssp_disable(&corgi_ssp_dev);
152 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_max1111)); 159 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_max1111));
153 ssp_enable(&corgi_ssp_dev); 160 ssp_enable(&corgi_ssp_dev);
@@ -169,7 +176,8 @@ int corgi_ssp_max1111_get(ulong data)
169 ssp_disable(&corgi_ssp_dev); 176 ssp_disable(&corgi_ssp_dev);
170 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); 177 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846));
171 ssp_enable(&corgi_ssp_dev); 178 ssp_enable(&corgi_ssp_dev);
172 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); 179 if (ssp_machinfo->cs_max1111 >= 0)
180 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111);
173 spin_unlock_irqrestore(&corgi_ssp_lock, flag); 181 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
174 182
175 if (voltage1 & 0xc0 || voltage2 & 0x3f) 183 if (voltage1 & 0xc0 || voltage2 & 0x3f)
@@ -196,9 +204,12 @@ static int __init corgi_ssp_probe(struct platform_device *dev)
196 int ret; 204 int ret;
197 205
198 /* Chip Select - Disable All */ 206 /* Chip Select - Disable All */
199 pxa_gpio_mode(ssp_machinfo->cs_lcdcon | GPIO_OUT | GPIO_DFLT_HIGH); 207 if (ssp_machinfo->cs_lcdcon >= 0)
200 pxa_gpio_mode(ssp_machinfo->cs_max1111 | GPIO_OUT | GPIO_DFLT_HIGH); 208 pxa_gpio_mode(ssp_machinfo->cs_lcdcon | GPIO_OUT | GPIO_DFLT_HIGH);
201 pxa_gpio_mode(ssp_machinfo->cs_ads7846 | GPIO_OUT | GPIO_DFLT_HIGH); 209 if (ssp_machinfo->cs_max1111 >= 0)
210 pxa_gpio_mode(ssp_machinfo->cs_max1111 | GPIO_OUT | GPIO_DFLT_HIGH);
211 if (ssp_machinfo->cs_ads7846 >= 0)
212 pxa_gpio_mode(ssp_machinfo->cs_ads7846 | GPIO_OUT | GPIO_DFLT_HIGH);
202 213
203 ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0); 214 ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0);
204 215
@@ -229,9 +240,12 @@ static int corgi_ssp_suspend(struct platform_device *dev, pm_message_t state)
229 240
230static int corgi_ssp_resume(struct platform_device *dev) 241static int corgi_ssp_resume(struct platform_device *dev)
231{ 242{
232 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */ 243 if (ssp_machinfo->cs_lcdcon >= 0)
233 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/ 244 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */
234 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/ 245 if (ssp_machinfo->cs_max1111 >= 0)
246 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/
247 if (ssp_machinfo->cs_ads7846 >= 0)
248 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/
235 ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state); 249 ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state);
236 ssp_enable(&corgi_ssp_dev); 250 ssp_enable(&corgi_ssp_dev);
237 251
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 234877a09dfb..9a9fa87cea9f 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -37,12 +37,15 @@
37#include <asm/arch/irda.h> 37#include <asm/arch/irda.h>
38#include <asm/arch/poodle.h> 38#include <asm/arch/poodle.h>
39#include <asm/arch/pxafb.h> 39#include <asm/arch/pxafb.h>
40#include <asm/arch/sharpsl.h>
41#include <asm/arch/ssp.h>
40 42
41#include <asm/hardware/scoop.h> 43#include <asm/hardware/scoop.h>
42#include <asm/hardware/locomo.h> 44#include <asm/hardware/locomo.h>
43#include <asm/mach/sharpsl_param.h> 45#include <asm/mach/sharpsl_param.h>
44 46
45#include "generic.h" 47#include "generic.h"
48#include "sharpsl.h"
46 49
47static struct resource poodle_scoop_resources[] = { 50static struct resource poodle_scoop_resources[] = {
48 [0] = { 51 [0] = {
@@ -120,13 +123,71 @@ static struct resource locomo_resources[] = {
120 }, 123 },
121}; 124};
122 125
123static struct platform_device locomo_device = { 126struct platform_device poodle_locomo_device = {
124 .name = "locomo", 127 .name = "locomo",
125 .id = 0, 128 .id = 0,
126 .num_resources = ARRAY_SIZE(locomo_resources), 129 .num_resources = ARRAY_SIZE(locomo_resources),
127 .resource = locomo_resources, 130 .resource = locomo_resources,
128}; 131};
129 132
133EXPORT_SYMBOL(poodle_locomo_device);
134
135/*
136 * Poodle SSP Device
137 */
138
139struct platform_device poodle_ssp_device = {
140 .name = "corgi-ssp",
141 .id = -1,
142};
143
144struct corgissp_machinfo poodle_ssp_machinfo = {
145 .port = 1,
146 .cs_lcdcon = -1,
147 .cs_ads7846 = -1,
148 .cs_max1111 = -1,
149 .clk_lcdcon = 2,
150 .clk_ads7846 = 36,
151 .clk_max1111 = 2,
152};
153
154
155/*
156 * Poodle Touch Screen Device
157 */
158static struct resource poodlets_resources[] = {
159 [0] = {
160 .start = POODLE_IRQ_GPIO_TP_INT,
161 .end = POODLE_IRQ_GPIO_TP_INT,
162 .flags = IORESOURCE_IRQ,
163 },
164};
165
166static unsigned long poodle_get_hsync_len(void)
167{
168 return 0;
169}
170
171static void poodle_null_hsync(void)
172{
173}
174
175static struct corgits_machinfo poodle_ts_machinfo = {
176 .get_hsync_len = poodle_get_hsync_len,
177 .put_hsync = poodle_null_hsync,
178 .wait_hsync = poodle_null_hsync,
179};
180
181static struct platform_device poodle_ts_device = {
182 .name = "corgi-ts",
183 .dev = {
184 .platform_data = &poodle_ts_machinfo,
185 },
186 .id = -1,
187 .num_resources = ARRAY_SIZE(poodlets_resources),
188 .resource = poodlets_resources,
189};
190
130 191
131/* 192/*
132 * MMC/SD Device 193 * MMC/SD Device
@@ -259,8 +320,10 @@ static struct pxafb_mach_info poodle_fb_info __initdata = {
259}; 320};
260 321
261static struct platform_device *devices[] __initdata = { 322static struct platform_device *devices[] __initdata = {
262 &locomo_device, 323 &poodle_locomo_device,
263 &poodle_scoop_device, 324 &poodle_scoop_device,
325 &poodle_ssp_device,
326 &poodle_ts_device,
264}; 327};
265 328
266static void poodle_poweroff(void) 329static void poodle_poweroff(void)
@@ -319,6 +382,7 @@ static void __init poodle_init(void)
319 GPSR1 = 0x00000000; 382 GPSR1 = 0x00000000;
320 GPSR2 = 0x00000000; 383 GPSR2 = 0x00000000;
321 384
385 set_pxa_fb_parent(&poodle_locomo_device.dev);
322 set_pxa_fb_info(&poodle_fb_info); 386 set_pxa_fb_info(&poodle_fb_info);
323 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT); 387 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT);
324 pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT); 388 pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT);
@@ -332,6 +396,7 @@ static void __init poodle_init(void)
332 if (ret) { 396 if (ret) {
333 printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n"); 397 printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n");
334 } 398 }
399 corgi_ssp_set_machinfo(&poodle_ssp_machinfo);
335} 400}
336 401
337static void __init fixup_poodle(struct machine_desc *desc, 402static void __init fixup_poodle(struct machine_desc *desc,