From patchwork Thu Aug 9 11:49:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1300151 Return-Path: X-Original-To: patchwork-linux-omap@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 E07693FC23 for ; Thu, 9 Aug 2012 11:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932252Ab2HILwL (ORCPT ); Thu, 9 Aug 2012 07:52:11 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:53315 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932241Ab2HILwJ (ORCPT ); Thu, 9 Aug 2012 07:52:09 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q79Bq8e9001513; Thu, 9 Aug 2012 06:52:08 -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 q79Bq8ql008228; Thu, 9 Aug 2012 06:52:08 -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; Thu, 9 Aug 2012 06:52:08 -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 q79Bq82E021739; Thu, 9 Aug 2012 06:52:08 -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 q79Bq6r16078; Thu, 9 Aug 2012 06:52:06 -0500 (CDT) From: Archit Taneja To: CC: , , Archit Taneja Subject: [PATCH v2 13/13] OMAPDSS: VENC: Add a get_timing function for VENC interface Date: Thu, 9 Aug 2012 17:19:49 +0530 Message-ID: <1344512989-4071-14-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344512989-4071-1-git-send-email-archit@ti.com> References: <1343817088-29645-1-git-send-email-archit@ti.com> <1344512989-4071-1-git-send-email-archit@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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); }