2 * linux/arch/arm/mach-omap2/board-rx51-video.c
4 * Copyright (C) 2008 Nokia
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/delay.h>
15 #include <linux/spi/spi.h>
17 #include <mach/lcd_mipid.h>
18 #include <mach/mcspi.h>
19 #include <mach/gpio.h>
20 #include <mach/board.h>
23 static struct omap2_mcspi_device_config mipid_mcspi_config = {
28 static struct platform_device rx51_lcd_device = {
33 static void mipid_shutdown(struct mipid_platform_data *pdata)
35 if (pdata->nreset_gpio != -1) {
36 pr_info("shutdown LCD\n");
37 gpio_direction_output(pdata->nreset_gpio, 0);
42 static struct mipid_platform_data rx51_mipid_platform_data = {
43 .shutdown = mipid_shutdown,
46 static void __init mipid_dev_init(void)
48 const struct omap_lcd_config *conf;
50 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
52 rx51_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
53 rx51_mipid_platform_data.data_lines = conf->data_lines;
57 static struct spi_board_info rx51_video_spi_board_info[] = {
59 .modalias = "lcd_mipid",
62 .max_speed_hz = 6000000,
63 .controller_data = &mipid_mcspi_config,
64 .platform_data = &rx51_mipid_platform_data,
68 static struct platform_device *rx51_video_devices[] = {
72 void __init rx51_video_init(void)
74 platform_add_devices(rx51_video_devices, ARRAY_SIZE(rx51_video_devices));
75 spi_register_board_info(rx51_video_spi_board_info,
76 ARRAY_SIZE(rx51_video_spi_board_info));