blob: 324db06b5dd4b219f83316dd8a6d4aff1906e6d1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Hardware specific definitions for SL-C7xx series of PDAs
3 *
4 * Copyright (c) 2004-2005 Richard Purdie
5 *
6 * Based on Sharp's 2.4 kernel patches
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13#ifndef __ASM_ARCH_CORGI_H
14#define __ASM_ARCH_CORGI_H 1
15
16
17/*
18 * Corgi (Non Standard) GPIO Definitions
19 */
20#define CORGI_GPIO_KEY_INT (0) /* Keyboard Interrupt */
21#define CORGI_GPIO_AC_IN (1) /* Charger Detection */
22#define CORGI_GPIO_WAKEUP (3) /* System wakeup notification? */
23#define CORGI_GPIO_AK_INT (4) /* Headphone Jack Control Interrupt */
24#define CORGI_GPIO_TP_INT (5) /* Touch Panel Interrupt */
25#define CORGI_GPIO_nSD_WP (7) /* SD Write Protect? */
26#define CORGI_GPIO_nSD_DETECT (9) /* MMC/SD Card Detect */
27#define CORGI_GPIO_nSD_INT (10) /* SD Interrupt for SDIO? */
28#define CORGI_GPIO_MAIN_BAT_LOW (11) /* Main Battery Low Notification */
29#define CORGI_GPIO_BAT_COVER (11) /* Battery Cover Detect */
30#define CORGI_GPIO_LED_ORANGE (13) /* Orange LED Control */
31#define CORGI_GPIO_CF_CD (14) /* Compact Flash Card Detect */
32#define CORGI_GPIO_CHRG_FULL (16) /* Charging Complete Notification */
33#define CORGI_GPIO_CF_IRQ (17) /* Compact Flash Interrupt */
34#define CORGI_GPIO_LCDCON_CS (19) /* LCD Control Chip Select */
35#define CORGI_GPIO_MAX1111_CS (20) /* MAX1111 Chip Select */
36#define CORGI_GPIO_ADC_TEMP_ON (21) /* Select battery voltage or temperature */
37#define CORGI_GPIO_IR_ON (22) /* Enable IR Transciever */
38#define CORGI_GPIO_ADS7846_CS (24) /* ADS7846 Chip Select */
39#define CORGI_GPIO_SD_PWR (33) /* MMC/SD Power */
40#define CORGI_GPIO_CHRG_ON (38) /* Enable battery Charging */
41#define CORGI_GPIO_DISCHARGE_ON (42) /* Enable battery Discharge */
42#define CORGI_GPIO_CHRG_UKN (43) /* Unknown Charging (Bypass Control?) */
43#define CORGI_GPIO_HSYNC (44) /* LCD HSync Pulse */
44#define CORGI_GPIO_USB_PULLUP (45) /* USB show presence to host */
45
46
47/*
48 * Corgi Keyboard Definitions
49 */
50#define CORGI_KEY_STROBE_NUM (12)
51#define CORGI_KEY_SENSE_NUM (8)
52#define CORGI_GPIO_ALL_STROBE_BIT (0x00003ffc)
53#define CORGI_GPIO_HIGH_SENSE_BIT (0xfc000000)
54#define CORGI_GPIO_HIGH_SENSE_RSHIFT (26)
55#define CORGI_GPIO_LOW_SENSE_BIT (0x00000003)
56#define CORGI_GPIO_LOW_SENSE_LSHIFT (6)
57#define CORGI_GPIO_STROBE_BIT(a) GPIO_bit(66+(a))
58#define CORGI_GPIO_SENSE_BIT(a) GPIO_bit(58+(a))
59#define CORGI_GAFR_ALL_STROBE_BIT (0x0ffffff0)
60#define CORGI_GAFR_HIGH_SENSE_BIT (0xfff00000)
61#define CORGI_GAFR_LOW_SENSE_BIT (0x0000000f)
62#define CORGI_GPIO_KEY_SENSE(a) (58+(a))
63#define CORGI_GPIO_KEY_STROBE(a) (66+(a))
64
65
66/*
67 * Corgi Interrupts
68 */
69#define CORGI_IRQ_GPIO_KEY_INT IRQ_GPIO(0)
70#define CORGI_IRQ_GPIO_AC_IN IRQ_GPIO(1)
71#define CORGI_IRQ_GPIO_WAKEUP IRQ_GPIO(3)
72#define CORGI_IRQ_GPIO_AK_INT IRQ_GPIO(4)
73#define CORGI_IRQ_GPIO_TP_INT IRQ_GPIO(5)
74#define CORGI_IRQ_GPIO_nSD_DETECT IRQ_GPIO(9)
75#define CORGI_IRQ_GPIO_nSD_INT IRQ_GPIO(10)
76#define CORGI_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(11)
77#define CORGI_IRQ_GPIO_CF_CD IRQ_GPIO(14)
78#define CORGI_IRQ_GPIO_CHRG_FULL IRQ_GPIO(16) /* Battery fully charged */
79#define CORGI_IRQ_GPIO_CF_IRQ IRQ_GPIO(17)
80#define CORGI_IRQ_GPIO_KEY_SENSE(a) IRQ_GPIO(58+(a)) /* Keyboard Sense lines */
81
82
83/*
84 * Corgi SCOOP GPIOs and Config
85 */
86#define CORGI_SCP_LED_GREEN SCOOP_GPCR_PA11
87#define CORGI_SCP_SWA SCOOP_GPCR_PA12 /* Hinge Switch A */
88#define CORGI_SCP_SWB SCOOP_GPCR_PA13 /* Hinge Switch B */
89#define CORGI_SCP_MUTE_L SCOOP_GPCR_PA14
90#define CORGI_SCP_MUTE_R SCOOP_GPCR_PA15
91#define CORGI_SCP_AKIN_PULLUP SCOOP_GPCR_PA16
92#define CORGI_SCP_APM_ON SCOOP_GPCR_PA17
93#define CORGI_SCP_BACKLIGHT_CONT SCOOP_GPCR_PA18
94#define CORGI_SCP_MIC_BIAS SCOOP_GPCR_PA19
95
96#define CORGI_SCOOP_IO_DIR ( CORGI_SCP_LED_GREEN | CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R | \
97 CORGI_SCP_AKIN_PULLUP | CORGI_SCP_APM_ON | CORGI_SCP_BACKLIGHT_CONT | \
98 CORGI_SCP_MIC_BIAS )
99#define CORGI_SCOOP_IO_OUT ( CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R )
100
101
102/*
103 * Shared data structures
104 */
105extern struct platform_device corgiscoop_device;
106
107/*
108 * External Functions
109 */
110extern unsigned long corgi_ssp_ads7846_putget(unsigned long);
111extern unsigned long corgi_ssp_ads7846_get(void);
112extern void corgi_ssp_ads7846_put(ulong data);
113extern void corgi_ssp_ads7846_lock(void);
114extern void corgi_ssp_ads7846_unlock(void);
115extern void corgi_ssp_lcdtg_send (u8 adrs, u8 data);
116extern void corgi_ssp_blduty_set(int duty);
117extern int corgi_ssp_max1111_get(ulong data);
118
119#endif /* __ASM_ARCH_CORGI_H */
120