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