mtd: nand: omap: Fix comment in platform data using wrong Kconfig symbol
[linux/fpc-iii.git] / arch / arm / mach-pxa / colibri-pxa270-income.c
blobd203dd30cdd0121e35606e6d0fe67a9e5df85916
1 /*
2 * linux/arch/arm/mach-pxa/income.c
4 * Support for Income s.r.o. SH-Dmaster PXA270 SBC
6 * Copyright (C) 2010
7 * Marek Vasut <marek.vasut@gmail.com>
8 * Pavel Revak <palo@bielyvlk.sk>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/bitops.h>
16 #include <linux/delay.h>
17 #include <linux/gpio/machine.h>
18 #include <linux/init.h>
19 #include <linux/interrupt.h>
20 #include <linux/leds.h>
21 #include <linux/ioport.h>
22 #include <linux/kernel.h>
23 #include <linux/platform_device.h>
24 #include <linux/pwm.h>
25 #include <linux/pwm_backlight.h>
26 #include <linux/platform_data/i2c-pxa.h>
28 #include <asm/irq.h>
29 #include <asm/mach-types.h>
31 #include <mach/hardware.h>
32 #include <linux/platform_data/mmc-pxamci.h>
33 #include <linux/platform_data/usb-ohci-pxa27x.h>
34 #include "pxa27x.h"
35 #include "pxa27x-udc.h"
36 #include <linux/platform_data/video-pxafb.h>
38 #include "devices.h"
39 #include "generic.h"
41 #define GPIO114_INCOME_ETH_IRQ (114)
42 #define GPIO0_INCOME_SD_DETECT (0)
43 #define GPIO0_INCOME_SD_RO (1)
44 #define GPIO54_INCOME_LED_A (54)
45 #define GPIO55_INCOME_LED_B (55)
46 #define GPIO113_INCOME_TS_IRQ (113)
48 /******************************************************************************
49 * SD/MMC card controller
50 ******************************************************************************/
51 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
52 static struct pxamci_platform_data income_mci_platform_data = {
53 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
54 .detect_delay_ms = 200,
57 static struct gpiod_lookup_table income_mci_gpio_table = {
58 .dev_id = "pxa2xx-mci.0",
59 .table = {
60 /* Card detect on GPIO 0 */
61 GPIO_LOOKUP("gpio-pxa", GPIO0_INCOME_SD_DETECT,
62 "cd", GPIO_ACTIVE_LOW),
63 /* Write protect on GPIO 1 */
64 GPIO_LOOKUP("gpio-pxa", GPIO0_INCOME_SD_RO,
65 "wp", GPIO_ACTIVE_LOW),
66 { },
70 static void __init income_mmc_init(void)
72 gpiod_add_lookup_table(&income_mci_gpio_table);
73 pxa_set_mci_info(&income_mci_platform_data);
75 #else
76 static inline void income_mmc_init(void) {}
77 #endif
79 /******************************************************************************
80 * USB Host
81 ******************************************************************************/
82 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
83 static struct pxaohci_platform_data income_ohci_info = {
84 .port_mode = PMM_PERPORT_MODE,
85 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
88 static void __init income_uhc_init(void)
90 pxa_set_ohci_info(&income_ohci_info);
92 #else
93 static inline void income_uhc_init(void) {}
94 #endif
96 /******************************************************************************
97 * LED
98 ******************************************************************************/
99 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
100 struct gpio_led income_gpio_leds[] = {
102 .name = "income:green:leda",
103 .default_trigger = "none",
104 .gpio = GPIO54_INCOME_LED_A,
105 .active_low = 1,
108 .name = "income:green:ledb",
109 .default_trigger = "none",
110 .gpio = GPIO55_INCOME_LED_B,
111 .active_low = 1,
115 static struct gpio_led_platform_data income_gpio_led_info = {
116 .leds = income_gpio_leds,
117 .num_leds = ARRAY_SIZE(income_gpio_leds),
120 static struct platform_device income_leds = {
121 .name = "leds-gpio",
122 .id = -1,
123 .dev = {
124 .platform_data = &income_gpio_led_info,
128 static void __init income_led_init(void)
130 platform_device_register(&income_leds);
132 #else
133 static inline void income_led_init(void) {}
134 #endif
136 /******************************************************************************
137 * I2C
138 ******************************************************************************/
139 #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
140 static struct i2c_board_info __initdata income_i2c_devs[] = {
142 I2C_BOARD_INFO("ds1340", 0x68),
143 }, {
144 I2C_BOARD_INFO("lm75", 0x4f),
148 static void __init income_i2c_init(void)
150 pxa_set_i2c_info(NULL);
151 pxa27x_set_i2c_power_info(NULL);
152 i2c_register_board_info(0, ARRAY_AND_SIZE(income_i2c_devs));
154 #else
155 static inline void income_i2c_init(void) {}
156 #endif
158 /******************************************************************************
159 * Framebuffer
160 ******************************************************************************/
161 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
162 static struct pxafb_mode_info income_lcd_modes[] = {
164 .pixclock = 144700,
165 .xres = 320,
166 .yres = 240,
167 .bpp = 32,
168 .depth = 18,
170 .left_margin = 10,
171 .right_margin = 10,
172 .upper_margin = 7,
173 .lower_margin = 8,
175 .hsync_len = 20,
176 .vsync_len = 2,
178 .sync = FB_SYNC_VERT_HIGH_ACT,
182 static struct pxafb_mach_info income_lcd_screen = {
183 .modes = income_lcd_modes,
184 .num_modes = ARRAY_SIZE(income_lcd_modes),
185 .lcd_conn = LCD_COLOR_TFT_18BPP | LCD_PCLK_EDGE_FALL,
188 static void __init income_lcd_init(void)
190 pxa_set_fb_info(NULL, &income_lcd_screen);
192 #else
193 static inline void income_lcd_init(void) {}
194 #endif
196 /******************************************************************************
197 * Backlight
198 ******************************************************************************/
199 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
200 static struct pwm_lookup income_pwm_lookup[] = {
201 PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 1000000,
202 PWM_POLARITY_NORMAL),
205 static struct platform_pwm_backlight_data income_backlight_data = {
206 .max_brightness = 0x3ff,
207 .dft_brightness = 0x1ff,
208 .enable_gpio = -1,
211 static struct platform_device income_backlight = {
212 .name = "pwm-backlight",
213 .dev = {
214 .parent = &pxa27x_device_pwm0.dev,
215 .platform_data = &income_backlight_data,
219 static void __init income_pwm_init(void)
221 pwm_add_table(income_pwm_lookup, ARRAY_SIZE(income_pwm_lookup));
222 platform_device_register(&income_backlight);
224 #else
225 static inline void income_pwm_init(void) {}
226 #endif
228 void __init colibri_pxa270_income_boardinit(void)
230 pxa_set_ffuart_info(NULL);
231 pxa_set_btuart_info(NULL);
232 pxa_set_stuart_info(NULL);
234 income_mmc_init();
235 income_uhc_init();
236 income_led_init();
237 income_i2c_init();
238 income_lcd_init();
239 income_pwm_init();