Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Hardware specific definitions for Sharp SL-C6000x series of PDAs |
| 3 | * |
| 4 | * Copyright (c) 2005 Dirk Opfer |
| 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_TOSA_H_ |
| 14 | #define _ASM_ARCH_TOSA_H_ 1 |
| 15 | |
| 16 | /* TOSA Chip selects */ |
| 17 | #define TOSA_LCDC_PHYS PXA_CS4_PHYS |
| 18 | /* Internel Scoop */ |
| 19 | #define TOSA_CF_PHYS (PXA_CS2_PHYS + 0x00800000) |
| 20 | /* Jacket Scoop */ |
| 21 | #define TOSA_SCOOP_PHYS (PXA_CS5_PHYS + 0x00800000) |
| 22 | |
| 23 | /* |
| 24 | * SCOOP2 internal GPIOs |
| 25 | */ |
Dmitry Baryshkov | d4e7d09 | 2008-04-12 20:16:16 +0100 | [diff] [blame] | 26 | #define TOSA_SCOOP_GPIO_BASE NR_BUILTIN_GPIO |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 27 | #define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11 |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 28 | #define TOSA_GPIO_TC6393XB_REST_IN (TOSA_SCOOP_GPIO_BASE + 1) |
Dmitry Baryshkov | d4e7d09 | 2008-04-12 20:16:16 +0100 | [diff] [blame] | 29 | #define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2) |
| 30 | #define TOSA_GPIO_SD_WP (TOSA_SCOOP_GPIO_BASE + 3) |
| 31 | #define TOSA_GPIO_PWR_ON (TOSA_SCOOP_GPIO_BASE + 4) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 32 | #define TOSA_SCOOP_AUD_PWR_ON SCOOP_GPCR_PA16 |
Dmitry Baryshkov | 16b32fd | 2008-07-05 09:02:48 +0100 | [diff] [blame] | 33 | #define TOSA_GPIO_BT_RESET (TOSA_SCOOP_GPIO_BASE + 6) |
| 34 | #define TOSA_GPIO_BT_PWR_EN (TOSA_SCOOP_GPIO_BASE + 7) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 35 | #define TOSA_SCOOP_AC_IN_OL SCOOP_GPCR_PA19 |
| 36 | |
| 37 | /* GPIO Direction 1 : output mode / 0:input mode */ |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 38 | #define TOSA_SCOOP_IO_DIR (TOSA_SCOOP_PXA_VCORE1 | \ |
Dmitry Baryshkov | 16b32fd | 2008-07-05 09:02:48 +0100 | [diff] [blame] | 39 | TOSA_SCOOP_AUD_PWR_ON) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * SCOOP2 jacket GPIOs |
| 43 | */ |
Dmitry Baryshkov | d4e7d09 | 2008-04-12 20:16:16 +0100 | [diff] [blame] | 44 | #define TOSA_SCOOP_JC_GPIO_BASE (NR_BUILTIN_GPIO + 12) |
Dmitry Baryshkov | c546106 | 2008-04-19 10:42:06 +0100 | [diff] [blame] | 45 | #define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0) |
Dmitry Baryshkov | 311c736 | 2008-04-12 20:17:02 +0100 | [diff] [blame] | 46 | #define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1) |
| 47 | #define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2) |
Dmitry Baryshkov | d4e7d09 | 2008-04-12 20:16:16 +0100 | [diff] [blame] | 48 | #define TOSA_GPIO_USB_PULLUP (TOSA_SCOOP_JC_GPIO_BASE + 3) |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 49 | #define TOSA_GPIO_TC6393XB_SUSPEND (TOSA_SCOOP_JC_GPIO_BASE + 4) |
| 50 | #define TOSA_GPIO_TC6393XB_L3V_ON (TOSA_SCOOP_JC_GPIO_BASE + 5) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 51 | #define TOSA_SCOOP_JC_WLAN_DETECT SCOOP_GPCR_PA17 |
Dmitry Baryshkov | c546106 | 2008-04-19 10:42:06 +0100 | [diff] [blame] | 52 | #define TOSA_GPIO_WLAN_LED (TOSA_SCOOP_JC_GPIO_BASE + 7) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 53 | #define TOSA_SCOOP_JC_CARD_LIMIT_SEL SCOOP_GPCR_PA19 |
| 54 | |
| 55 | /* GPIO Direction 1 : output mode / 0:input mode */ |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 56 | #define TOSA_SCOOP_JC_IO_DIR (TOSA_SCOOP_JC_CARD_LIMIT_SEL) |
| 57 | |
| 58 | /* |
| 59 | * TC6393XB GPIOs |
| 60 | */ |
| 61 | #define TOSA_TC6393XB_GPIO_BASE (NR_BUILTIN_GPIO + 2 * 12) |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 62 | |
| 63 | #define TOSA_GPIO_TG_ON (TOSA_TC6393XB_GPIO_BASE + 0) |
| 64 | #define TOSA_GPIO_L_MUTE (TOSA_TC6393XB_GPIO_BASE + 1) |
| 65 | #define TOSA_GPIO_BL_C20MA (TOSA_TC6393XB_GPIO_BASE + 3) |
| 66 | #define TOSA_GPIO_CARD_VCC_ON (TOSA_TC6393XB_GPIO_BASE + 4) |
| 67 | #define TOSA_GPIO_CHARGE_OFF (TOSA_TC6393XB_GPIO_BASE + 6) |
| 68 | #define TOSA_GPIO_CHARGE_OFF_JC (TOSA_TC6393XB_GPIO_BASE + 7) |
| 69 | #define TOSA_GPIO_BAT0_V_ON (TOSA_TC6393XB_GPIO_BASE + 9) |
| 70 | #define TOSA_GPIO_BAT1_V_ON (TOSA_TC6393XB_GPIO_BASE + 10) |
| 71 | #define TOSA_GPIO_BU_CHRG_ON (TOSA_TC6393XB_GPIO_BASE + 11) |
| 72 | #define TOSA_GPIO_BAT_SW_ON (TOSA_TC6393XB_GPIO_BASE + 12) |
| 73 | #define TOSA_GPIO_BAT0_TH_ON (TOSA_TC6393XB_GPIO_BASE + 14) |
| 74 | #define TOSA_GPIO_BAT1_TH_ON (TOSA_TC6393XB_GPIO_BASE + 15) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 75 | |
| 76 | /* |
| 77 | * Timing Generator |
| 78 | */ |
| 79 | #define TG_PNLCTL 0x00 |
| 80 | #define TG_TPOSCTL 0x01 |
| 81 | #define TG_DUTYCTL 0x02 |
| 82 | #define TG_GPOSR 0x03 |
| 83 | #define TG_GPODR1 0x04 |
| 84 | #define TG_GPODR2 0x05 |
| 85 | #define TG_PINICTL 0x06 |
| 86 | #define TG_HPOSCTL 0x07 |
| 87 | |
| 88 | /* |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 89 | * PXA GPIOs |
| 90 | */ |
| 91 | #define TOSA_GPIO_POWERON (0) |
| 92 | #define TOSA_GPIO_RESET (1) |
| 93 | #define TOSA_GPIO_AC_IN (2) |
| 94 | #define TOSA_GPIO_RECORD_BTN (3) |
| 95 | #define TOSA_GPIO_SYNC (4) /* Cradle SYNC Button */ |
| 96 | #define TOSA_GPIO_USB_IN (5) |
| 97 | #define TOSA_GPIO_JACKET_DETECT (7) |
| 98 | #define TOSA_GPIO_nSD_DETECT (9) |
| 99 | #define TOSA_GPIO_nSD_INT (10) |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 100 | #define TOSA_GPIO_TC6393XB_CLK (11) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 101 | #define TOSA_GPIO_BAT1_CRG (12) |
| 102 | #define TOSA_GPIO_CF_CD (13) |
| 103 | #define TOSA_GPIO_BAT0_CRG (14) |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 104 | #define TOSA_GPIO_TC6393XB_INT (15) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 105 | #define TOSA_GPIO_BAT0_LOW (17) |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 106 | #define TOSA_GPIO_TC6393XB_RDY (18) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 107 | #define TOSA_GPIO_ON_RESET (19) |
| 108 | #define TOSA_GPIO_EAR_IN (20) |
| 109 | #define TOSA_GPIO_CF_IRQ (21) /* CF slot0 Ready */ |
| 110 | #define TOSA_GPIO_ON_KEY (22) |
| 111 | #define TOSA_GPIO_VGA_LINE (27) |
| 112 | #define TOSA_GPIO_TP_INT (32) /* Touch Panel pen down interrupt */ |
| 113 | #define TOSA_GPIO_JC_CF_IRQ (36) /* CF slot1 Ready */ |
| 114 | #define TOSA_GPIO_BAT_LOCKED (38) /* Battery locked */ |
Dmitry Baryshkov | b032fcc | 2008-06-12 11:42:07 +0100 | [diff] [blame] | 115 | #define TOSA_GPIO_IRDA_TX (47) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 116 | #define TOSA_GPIO_TG_SPI_SCLK (81) |
| 117 | #define TOSA_GPIO_TG_SPI_CS (82) |
| 118 | #define TOSA_GPIO_TG_SPI_MOSI (83) |
| 119 | #define TOSA_GPIO_BAT1_LOW (84) |
| 120 | |
| 121 | #define TOSA_GPIO_HP_IN GPIO_EAR_IN |
| 122 | |
| 123 | #define TOSA_GPIO_MAIN_BAT_LOW GPIO_BAT0_LOW |
| 124 | |
| 125 | #define TOSA_KEY_STROBE_NUM (11) |
| 126 | #define TOSA_KEY_SENSE_NUM (7) |
| 127 | |
| 128 | #define TOSA_GPIO_HIGH_STROBE_BIT (0xfc000000) |
| 129 | #define TOSA_GPIO_LOW_STROBE_BIT (0x0000001f) |
| 130 | #define TOSA_GPIO_ALL_SENSE_BIT (0x00000fe0) |
| 131 | #define TOSA_GPIO_ALL_SENSE_RSHIFT (5) |
| 132 | #define TOSA_GPIO_STROBE_BIT(a) GPIO_bit(58+(a)) |
| 133 | #define TOSA_GPIO_SENSE_BIT(a) GPIO_bit(69+(a)) |
| 134 | #define TOSA_GAFR_HIGH_STROBE_BIT (0xfff00000) |
| 135 | #define TOSA_GAFR_LOW_STROBE_BIT (0x000003ff) |
| 136 | #define TOSA_GAFR_ALL_SENSE_BIT (0x00fffc00) |
| 137 | #define TOSA_GPIO_KEY_SENSE(a) (69+(a)) |
| 138 | #define TOSA_GPIO_KEY_STROBE(a) (58+(a)) |
| 139 | |
| 140 | /* |
| 141 | * Interrupts |
| 142 | */ |
| 143 | #define TOSA_IRQ_GPIO_WAKEUP IRQ_GPIO(TOSA_GPIO_WAKEUP) |
| 144 | #define TOSA_IRQ_GPIO_AC_IN IRQ_GPIO(TOSA_GPIO_AC_IN) |
| 145 | #define TOSA_IRQ_GPIO_RECORD_BTN IRQ_GPIO(TOSA_GPIO_RECORD_BTN) |
| 146 | #define TOSA_IRQ_GPIO_SYNC IRQ_GPIO(TOSA_GPIO_SYNC) |
| 147 | #define TOSA_IRQ_GPIO_USB_IN IRQ_GPIO(TOSA_GPIO_USB_IN) |
| 148 | #define TOSA_IRQ_GPIO_JACKET_DETECT IRQ_GPIO(TOSA_GPIO_JACKET_DETECT) |
| 149 | #define TOSA_IRQ_GPIO_nSD_INT IRQ_GPIO(TOSA_GPIO_nSD_INT) |
| 150 | #define TOSA_IRQ_GPIO_nSD_DETECT IRQ_GPIO(TOSA_GPIO_nSD_DETECT) |
| 151 | #define TOSA_IRQ_GPIO_BAT1_CRG IRQ_GPIO(TOSA_GPIO_BAT1_CRG) |
| 152 | #define TOSA_IRQ_GPIO_CF_CD IRQ_GPIO(TOSA_GPIO_CF_CD) |
| 153 | #define TOSA_IRQ_GPIO_BAT0_CRG IRQ_GPIO(TOSA_GPIO_BAT0_CRG) |
Dmitry Baryshkov | bf0116e | 2008-06-14 11:42:02 +0100 | [diff] [blame] | 154 | #define TOSA_IRQ_GPIO_TC6393XB_INT IRQ_GPIO(TOSA_GPIO_TC6393XB_INT) |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 155 | #define TOSA_IRQ_GPIO_BAT0_LOW IRQ_GPIO(TOSA_GPIO_BAT0_LOW) |
| 156 | #define TOSA_IRQ_GPIO_EAR_IN IRQ_GPIO(TOSA_GPIO_EAR_IN) |
| 157 | #define TOSA_IRQ_GPIO_CF_IRQ IRQ_GPIO(TOSA_GPIO_CF_IRQ) |
| 158 | #define TOSA_IRQ_GPIO_ON_KEY IRQ_GPIO(TOSA_GPIO_ON_KEY) |
| 159 | #define TOSA_IRQ_GPIO_VGA_LINE IRQ_GPIO(TOSA_GPIO_VGA_LINE) |
| 160 | #define TOSA_IRQ_GPIO_TP_INT IRQ_GPIO(TOSA_GPIO_TP_INT) |
| 161 | #define TOSA_IRQ_GPIO_JC_CF_IRQ IRQ_GPIO(TOSA_GPIO_JC_CF_IRQ) |
| 162 | #define TOSA_IRQ_GPIO_BAT_LOCKED IRQ_GPIO(TOSA_GPIO_BAT_LOCKED) |
| 163 | #define TOSA_IRQ_GPIO_BAT1_LOW IRQ_GPIO(TOSA_GPIO_BAT1_LOW) |
| 164 | #define TOSA_IRQ_GPIO_KEY_SENSE(a) IRQ_GPIO(69+(a)) |
| 165 | |
| 166 | #define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW) |
| 167 | |
Dmitry Baryshkov | 93e9012 | 2008-01-21 01:04:20 -0500 | [diff] [blame] | 168 | #define TOSA_KEY_SYNC KEY_102ND /* ??? */ |
| 169 | |
Eric Miao | cb8f3c7 | 2010-04-27 14:43:03 +0800 | [diff] [blame] | 170 | #ifndef CONFIG_TOSA_USE_EXT_KEYCODES |
Dmitry Baryshkov | 93e9012 | 2008-01-21 01:04:20 -0500 | [diff] [blame] | 171 | #define TOSA_KEY_RECORD KEY_YEN |
| 172 | #define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA |
| 173 | #define TOSA_KEY_CANCEL KEY_ESC |
| 174 | #define TOSA_KEY_CENTER KEY_HIRAGANA |
| 175 | #define TOSA_KEY_OK KEY_HENKAN |
| 176 | #define TOSA_KEY_CALENDAR KEY_KATAKANAHIRAGANA |
| 177 | #define TOSA_KEY_HOMEPAGE KEY_HANGEUL |
| 178 | #define TOSA_KEY_LIGHT KEY_MUHENKAN |
| 179 | #define TOSA_KEY_MENU KEY_HANJA |
| 180 | #define TOSA_KEY_FN KEY_RIGHTALT |
| 181 | #define TOSA_KEY_MAIL KEY_ZENKAKUHANKAKU |
| 182 | #else |
| 183 | #define TOSA_KEY_RECORD KEY_RECORD |
| 184 | #define TOSA_KEY_ADDRESSBOOK KEY_ADDRESSBOOK |
| 185 | #define TOSA_KEY_CANCEL KEY_CANCEL |
| 186 | #define TOSA_KEY_CENTER KEY_SELECT /* ??? */ |
| 187 | #define TOSA_KEY_OK KEY_OK |
| 188 | #define TOSA_KEY_CALENDAR KEY_CALENDAR |
| 189 | #define TOSA_KEY_HOMEPAGE KEY_HOMEPAGE |
| 190 | #define TOSA_KEY_LIGHT KEY_KBDILLUMTOGGLE |
| 191 | #define TOSA_KEY_MENU KEY_MENU |
| 192 | #define TOSA_KEY_FN KEY_FN |
| 193 | #define TOSA_KEY_MAIL KEY_MAIL |
| 194 | #endif |
| 195 | |
Dmitry Baryshkov | fbd1b17 | 2008-09-13 20:58:51 +0400 | [diff] [blame] | 196 | struct spi_device; |
| 197 | extern int tosa_bl_enable(struct spi_device *spi, int enable); |
| 198 | |
Dirk Opfer | 8459c15 | 2005-11-06 14:27:52 +0000 | [diff] [blame] | 199 | #endif /* _ASM_ARCH_TOSA_H_ */ |