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> |
Archit Taneja | 3c803f4 | 2013-02-12 14:05:37 +0530 | [diff] [blame] | 19 | #include <video/omap-panel-data.h> |
| 20 | |
Arnd Bergmann | 2203747 | 2012-08-24 15:21:06 +0200 | [diff] [blame] | 21 | #include <linux/platform_data/spi-omap2-mcspi.h> |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 22 | |
Tony Lindgren | b76c8b1 | 2013-01-11 11:24:18 -0800 | [diff] [blame] | 23 | #include "soc.h" |
Tony Lindgren | 0a6f98c | 2012-09-20 11:40:56 -0700 | [diff] [blame] | 24 | #include "board-rx51.h" |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 25 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 26 | #include "mux.h" |
| 27 | |
| 28 | #define RX51_LCD_RESET_GPIO 90 |
| 29 | |
| 30 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |
| 31 | |
Tomi Valkeinen | 2320dc6 | 2013-05-17 12:37:27 +0300 | [diff] [blame] | 32 | static struct connector_atv_platform_data rx51_tv_pdata = { |
| 33 | .name = "tv", |
| 34 | .source = "venc.0", |
| 35 | .connector_type = OMAP_DSS_VENC_TYPE_COMPOSITE, |
| 36 | .invert_polarity = false, |
Archit Taneja | 3c803f4 | 2013-02-12 14:05:37 +0530 | [diff] [blame] | 37 | }; |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 38 | |
Tomi Valkeinen | 2320dc6 | 2013-05-17 12:37:27 +0300 | [diff] [blame] | 39 | static struct platform_device rx51_tv_connector_device = { |
| 40 | .name = "connector-analog-tv", |
| 41 | .id = 0, |
| 42 | .dev.platform_data = &rx51_tv_pdata, |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | static struct omap_dss_board_info rx51_dss_board_info = { |
Tomi Valkeinen | 2320dc6 | 2013-05-17 12:37:27 +0300 | [diff] [blame] | 46 | .default_display_name = "lcd", |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 47 | }; |
| 48 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 49 | static int __init rx51_video_init(void) |
| 50 | { |
Pavel Machek | ea2409b | 2013-07-01 23:15:04 +0200 | [diff] [blame] | 51 | if (!machine_is_nokia_rx51() && !of_machine_is_compatible("nokia,omap3-n900")) |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 52 | return 0; |
| 53 | |
| 54 | if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) { |
| 55 | pr_err("%s cannot configure MUX for LCD RESET\n", __func__); |
| 56 | return 0; |
| 57 | } |
| 58 | |
Senthilvadivu Guruswamy | d5e1322 | 2011-02-22 11:24:50 +0200 | [diff] [blame] | 59 | omap_display_init(&rx51_dss_board_info); |
Archit Taneja | 3c803f4 | 2013-02-12 14:05:37 +0530 | [diff] [blame] | 60 | |
Tomi Valkeinen | 2320dc6 | 2013-05-17 12:37:27 +0300 | [diff] [blame] | 61 | platform_device_register(&rx51_tv_connector_device); |
| 62 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 63 | return 0; |
| 64 | } |
| 65 | |
Tony Lindgren | b76c8b1 | 2013-01-11 11:24:18 -0800 | [diff] [blame] | 66 | omap_subsys_initcall(rx51_video_init); |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 67 | #endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */ |