^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Hardware definitions for Palm Treo smartphones
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * currently supported:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Palm Treo 680 (GSM)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Palm Centro 685 (GSM)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Author: Tomas Cech <sleep_walker@suse.cz>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * (find more info at www.hackndev.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/gpio_keys.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/memblock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/pda_power.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/pwm_backlight.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/power_supply.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/w1-gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <asm/mach/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include "pxa27x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include "pxa27x-udc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #include <mach/audio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #include "palmtreo.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #include <linux/platform_data/mmc-pxamci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #include <linux/platform_data/video-pxafb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #include <linux/platform_data/irda-pxaficp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #include <linux/platform_data/keypad-pxa27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #include "udc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #include <linux/platform_data/usb-ohci-pxa27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #include <mach/pxa2xx-regs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #include <linux/platform_data/asoc-palm27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #include <linux/platform_data/media/camera-pxa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #include "palm27x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #include <sound/pxa2xx-lib.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #include "generic.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #include "devices.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * Pin configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) static unsigned long treo_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) /* MMC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) GPIO32_MMC_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) GPIO92_MMC_DAT_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) GPIO109_MMC_DAT_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) GPIO110_MMC_DAT_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) GPIO111_MMC_DAT_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) GPIO112_MMC_CMD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) GPIO113_GPIO, /* SD detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* AC97 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) GPIO28_AC97_BITCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) GPIO29_AC97_SDATA_IN_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) GPIO30_AC97_SDATA_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) GPIO31_AC97_SYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) GPIO89_AC97_SYSCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) GPIO95_AC97_nRESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) /* IrDA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) GPIO46_FICP_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) GPIO47_FICP_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) /* PWM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) GPIO16_PWM0_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) /* USB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) /* MATRIX KEYPAD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) GPIO101_KP_MKIN_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) GPIO102_KP_MKIN_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) GPIO97_KP_MKIN_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) GPIO98_KP_MKIN_4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) GPIO91_KP_MKIN_6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) GPIO13_KP_MKIN_7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) GPIO104_KP_MKOUT_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) GPIO105_KP_MKOUT_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) GPIO106_KP_MKOUT_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) GPIO107_KP_MKOUT_4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) GPIO108_KP_MKOUT_5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) GPIO96_KP_MKOUT_6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /* Quick Capture Interface */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) GPIO84_CIF_FV,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) GPIO85_CIF_LV,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) GPIO53_CIF_MCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) GPIO54_CIF_PCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) GPIO81_CIF_DD_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) GPIO55_CIF_DD_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) GPIO51_CIF_DD_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) GPIO50_CIF_DD_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) GPIO52_CIF_DD_4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) GPIO48_CIF_DD_5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) GPIO17_CIF_DD_6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) GPIO12_CIF_DD_7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /* I2C */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) GPIO117_I2C_SCL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) GPIO118_I2C_SDA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) /* GSM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) GPIO14_GPIO | WAKEUP_ON_EDGE_BOTH, /* GSM host wake up */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) GPIO34_FFUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) GPIO35_FFUART_CTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) GPIO39_FFUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) GPIO41_FFUART_RTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /* MISC. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* external power detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH, /* silent switch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) GPIO116_GPIO, /* headphone detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) #ifdef CONFIG_MACH_TREO680
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static unsigned long treo680_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) GPIO33_GPIO, /* SD read only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) /* MATRIX KEYPAD - different wake up source */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) GPIO99_KP_MKIN_5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) /* LCD... L_BIAS alt fn not configured on Treo680; is GPIO instead */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) GPIOxx_LCD_16BPP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) GPIO74_LCD_FCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) GPIO75_LCD_LCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) GPIO76_LCD_PCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) #endif /* CONFIG_MACH_TREO680 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #ifdef CONFIG_MACH_CENTRO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) static unsigned long centro685_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /* Bluetooth attached to BT UART*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) MFP_CFG_OUT(GPIO80, AF0, DRIVE_LOW), /* power: LOW = off */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) GPIO42_BTUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) GPIO43_BTUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) GPIO44_BTUART_CTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) GPIO45_BTUART_RTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) /* MATRIX KEYPAD - different wake up source */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) GPIO100_KP_MKIN_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /* LCD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) GPIOxx_LCD_TFT_16BPP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) #endif /* CONFIG_MACH_CENTRO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * GPIO keyboard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #if IS_ENABLED(CONFIG_KEYBOARD_PXA27x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) static const unsigned int treo680_matrix_keys[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) KEY(0, 0, KEY_F8), /* Red/Off/Power */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) KEY(0, 1, KEY_LEFT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) KEY(0, 2, KEY_LEFTCTRL), /* Alternate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) KEY(0, 3, KEY_L),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) KEY(0, 4, KEY_A),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) KEY(0, 5, KEY_Q),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) KEY(0, 6, KEY_P),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) KEY(1, 0, KEY_RIGHTCTRL), /* Menu */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) KEY(1, 1, KEY_RIGHT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) KEY(1, 3, KEY_Z),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) KEY(1, 4, KEY_S),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) KEY(1, 5, KEY_W),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) KEY(2, 0, KEY_F1), /* Phone */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) KEY(2, 1, KEY_UP),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) KEY(2, 2, KEY_0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) KEY(2, 3, KEY_X),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) KEY(2, 4, KEY_D),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) KEY(2, 5, KEY_E),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) KEY(3, 0, KEY_F10), /* Calendar */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) KEY(3, 1, KEY_DOWN),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) KEY(3, 2, KEY_SPACE),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) KEY(3, 3, KEY_C),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) KEY(3, 4, KEY_F),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) KEY(3, 5, KEY_R),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) KEY(4, 0, KEY_F12), /* Mail */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) KEY(4, 1, KEY_KPENTER),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) KEY(4, 2, KEY_RIGHTALT), /* Alt */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) KEY(4, 3, KEY_V),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) KEY(4, 4, KEY_G),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) KEY(4, 5, KEY_T),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) KEY(5, 0, KEY_F9), /* Home */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) KEY(5, 1, KEY_PAGEUP), /* Side up */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) KEY(5, 2, KEY_DOT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) KEY(5, 3, KEY_B),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) KEY(5, 4, KEY_H),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) KEY(5, 5, KEY_Y),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) KEY(6, 0, KEY_TAB), /* Side Activate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) KEY(6, 1, KEY_PAGEDOWN), /* Side down */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) KEY(6, 2, KEY_ENTER),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) KEY(6, 3, KEY_N),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) KEY(6, 4, KEY_J),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) KEY(6, 5, KEY_U),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) KEY(7, 0, KEY_F6), /* Green/Call */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) KEY(7, 1, KEY_O),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) KEY(7, 2, KEY_BACKSPACE),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) KEY(7, 3, KEY_M),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) KEY(7, 4, KEY_K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) KEY(7, 5, KEY_I),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) static const unsigned int centro_matrix_keys[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) KEY(0, 0, KEY_F9), /* Home */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) KEY(0, 1, KEY_LEFT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) KEY(0, 2, KEY_LEFTCTRL), /* Alternate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) KEY(0, 3, KEY_L),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) KEY(0, 4, KEY_A),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) KEY(0, 5, KEY_Q),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) KEY(0, 6, KEY_P),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) KEY(1, 0, KEY_RIGHTCTRL), /* Menu */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) KEY(1, 1, KEY_RIGHT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) KEY(1, 3, KEY_Z),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) KEY(1, 4, KEY_S),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) KEY(1, 5, KEY_W),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) KEY(2, 0, KEY_F1), /* Phone */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) KEY(2, 1, KEY_UP),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) KEY(2, 2, KEY_0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) KEY(2, 3, KEY_X),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) KEY(2, 4, KEY_D),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) KEY(2, 5, KEY_E),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) KEY(3, 0, KEY_F10), /* Calendar */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) KEY(3, 1, KEY_DOWN),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) KEY(3, 2, KEY_SPACE),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) KEY(3, 3, KEY_C),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) KEY(3, 4, KEY_F),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) KEY(3, 5, KEY_R),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) KEY(4, 0, KEY_F12), /* Mail */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) KEY(4, 1, KEY_KPENTER),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) KEY(4, 2, KEY_RIGHTALT), /* Alt */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) KEY(4, 3, KEY_V),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) KEY(4, 4, KEY_G),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) KEY(4, 5, KEY_T),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) KEY(5, 0, KEY_F8), /* Red/Off/Power */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) KEY(5, 1, KEY_PAGEUP), /* Side up */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) KEY(5, 2, KEY_DOT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) KEY(5, 3, KEY_B),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) KEY(5, 4, KEY_H),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) KEY(5, 5, KEY_Y),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) KEY(6, 0, KEY_TAB), /* Side Activate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) KEY(6, 1, KEY_PAGEDOWN), /* Side down */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) KEY(6, 2, KEY_ENTER),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) KEY(6, 3, KEY_N),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) KEY(6, 4, KEY_J),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) KEY(6, 5, KEY_U),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) KEY(7, 0, KEY_F6), /* Green/Call */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) KEY(7, 1, KEY_O),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) KEY(7, 2, KEY_BACKSPACE),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) KEY(7, 3, KEY_M),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) KEY(7, 4, KEY_K),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) KEY(7, 5, KEY_I),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) static struct matrix_keymap_data treo680_matrix_keymap_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) .keymap = treo680_matrix_keys,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) .keymap_size = ARRAY_SIZE(treo680_matrix_keys),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) static struct matrix_keymap_data centro_matrix_keymap_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) .keymap = centro_matrix_keys,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) .keymap_size = ARRAY_SIZE(centro_matrix_keys),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) static struct pxa27x_keypad_platform_data treo680_keypad_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) .matrix_key_rows = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) .matrix_key_cols = 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) .matrix_keymap_data = &treo680_matrix_keymap_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) .direct_key_map = { KEY_CONNECT },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) .direct_key_num = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) .debounce_interval = 30,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) static void __init palmtreo_kpc_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) static struct pxa27x_keypad_platform_data *data = &treo680_keypad_pdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) if (machine_is_centro())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) data->matrix_keymap_data = ¢ro_matrix_keymap_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) pxa_set_keypad_info(&treo680_keypad_pdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) static inline void palmtreo_kpc_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) * USB host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) #if IS_ENABLED(CONFIG_USB_OHCI_HCD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) static struct pxaohci_platform_data treo680_ohci_info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) .port_mode = PMM_PERPORT_MODE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) .flags = ENABLE_PORT1 | ENABLE_PORT3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) .power_budget = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) static void __init palmtreo_uhc_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) if (machine_is_treo680())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) pxa_set_ohci_info(&treo680_ohci_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) static inline void palmtreo_uhc_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) * Vibra and LEDs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) static struct gpio_led treo680_gpio_leds[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) .name = "treo680:vibra:vibra",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) .default_trigger = "none",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) .gpio = GPIO_NR_TREO680_VIBRATE_EN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) .name = "treo680:green:led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) .default_trigger = "mmc0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) .gpio = GPIO_NR_TREO_GREEN_LED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) .name = "treo680:white:keybbl",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) .default_trigger = "none",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) .gpio = GPIO_NR_TREO680_KEYB_BL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) static struct gpio_led_platform_data treo680_gpio_led_info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) .leds = treo680_gpio_leds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) .num_leds = ARRAY_SIZE(treo680_gpio_leds),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) static struct gpio_led centro_gpio_leds[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) .name = "centro:vibra:vibra",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) .default_trigger = "none",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) .gpio = GPIO_NR_CENTRO_VIBRATE_EN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) .name = "centro:green:led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) .default_trigger = "mmc0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) .gpio = GPIO_NR_TREO_GREEN_LED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) .name = "centro:white:keybbl",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) .default_trigger = "none",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) .active_low = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) .gpio = GPIO_NR_CENTRO_KEYB_BL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) static struct gpio_led_platform_data centro_gpio_led_info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) .leds = centro_gpio_leds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) .num_leds = ARRAY_SIZE(centro_gpio_leds),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) static struct platform_device palmtreo_leds = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) .name = "leds-gpio",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) static void __init palmtreo_leds_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) if (machine_is_centro())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) palmtreo_leds.dev.platform_data = ¢ro_gpio_led_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) else if (machine_is_treo680())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) palmtreo_leds.dev.platform_data = &treo680_gpio_led_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) platform_device_register(&palmtreo_leds);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) * Machine init
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) static void __init treo_reserve(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) memblock_reserve(0xa0000000, 0x1000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) memblock_reserve(0xa2000000, 0x1000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) static void __init palmphone_common_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) pxa_set_ffuart_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) pxa_set_btuart_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) pxa_set_stuart_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) palm27x_pm_init(TREO_STR_BASE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) palm27x_lcd_init(GPIO_NR_TREO_BL_POWER, &palm_320x320_new_lcd_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) palm27x_udc_init(GPIO_NR_TREO_USB_DETECT, GPIO_NR_TREO_USB_PULLUP, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) palm27x_irda_init(GPIO_NR_TREO_IR_EN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) palm27x_ac97_init(-1, -1, -1, 95);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) palm27x_pwm_init(GPIO_NR_TREO_BL_POWER, -1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) palm27x_power_init(GPIO_NR_TREO_POWER_DETECT, -1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) palm27x_pmic_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) palmtreo_kpc_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) palmtreo_uhc_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) palmtreo_leds_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) #ifdef CONFIG_MACH_TREO680
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) void __init treo680_gpio_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) unsigned int gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) /* drive all three lcd gpios high initially */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) const unsigned long lcd_flags = GPIOF_INIT_HIGH | GPIOF_DIR_OUT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) * LCD GPIO initialization...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) * This is likely the power to the lcd. Toggling it low/high appears to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) * turn the lcd off/on. Can be toggled after lcd is initialized without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) * any apparent adverse effects to the lcd operation. Note that this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) * gpio line is used by the lcd controller as the L_BIAS signal, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) * treo680 configures it as gpio.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) gpio = GPIO_NR_TREO680_LCD_POWER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) if (gpio_request_one(gpio, lcd_flags, "LCD power") < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) goto fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) * These two are called "enables", for lack of a better understanding.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) * If either of these are toggled after the lcd is initialized, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) * image becomes degraded. N.B. The IPL shipped with the treo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) * configures GPIO_NR_TREO680_LCD_EN_N as output and drives it high. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) * the IPL is ever reprogrammed, this initialization may be need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) * revisited.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) gpio = GPIO_NR_TREO680_LCD_EN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) if (gpio_request_one(gpio, lcd_flags, "LCD enable") < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) goto fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) gpio = GPIO_NR_TREO680_LCD_EN_N;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) if (gpio_request_one(gpio, lcd_flags, "LCD enable_n") < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) goto fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) /* driving this low turns LCD on */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) gpio_set_value(GPIO_NR_TREO680_LCD_EN_N, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) fail:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) pr_err("gpio %d initialization failed\n", gpio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) gpio_free(GPIO_NR_TREO680_LCD_POWER);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) gpio_free(GPIO_NR_TREO680_LCD_EN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) gpio_free(GPIO_NR_TREO680_LCD_EN_N);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) static struct gpiod_lookup_table treo680_mci_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) .dev_id = "pxa2xx-mci.0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) .table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO_SD_DETECT_N,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) "cd", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO680_SD_READONLY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) "wp", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO680_SD_POWER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) "power", GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) { },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) static void __init treo680_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) palmphone_common_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) treo680_gpio_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) palm27x_mmc_init(&treo680_mci_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) #ifdef CONFIG_MACH_CENTRO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) static struct gpiod_lookup_table centro685_mci_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) .dev_id = "pxa2xx-mci.0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) .table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) GPIO_LOOKUP("gpio-pxa", GPIO_NR_TREO_SD_DETECT_N,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) "cd", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) GPIO_LOOKUP("gpio-pxa", GPIO_NR_CENTRO_SD_POWER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) "power", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) { },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) static void __init centro_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) palmphone_common_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) palm27x_mmc_init(¢ro685_mci_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) #ifdef CONFIG_MACH_TREO680
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) MACHINE_START(TREO680, "Palm Treo 680")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) .atag_offset = 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) .map_io = pxa27x_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) .reserve = treo_reserve,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) .nr_irqs = PXA_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) .init_irq = pxa27x_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) .handle_irq = pxa27x_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) .init_time = pxa_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) .init_machine = treo680_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) .restart = pxa_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) MACHINE_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) #ifdef CONFIG_MACH_CENTRO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) MACHINE_START(CENTRO, "Palm Centro 685")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) .atag_offset = 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) .map_io = pxa27x_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) .reserve = treo_reserve,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) .nr_irqs = PXA_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) .init_irq = pxa27x_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) .handle_irq = pxa27x_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) .init_time = pxa_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) .init_machine = centro_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) .restart = pxa_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) MACHINE_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) #endif