18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * GPIOs and interrupts for Palm LifeDrive Handheld Computer 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Authors: Alex Osborne <ato@meshy.org> 68c2ecf20Sopenharmony_ci * Marek Vasut <marek.vasut@gmail.com> 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef _INCLUDE_PALMLD_H_ 108c2ecf20Sopenharmony_ci#define _INCLUDE_PALMLD_H_ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include "irqs.h" /* PXA_GPIO_TO_IRQ */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/** HERE ARE GPIOs **/ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* GPIOs */ 178c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_GPIO_RESET 1 188c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_POWER_DETECT 4 198c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N 10 208c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_POWER_SWITCH 12 218c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_EARPHONE_DETECT 13 228c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_LOCK_SWITCH 15 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci/* SD/MMC */ 258c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_SD_DETECT_N 14 268c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_SD_POWER 114 278c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_SD_READONLY 116 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* TOUCHSCREEN */ 308c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_WM9712_IRQ 27 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* IRDA */ 338c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_IR_DISABLE 108 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* LCD/BACKLIGHT */ 368c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_BL_POWER 19 378c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_LCD_POWER 96 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* LCD BORDER */ 408c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_BORDER_SWITCH 21 418c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_BORDER_SELECT 22 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* BLUETOOTH */ 448c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_BT_POWER 17 458c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_BT_RESET 83 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci/* PCMCIA (WiFi) */ 488c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_PCMCIA_READY 38 498c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_PCMCIA_POWER 36 508c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_PCMCIA_RESET 81 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci/* LEDs */ 538c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_LED_GREEN 52 548c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_LED_AMBER 94 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci/* IDE */ 578c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_IDE_RESET 98 588c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_IDE_PWEN 115 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci/* USB */ 618c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_USB_DETECT_N 3 628c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_USB_READY 86 638c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_USB_RESET 88 648c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_USB_INT 106 658c2ecf20Sopenharmony_ci#define GPIO_NR_PALMLD_USB_POWER 118 668c2ecf20Sopenharmony_ci/* 20, 53 and 86 are usb related too */ 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci/* INTERRUPTS */ 698c2ecf20Sopenharmony_ci#define IRQ_GPIO_PALMLD_GPIO_RESET PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_GPIO_RESET) 708c2ecf20Sopenharmony_ci#define IRQ_GPIO_PALMLD_SD_DETECT_N PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_SD_DETECT_N) 718c2ecf20Sopenharmony_ci#define IRQ_GPIO_PALMLD_WM9712_IRQ PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_WM9712_IRQ) 728c2ecf20Sopenharmony_ci#define IRQ_GPIO_PALMLD_IDE_IRQ PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_IDE_IRQ) 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci/** HERE ARE INIT VALUES **/ 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci/* IO mappings */ 788c2ecf20Sopenharmony_ci#define PALMLD_USB_PHYS PXA_CS2_PHYS 798c2ecf20Sopenharmony_ci#define PALMLD_USB_VIRT 0xf0000000 808c2ecf20Sopenharmony_ci#define PALMLD_USB_SIZE 0x00100000 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define PALMLD_IDE_PHYS 0x20000000 838c2ecf20Sopenharmony_ci#define PALMLD_IDE_VIRT 0xf1000000 848c2ecf20Sopenharmony_ci#define PALMLD_IDE_SIZE 0x00100000 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#define PALMLD_PHYS_IO_START 0x40000000 878c2ecf20Sopenharmony_ci#define PALMLD_STR_BASE 0xa0200000 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci/* BATTERY */ 908c2ecf20Sopenharmony_ci#define PALMLD_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */ 918c2ecf20Sopenharmony_ci#define PALMLD_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */ 928c2ecf20Sopenharmony_ci#define PALMLD_BAT_MAX_CURRENT 0 /* unknown */ 938c2ecf20Sopenharmony_ci#define PALMLD_BAT_MIN_CURRENT 0 /* unknown */ 948c2ecf20Sopenharmony_ci#define PALMLD_BAT_MAX_CHARGE 1 /* unknown */ 958c2ecf20Sopenharmony_ci#define PALMLD_BAT_MIN_CHARGE 1 /* unknown */ 968c2ecf20Sopenharmony_ci#define PALMLD_MAX_LIFE_MINS 240 /* on-life in minutes */ 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci#define PALMLD_BAT_MEASURE_DELAY (HZ * 1) 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci/* BACKLIGHT */ 1018c2ecf20Sopenharmony_ci#define PALMLD_MAX_INTENSITY 0xFE 1028c2ecf20Sopenharmony_ci#define PALMLD_DEFAULT_INTENSITY 0x7E 1038c2ecf20Sopenharmony_ci#define PALMLD_LIMIT_MASK 0x7F 1048c2ecf20Sopenharmony_ci#define PALMLD_PRESCALER 0x3F 1058c2ecf20Sopenharmony_ci#define PALMLD_PERIOD_NS 3500 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci#endif 108