From patchwork Wed Jun 27 14:04:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jassi Brar X-Patchwork-Id: 9649 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 68ED723E16 for ; Wed, 27 Jun 2012 14:04:51 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 31218A18AD6 for ; Wed, 27 Jun 2012 14:04:51 +0000 (UTC) Received: by ggnf1 with SMTP id f1so996444ggn.11 for ; Wed, 27 Jun 2012 07:04:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=PMd8SU4oXU8pupiWazBCNUp5U6Jswsta4ciU4FF5sFo=; b=meZ3EeMH+RGBKkHn67kmpbSqss8xuZIV9xuOJTEHJnx522nd8cnO8isvOiIzN6gwQq 2mhyVVm2t6lRfIlPCGrixYk96RND7yMNPo9cG9Q1hPSpKiEelI/6tCDfUJVi0xkk2SyD 872A3yYhmeQJ8vO/3Z4bHct18SNNma8SAyxD+31R7Q6fKNxT9hGU0pfCRwgpHdreyfIj uZIWzIgW6DH5OTLCTrT95gwPA8JVwcaA/xw3RLIT2POrnVwlmBvq/9yRwaST4kk1cZp2 KhbYVDJm8ens05I4l2lkaPQQyXfZmzlGcH1H3Qs17A9nbBHwvDEHoqKQgAEII0/YpLdL 9NRg== Received: by 10.42.155.73 with SMTP id t9mr10974276icw.48.1340805890324; Wed, 27 Jun 2012 07:04:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp13227ibb; Wed, 27 Jun 2012 07:04:49 -0700 (PDT) Received: by 10.68.138.166 with SMTP id qr6mr64591182pbb.43.1340805889654; Wed, 27 Jun 2012 07:04:49 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pv10si20893521pbb.4.2012.06.27.07.04.49 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jun 2012 07:04:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of jaswinder.singh@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of jaswinder.singh@linaro.org) smtp.mail=jaswinder.singh@linaro.org Received: by pbbrr4 with SMTP id rr4so1937562pbb.37 for ; Wed, 27 Jun 2012 07:04:49 -0700 (PDT) Received: by 10.68.204.129 with SMTP id ky1mr65894059pbc.32.1340805889203; Wed, 27 Jun 2012 07:04:49 -0700 (PDT) Received: from localhost.localdomain ([122.178.249.255]) by mx.google.com with ESMTPS id sk5sm15282385pbc.7.2012.06.27.07.04.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jun 2012 07:04:47 -0700 (PDT) From: jaswinder.singh@linaro.org To: tomi.valkeinen@ti.com, mythripk@ti.com Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, andy.green@linaro.org, n-dechesne@ti.com, patches@linaro.org, Jassi Brar Subject: [PATCH 1/3] OMAPDSS: HDMI: Discard phy_tx_enabled member Date: Wed, 27 Jun 2012 19:34:36 +0530 Message-Id: <1340805876-28696-1-git-send-email-jaswinder.singh@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmQv4Oody4Ga19IvyXSOdn0R6ds640s5FOnLPqFzSUytg1okFwLxCQdjGzf6aXuVAIOj2tE From: Jassi Brar It is simpler to read the current status from a register as compared to maintaining a state variable to hold the information. Signed-off-by: Jassi Brar --- drivers/video/omap2/dss/ti_hdmi.h | 1 - drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h index e734cb4..d174ca1 100644 --- a/drivers/video/omap2/dss/ti_hdmi.h +++ b/drivers/video/omap2/dss/ti_hdmi.h @@ -177,7 +177,6 @@ struct hdmi_ip_data { /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */ int hpd_gpio; - bool phy_tx_enabled; }; int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data); void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data); diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index 4dae1b2..3fa3d98 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c @@ -157,6 +157,10 @@ static int hdmi_pll_init(struct hdmi_ip_data *ip_data) /* PHY_PWR_CMD */ static int hdmi_set_phy_pwr(struct hdmi_ip_data *ip_data, enum hdmi_phy_pwr val) { + /* Return if already the state */ + if (REG_GET(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, 5, 4) == val) + return 0; + /* Command for power control of HDMI PHY */ REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, val, 7, 6); @@ -241,11 +245,6 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) hpd = gpio_get_value(ip_data->hpd_gpio); - if (hpd == ip_data->phy_tx_enabled) { - spin_unlock_irqrestore(&phy_tx_lock, flags); - return 0; - } - if (hpd) r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_TXON); else @@ -257,7 +256,6 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) goto err; } - ip_data->phy_tx_enabled = hpd; err: spin_unlock_irqrestore(&phy_tx_lock, flags); return r; @@ -327,7 +325,6 @@ void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data) free_irq(gpio_to_irq(ip_data->hpd_gpio), ip_data); hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); - ip_data->phy_tx_enabled = false; } static int hdmi_core_ddc_init(struct hdmi_ip_data *ip_data)