1
2
3
4
5
6
7
8
9
10
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 <video/omap-panel-data.h>
19
20#include "board-zoom.h"
21#include "soc.h"
22#include "common.h"
23
24#define LCD_PANEL_RESET_GPIO_PROD 96
25#define LCD_PANEL_RESET_GPIO_PILOT 55
26#define LCD_PANEL_QVGA_GPIO 56
27
28static struct panel_nec_nl8048_data zoom_lcd_data = {
29
30 .qvga_gpio = LCD_PANEL_QVGA_GPIO,
31};
32
33static struct omap_dss_device zoom_lcd_device = {
34 .name = "lcd",
35 .driver_name = "NEC_8048_panel",
36 .type = OMAP_DISPLAY_TYPE_DPI,
37 .phy.dpi.data_lines = 24,
38 .data = &zoom_lcd_data,
39};
40
41static struct omap_dss_device *zoom_dss_devices[] = {
42 &zoom_lcd_device,
43};
44
45static struct omap_dss_board_info zoom_dss_data = {
46 .num_devices = ARRAY_SIZE(zoom_dss_devices),
47 .devices = zoom_dss_devices,
48 .default_device = &zoom_lcd_device,
49};
50
51static void __init zoom_lcd_panel_init(void)
52{
53 zoom_lcd_data.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
54 LCD_PANEL_RESET_GPIO_PROD :
55 LCD_PANEL_RESET_GPIO_PILOT;
56}
57
58static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
59 .turbo_mode = 1,
60};
61
62static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
63 [0] = {
64 .modalias = "nec_8048_spi",
65 .bus_num = 1,
66 .chip_select = 2,
67 .max_speed_hz = 375000,
68 .controller_data = &dss_lcd_mcspi_config,
69 },
70};
71
72void __init zoom_display_init(void)
73{
74 omap_display_init(&zoom_dss_data);
75 spi_register_board_info(nec_8048_spi_board_info,
76 ARRAY_SIZE(nec_8048_spi_board_info));
77 zoom_lcd_panel_init();
78}
79
80