From patchwork Tue Feb 26 22:53:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 2188231 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 65397DF215 for ; Tue, 26 Feb 2013 22:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759664Ab3BZW7Z (ORCPT ); Tue, 26 Feb 2013 17:59:25 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:51048 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755909Ab3BZW7Y (ORCPT ); Tue, 26 Feb 2013 17:59:24 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r1QMxMaO006347; Tue, 26 Feb 2013 16:59:22 -0600 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 r1QMxMsv017287; Tue, 26 Feb 2013 16:59:22 -0600 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; Tue, 26 Feb 2013 16:59:22 -0600 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 r1QMxMhY027399; Tue, 26 Feb 2013 16:59:22 -0600 Received: from localhost (h64-1.vpn.ti.com [172.24.64.1]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r1QMxJV18924; Tue, 26 Feb 2013 16:59:19 -0600 (CST) From: Eduardo Valentin To: CC: , , , Eduardo Valentin Subject: [PATCH 15/15] staging: omap-thermal: update clock prepare count Date: Tue, 26 Feb 2013 18:53:38 -0400 Message-ID: <1361919218-9788-16-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.7.7.1.488.ge8e1c In-Reply-To: <1361919218-9788-1-git-send-email-eduardo.valentin@ti.com> References: <1361919218-9788-1-git-send-email-eduardo.valentin@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 This patch changes the clock management code to also update the clock prepare counter, this way we won't skip the enable/disable operation due to prepare dependencies. Signed-off-by: Eduardo Valentin --- drivers/staging/omap-thermal/omap-bandgap.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/omap-thermal/omap-bandgap.c b/drivers/staging/omap-thermal/omap-bandgap.c index 83f74f4..d4a3788 100644 --- a/drivers/staging/omap-thermal/omap-bandgap.c +++ b/drivers/staging/omap-thermal/omap-bandgap.c @@ -943,7 +943,7 @@ int omap_bandgap_probe(struct platform_device *pdev) bg_ptr->clk_rate = clk_rate; if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL)) - clk_enable(bg_ptr->fclock); + clk_prepare_enable(bg_ptr->fclock); mutex_init(&bg_ptr->bg_mutex); @@ -1013,7 +1013,7 @@ int omap_bandgap_probe(struct platform_device *pdev) disable_clk: if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL)) - clk_disable(bg_ptr->fclock); + clk_disable_unprepare(bg_ptr->fclock); put_clks: clk_put(bg_ptr->fclock); clk_put(bg_ptr->div_clk); @@ -1044,7 +1044,7 @@ int omap_bandgap_remove(struct platform_device *pdev) omap_bandgap_power(bg_ptr, false); if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL)) - clk_disable(bg_ptr->fclock); + clk_disable_unprepare(bg_ptr->fclock); clk_put(bg_ptr->fclock); clk_put(bg_ptr->div_clk); @@ -1143,7 +1143,7 @@ static int omap_bandgap_suspend(struct device *dev) omap_bandgap_power(bg_ptr, false); if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL)) - clk_disable(bg_ptr->fclock); + clk_disable_unprepare(bg_ptr->fclock); return err; } @@ -1153,7 +1153,7 @@ static int omap_bandgap_resume(struct device *dev) struct omap_bandgap *bg_ptr = dev_get_drvdata(dev); if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL)) - clk_enable(bg_ptr->fclock); + clk_prepare_enable(bg_ptr->fclock); omap_bandgap_power(bg_ptr, true);