From patchwork Fri Aug 10 10:37:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1304871 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 530763FC33 for ; Fri, 10 Aug 2012 10:38:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760177Ab2HJKiu (ORCPT ); Fri, 10 Aug 2012 06:38:50 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:45582 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754345Ab2HJKit (ORCPT ); Fri, 10 Aug 2012 06:38:49 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7AAcn9o027948; Fri, 10 Aug 2012 05:38:49 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7AAcnxP007795; Fri, 10 Aug 2012 05:38:49 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Fri, 10 Aug 2012 05:38:48 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7AAcm5t030014; Fri, 10 Aug 2012 05:38:48 -0500 Received: from localhost (a0393947pc.apr.dhcp.ti.com [172.24.137.248]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id q7AAclr18339; Fri, 10 Aug 2012 05:38:47 -0500 (CDT) From: Archit Taneja To: CC: , , Archit Taneja Subject: [PATCH 4/5] OMAPDSS: DPI: Maitain copy of number of data lines in driver data Date: Fri, 10 Aug 2012 16:07:05 +0530 Message-ID: <1344595026-10607-5-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344595026-10607-1-git-send-email-archit@ti.com> References: <1344595026-10607-1-git-send-email-archit@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The DPI driver currently relies on the omap_dss_device struct to configure the number of data lines as specified by the panel. This makes the DPI interface driver dependent on the omap_dss_device struct. Make the DPI driver data maintain it's own data lines field. A panel driver is expected to call omapdss_dpi_set_data_lines() before enabling the interface. Signed-off-by: Archit Taneja --- drivers/video/omap2/displays/panel-generic-dpi.c | 1 + .../omap2/displays/panel-lgphilips-lb035q02.c | 1 + .../omap2/displays/panel-nec-nl8048hl11-01b.c | 1 + drivers/video/omap2/displays/panel-picodlp.c | 1 + .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 1 + drivers/video/omap2/displays/panel-tfp410.c | 1 + .../video/omap2/displays/panel-tpo-td043mtea1.c | 1 + drivers/video/omap2/dss/dpi.c | 13 ++++++++++++- include/video/omapdss.h | 1 + 9 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c index a07e18c..88295c5 100644 --- a/drivers/video/omap2/displays/panel-generic-dpi.c +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -566,6 +566,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev) return 0; omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c index 7e52aee..90c1cab 100644 --- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c +++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c @@ -56,6 +56,7 @@ static int lb035q02_panel_power_on(struct omap_dss_device *dssdev) return 0; omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c index e501c40..908fd26 100644 --- a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c +++ b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c @@ -176,6 +176,7 @@ static int nec_8048_panel_power_on(struct omap_dss_device *dssdev) return 0; omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c index 0d7a8ff..9df8764 100644 --- a/drivers/video/omap2/displays/panel-picodlp.c +++ b/drivers/video/omap2/displays/panel-picodlp.c @@ -379,6 +379,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev) msleep(1000); omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) { diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c index 1486a81..1ec3b27 100644 --- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c @@ -143,6 +143,7 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev) return 0; omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c index 9397236..4be9a59 100644 --- a/drivers/video/omap2/displays/panel-tfp410.c +++ b/drivers/video/omap2/displays/panel-tfp410.c @@ -66,6 +66,7 @@ static int tfp410_power_on(struct omap_dss_device *dssdev) return 0; omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index 3f47f5f..b5e6dbc 100644 --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c @@ -338,6 +338,7 @@ static int tpo_td043_enable_dss(struct omap_dss_device *dssdev) return 0; omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings); + omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines); r = omapdss_dpi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 6c43d80..8c860c0 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -43,6 +43,7 @@ static struct { struct omap_video_timings timings; struct dss_lcd_mgr_config mgr_config; + int data_lines; } dpi; static struct platform_device *dpi_get_dsidev(enum omap_dss_clk_source clk) @@ -176,7 +177,7 @@ static void dpi_config_lcd_manager(struct omap_dss_device *dssdev) dpi.mgr_config.stallmode = false; dpi.mgr_config.fifohandcheck = false; - dpi.mgr_config.video_port_width = dssdev->phy.dpi.data_lines; + dpi.mgr_config.video_port_width = dpi.data_lines; dpi.mgr_config.lcden_sig_polarity = 0; @@ -368,6 +369,16 @@ int dpi_check_timings(struct omap_dss_device *dssdev, } EXPORT_SYMBOL(dpi_check_timings); +void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines) +{ + mutex_lock(&dpi.lock); + + dpi.data_lines = data_lines; + + mutex_unlock(&dpi.lock); +} +EXPORT_SYMBOL(omapdss_dpi_set_data_lines); + static int __init dpi_init_display(struct omap_dss_device *dssdev) { DSSDBG("init_display\n"); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index e4fcc89..47f29b7 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -760,6 +760,7 @@ void omapdss_dpi_set_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings); int dpi_check_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings); +void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines); int omapdss_sdi_display_enable(struct omap_dss_device *dssdev); void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);