blob: 9a7174faac510a456492359a818c4438cdcfed3b [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>
Tony Lindgren8599e7c2012-10-08 09:11:22 -070018#include "board-zoom.h"
Kishore Ya6490332010-11-15 07:09:03 +010019
Tony Lindgrene4c060d2012-10-05 13:25:59 -070020#include "soc.h"
Tony Lindgrendbc04162012-08-31 10:59:07 -070021#include "common.h"
Tony Lindgren4b254082012-08-30 15:37:24 -070022
Kishore Ya6490332010-11-15 07:09:03 +010023#define LCD_PANEL_RESET_GPIO_PROD 96
24#define LCD_PANEL_RESET_GPIO_PILOT 55
25#define LCD_PANEL_QVGA_GPIO 56
26
Igor Grinbergbc593f52011-05-03 18:22:09 +030027static 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" },
30};
31
Santosh Shilimkar89c47052011-05-30 00:11:45 -070032static void __init zoom_lcd_panel_init(void)
Kishore Ya6490332010-11-15 07:09:03 +010033{
Igor Grinbergbc593f52011-05-03 18:22:09 +030034 zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
Kishore Ya6490332010-11-15 07:09:03 +010035 LCD_PANEL_RESET_GPIO_PROD :
36 LCD_PANEL_RESET_GPIO_PILOT;
37
Igor Grinbergbc593f52011-05-03 18:22:09 +030038 if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
39 pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
Kishore Ya6490332010-11-15 07:09:03 +010040}
41
42static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
43{
44 return 0;
45}
46
47static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
48{
49}
50
Kishore Ya6490332010-11-15 07:09:03 +010051static struct omap_dss_device zoom_lcd_device = {
52 .name = "lcd",
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,
Kishore Ya6490332010-11-15 07:09:03 +010058};
59
60static struct omap_dss_device *zoom_dss_devices[] = {
61 &zoom_lcd_device,
62};
63
64static 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,
68};
69
Kishore Ya6490332010-11-15 07:09:03 +010070static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
71 .turbo_mode = 1,
Kishore Ya6490332010-11-15 07:09:03 +010072};
73
74static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
75 [0] = {
76 .modalias = "nec_8048_spi",
77 .bus_num = 1,
78 .chip_select = 2,
79 .max_speed_hz = 375000,
80 .controller_data = &dss_lcd_mcspi_config,
81 },
82};
83
Kishore Ya6490332010-11-15 07:09:03 +010084void __init zoom_display_init(void)
85{
Senthilvadivu Guruswamyd5e13222011-02-22 11:24:50 +020086 omap_display_init(&zoom_dss_data);
Kishore Ya6490332010-11-15 07:09:03 +010087 spi_register_board_info(nec_8048_spi_board_info,
88 ARRAY_SIZE(nec_8048_spi_board_info));
89 zoom_lcd_panel_init();
90}
91