2 * Copyright (C) 2010 Texas Instruments Inc.
4 * Modified from mach-omap2/board-zoom-peripherals.c
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/gpio.h>
15 #include <linux/spi/spi.h>
16 #include <linux/platform_data/spi-omap2-mcspi.h>
17 #include <video/omapdss.h>
18 #include "board-zoom.h"
23 #define LCD_PANEL_RESET_GPIO_PROD 96
24 #define LCD_PANEL_RESET_GPIO_PILOT 55
25 #define LCD_PANEL_QVGA_GPIO 56
27 static struct gpio zoom_lcd_gpios[] __initdata = {
28 { -EINVAL, GPIOF_OUT_INIT_HIGH, "lcd reset" },
29 { LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "lcd qvga" },
32 static void __init zoom_lcd_panel_init(void)
34 zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
35 LCD_PANEL_RESET_GPIO_PROD :
36 LCD_PANEL_RESET_GPIO_PILOT;
38 if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
39 pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
42 static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
47 static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
51 static struct omap_dss_device zoom_lcd_device = {
53 .driver_name = "NEC_8048_panel",
54 .type = OMAP_DISPLAY_TYPE_DPI,
55 .phy.dpi.data_lines = 24,
56 .platform_enable = zoom_panel_enable_lcd,
57 .platform_disable = zoom_panel_disable_lcd,
60 static struct omap_dss_device *zoom_dss_devices[] = {
64 static struct omap_dss_board_info zoom_dss_data = {
65 .num_devices = ARRAY_SIZE(zoom_dss_devices),
66 .devices = zoom_dss_devices,
67 .default_device = &zoom_lcd_device,
70 static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
74 static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
76 .modalias = "nec_8048_spi",
79 .max_speed_hz = 375000,
80 .controller_data = &dss_lcd_mcspi_config,
84 void __init zoom_display_init(void)
86 omap_display_init(&zoom_dss_data);
87 spi_register_board_info(nec_8048_spi_board_info,
88 ARRAY_SIZE(nec_8048_spi_board_info));
89 zoom_lcd_panel_init();