From patchwork Wed Aug 1 10:31:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1263861 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 918BE3FC71 for ; Wed, 1 Aug 2012 10:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754366Ab2HAKdr (ORCPT ); Wed, 1 Aug 2012 06:33:47 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:43813 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753934Ab2HAKdq (ORCPT ); Wed, 1 Aug 2012 06:33:46 -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 q71AXj6E009943; Wed, 1 Aug 2012 05:33:46 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q71AXjpx003094; Wed, 1 Aug 2012 05:33:45 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 1 Aug 2012 05:33:45 -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 q71AXjqM016074; Wed, 1 Aug 2012 05:33:45 -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 q71AXhr26864; Wed, 1 Aug 2012 05:33:43 -0500 (CDT) From: Archit Taneja To: CC: , , , , Archit Taneja Subject: [RFC 11/17] OMAPDSS: HDMI: Add locking for hdmi interface get/set timing functions Date: Wed, 1 Aug 2012 16:01:22 +0530 Message-ID: <1343817088-29645-12-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 The hdmi interface driver exposes functions to the hdmi panel driver to get and configure the interface timings maintained by the hdmi driver. These timings(stored in hdmi.ip_data.cfg) should be protected by the hdmi lock to ensure they are called sequentially, this is similar to how hdmi enable and disable functions need locking. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 2de1f91..dfd582e 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -547,7 +547,11 @@ static void hdmi_power_off(struct omap_dss_device *dssdev) void omapdss_hdmi_display_get_timing(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { + mutex_lock(&hdmi.lock); + *timings = hdmi.ip_data.cfg.timings; + + mutex_unlock(&hdmi.lock); } int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, @@ -570,6 +574,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, struct hdmi_cm cm; const struct hdmi_config *timing; + mutex_lock(&hdmi.lock); + cm = hdmi_get_code(timings); hdmi.ip_data.cfg.cm = cm; @@ -588,6 +594,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, } else { dss_mgr_set_timings(dssdev->manager, &timing->timings); } + + mutex_unlock(&hdmi.lock); } static void hdmi_dump_regs(struct seq_file *s)