From patchwork Wed Aug 1 10:31:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1263981 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 D99563FC71 for ; Wed, 1 Aug 2012 10:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754978Ab2HAKeM (ORCPT ); Wed, 1 Aug 2012 06:34:12 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:39572 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754962Ab2HAKeM (ORCPT ); Wed, 1 Aug 2012 06:34:12 -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 q71AYBwb020660; Wed, 1 Aug 2012 05:34:11 -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 q71AYBjF003426; Wed, 1 Aug 2012 05:34:11 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 1 Aug 2012 05:34:11 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q71AYBjP016923; Wed, 1 Aug 2012 05:34:11 -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 q71AY9r26908; Wed, 1 Aug 2012 05:34:09 -0500 (CDT) From: Archit Taneja To: CC: , , , , Archit Taneja Subject: [RFC 17/17] OMAPDSS: VENC: Add a get_timing function for VENC interface Date: Wed, 1 Aug 2012 16:01:28 +0530 Message-ID: <1343817088-29645-18-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343817088-29645-1-git-send-email-archit@ti.com> References: <1343817088-29645-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 Add function omapdss_venc_get_timing() which returns the timings maintained by the VENC interface driver in it's driver data. This is just used once by the driver during it's probe. This prevents the need for the panel driver to configure default timings in it's probe. Int the VENC interface's probe, the timings field is set to PAL as a default value. The get_timing op makes more sense for interfaces which can be configured to a default timing. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/dss.h | 2 ++ drivers/video/omap2/dss/venc.c | 13 +++++++++++++ drivers/video/omap2/dss/venc_panel.c | 11 +++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 69b6ab9..3fe76c0 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -474,6 +474,8 @@ int omapdss_venc_display_enable(struct omap_dss_device *dssdev); void omapdss_venc_display_disable(struct omap_dss_device *dssdev); void omapdss_venc_set_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings); +void omapdss_venc_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); int omapdss_venc_check_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings); u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev); diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index d96025e..42f97ac 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -579,6 +579,18 @@ void omapdss_venc_set_timings(struct omap_dss_device *dssdev, mutex_unlock(&venc.venc_lock); } +void omapdss_venc_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings) +{ + DSSDBG("venc_set_timings\n"); + + mutex_lock(&venc.venc_lock); + + *timings = venc.timings; + + mutex_unlock(&venc.venc_lock); +} + int omapdss_venc_check_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { @@ -768,6 +780,7 @@ static int __init omap_venchw_probe(struct platform_device *pdev) mutex_init(&venc.venc_lock); venc.wss_data = 0; + venc.timings = omap_dss_pal_timings; venc_mem = platform_get_resource(venc.pdev, IORESOURCE_MEM, 0); if (!venc_mem) { diff --git a/drivers/video/omap2/dss/venc_panel.c b/drivers/video/omap2/dss/venc_panel.c index 350b0d9..fe9958d 100644 --- a/drivers/video/omap2/dss/venc_panel.c +++ b/drivers/video/omap2/dss/venc_panel.c @@ -84,14 +84,13 @@ static DEVICE_ATTR(output_type, S_IRUGO | S_IWUSR, static int venc_panel_probe(struct omap_dss_device *dssdev) { + struct omap_video_timings timings; + mutex_init(&venc_panel.lock); - /* set initial timings to PAL */ - dssdev->panel.timings = (struct omap_video_timings) - { 720, 574, 13500, 64, 12, 68, 5, 5, 41, - OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH, - true, - }; + omapdss_venc_get_timings(dssdev, &timings); + + dssdev->panel.timings = timings; return device_create_file(&dssdev->dev, &dev_attr_output_type); }