All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: tony@atomide.com
Cc: linux-omap@vger.kernel.org,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Mayuresh Janorkar <mayur@ti.com>, Mythri P K <mythripk@ti.com>
Subject: [PATCH 10/10] OMAP4: 4430SDP: Add picodlp support to board file
Date: Tue, 20 Sep 2011 11:18:26 +0300	[thread overview]
Message-ID: <1316506706-18941-11-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1316506706-18941-1-git-send-email-tomi.valkeinen@ti.com>

An on-board projector named picodlp is available for OMAP4430 SDP.

Entry for this picodlp as a panel is being added in dss_devices array to
the board file.  It needs 4 GPIO pins for interfacing with host
processor and these are defined and two of them are configured in board
file.  Two GPIOs power_on and display_select are configured here.
picodlp also needs an i2c client over i2c controller-2 at address 0x1b.

Signed-off-by: Mayuresh Janorkar <mayur@ti.com>
Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/board-4430sdp.c |   52 +++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 187fcae..d3874a6 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -39,6 +39,7 @@
 #include <plat/omap4-keypad.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-nokia-dsi.h>
+#include <video/omap-panel-picodlp.h>
 #include <linux/wl12xx.h>
 
 #include "mux.h"
@@ -54,6 +55,7 @@
 #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
 #define DISPLAY_SEL_GPIO	59	/* LCD2/PicoDLP switch */
+#define DLP_POWER_ON_GPIO	40
 
 #define GPIO_WIFI_PMENA		54
 #define GPIO_WIFI_IRQ		53
@@ -758,10 +760,59 @@ static struct omap_dss_device sdp4430_hdmi_device = {
 	.channel = OMAP_DSS_CHANNEL_DIGIT,
 };
 
+static struct picodlp_panel_data sdp4430_picodlp_pdata = {
+	.picodlp_adapter_id	= 2,
+	.emu_done_gpio		= 44,
+	.pwrgood_gpio		= 45,
+};
+
+static void sdp4430_picodlp_init(void)
+{
+	int r;
+	const struct gpio picodlp_gpios[] = {
+		{DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
+			"DLP POWER ON"},
+		{sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN,
+			"DLP EMU DONE"},
+		{sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW,
+			"DLP PWRGOOD"},
+	};
+
+	r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios));
+	if (r)
+		pr_err("Cannot request PicoDLP GPIOs, error %d\n", r);
+}
+
+static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(DISPLAY_SEL_GPIO, 0);
+	gpio_set_value(DLP_POWER_ON_GPIO, 1);
+
+	return 0;
+}
+
+static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(DLP_POWER_ON_GPIO, 0);
+	gpio_set_value(DISPLAY_SEL_GPIO, 1);
+}
+
+static struct omap_dss_device sdp4430_picodlp_device = {
+	.name			= "picodlp",
+	.driver_name		= "picodlp_panel",
+	.type			= OMAP_DISPLAY_TYPE_DPI,
+	.phy.dpi.data_lines	= 24,
+	.channel		= OMAP_DSS_CHANNEL_LCD2,
+	.platform_enable	= sdp4430_panel_enable_picodlp,
+	.platform_disable	= sdp4430_panel_disable_picodlp,
+	.data			= &sdp4430_picodlp_pdata,
+};
+
 static struct omap_dss_device *sdp4430_dss_devices[] = {
 	&sdp4430_lcd_device,
 	&sdp4430_lcd2_device,
 	&sdp4430_hdmi_device,
+	&sdp4430_picodlp_device,
 };
 
 static struct omap_dss_board_info sdp4430_dss_data = {
@@ -782,6 +833,7 @@ static void omap_4430sdp_display_init(void)
 
 	sdp4430_lcd_init();
 	sdp4430_hdmi_mux_init();
+	sdp4430_picodlp_init();
 	omap_display_init(&sdp4430_dss_data);
 }
 
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-20  8:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  8:18 [PATCH 00/10] OMAP DSS related board changes Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 01/10] OMAP: DSS2: Change DSI device naming Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 02/10] OMAP4: TWL: Add common omapdss supplies Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 03/10] OMAP: Devkit8000: Change lcd driver to AT070TN83 Tomi Valkeinen
2011-09-20 12:35   ` Thomas Weber
2011-09-20 12:37     ` Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 04/10] OMAP: DSS2: HDMI: use default dividers Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 05/10] OMAP: use dvi panel driver instead of generic-dpi Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 06/10] OMAP: stalker: Remove LCD device from board file Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 07/10] OMAP: Add DDC i2c_bus_num to board files Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 08/10] OMAP: 4430SDP: Remove unneeded lcd config Tomi Valkeinen
2011-09-20  8:18 ` [PATCH 09/10] OMAP4: 4430SDP: Add panel support to board file Tomi Valkeinen
2011-09-20  8:18 ` Tomi Valkeinen [this message]
2011-09-26  6:37 ` [PATCH 00/10] OMAP DSS related board changes Tomi Valkeinen
2011-09-29 17:52   ` Tony Lindgren
2011-09-30  5:20     ` Tomi Valkeinen
2011-10-04  0:32       ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316506706-18941-11-git-send-email-tomi.valkeinen@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mayur@ti.com \
    --cc=mythripk@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.