From patchwork Thu Aug 16 07:36:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1330061 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 880D340210 for ; Thu, 16 Aug 2012 07:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753284Ab2HPHiW (ORCPT ); Thu, 16 Aug 2012 03:38:22 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:42135 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753102Ab2HPHiV (ORCPT ); Thu, 16 Aug 2012 03:38:21 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7G7cKwL007296; Thu, 16 Aug 2012 02:38:20 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7G7cKQ1028763; Thu, 16 Aug 2012 02:38:20 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Thu, 16 Aug 2012 02:38:19 -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 q7G7cKNV018548; Thu, 16 Aug 2012 02:38:20 -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 q7G7cIr13365; Thu, 16 Aug 2012 02:38:18 -0500 (CDT) From: Archit Taneja To: CC: , , Archit Taneja Subject: [PATCH 4/6] OMAPDSS: RFBI: Maitain copy of rfbi timings in driver data Date: Thu, 16 Aug 2012 13:06:32 +0530 Message-ID: <1345102594-6222-5-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345102594-6222-1-git-send-email-archit@ti.com> References: <343817088-29645-1-git-send-email-archit@ti.com> <1345102594-6222-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 RFBI driver currently relies on the omap_dss_device struct to receive the rfbi specific timings requested by the panel driver. This makes the RFBI interface driver dependent on the omap_dss_device struct. Make the RFBI driver data maintain it's own rfbi specific timings field. The panel driver is expected to call omapdss_rfbi_set_interface_timings() to configure the rfbi timings before the interface is enabled. The function takes a void pointer rather than a pointer to rfbi_timings struct. This is because this function will finally be an output op shared across different outputs to set custom or private timings. Signed-off-by: Archit Taneja --- drivers/video/omap2/displays/panel-n8x0.c | 2 ++ drivers/video/omap2/dss/rfbi.c | 14 +++++++++++--- include/video/omapdss.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c index 3ffd987..14adc1d 100644 --- a/drivers/video/omap2/displays/panel-n8x0.c +++ b/drivers/video/omap2/displays/panel-n8x0.c @@ -307,6 +307,8 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev) dssdev->panel.timings.y_res); omapdss_rfbi_set_pixel_size(dssdev, dssdev->ctrl.pixel_size); omapdss_rfbi_set_data_lines(dssdev, dssdev->phy.rfbi.data_lines); + omapdss_rfbi_set_interface_timings(dssdev, + (void *) &dssdev->ctrl.rfbi_timings); r = omapdss_rfbi_display_enable(dssdev); if (r) diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 698d5b9..b5b0bc6 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -115,6 +115,7 @@ static struct { struct omap_video_timings timings; int pixel_size; int data_lines; + struct rfbi_timings intf_timings; } rfbi; static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val) @@ -799,6 +800,15 @@ void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev, int data_lines) } EXPORT_SYMBOL(omapdss_rfbi_set_data_lines); +void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, + void *timings) +{ + struct rfbi_timings *t = (struct rfbi_timings *) timings; + + rfbi.intf_timings = *t; +} +EXPORT_SYMBOL(omapdss_rfbi_set_interface_timings); + static void rfbi_dump_regs(struct seq_file *s) { #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, rfbi_read_reg(r)) @@ -907,9 +917,7 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) rfbi_configure(dssdev->phy.rfbi.channel, rfbi.pixel_size, rfbi.data_lines); - rfbi_set_timings(dssdev->phy.rfbi.channel, - &dssdev->ctrl.rfbi_timings); - + rfbi_set_timings(dssdev->phy.rfbi.channel, &rfbi.intf_timings); return 0; err1: diff --git a/include/video/omapdss.h b/include/video/omapdss.h index faac986..91eba93 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -765,5 +765,7 @@ void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size); void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev, int data_lines); +void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, + void *timings); #endif