root/arch/arm/mach-pxa/palmt5.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. palmt5_kpc_init
  2. palmt5_kpc_init
  3. palmt5_keys_init
  4. palmt5_keys_init
  5. palmt5_reserve
  6. palmt5_init

   1 // SPDX-License-Identifier: GPL-2.0-only
   2 /*
   3  * Hardware definitions for Palm Tungsten|T5
   4  *
   5  * Author:      Marek Vasut <marek.vasut@gmail.com>
   6  *
   7  * Based on work of:
   8  *              Ales Snuparek <snuparek@atlas.cz>
   9  *              Justin Kendrick <twilightsentry@gmail.com>
  10  *              RichardT5 <richard_t5@users.sourceforge.net>
  11  *
  12  * (find more info at www.hackndev.com)
  13  */
  14 
  15 #include <linux/platform_device.h>
  16 #include <linux/delay.h>
  17 #include <linux/irq.h>
  18 #include <linux/gpio_keys.h>
  19 #include <linux/input.h>
  20 #include <linux/memblock.h>
  21 #include <linux/pda_power.h>
  22 #include <linux/pwm_backlight.h>
  23 #include <linux/gpio.h>
  24 #include <linux/wm97xx.h>
  25 #include <linux/power_supply.h>
  26 #include <linux/usb/gpio_vbus.h>
  27 
  28 #include <asm/mach-types.h>
  29 #include <asm/mach/arch.h>
  30 #include <asm/mach/map.h>
  31 
  32 #include "pxa27x.h"
  33 #include <mach/audio.h>
  34 #include "palmt5.h"
  35 #include <linux/platform_data/mmc-pxamci.h>
  36 #include <linux/platform_data/video-pxafb.h>
  37 #include <linux/platform_data/irda-pxaficp.h>
  38 #include <linux/platform_data/keypad-pxa27x.h>
  39 #include "udc.h"
  40 #include <linux/platform_data/asoc-palm27x.h>
  41 #include "palm27x.h"
  42 
  43 #include "generic.h"
  44 #include "devices.h"
  45 
  46 /******************************************************************************
  47  * Pin configuration
  48  ******************************************************************************/
  49 static unsigned long palmt5_pin_config[] __initdata = {
  50         /* MMC */
  51         GPIO32_MMC_CLK,
  52         GPIO92_MMC_DAT_0,
  53         GPIO109_MMC_DAT_1,
  54         GPIO110_MMC_DAT_2,
  55         GPIO111_MMC_DAT_3,
  56         GPIO112_MMC_CMD,
  57         GPIO14_GPIO,    /* SD detect */
  58         GPIO114_GPIO,   /* SD power */
  59         GPIO115_GPIO,   /* SD r/o switch */
  60 
  61         /* AC97 */
  62         GPIO28_AC97_BITCLK,
  63         GPIO29_AC97_SDATA_IN_0,
  64         GPIO30_AC97_SDATA_OUT,
  65         GPIO31_AC97_SYNC,
  66         GPIO89_AC97_SYSCLK,
  67         GPIO95_AC97_nRESET,
  68 
  69         /* IrDA */
  70         GPIO40_GPIO,    /* ir disable */
  71         GPIO46_FICP_RXD,
  72         GPIO47_FICP_TXD,
  73 
  74         /* USB */
  75         GPIO15_GPIO,    /* usb detect */
  76         GPIO93_GPIO,    /* usb power */
  77 
  78         /* MATRIX KEYPAD */
  79         GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
  80         GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
  81         GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
  82         GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
  83         GPIO103_KP_MKOUT_0,
  84         GPIO104_KP_MKOUT_1,
  85         GPIO105_KP_MKOUT_2,
  86 
  87         /* LCD */
  88         GPIOxx_LCD_TFT_16BPP,
  89 
  90         /* PWM */
  91         GPIO16_PWM0_OUT,
  92 
  93         /* FFUART */
  94         GPIO34_FFUART_RXD,
  95         GPIO39_FFUART_TXD,
  96 
  97         /* MISC */
  98         GPIO10_GPIO,    /* hotsync button */
  99         GPIO90_GPIO,    /* power detect */
 100         GPIO107_GPIO,   /* earphone detect */
 101 };
 102 
 103 /******************************************************************************
 104  * GPIO keyboard
 105  ******************************************************************************/
 106 #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
 107 static const unsigned int palmt5_matrix_keys[] = {
 108         KEY(0, 0, KEY_POWER),
 109         KEY(0, 1, KEY_F1),
 110         KEY(0, 2, KEY_ENTER),
 111 
 112         KEY(1, 0, KEY_F2),
 113         KEY(1, 1, KEY_F3),
 114         KEY(1, 2, KEY_F4),
 115 
 116         KEY(2, 0, KEY_UP),
 117         KEY(2, 2, KEY_DOWN),
 118 
 119         KEY(3, 0, KEY_RIGHT),
 120         KEY(3, 2, KEY_LEFT),
 121 };
 122 
 123 static struct matrix_keymap_data palmt5_matrix_keymap_data = {
 124         .keymap                 = palmt5_matrix_keys,
 125         .keymap_size            = ARRAY_SIZE(palmt5_matrix_keys),
 126 };
 127 
 128 static struct pxa27x_keypad_platform_data palmt5_keypad_platform_data = {
 129         .matrix_key_rows        = 4,
 130         .matrix_key_cols        = 3,
 131         .matrix_keymap_data     = &palmt5_matrix_keymap_data,
 132 
 133         .debounce_interval      = 30,
 134 };
 135 
 136 static void __init palmt5_kpc_init(void)
 137 {
 138         pxa_set_keypad_info(&palmt5_keypad_platform_data);
 139 }
 140 #else
 141 static inline void palmt5_kpc_init(void) {}
 142 #endif
 143 
 144 /******************************************************************************
 145  * GPIO keys
 146  ******************************************************************************/
 147 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 148 static struct gpio_keys_button palmt5_pxa_buttons[] = {
 149         {KEY_F8, GPIO_NR_PALMT5_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
 150 };
 151 
 152 static struct gpio_keys_platform_data palmt5_pxa_keys_data = {
 153         .buttons        = palmt5_pxa_buttons,
 154         .nbuttons       = ARRAY_SIZE(palmt5_pxa_buttons),
 155 };
 156 
 157 static struct platform_device palmt5_pxa_keys = {
 158         .name   = "gpio-keys",
 159         .id     = -1,
 160         .dev    = {
 161                 .platform_data = &palmt5_pxa_keys_data,
 162         },
 163 };
 164 
 165 static void __init palmt5_keys_init(void)
 166 {
 167         platform_device_register(&palmt5_pxa_keys);
 168 }
 169 #else
 170 static inline void palmt5_keys_init(void) {}
 171 #endif
 172 
 173 /******************************************************************************
 174  * Machine init
 175  ******************************************************************************/
 176 static void __init palmt5_reserve(void)
 177 {
 178         memblock_reserve(0xa0200000, 0x1000);
 179 }
 180 
 181 static struct gpiod_lookup_table palmt5_mci_gpio_table = {
 182         .dev_id = "pxa2xx-mci.0",
 183         .table = {
 184                 GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMT5_SD_DETECT_N,
 185                             "cd", GPIO_ACTIVE_LOW),
 186                 GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMT5_SD_READONLY,
 187                             "wp", GPIO_ACTIVE_LOW),
 188                 GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMT5_SD_POWER,
 189                             "power", GPIO_ACTIVE_HIGH),
 190                 { },
 191         },
 192 };
 193 
 194 static void __init palmt5_init(void)
 195 {
 196         pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
 197         pxa_set_ffuart_info(NULL);
 198         pxa_set_btuart_info(NULL);
 199         pxa_set_stuart_info(NULL);
 200 
 201         palm27x_mmc_init(&palmt5_mci_gpio_table);
 202         palm27x_pm_init(PALMT5_STR_BASE);
 203         palm27x_lcd_init(-1, &palm_320x480_lcd_mode);
 204         palm27x_udc_init(GPIO_NR_PALMT5_USB_DETECT_N,
 205                         GPIO_NR_PALMT5_USB_PULLUP, 1);
 206         palm27x_irda_init(GPIO_NR_PALMT5_IR_DISABLE);
 207         palm27x_ac97_init(PALMT5_BAT_MIN_VOLTAGE, PALMT5_BAT_MAX_VOLTAGE,
 208                         GPIO_NR_PALMT5_EARPHONE_DETECT, 95);
 209         palm27x_pwm_init(GPIO_NR_PALMT5_BL_POWER, GPIO_NR_PALMT5_LCD_POWER);
 210         palm27x_power_init(GPIO_NR_PALMT5_POWER_DETECT, -1);
 211         palm27x_pmic_init();
 212         palmt5_kpc_init();
 213         palmt5_keys_init();
 214 }
 215 
 216 MACHINE_START(PALMT5, "Palm Tungsten|T5")
 217         .atag_offset    = 0x100,
 218         .map_io         = pxa27x_map_io,
 219         .reserve        = palmt5_reserve,
 220         .nr_irqs        = PXA_NR_IRQS,
 221         .init_irq       = pxa27x_init_irq,
 222         .handle_irq     = pxa27x_handle_irq,
 223         .init_time      = pxa_timer_init,
 224         .init_machine   = palmt5_init,
 225         .restart        = pxa_restart,
 226 MACHINE_END

/* [<][>][^][v][top][bottom][index][help] */