Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/board-rx51-video.c |
| 3 | * |
| 4 | * Copyright (C) 2010 Nokia |
| 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> |
| 15 | #include <linux/spi/spi.h> |
| 16 | #include <linux/mm.h> |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 17 | #include <asm/mach-types.h> |
Tomi Valkeinen | a0b38cc | 2011-05-11 14:05:07 +0300 | [diff] [blame] | 18 | #include <video/omapdss.h> |
Arnd Bergmann | 2203747 | 2012-08-24 15:21:06 +0200 | [diff] [blame] | 19 | #include <linux/platform_data/spi-omap2-mcspi.h> |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 20 | |
Tony Lindgren | 0a6f98c | 2012-09-20 11:40:56 -0700 | [diff] [blame] | 21 | #include "board-rx51.h" |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 22 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 23 | #include "mux.h" |
| 24 | |
| 25 | #define RX51_LCD_RESET_GPIO 90 |
| 26 | |
| 27 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |
| 28 | |
| 29 | static int rx51_lcd_enable(struct omap_dss_device *dssdev) |
| 30 | { |
| 31 | gpio_set_value(dssdev->reset_gpio, 1); |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | static void rx51_lcd_disable(struct omap_dss_device *dssdev) |
| 36 | { |
| 37 | gpio_set_value(dssdev->reset_gpio, 0); |
| 38 | } |
| 39 | |
| 40 | static struct omap_dss_device rx51_lcd_device = { |
| 41 | .name = "lcd", |
| 42 | .driver_name = "panel-acx565akm", |
| 43 | .type = OMAP_DISPLAY_TYPE_SDI, |
| 44 | .phy.sdi.datapairs = 2, |
| 45 | .reset_gpio = RX51_LCD_RESET_GPIO, |
| 46 | .platform_enable = rx51_lcd_enable, |
| 47 | .platform_disable = rx51_lcd_disable, |
| 48 | }; |
| 49 | |
Srikar | 60d24ee | 2010-12-20 18:48:16 -0800 | [diff] [blame] | 50 | static struct omap_dss_device rx51_tv_device = { |
| 51 | .name = "tv", |
| 52 | .type = OMAP_DISPLAY_TYPE_VENC, |
| 53 | .driver_name = "venc", |
| 54 | .phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE, |
Srikar | 60d24ee | 2010-12-20 18:48:16 -0800 | [diff] [blame] | 55 | }; |
| 56 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 57 | static struct omap_dss_device *rx51_dss_devices[] = { |
| 58 | &rx51_lcd_device, |
Srikar | 60d24ee | 2010-12-20 18:48:16 -0800 | [diff] [blame] | 59 | &rx51_tv_device, |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | static struct omap_dss_board_info rx51_dss_board_info = { |
| 63 | .num_devices = ARRAY_SIZE(rx51_dss_devices), |
| 64 | .devices = rx51_dss_devices, |
| 65 | .default_device = &rx51_lcd_device, |
| 66 | }; |
| 67 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 68 | static int __init rx51_video_init(void) |
| 69 | { |
| 70 | if (!machine_is_nokia_rx51()) |
| 71 | return 0; |
| 72 | |
| 73 | if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) { |
| 74 | pr_err("%s cannot configure MUX for LCD RESET\n", __func__); |
| 75 | return 0; |
| 76 | } |
| 77 | |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 78 | if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH, |
| 79 | "LCD ACX565AKM reset")) { |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 80 | pr_err("%s failed to get LCD Reset GPIO\n", __func__); |
| 81 | return 0; |
| 82 | } |
| 83 | |
Senthilvadivu Guruswamy | d5e1322 | 2011-02-22 11:24:50 +0200 | [diff] [blame] | 84 | omap_display_init(&rx51_dss_board_info); |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 85 | return 0; |
| 86 | } |
| 87 | |
| 88 | subsys_initcall(rx51_video_init); |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 89 | #endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */ |