From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] ARM: OMAP2+: Add DT init code for DPI displays and make omap3 LDP to use it
Date: Fri, 15 Nov 2013 16:36:05 -0800 [thread overview]
Message-ID: <1384562167-14725-4-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1384562167-14725-1-git-send-email-tony@atomide.com>
In order to make the remaining omap3 boards usable with device
tree, we need to initialize the DPI based displays using pdata
until we have the DSS bindings in place.
At least board-am3517evm.c, board-cm-t35.c, board-devkit8000.c,
board-ldp.c and board-overo.c all use fairly similar DPI setup,
so let's add generic code for it. And let's make omap3 LDP to
use it and also initialize the ads7846 until we have a binding
for it.
Note that at least LDP needs the TWL bug fix posted as
"gpio: twl4030: Fix regression for twl gpio output" for the
LCD backlight to power.
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/dss-common.c | 67 ++++++++++++++++++++++++++++++++++++++
arch/arm/mach-omap2/dss-common.h | 1 +
arch/arm/mach-omap2/pdata-quirks.c | 15 +++++++++
3 files changed, 83 insertions(+)
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index 365bfd3..86e98c5 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -257,3 +257,70 @@ void __init omap3_igep2_display_init_of(void)
platform_device_register(&omap3_igep2_tfp410_device);
platform_device_register(&omap3_igep2_dvi_connector_device);
}
+
+/* Systems with DPI LCD */
+
+static struct panel_dpi_platform_data dpi_lcd = {
+ .name = "lcd",
+ .source = "dpi.0",
+ .enable_gpio = -1,
+ .backlight_gpio = -1,
+};
+
+static struct platform_device dpi_lcd_device = {
+ .name = "panel-dpi",
+ .id = 0,
+ .dev.platform_data = &dpi_lcd,
+};
+
+static struct omap_dss_board_info dpi_dss_data = {
+ .default_display_name = "lcd",
+};
+
+static void dpi_display_init(void)
+{
+ platform_device_register(&dpi_lcd_device);
+ omap_display_init(&dpi_dss_data);
+}
+
+/* DPI on omap3 LDP */
+
+static const struct display_timing ldp_lcd_videomode = {
+ .pixelclock = { 0, 5400000, 0 },
+
+ .hactive = { 0, 240, 0 },
+ .hfront_porch = { 0, 3, 0 },
+ .hback_porch = { 0, 39, 0 },
+ .hsync_len = { 0, 3, 0 },
+
+ .vactive = { 0, 320, 0 },
+ .vfront_porch = { 0, 2, 0 },
+ .vback_porch = { 0, 7, 0 },
+ .vsync_len = { 0, 1, 0 },
+
+ .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
+ DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
+};
+
+void __init omap3_ldp_display_init_of(int gpio_bl, int gpio_en)
+{
+ int r;
+
+ static struct gpio gpios[] = {
+ { 55, GPIOF_OUT_INIT_HIGH, "LCD RESET" },
+ { 56, GPIOF_OUT_INIT_HIGH, "LCD QVGA" },
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r) {
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+ return;
+ }
+
+ dpi_lcd.data_lines = 18;
+ dpi_lcd.display_timing = &ldp_lcd_videomode;
+ dpi_lcd.enable_gpio = gpio_en;
+ dpi_lcd.backlight_gpio = gpio_bl;
+
+ dpi_display_init();
+}
diff --git a/arch/arm/mach-omap2/dss-common.h b/arch/arm/mach-omap2/dss-common.h
index a9becf0..bc9921c 100644
--- a/arch/arm/mach-omap2/dss-common.h
+++ b/arch/arm/mach-omap2/dss-common.h
@@ -9,5 +9,6 @@
void __init omap4_panda_display_init_of(void);
void __init omap_4430sdp_display_init_of(void);
void __init omap3_igep2_display_init_of(void);
+void omap3_ldp_display_init_of(int gpio_bl, int gpio_en);
#endif
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index f2fc072..97f200f 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -100,6 +100,20 @@ static void __init omap3_evm_legacy_init(void)
legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
}
+/* Pass enable and backlight GPIO to DSS code */
+int __init ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
+{
+ omap3_ldp_display_init_of(gpio + 7, gpio + 15);
+ omap_ads7846_init(1, 54, 310, NULL);
+
+ return 0;
+}
+
+static void __init omap3_ldp_legacy_init(void)
+{
+ twl_gpio_auxdata.setup = ldp_twl_gpio_setup;
+}
+
static void __init omap3_zoom_legacy_init(void)
{
legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
@@ -190,6 +204,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
{ "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
+ { "ti,omap3-ldp", omap3_ldp_legacy_init, },
{ "ti,omap3-zoom3", omap3_zoom_legacy_init, },
#endif
#ifdef CONFIG_ARCH_OMAP4
--
1.8.1.1
next prev parent reply other threads:[~2013-11-16 0:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 0:36 [PATCH 0/5] Prepare making omap3 device tree only and convert LDP Tony Lindgren
2013-11-16 0:36 ` [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case Tony Lindgren
2013-11-18 10:29 ` Lee Jones
2013-11-18 17:25 ` Felipe Balbi
2013-11-18 17:46 ` Lee Jones
2013-11-18 18:11 ` Tony Lindgren
2013-11-18 19:09 ` Lee Jones
2013-11-18 19:22 ` Tony Lindgren
2013-11-18 19:28 ` Lee Jones
2013-11-18 19:33 ` Tony Lindgren
2013-11-21 10:46 ` Lee Jones
2013-11-21 11:09 ` Lee Jones
2013-11-25 23:22 ` Tony Lindgren
2013-11-18 18:40 ` Felipe Balbi
2013-11-16 0:36 ` [PATCH 2/5] ARM: OMAP2+: Add support for legacy auxdata for twl Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren [this message]
2013-11-18 13:06 ` [PATCH 3/5] ARM: OMAP2+: Add DT init code for DPI displays and make omap3 LDP to use it Tomi Valkeinen
2013-11-18 18:19 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 4/5] ARM: dts: Add basic support for omap3 LDP zoom1 labrador Tony Lindgren
2013-11-16 8:04 ` Sebastian Reichel
2013-11-16 14:40 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 5/5] ARM: OMAP2+: Remove legacy booting support for LDP Tony Lindgren
[not found] ` <20131116120508.GA22335@earth.universe>
2013-11-16 14:12 ` N900 board code in 3.14 Tony Lindgren
2013-11-16 15:50 ` Sebastian Reichel
2013-11-21 18:58 ` Tony Lindgren
2013-11-21 23:51 ` Sebastian Reichel
2013-11-22 10:41 ` Javier Martinez Canillas
2013-11-23 21:09 ` Sebastian Reichel
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=1384562167-14725-4-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).