2 * linux/arch/arm/mach-pxa/income.c
4 * Support for Income s.r.o. SH-Dmaster PXA270 SBC
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.h>
18 #include <linux/init.h>
19 #include <linux/interrupt.h>
20 #include <linux/ioport.h>
21 #include <linux/kernel.h>
22 #include <linux/platform_device.h>
23 #include <linux/pwm_backlight.h>
24 #include <linux/i2c/pxa-i2c.h>
27 #include <asm/mach-types.h>
29 #include <mach/hardware.h>
31 #include <mach/ohci.h>
32 #include <mach/pxa27x.h>
33 #include <mach/pxa27x-udc.h>
34 #include <mach/pxafb.h>
39 #define GPIO114_INCOME_ETH_IRQ (114)
40 #define GPIO0_INCOME_SD_DETECT (0)
41 #define GPIO0_INCOME_SD_RO (1)
42 #define GPIO54_INCOME_LED_A (54)
43 #define GPIO55_INCOME_LED_B (55)
44 #define GPIO113_INCOME_TS_IRQ (113)
46 /******************************************************************************
47 * SD/MMC card controller
48 ******************************************************************************/
49 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
50 static struct pxamci_platform_data income_mci_platform_data = {
51 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
53 .gpio_card_detect = GPIO0_INCOME_SD_DETECT,
54 .gpio_card_ro = GPIO0_INCOME_SD_RO,
55 .detect_delay_ms = 200,
58 static void __init income_mmc_init(void)
60 pxa_set_mci_info(&income_mci_platform_data);
63 static inline void income_mmc_init(void) {}
66 /******************************************************************************
68 ******************************************************************************/
69 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
70 static struct pxaohci_platform_data income_ohci_info = {
71 .port_mode = PMM_PERPORT_MODE,
72 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
75 static void __init income_uhc_init(void)
77 pxa_set_ohci_info(&income_ohci_info);
80 static inline void income_uhc_init(void) {}
83 /******************************************************************************
85 ******************************************************************************/
86 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
87 struct gpio_led income_gpio_leds[] = {
89 .name = "income:green:leda",
90 .default_trigger = "none",
91 .gpio = GPIO54_INCOME_LED_A,
95 .name = "income:green:ledb",
96 .default_trigger = "none",
97 .gpio = GPIO55_INCOME_LED_B,
102 static struct gpio_led_platform_data income_gpio_led_info = {
103 .leds = income_gpio_leds,
104 .num_leds = ARRAY_SIZE(income_gpio_leds),
107 static struct platform_device income_leds = {
111 .platform_data = &income_gpio_led_info,
115 static void __init income_led_init(void)
117 platform_device_register(&income_leds);
120 static inline void income_led_init(void) {}
123 /******************************************************************************
125 ******************************************************************************/
126 #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
127 static struct i2c_board_info __initdata income_i2c_devs[] = {
129 I2C_BOARD_INFO("ds1340", 0x68),
131 I2C_BOARD_INFO("lm75", 0x4f),
135 static void __init income_i2c_init(void)
137 pxa_set_i2c_info(NULL);
138 pxa27x_set_i2c_power_info(NULL);
139 i2c_register_board_info(0, ARRAY_AND_SIZE(income_i2c_devs));
142 static inline void income_i2c_init(void) {}
145 /******************************************************************************
147 ******************************************************************************/
148 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
149 static struct pxafb_mode_info income_lcd_modes[] = {
165 .sync = FB_SYNC_VERT_HIGH_ACT,
169 static struct pxafb_mach_info income_lcd_screen = {
170 .modes = income_lcd_modes,
171 .num_modes = ARRAY_SIZE(income_lcd_modes),
172 .lcd_conn = LCD_COLOR_TFT_18BPP | LCD_PCLK_EDGE_FALL,
175 static void __init income_lcd_init(void)
177 pxa_set_fb_info(NULL, &income_lcd_screen);
180 static inline void income_lcd_init(void) {}
183 /******************************************************************************
185 ******************************************************************************/
186 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM__MODULE)
187 static struct platform_pwm_backlight_data income_backlight_data = {
189 .max_brightness = 0x3ff,
190 .dft_brightness = 0x1ff,
191 .pwm_period_ns = 1000000,
194 static struct platform_device income_backlight = {
195 .name = "pwm-backlight",
197 .parent = &pxa27x_device_pwm0.dev,
198 .platform_data = &income_backlight_data,
202 static void __init income_pwm_init(void)
204 platform_device_register(&income_backlight);
207 static inline void income_pwm_init(void) {}
210 void __init colibri_pxa270_income_boardinit(void)
212 pxa_set_ffuart_info(NULL);
213 pxa_set_btuart_info(NULL);
214 pxa_set_stuart_info(NULL);