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/sysdev.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>
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
,
55 .gpio_card_detect
= GPIO0_INCOME_SD_DETECT
,
56 .gpio_card_ro
= GPIO0_INCOME_SD_RO
,
57 .detect_delay_ms
= 200,
60 static void __init
income_mmc_init(void)
62 pxa_set_mci_info(&income_mci_platform_data
);
65 static inline void income_mmc_init(void) {}
68 /******************************************************************************
70 ******************************************************************************/
71 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
72 static struct pxaohci_platform_data income_ohci_info
= {
73 .port_mode
= PMM_PERPORT_MODE
,
74 .flags
= ENABLE_PORT1
| POWER_CONTROL_LOW
| POWER_SENSE_LOW
,
77 static void __init
income_uhc_init(void)
79 pxa_set_ohci_info(&income_ohci_info
);
82 static inline void income_uhc_init(void) {}
85 /******************************************************************************
87 ******************************************************************************/
88 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
89 struct gpio_led income_gpio_leds
[] = {
91 .name
= "income:green:leda",
92 .default_trigger
= "none",
93 .gpio
= GPIO54_INCOME_LED_A
,
97 .name
= "income:green:ledb",
98 .default_trigger
= "none",
99 .gpio
= GPIO55_INCOME_LED_B
,
104 static struct gpio_led_platform_data income_gpio_led_info
= {
105 .leds
= income_gpio_leds
,
106 .num_leds
= ARRAY_SIZE(income_gpio_leds
),
109 static struct platform_device income_leds
= {
113 .platform_data
= &income_gpio_led_info
,
117 static void __init
income_led_init(void)
119 platform_device_register(&income_leds
);
122 static inline void income_led_init(void) {}
125 /******************************************************************************
127 ******************************************************************************/
128 #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
129 static struct i2c_board_info __initdata income_i2c_devs
[] = {
131 I2C_BOARD_INFO("ds1340", 0x68),
133 I2C_BOARD_INFO("lm75", 0x4f),
137 static void __init
income_i2c_init(void)
139 pxa_set_i2c_info(NULL
);
140 pxa27x_set_i2c_power_info(NULL
);
141 i2c_register_board_info(0, ARRAY_AND_SIZE(income_i2c_devs
));
144 static inline void income_i2c_init(void) {}
147 /******************************************************************************
149 ******************************************************************************/
150 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
151 static struct pxafb_mode_info income_lcd_modes
[] = {
167 .sync
= FB_SYNC_VERT_HIGH_ACT
,
171 static struct pxafb_mach_info income_lcd_screen
= {
172 .modes
= income_lcd_modes
,
173 .num_modes
= ARRAY_SIZE(income_lcd_modes
),
174 .lcd_conn
= LCD_COLOR_TFT_18BPP
| LCD_PCLK_EDGE_FALL
,
177 static void __init
income_lcd_init(void)
179 set_pxa_fb_info(&income_lcd_screen
);
182 static inline void income_lcd_init(void) {}
185 /******************************************************************************
187 ******************************************************************************/
188 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM__MODULE)
189 static struct platform_pwm_backlight_data income_backlight_data
= {
191 .max_brightness
= 0x3ff,
192 .dft_brightness
= 0x1ff,
193 .pwm_period_ns
= 1000000,
196 static struct platform_device income_backlight
= {
197 .name
= "pwm-backlight",
199 .parent
= &pxa27x_device_pwm0
.dev
,
200 .platform_data
= &income_backlight_data
,
204 static void __init
income_pwm_init(void)
206 platform_device_register(&income_backlight
);
209 static inline void income_pwm_init(void) {}
212 void __init
colibri_pxa270_income_boardinit(void)
214 pxa_set_ffuart_info(NULL
);
215 pxa_set_btuart_info(NULL
);
216 pxa_set_stuart_info(NULL
);