aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-09-13 04:25:34 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-13 11:22:31 -0400
commit0dd28f1dd83a0e49b75d5171477bc56158681411 (patch)
treef0f917f090df608927fa1288a5b9a84efea81b07
parent1351e6e093271d0f5056f3ac272864cf4383041a (diff)
[PATCH] SharpSL: Add new ARM PXA machines Spitz and Borzoi with partial Akita Support
Add the platform support code for two new Sharp Zaurus Models, Spitz (SL-C3000) and Borzoi (SL-C3100). This patch also adds most of the foundations for Akita (SL-C1000) Support. The missing link for Akita is the driver for its I2C io expander. Once this has been finished, the missing Kconfig option and machine declaration can easily be added to this code. Signed-Off-by: Richard Purdie <rpurdie@rpsys.net> Cc: Vojtech Pavlik <vojtech@suse.cz> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/arm/mach-pxa/Kconfig49
-rw-r--r--arch/arm/mach-pxa/Makefile1
-rw-r--r--arch/arm/mach-pxa/spitz.c380
-rw-r--r--include/asm-arm/arch-pxa/akita.h30
-rw-r--r--include/asm-arm/arch-pxa/spitz.h158
5 files changed, 609 insertions, 9 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 405a55f2287c..3e5f69bb5ac4 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -20,40 +20,66 @@ config ARCH_PXA_IDP
20 select PXA25x 20 select PXA25x
21 21
22config PXA_SHARPSL 22config PXA_SHARPSL
23 bool "SHARP SL-5600 and SL-C7xx Models" 23 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
24 select PXA25x
25 select SHARP_SCOOP 24 select SHARP_SCOOP
26 select SHARP_PARAM 25 select SHARP_PARAM
27 help 26 help
28 Say Y here if you intend to run this kernel on a 27 Say Y here if you intend to run this kernel on a
29 Sharp SL-5600 (Poodle), Sharp SL-C700 (Corgi), 28 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
30 SL-C750 (Shepherd) or a Sharp SL-C760 (Husky) 29 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita),
31 handheld computer. 30 SL-C3000 (Spitz) or SL-C3100 (Borzoi) handheld computer.
32 31
33endchoice 32endchoice
34 33
34if PXA_SHARPSL
35
36choice
37 prompt "Select target Sharp Zaurus device range"
38
39config PXA_SHARPSL_25x
40 bool "Sharp PXA25x models (SL-5600 and SL-C7xx)"
41 select PXA25x
42
43config PXA_SHARPSL_27x
44 bool "Sharp PXA270 models (SL-Cxx00)"
45 select PXA27x
46
47endchoice
48
49endif
50
35endmenu 51endmenu
36 52
37config MACH_POODLE 53config MACH_POODLE
38 bool "Enable Sharp SL-5600 (Poodle) Support" 54 bool "Enable Sharp SL-5600 (Poodle) Support"
39 depends PXA_SHARPSL 55 depends PXA_SHARPSL_25x
40 select SHARP_LOCOMO 56 select SHARP_LOCOMO
41 57
42config MACH_CORGI 58config MACH_CORGI
43 bool "Enable Sharp SL-C700 (Corgi) Support" 59 bool "Enable Sharp SL-C700 (Corgi) Support"
44 depends PXA_SHARPSL 60 depends PXA_SHARPSL_25x
45 select PXA_SHARP_C7xx 61 select PXA_SHARP_C7xx
46 62
47config MACH_SHEPHERD 63config MACH_SHEPHERD
48 bool "Enable Sharp SL-C750 (Shepherd) Support" 64 bool "Enable Sharp SL-C750 (Shepherd) Support"
49 depends PXA_SHARPSL 65 depends PXA_SHARPSL_25x
50 select PXA_SHARP_C7xx 66 select PXA_SHARP_C7xx
51 67
52config MACH_HUSKY 68config MACH_HUSKY
53 bool "Enable Sharp SL-C760 (Husky) Support" 69 bool "Enable Sharp SL-C760 (Husky) Support"
54 depends PXA_SHARPSL 70 depends PXA_SHARPSL_25x
55 select PXA_SHARP_C7xx 71 select PXA_SHARP_C7xx
56 72
73config MACH_SPITZ
74 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
75 depends PXA_SHARPSL_27x
76 select PXA_SHARP_Cxx00
77
78config MACH_BORZOI
79 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support"
80 depends PXA_SHARPSL_27x
81 select PXA_SHARP_Cxx00
82
57config PXA25x 83config PXA25x
58 bool 84 bool
59 help 85 help
@@ -74,4 +100,9 @@ config PXA_SHARP_C7xx
74 help 100 help
75 Enable support for all Sharp C7xx models 101 Enable support for all Sharp C7xx models
76 102
103config PXA_SHARP_Cxx00
104 bool
105 help
106 Enable common support for Sharp Cxx00 models
107
77endif 108endif
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 33dae99ec2d8..f609a0f232cb 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
12obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 12obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
13obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 13obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
14obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o ssp.o 14obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o ssp.o
15obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o ssp.o
15obj-$(CONFIG_MACH_POODLE) += poodle.o 16obj-$(CONFIG_MACH_POODLE) += poodle.o
16 17
17# Support for blinky lights 18# Support for blinky lights
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
new file mode 100644
index 000000000000..568afe3d6e1a
--- /dev/null
+++ b/arch/arm/mach-pxa/spitz.c
@@ -0,0 +1,380 @@
1/*
2 * Support for Sharp SL-Cxx00 Series of PDAs
3 * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi)
4 *
5 * Copyright (c) 2005 Richard Purdie
6 *
7 * Based on Sharp's 2.4 kernel patches/lubbock.c
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/delay.h>
19#include <linux/major.h>
20#include <linux/fs.h>
21#include <linux/interrupt.h>
22#include <linux/mmc/host.h>
23
24#include <asm/setup.h>
25#include <asm/memory.h>
26#include <asm/mach-types.h>
27#include <asm/hardware.h>
28#include <asm/irq.h>
29#include <asm/io.h>
30
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33#include <asm/mach/irq.h>
34
35#include <asm/arch/pxa-regs.h>
36#include <asm/arch/irq.h>
37#include <asm/arch/mmc.h>
38#include <asm/arch/udc.h>
39#include <asm/arch/ohci.h>
40#include <asm/arch/pxafb.h>
41#include <asm/arch/akita.h>
42#include <asm/arch/spitz.h>
43#include <asm/arch/sharpsl.h>
44
45#include <asm/mach/sharpsl_param.h>
46#include <asm/hardware/scoop.h>
47
48#include "generic.h"
49#include "sharpsl.h"
50
51/*
52 * Spitz SCOOP Device #1
53 */
54static struct resource spitz_scoop_resources[] = {
55 [0] = {
56 .start = 0x10800000,
57 .end = 0x10800fff,
58 .flags = IORESOURCE_MEM,
59 },
60};
61
62static struct scoop_config spitz_scoop_setup = {
63 .io_dir = SPITZ_SCP_IO_DIR,
64 .io_out = SPITZ_SCP_IO_OUT,
65 .suspend_clr = SPITZ_SCP_SUS_CLR,
66 .suspend_set = SPITZ_SCP_SUS_SET,
67};
68
69struct platform_device spitzscoop_device = {
70 .name = "sharp-scoop",
71 .id = 0,
72 .dev = {
73 .platform_data = &spitz_scoop_setup,
74 },
75 .num_resources = ARRAY_SIZE(spitz_scoop_resources),
76 .resource = spitz_scoop_resources,
77};
78
79/*
80 * Spitz SCOOP Device #2
81 */
82static struct resource spitz_scoop2_resources[] = {
83 [0] = {
84 .start = 0x08800040,
85 .end = 0x08800fff,
86 .flags = IORESOURCE_MEM,
87 },
88};
89
90static struct scoop_config spitz_scoop2_setup = {
91 .io_dir = SPITZ_SCP2_IO_DIR,
92 .io_out = SPITZ_SCP2_IO_OUT,
93 .suspend_clr = SPITZ_SCP2_SUS_CLR,
94 .suspend_set = SPITZ_SCP2_SUS_SET,
95};
96
97struct platform_device spitzscoop2_device = {
98 .name = "sharp-scoop",
99 .id = 1,
100 .dev = {
101 .platform_data = &spitz_scoop2_setup,
102 },
103 .num_resources = ARRAY_SIZE(spitz_scoop2_resources),
104 .resource = spitz_scoop2_resources,
105};
106
107static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
108{
109 .dev = &spitzscoop_device.dev,
110 .irq = SPITZ_IRQ_GPIO_CF_IRQ,
111 .cd_irq = SPITZ_IRQ_GPIO_CF_CD,
112 .cd_irq_str = "PCMCIA0 CD",
113},{
114 .dev = &spitzscoop2_device.dev,
115 .irq = SPITZ_IRQ_GPIO_CF2_IRQ,
116 .cd_irq = -1,
117},
118};
119
120
121/*
122 * Spitz SSP Device
123 *
124 * Set the parent as the scoop device because a lot of SSP devices
125 * also use scoop functions and this makes the power up/down order
126 * work correctly.
127 */
128struct platform_device spitzssp_device = {
129 .name = "corgi-ssp",
130 .dev = {
131 .parent = &spitzscoop_device.dev,
132 },
133 .id = -1,
134};
135
136struct corgissp_machinfo spitz_ssp_machinfo = {
137 .port = 2,
138 .cs_lcdcon = SPITZ_GPIO_LCDCON_CS,
139 .cs_ads7846 = SPITZ_GPIO_ADS7846_CS,
140 .cs_max1111 = SPITZ_GPIO_MAX1111_CS,
141 .clk_lcdcon = 520,
142 .clk_ads7846 = 14,
143 .clk_max1111 = 56,
144};
145
146
147/*
148 * Spitz Backlight Device
149 */
150static struct corgibl_machinfo spitz_bl_machinfo = {
151 .max_intensity = 0x2f,
152};
153
154static struct platform_device spitzbl_device = {
155 .name = "corgi-bl",
156 .dev = {
157 .platform_data = &spitz_bl_machinfo,
158 },
159 .id = -1,
160};
161
162
163/*
164 * Spitz Keyboard Device
165 */
166static struct platform_device spitzkbd_device = {
167 .name = "spitz-keyboard",
168 .id = -1,
169};
170
171
172/*
173 * Spitz Touch Screen Device
174 */
175static struct resource spitzts_resources[] = {
176 [0] = {
177 .start = SPITZ_IRQ_GPIO_TP_INT,
178 .end = SPITZ_IRQ_GPIO_TP_INT,
179 .flags = IORESOURCE_IRQ,
180 },
181};
182
183static struct corgits_machinfo spitz_ts_machinfo = {
184 .get_hsync_len = spitz_get_hsync_len,
185 .put_hsync = spitz_put_hsync,
186 .wait_hsync = spitz_wait_hsync,
187};
188
189static struct platform_device spitzts_device = {
190 .name = "corgi-ts",
191 .dev = {
192 .parent = &spitzssp_device.dev,
193 .platform_data = &spitz_ts_machinfo,
194 },
195 .id = -1,
196 .num_resources = ARRAY_SIZE(spitzts_resources),
197 .resource = spitzts_resources,
198};
199
200
201/*
202 * MMC/SD Device
203 *
204 * The card detect interrupt isn't debounced so we delay it by 250ms
205 * to give the card a chance to fully insert/eject.
206 */
207
208static struct pxamci_platform_data spitz_mci_platform_data;
209
210static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(int, void *, struct pt_regs *), void *data)
211{
212 int err;
213
214 /* setup GPIO for PXA27x MMC controller */
215 pxa_gpio_mode(GPIO32_MMCCLK_MD);
216 pxa_gpio_mode(GPIO112_MMCCMD_MD);
217 pxa_gpio_mode(GPIO92_MMCDAT0_MD);
218 pxa_gpio_mode(GPIO109_MMCDAT1_MD);
219 pxa_gpio_mode(GPIO110_MMCDAT2_MD);
220 pxa_gpio_mode(GPIO111_MMCDAT3_MD);
221 pxa_gpio_mode(SPITZ_GPIO_nSD_DETECT | GPIO_IN);
222 pxa_gpio_mode(SPITZ_GPIO_nSD_WP | GPIO_IN);
223
224 spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250);
225
226 err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, SA_INTERRUPT,
227 "MMC card detect", data);
228 if (err) {
229 printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
230 return -1;
231 }
232
233 set_irq_type(SPITZ_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
234
235 return 0;
236}
237
238/* Power control is shared with one of the CF slots so we have a mess */
239static void spitz_mci_setpower(struct device *dev, unsigned int vdd)
240{
241 struct pxamci_platform_data* p_d = dev->platform_data;
242
243 unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR);
244
245 if (( 1 << vdd) & p_d->ocr_mask) {
246 /* printk(KERN_DEBUG "%s: on\n", __FUNCTION__); */
247 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
248 mdelay(2);
249 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | 0x04);
250 } else {
251 /* printk(KERN_DEBUG "%s: off\n", __FUNCTION__); */
252 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr & ~0x04);
253
254 if (!(cpr | 0x02)) {
255 mdelay(1);
256 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
257 }
258 }
259}
260
261static int spitz_mci_get_ro(struct device *dev)
262{
263 return GPLR(SPITZ_GPIO_nSD_WP) & GPIO_bit(SPITZ_GPIO_nSD_WP);
264}
265
266static void spitz_mci_exit(struct device *dev, void *data)
267{
268 free_irq(SPITZ_IRQ_GPIO_nSD_DETECT, data);
269}
270
271static struct pxamci_platform_data spitz_mci_platform_data = {
272 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
273 .init = spitz_mci_init,
274 .get_ro = spitz_mci_get_ro,
275 .setpower = spitz_mci_setpower,
276 .exit = spitz_mci_exit,
277};
278
279
280/*
281 * Spitz PXA Framebuffer
282 */
283static struct pxafb_mach_info spitz_pxafb_info __initdata = {
284 .pixclock = 19231,
285 .xres = 480,
286 .yres = 640,
287 .bpp = 16,
288 .hsync_len = 40,
289 .left_margin = 46,
290 .right_margin = 125,
291 .vsync_len = 3,
292 .upper_margin = 1,
293 .lower_margin = 0,
294 .sync = 0,
295 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act | LCCR0_LDDALT | LCCR0_OUC | LCCR0_CMDIM | LCCR0_RDSTM,
296 .lccr3 = LCCR3_PixRsEdg | LCCR3_OutEnH,
297 .pxafb_lcd_power = spitz_lcd_power,
298};
299
300
301static struct platform_device *devices[] __initdata = {
302 &spitzscoop_device,
303 &spitzssp_device,
304 &spitzkbd_device,
305 &spitzts_device,
306 &spitzbl_device,
307 &spitzbattery_device,
308};
309
310static void __init common_init(void)
311{
312 PMCR = 0x00;
313
314 /* setup sleep mode values */
315 PWER = 0x00000002;
316 PFER = 0x00000000;
317 PRER = 0x00000002;
318 PGSR0 = 0x0158C000;
319 PGSR1 = 0x00FF0080;
320 PGSR2 = 0x0001C004;
321
322 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
323 PCFR |= PCFR_OPDE;
324
325 corgi_ssp_set_machinfo(&spitz_ssp_machinfo);
326
327 pxa_gpio_mode(SPITZ_GPIO_HSYNC | GPIO_IN);
328
329 platform_add_devices(devices, ARRAY_SIZE(devices));
330 pxa_set_mci_info(&spitz_mci_platform_data);
331 pxafb_device.dev.parent = &spitzssp_device.dev;
332 set_pxa_fb_info(&spitz_pxafb_info);
333}
334
335static void __init spitz_init(void)
336{
337 scoop_num = 2;
338 scoop_devs = &spitz_pcmcia_scoop[0];
339 spitz_bl_machinfo.set_bl_intensity = spitz_bl_set_intensity;
340
341 common_init();
342
343 platform_device_register(&spitzscoop2_device);
344}
345
346static void __init fixup_spitz(struct machine_desc *desc,
347 struct tag *tags, char **cmdline, struct meminfo *mi)
348{
349 sharpsl_save_param();
350 mi->nr_banks = 1;
351 mi->bank[0].start = 0xa0000000;
352 mi->bank[0].node = 0;
353 mi->bank[0].size = (64*1024*1024);
354}
355
356#ifdef CONFIG_MACH_SPITZ
357MACHINE_START(SPITZ, "SHARP Spitz")
358 .phys_ram = 0xa0000000,
359 .phys_io = 0x40000000,
360 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
361 .fixup = fixup_spitz,
362 .map_io = pxa_map_io,
363 .init_irq = pxa_init_irq,
364 .init_machine = spitz_init,
365 .timer = &pxa_timer,
366MACHINE_END
367#endif
368
369#ifdef CONFIG_MACH_BORZOI
370MACHINE_START(BORZOI, "SHARP Borzoi")
371 .phys_ram = 0xa0000000,
372 .phys_io = 0x40000000,
373 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
374 .fixup = fixup_spitz,
375 .map_io = pxa_map_io,
376 .init_irq = pxa_init_irq,
377 .init_machine = spitz_init,
378 .timer = &pxa_timer,
379MACHINE_END
380#endif
diff --git a/include/asm-arm/arch-pxa/akita.h b/include/asm-arm/arch-pxa/akita.h
new file mode 100644
index 000000000000..4a1fbcfccc39
--- /dev/null
+++ b/include/asm-arm/arch-pxa/akita.h
@@ -0,0 +1,30 @@
1/*
2 * Hardware specific definitions for SL-C1000 (Akita)
3 *
4 * Copyright (c) 2005 Richard Purdie
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12/* Akita IO Expander GPIOs */
13
14#define AKITA_IOEXP_RESERVED_7 (1 << 7)
15#define AKITA_IOEXP_IR_ON (1 << 6)
16#define AKITA_IOEXP_AKIN_PULLUP (1 << 5)
17#define AKITA_IOEXP_BACKLIGHT_CONT (1 << 4)
18#define AKITA_IOEXP_BACKLIGHT_ON (1 << 3)
19#define AKITA_IOEXP_MIC_BIAS (1 << 2)
20#define AKITA_IOEXP_RESERVED_1 (1 << 1)
21#define AKITA_IOEXP_RESERVED_0 (1 << 0)
22
23/* Direction Bitfield 0=output 1=input */
24#define AKITA_IOEXP_IO_DIR 0
25/* Default Values */
26#define AKITA_IOEXP_IO_OUT (AKITA_IOEXP_IR_ON | AKITA_IOEXP_AKIN_PULLUP)
27
28void akita_set_ioexp(struct device *dev, unsigned char bitmask);
29void akita_reset_ioexp(struct device *dev, unsigned char bitmask);
30
diff --git a/include/asm-arm/arch-pxa/spitz.h b/include/asm-arm/arch-pxa/spitz.h
new file mode 100644
index 000000000000..62e1fe4d025f
--- /dev/null
+++ b/include/asm-arm/arch-pxa/spitz.h
@@ -0,0 +1,158 @@
1/*
2 * Hardware specific definitions for SL-Cx000 series of PDAs
3 *
4 * Copyright (c) 2005 Alexander Wykes
5 * Copyright (c) 2005 Richard Purdie
6 *
7 * Based on Sharp's 2.4 kernel patches
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14#ifndef __ASM_ARCH_SPITZ_H
15#define __ASM_ARCH_SPITZ_H 1
16#endif
17
18/* Spitz/Akita GPIOs */
19
20#define SPITZ_GPIO_KEY_INT (0) /* Key Interrupt */
21#define SPITZ_GPIO_RESET (1)
22#define SPITZ_GPIO_nSD_DETECT (9)
23#define SPITZ_GPIO_TP_INT (11) /* Touch Panel interrupt */
24#define SPITZ_GPIO_AK_INT (13) /* Remote Control */
25#define SPITZ_GPIO_ADS7846_CS (14)
26#define SPITZ_GPIO_SYNC (16)
27#define SPITZ_GPIO_MAX1111_CS (20)
28#define SPITZ_GPIO_FATAL_BAT (21)
29#define SPITZ_GPIO_HSYNC (22)
30#define SPITZ_GPIO_nSD_CLK (32)
31#define SPITZ_GPIO_USB_DEVICE (35)
32#define SPITZ_GPIO_USB_HOST (37)
33#define SPITZ_GPIO_USB_CONNECT (41)
34#define SPITZ_GPIO_LCDCON_CS (53)
35#define SPITZ_GPIO_nPCE (54)
36#define SPITZ_GPIO_nSD_WP (81)
37#define SPITZ_GPIO_ON_RESET (89)
38#define SPITZ_GPIO_BAT_COVER (90)
39#define SPITZ_GPIO_CF_CD (94)
40#define SPITZ_GPIO_ON_KEY (95)
41#define SPITZ_GPIO_SWA (97)
42#define SPITZ_GPIO_SWB (96)
43#define SPITZ_GPIO_CHRG_FULL (101)
44#define SPITZ_GPIO_CO (101)
45#define SPITZ_GPIO_CF_IRQ (105)
46#define SPITZ_GPIO_AC_IN (115)
47#define SPITZ_GPIO_HP_IN (116)
48
49/* Spitz Only GPIOs */
50
51#define SPITZ_GPIO_CF2_IRQ (106) /* CF slot1 Ready */
52#define SPITZ_GPIO_CF2_CD (93)
53
54
55/* Spitz/Akita Keyboard Definitions */
56
57#define SPITZ_KEY_STROBE_NUM (11)
58#define SPITZ_KEY_SENSE_NUM (7)
59#define SPITZ_GPIO_G0_STROBE_BIT 0x0f800000
60#define SPITZ_GPIO_G1_STROBE_BIT 0x00100000
61#define SPITZ_GPIO_G2_STROBE_BIT 0x01000000
62#define SPITZ_GPIO_G3_STROBE_BIT 0x00041880
63#define SPITZ_GPIO_G0_SENSE_BIT 0x00021000
64#define SPITZ_GPIO_G1_SENSE_BIT 0x000000d4
65#define SPITZ_GPIO_G2_SENSE_BIT 0x08000000
66#define SPITZ_GPIO_G3_SENSE_BIT 0x00000000
67
68#define SPITZ_GPIO_KEY_STROBE0 88
69#define SPITZ_GPIO_KEY_STROBE1 23
70#define SPITZ_GPIO_KEY_STROBE2 24
71#define SPITZ_GPIO_KEY_STROBE3 25
72#define SPITZ_GPIO_KEY_STROBE4 26
73#define SPITZ_GPIO_KEY_STROBE5 27
74#define SPITZ_GPIO_KEY_STROBE6 52
75#define SPITZ_GPIO_KEY_STROBE7 103
76#define SPITZ_GPIO_KEY_STROBE8 107
77#define SPITZ_GPIO_KEY_STROBE9 108
78#define SPITZ_GPIO_KEY_STROBE10 114
79
80#define SPITZ_GPIO_KEY_SENSE0 12
81#define SPITZ_GPIO_KEY_SENSE1 17
82#define SPITZ_GPIO_KEY_SENSE2 91
83#define SPITZ_GPIO_KEY_SENSE3 34
84#define SPITZ_GPIO_KEY_SENSE4 36
85#define SPITZ_GPIO_KEY_SENSE5 38
86#define SPITZ_GPIO_KEY_SENSE6 39
87
88
89/* Spitz Scoop Device (No. 1) GPIOs */
90/* Suspend States in comments */
91#define SPITZ_SCP_LED_GREEN SCOOP_GPCR_PA11 /* Keep */
92#define SPITZ_SCP_JK_B SCOOP_GPCR_PA12 /* Keep */
93#define SPITZ_SCP_CHRG_ON SCOOP_GPCR_PA13 /* Keep */
94#define SPITZ_SCP_MUTE_L SCOOP_GPCR_PA14 /* Low */
95#define SPITZ_SCP_MUTE_R SCOOP_GPCR_PA15 /* Low */
96#define SPITZ_SCP_CF_POWER SCOOP_GPCR_PA16 /* Keep */
97#define SPITZ_SCP_LED_ORANGE SCOOP_GPCR_PA17 /* Keep */
98#define SPITZ_SCP_JK_A SCOOP_GPCR_PA18 /* Low */
99#define SPITZ_SCP_ADC_TEMP_ON SCOOP_GPCR_PA19 /* Low */
100
101#define SPITZ_SCP_IO_DIR (SPITZ_SCP_LED_GREEN | SPITZ_SCP_JK_B | SPITZ_SCP_CHRG_ON | \
102 SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | SPITZ_SCP_LED_ORANGE | \
103 SPITZ_SCP_CF_POWER | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON)
104#define SPITZ_SCP_IO_OUT (SPITZ_SCP_CHRG_ON | SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R)
105#define SPITZ_SCP_SUS_CLR (SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON)
106#define SPITZ_SCP_SUS_SET 0
107
108/* Spitz Scoop Device (No. 2) GPIOs */
109/* Suspend States in comments */
110#define SPITZ_SCP2_IR_ON SCOOP_GPCR_PA11 /* High */
111#define SPITZ_SCP2_AKIN_PULLUP SCOOP_GPCR_PA12 /* Keep */
112#define SPITZ_SCP2_RESERVED_1 SCOOP_GPCR_PA13 /* High */
113#define SPITZ_SCP2_RESERVED_2 SCOOP_GPCR_PA14 /* Low */
114#define SPITZ_SCP2_RESERVED_3 SCOOP_GPCR_PA15 /* Low */
115#define SPITZ_SCP2_RESERVED_4 SCOOP_GPCR_PA16 /* Low */
116#define SPITZ_SCP2_BACKLIGHT_CONT SCOOP_GPCR_PA17 /* Low */
117#define SPITZ_SCP2_BACKLIGHT_ON SCOOP_GPCR_PA18 /* Low */
118#define SPITZ_SCP2_MIC_BIAS SCOOP_GPCR_PA19 /* Low */
119
120#define SPITZ_SCP2_IO_DIR (SPITZ_SCP2_IR_ON | SPITZ_SCP2_AKIN_PULLUP | SPITZ_SCP2_RESERVED_1 | \
121 SPITZ_SCP2_RESERVED_2 | SPITZ_SCP2_RESERVED_3 | SPITZ_SCP2_RESERVED_4 | \
122 SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS)
123
124#define SPITZ_SCP2_IO_OUT (SPITZ_SCP2_IR_ON | SPITZ_SCP2_AKIN_PULLUP | SPITZ_SCP2_RESERVED_1)
125#define SPITZ_SCP2_SUS_CLR (SPITZ_SCP2_RESERVED_2 | SPITZ_SCP2_RESERVED_3 | SPITZ_SCP2_RESERVED_4 | \
126 SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS)
127#define SPITZ_SCP2_SUS_SET (SPITZ_SCP2_IR_ON | SPITZ_SCP2_RESERVED_1)
128
129
130/* Spitz IRQ Definitions */
131
132#define SPITZ_IRQ_GPIO_KEY_INT IRQ_GPIO(SPITZ_GPIO_KEY_INT)
133#define SPITZ_IRQ_GPIO_AC_IN IRQ_GPIO(SPITZ_GPIO_AC_IN)
134#define SPITZ_IRQ_GPIO_AK_INT IRQ_GPIO(SPITZ_GPIO_AK_INT)
135#define SPITZ_IRQ_GPIO_HP_IN IRQ_GPIO(SPITZ_GPIO_HP_IN)
136#define SPITZ_IRQ_GPIO_TP_INT IRQ_GPIO(SPITZ_GPIO_TP_INT)
137#define SPITZ_IRQ_GPIO_SYNC IRQ_GPIO(SPITZ_GPIO_SYNC)
138#define SPITZ_IRQ_GPIO_ON_KEY IRQ_GPIO(SPITZ_GPIO_ON_KEY)
139#define SPITZ_IRQ_GPIO_SWA IRQ_GPIO(SPITZ_GPIO_SWA)
140#define SPITZ_IRQ_GPIO_SWB IRQ_GPIO(SPITZ_GPIO_SWB)
141#define SPITZ_IRQ_GPIO_BAT_COVER IRQ_GPIO(SPITZ_GPIO_BAT_COVER)
142#define SPITZ_IRQ_GPIO_FATAL_BAT IRQ_GPIO(SPITZ_GPIO_FATAL_BAT)
143#define SPITZ_IRQ_GPIO_CO IRQ_GPIO(SPITZ_GPIO_CO)
144#define SPITZ_IRQ_GPIO_CF_IRQ IRQ_GPIO(SPITZ_GPIO_CF_IRQ)
145#define SPITZ_IRQ_GPIO_CF_CD IRQ_GPIO(SPITZ_GPIO_CF_CD)
146#define SPITZ_IRQ_GPIO_CF2_IRQ IRQ_GPIO(SPITZ_GPIO_CF2_IRQ)
147#define SPITZ_IRQ_GPIO_nSD_INT IRQ_GPIO(SPITZ_GPIO_nSD_INT)
148#define SPITZ_IRQ_GPIO_nSD_DETECT IRQ_GPIO(SPITZ_GPIO_nSD_DETECT)
149
150/*
151 * Shared data structures
152 */
153extern struct platform_device spitzscoop_device;
154extern struct platform_device spitzscoop2_device;
155extern struct platform_device spitzssp_device;
156extern struct sharpsl_charger_machinfo spitz_pm_machinfo;
157
158extern void spitz_lcd_power(int on);