aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c
index bc89bb6430e8..920e42a9389f 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c
@@ -28,6 +28,8 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/input.h> 29#include <linux/input.h>
30#include <linux/i2c.h> 30#include <linux/i2c.h>
31#include <video/platform_lcd.h>
32#include <linux/backlight.h>
31 33
32#include <asm/mach-types.h> 34#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
@@ -71,10 +73,57 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
71 MX51_PAD_AUD3_BB_RXD__AUD3_RXD, 73 MX51_PAD_AUD3_BB_RXD__AUD3_RXD,
72 MX51_PAD_AUD3_BB_CK__AUD3_TXC, 74 MX51_PAD_AUD3_BB_CK__AUD3_TXC,
73 MX51_PAD_AUD3_BB_FS__AUD3_TXFS, 75 MX51_PAD_AUD3_BB_FS__AUD3_TXFS,
76 /* LCD Backlight */
77 MX51_PAD_DI1_D1_CS__GPIO3_4,
78 /* LCD RST */
79 MX51_PAD_CSI1_D9__GPIO3_13,
74}; 80};
75 81
76#define GPIO_LED1 IMX_GPIO_NR(3, 30) 82#define GPIO_LED1 IMX_GPIO_NR(3, 30)
77#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) 83#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31)
84#define GPIO_LCDRST IMX_GPIO_NR(3, 13)
85#define GPIO_LCDBL IMX_GPIO_NR(3, 4)
86
87static void eukrea_mbimxsd51_lcd_power_set(struct plat_lcd_data *pd,
88 unsigned int power)
89{
90 if (power)
91 gpio_direction_output(GPIO_LCDRST, 1);
92 else
93 gpio_direction_output(GPIO_LCDRST, 0);
94}
95
96static struct plat_lcd_data eukrea_mbimxsd51_lcd_power_data = {
97 .set_power = eukrea_mbimxsd51_lcd_power_set,
98};
99
100static struct platform_device eukrea_mbimxsd51_lcd_powerdev = {
101 .name = "platform-lcd",
102 .dev.platform_data = &eukrea_mbimxsd51_lcd_power_data,
103};
104
105static void eukrea_mbimxsd51_bl_set_intensity(int intensity)
106{
107 if (intensity)
108 gpio_direction_output(GPIO_LCDBL, 1);
109 else
110 gpio_direction_output(GPIO_LCDBL, 0);
111}
112
113static struct generic_bl_info eukrea_mbimxsd51_bl_info = {
114 .name = "eukrea_mbimxsd51-bl",
115 .max_intensity = 0xff,
116 .default_intensity = 0xff,
117 .set_bl_intensity = eukrea_mbimxsd51_bl_set_intensity,
118};
119
120static struct platform_device eukrea_mbimxsd51_bl_dev = {
121 .name = "generic-bl",
122 .id = 1,
123 .dev = {
124 .platform_data = &eukrea_mbimxsd51_bl_info,
125 },
126};
78 127
79static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = { 128static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
80 { 129 {
@@ -122,6 +171,19 @@ struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {
122 .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, 171 .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
123}; 172};
124 173
174static int screen_type;
175
176static int __init eukrea_mbimxsd51_screen_type(char *options)
177{
178 if (!strcmp(options, "dvi"))
179 screen_type = 1;
180 else if (!strcmp(options, "tft"))
181 screen_type = 0;
182
183 return 0;
184}
185__setup("screen_type=", eukrea_mbimxsd51_screen_type);
186
125/* 187/*
126 * system init for baseboard usage. Will be called by cpuimx51sd init. 188 * system init for baseboard usage. Will be called by cpuimx51sd init.
127 * 189 *
@@ -149,6 +211,18 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
149 gpio_direction_input(GPIO_SWITCH1); 211 gpio_direction_input(GPIO_SWITCH1);
150 gpio_free(GPIO_SWITCH1); 212 gpio_free(GPIO_SWITCH1);
151 213
214 gpio_request(GPIO_LCDRST, "LCDRST");
215 gpio_direction_output(GPIO_LCDRST, 0);
216 gpio_request(GPIO_LCDBL, "LCDBL");
217 gpio_direction_output(GPIO_LCDBL, 0);
218 if (!screen_type) {
219 platform_device_register(&eukrea_mbimxsd51_bl_dev);
220 platform_device_register(&eukrea_mbimxsd51_lcd_powerdev);
221 } else {
222 gpio_free(GPIO_LCDRST);
223 gpio_free(GPIO_LCDBL);
224 }
225
152 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 226 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
153 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 227 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
154 228