blob: c48b54d0f33102d32f5a0ad25d01a0f30177d355 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
2 * GPIO and IRQ definitions for HTC Magician PDA phones
3 *
4 * Copyright (c) 2007 Philipp Zabel
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#ifndef _MAGICIAN_H_
13#define _MAGICIAN_H_
14
Philipp Zabel250ccd42011-04-21 15:57:04 +020015#include <linux/gpio.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010016#include <mach/irqs.h>
17
18/*
19 * PXA GPIOs
20 */
21
22#define GPIO0_MAGICIAN_KEY_POWER 0
23#define GPIO9_MAGICIAN_UNKNOWN 9
24#define GPIO10_MAGICIAN_GSM_IRQ 10
25#define GPIO11_MAGICIAN_GSM_OUT1 11
26#define GPIO13_MAGICIAN_CPLD_IRQ 13
Petr Cvek7ade4452017-03-13 09:05:49 +010027#define GPIO14_MAGICIAN_TSC2046_CS 14
Russell Kinga09e64f2008-08-05 16:14:15 +010028#define GPIO18_MAGICIAN_UNKNOWN 18
29#define GPIO22_MAGICIAN_VIBRA_EN 22
30#define GPIO26_MAGICIAN_GSM_POWER 26
31#define GPIO27_MAGICIAN_USBC_PUEN 27
Philipp Zabeleb650b92009-01-31 12:13:57 +010032#define GPIO30_MAGICIAN_BQ24022_nCHARGE_EN 30
Russell Kinga09e64f2008-08-05 16:14:15 +010033#define GPIO37_MAGICIAN_KEY_HANGUP 37
34#define GPIO38_MAGICIAN_KEY_CONTACTS 38
35#define GPIO40_MAGICIAN_GSM_OUT2 40
36#define GPIO48_MAGICIAN_UNKNOWN 48
37#define GPIO56_MAGICIAN_UNKNOWN 56
38#define GPIO57_MAGICIAN_CAM_RESET 57
39#define GPIO75_MAGICIAN_SAMSUNG_POWER 75
40#define GPIO83_MAGICIAN_nIR_EN 83
41#define GPIO86_MAGICIAN_GSM_RESET 86
42#define GPIO87_MAGICIAN_GSM_SELECT 87
43#define GPIO90_MAGICIAN_KEY_CALENDAR 90
44#define GPIO91_MAGICIAN_KEY_CAMERA 91
45#define GPIO93_MAGICIAN_KEY_UP 93
46#define GPIO94_MAGICIAN_KEY_DOWN 94
47#define GPIO95_MAGICIAN_KEY_LEFT 95
48#define GPIO96_MAGICIAN_KEY_RIGHT 96
49#define GPIO97_MAGICIAN_KEY_ENTER 97
50#define GPIO98_MAGICIAN_KEY_RECORD 98
51#define GPIO99_MAGICIAN_HEADPHONE_IN 99
52#define GPIO100_MAGICIAN_KEY_VOL_UP 100
53#define GPIO101_MAGICIAN_KEY_VOL_DOWN 101
54#define GPIO102_MAGICIAN_KEY_PHONE 102
55#define GPIO103_MAGICIAN_LED_KP 103
Petr Cvek6001ae72015-09-28 23:15:57 +020056#define GPIO104_MAGICIAN_LCD_VOFF_EN 104
57#define GPIO105_MAGICIAN_LCD_VON_EN 105
58#define GPIO106_MAGICIAN_LCD_DCDC_NRESET 106
Russell Kinga09e64f2008-08-05 16:14:15 +010059#define GPIO107_MAGICIAN_DS1WM_IRQ 107
60#define GPIO108_MAGICIAN_GSM_READY 108
61#define GPIO114_MAGICIAN_UNKNOWN 114
62#define GPIO115_MAGICIAN_nPEN_IRQ 115
63#define GPIO116_MAGICIAN_nCAM_EN 116
64#define GPIO119_MAGICIAN_UNKNOWN 119
65#define GPIO120_MAGICIAN_UNKNOWN 120
66
67/*
68 * CPLD IRQs
69 */
70
71#define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0)
72#define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1)
73#define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2)
Philipp Zabel6489c612009-02-01 11:20:30 +010074#define IRQ_MAGICIAN_VBUS (IRQ_BOARD_START + 3)
Russell Kinga09e64f2008-08-05 16:14:15 +010075
Haojian Zhuang6ac6b812010-08-20 15:23:59 +080076#define MAGICIAN_NR_IRQS (IRQ_BOARD_START + 8)
77
Russell Kinga09e64f2008-08-05 16:14:15 +010078/*
79 * CPLD EGPIOs
80 */
81
Petr Cvekccb6f9a2015-09-28 23:09:52 +020082#define MAGICIAN_EGPIO_BASE PXA_NR_BUILTIN_GPIO
Russell Kinga09e64f2008-08-05 16:14:15 +010083#define MAGICIAN_EGPIO(reg,bit) \
84 (MAGICIAN_EGPIO_BASE + 8*reg + bit)
85
86/* output */
87
Petr Cvekccb6f9a2015-09-28 23:09:52 +020088#define EGPIO_MAGICIAN_TOPPOLY_POWER MAGICIAN_EGPIO(0, 2)
89#define EGPIO_MAGICIAN_LED_POWER MAGICIAN_EGPIO(0, 5)
90#define EGPIO_MAGICIAN_GSM_RESET MAGICIAN_EGPIO(0, 6)
91#define EGPIO_MAGICIAN_LCD_POWER MAGICIAN_EGPIO(0, 7)
92#define EGPIO_MAGICIAN_SPK_POWER MAGICIAN_EGPIO(1, 0)
93#define EGPIO_MAGICIAN_EP_POWER MAGICIAN_EGPIO(1, 1)
94#define EGPIO_MAGICIAN_IN_SEL0 MAGICIAN_EGPIO(1, 2)
95#define EGPIO_MAGICIAN_IN_SEL1 MAGICIAN_EGPIO(1, 3)
96#define EGPIO_MAGICIAN_MIC_POWER MAGICIAN_EGPIO(1, 4)
97#define EGPIO_MAGICIAN_CODEC_RESET MAGICIAN_EGPIO(1, 5)
98#define EGPIO_MAGICIAN_CODEC_POWER MAGICIAN_EGPIO(1, 6)
99#define EGPIO_MAGICIAN_BL_POWER MAGICIAN_EGPIO(1, 7)
100#define EGPIO_MAGICIAN_SD_POWER MAGICIAN_EGPIO(2, 0)
101#define EGPIO_MAGICIAN_CARKIT_MIC MAGICIAN_EGPIO(2, 1)
Petr Cvek02b0d342015-09-28 23:15:19 +0200102#define EGPIO_MAGICIAN_IR_RX_SHUTDOWN MAGICIAN_EGPIO(2, 2)
Petr Cvekccb6f9a2015-09-28 23:09:52 +0200103#define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3)
104#define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4)
105#define EGPIO_MAGICIAN_BQ24022_ISET2 MAGICIAN_EGPIO(2, 5)
Petr Cvek02b0d342015-09-28 23:15:19 +0200106#define EGPIO_MAGICIAN_NICD_CHARGE MAGICIAN_EGPIO(2, 6)
Petr Cvekccb6f9a2015-09-28 23:09:52 +0200107#define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7)
Russell Kinga09e64f2008-08-05 16:14:15 +0100108
109/* input */
110
Petr Cvekf78b3a12015-09-28 23:32:40 +0200111/* USB or AC charger type */
112#define EGPIO_MAGICIAN_CABLE_TYPE MAGICIAN_EGPIO(4, 0)
113/*
114 * Vbus is detected
115 * FIXME behaves like (6,3), may differ for host/device
116 */
117#define EGPIO_MAGICIAN_CABLE_VBUS MAGICIAN_EGPIO(4, 1)
Russell Kinga09e64f2008-08-05 16:14:15 +0100118
Petr Cvekccb6f9a2015-09-28 23:09:52 +0200119#define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0)
120#define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1)
121#define EGPIO_MAGICIAN_BOARD_ID2 MAGICIAN_EGPIO(5, 2)
122#define EGPIO_MAGICIAN_LCD_SELECT MAGICIAN_EGPIO(5, 3)
123#define EGPIO_MAGICIAN_nSD_READONLY MAGICIAN_EGPIO(5, 4)
Russell Kinga09e64f2008-08-05 16:14:15 +0100124
Petr Cvekccb6f9a2015-09-28 23:09:52 +0200125#define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1)
Petr Cvek02b0d342015-09-28 23:15:19 +0200126/* FIXME behaves like (4,1), may differ for host/device */
Petr Cvekf78b3a12015-09-28 23:32:40 +0200127#define EGPIO_MAGICIAN_CABLE_INSERTED MAGICIAN_EGPIO(6, 3)
Russell Kinga09e64f2008-08-05 16:14:15 +0100128
129#endif /* _MAGICIAN_H_ */