Linux-libre 5.4.47-gnu
[librecmc/linux-libre.git] / arch / arm / mach-pxa / include / mach / palmld.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * GPIOs and interrupts for Palm LifeDrive Handheld Computer
4  *
5  * Authors:     Alex Osborne <ato@meshy.org>
6  *              Marek Vasut <marek.vasut@gmail.com>
7  */
8
9 #ifndef _INCLUDE_PALMLD_H_
10 #define _INCLUDE_PALMLD_H_
11
12 #include "irqs.h" /* PXA_GPIO_TO_IRQ */
13
14 /** HERE ARE GPIOs **/
15
16 /* GPIOs */
17 #define GPIO_NR_PALMLD_GPIO_RESET       1
18 #define GPIO_NR_PALMLD_POWER_DETECT     4
19 #define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N 10
20 #define GPIO_NR_PALMLD_POWER_SWITCH     12
21 #define GPIO_NR_PALMLD_EARPHONE_DETECT  13
22 #define GPIO_NR_PALMLD_LOCK_SWITCH      15
23
24 /* SD/MMC */
25 #define GPIO_NR_PALMLD_SD_DETECT_N      14
26 #define GPIO_NR_PALMLD_SD_POWER         114
27 #define GPIO_NR_PALMLD_SD_READONLY      116
28
29 /* TOUCHSCREEN */
30 #define GPIO_NR_PALMLD_WM9712_IRQ       27
31
32 /* IRDA */
33 #define GPIO_NR_PALMLD_IR_DISABLE       108
34
35 /* LCD/BACKLIGHT */
36 #define GPIO_NR_PALMLD_BL_POWER         19
37 #define GPIO_NR_PALMLD_LCD_POWER        96
38
39 /* LCD BORDER */
40 #define GPIO_NR_PALMLD_BORDER_SWITCH    21
41 #define GPIO_NR_PALMLD_BORDER_SELECT    22
42
43 /* BLUETOOTH */
44 #define GPIO_NR_PALMLD_BT_POWER         17
45 #define GPIO_NR_PALMLD_BT_RESET         83
46
47 /* PCMCIA (WiFi) */
48 #define GPIO_NR_PALMLD_PCMCIA_READY     38
49 #define GPIO_NR_PALMLD_PCMCIA_POWER     36
50 #define GPIO_NR_PALMLD_PCMCIA_RESET     81
51
52 /* LEDs */
53 #define GPIO_NR_PALMLD_LED_GREEN        52
54 #define GPIO_NR_PALMLD_LED_AMBER        94
55
56 /* IDE */
57 #define GPIO_NR_PALMLD_IDE_RESET        98
58 #define GPIO_NR_PALMLD_IDE_PWEN         115
59
60 /* USB */
61 #define GPIO_NR_PALMLD_USB_DETECT_N     3
62 #define GPIO_NR_PALMLD_USB_READY        86
63 #define GPIO_NR_PALMLD_USB_RESET        88
64 #define GPIO_NR_PALMLD_USB_INT          106
65 #define GPIO_NR_PALMLD_USB_POWER        118
66 /* 20, 53 and 86 are usb related too */
67
68 /* INTERRUPTS */
69 #define IRQ_GPIO_PALMLD_GPIO_RESET      PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_GPIO_RESET)
70 #define IRQ_GPIO_PALMLD_SD_DETECT_N     PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_SD_DETECT_N)
71 #define IRQ_GPIO_PALMLD_WM9712_IRQ      PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_WM9712_IRQ)
72 #define IRQ_GPIO_PALMLD_IDE_IRQ         PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_IDE_IRQ)
73
74
75 /** HERE ARE INIT VALUES **/
76
77 /* IO mappings */
78 #define PALMLD_USB_PHYS         PXA_CS2_PHYS
79 #define PALMLD_USB_VIRT         0xf0000000
80 #define PALMLD_USB_SIZE         0x00100000
81
82 #define PALMLD_IDE_PHYS         0x20000000
83 #define PALMLD_IDE_VIRT         0xf1000000
84 #define PALMLD_IDE_SIZE         0x00100000
85
86 #define PALMLD_PHYS_IO_START    0x40000000
87 #define PALMLD_STR_BASE         0xa0200000
88
89 /* BATTERY */
90 #define PALMLD_BAT_MAX_VOLTAGE          4000    /* 4.00V maximum voltage */
91 #define PALMLD_BAT_MIN_VOLTAGE          3550    /* 3.55V critical voltage */
92 #define PALMLD_BAT_MAX_CURRENT          0       /* unknown */
93 #define PALMLD_BAT_MIN_CURRENT          0       /* unknown */
94 #define PALMLD_BAT_MAX_CHARGE           1       /* unknown */
95 #define PALMLD_BAT_MIN_CHARGE           1       /* unknown */
96 #define PALMLD_MAX_LIFE_MINS            240     /* on-life in minutes */
97
98 #define PALMLD_BAT_MEASURE_DELAY        (HZ * 1)
99
100 /* BACKLIGHT */
101 #define PALMLD_MAX_INTENSITY            0xFE
102 #define PALMLD_DEFAULT_INTENSITY        0x7E
103 #define PALMLD_LIMIT_MASK               0x7F
104 #define PALMLD_PRESCALER                0x3F
105 #define PALMLD_PERIOD_NS                3500
106
107 #endif