blob: c2a079cb76fcd34870b0f86b407b0d74bc0c4528 [file] [log] [blame]
Kishore Ya6490332010-11-15 07:09:03 +01001/*
2 * Copyright (C) 2010 Texas Instruments Inc.
3 *
4 * Modified from mach-omap2/board-zoom-peripherals.c
5 *
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.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/gpio.h>
Kishore Ya6490332010-11-15 07:09:03 +010015#include <linux/spi/spi.h>
Arnd Bergmann22037472012-08-24 15:21:06 +020016#include <linux/platform_data/spi-omap2-mcspi.h>
Tomi Valkeinena0b38cc2011-05-11 14:05:07 +030017#include <video/omapdss.h>
Archit Taneja20012c72013-02-13 15:07:38 +053018#include <video/omap-panel-data.h>
Kishore Ya6490332010-11-15 07:09:03 +010019
Archit Taneja20012c72013-02-13 15:07:38 +053020#include "board-zoom.h"
Tony Lindgrene4c060d2012-10-05 13:25:59 -070021#include "soc.h"
Tony Lindgrendbc04162012-08-31 10:59:07 -070022#include "common.h"
Tony Lindgren4b254082012-08-30 15:37:24 -070023
Kishore Ya6490332010-11-15 07:09:03 +010024#define LCD_PANEL_RESET_GPIO_PROD 96
25#define LCD_PANEL_RESET_GPIO_PILOT 55
26#define LCD_PANEL_QVGA_GPIO 56
27
Archit Taneja20012c72013-02-13 15:07:38 +053028static struct panel_nec_nl8048_data zoom_lcd_data = {
29 /* res_gpio filled in code */
30 .qvga_gpio = LCD_PANEL_QVGA_GPIO,
Igor Grinbergbc593f52011-05-03 18:22:09 +030031};
32
Kishore Ya6490332010-11-15 07:09:03 +010033static 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,
Archit Taneja20012c72013-02-13 15:07:38 +053038 .data = &zoom_lcd_data,
Kishore Ya6490332010-11-15 07:09:03 +010039};
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
Archit Taneja20012c72013-02-13 15:07:38 +053051static 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
Kishore Ya6490332010-11-15 07:09:03 +010058static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
59 .turbo_mode = 1,
Kishore Ya6490332010-11-15 07:09:03 +010060};
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
Kishore Ya6490332010-11-15 07:09:03 +010072void __init zoom_display_init(void)
73{
Senthilvadivu Guruswamyd5e13222011-02-22 11:24:50 +020074 omap_display_init(&zoom_dss_data);
Kishore Ya6490332010-11-15 07:09:03 +010075 spi_register_board_info(nec_8048_spi_board_info,
76 ARRAY_SIZE(nec_8048_spi_board_info));
77 zoom_lcd_panel_init();
78}
79