From patchwork Thu Nov 15 01:13:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1744751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 752F2DF264 for ; Thu, 15 Nov 2012 01:15:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYo14-00046p-Kq; Thu, 15 Nov 2012 01:13:14 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TYo10-00046W-1A for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2012 01:13:10 +0000 Received: by mail-pa0-f49.google.com with SMTP id bi5so666286pad.36 for ; Wed, 14 Nov 2012 17:13:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=Onj0RJtgZdwPOK54c7cXNn2VrKM41suefHf5rFK4XAk=; b=KhY0ekYyBb8XL+qAXi4m/bP1wqIQ+xsVI9nNXEzsE/UIt9/d5vXOVEJAdCxIqB80/K 56d3KKNL3zi8BKnYZ+sETbxicuFBdHPx95WUzCGx+gcHW19M1Gv62cPv0rNp1MbO7KD4 U8x+3dhcViYYiog6YAmV7bwR8JTaLNV17Qs8JBWQ0JvcjCGorORA05AAN/rS6L5rmIQG qIBG/wk46CJF15BVrtVQVi9gfcljShjRooy77IKSQ1MMSeXRrcSqaQgtfXRQt7Z9bByf 2BS7xjKPJfrqqGmwgm9+zXLtNhQY+RIYJbigM8n1Z32KXE4KfsRyIvGwwVspClK9B4Jn 0E0Q== Received: by 10.68.135.200 with SMTP id pu8mr39558063pbb.27.1352941986855; Wed, 14 Nov 2012 17:13:06 -0800 (PST) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id nt5sm6357501pbb.59.2012.11.14.17.13.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Nov 2012 17:13:06 -0800 (PST) From: Kevin Hilman To: Tony Lindgren , linux-omap@vger.kernel.org Subject: [PATCH] ARM: OMAP2+: voltage: fixup oscillator handling when CONFIG_PM=n Date: Wed, 14 Nov 2012 17:13:04 -0800 Message-Id: <1352941984-11828-1-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.8.0 X-Gm-Message-State: ALoCoQkoCLRUF3LSZnYqASZbpNDynDALVlZQF5U6C55oVYLzuoNT4XbsR0yhzDBh8XbO5uInC18b X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121114_201310_281532_605E2E63 X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Tero Kristo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kevin Hilman commit 908b75e8 (ARM: OMAP: add support for oscillator setup) added a new API for oscillator setup, but is broken when CONFIG_PM=n. The new functions have dummy definitions when CONFIG_PM=n, but also have full implementations available, which conflict. To fix, wrap the PM implmentations in #ifdef CONFIG_PM. Cc: Tero Kristo Signed-off-by: Kevin Hilman --- This applies to Tony's omap-for-v3.8/pm branch, which includes my for_3.8-pm-voltage tag where this bug was introduced. arch/arm/mach-omap2/pm.c | 2 ++ arch/arm/mach-omap2/pm.h | 2 +- arch/arm/mach-omap2/vc.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 109a02e..ef668c756 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -39,6 +39,7 @@ static struct omap_device_pm_latency *pm_lats; */ int (*omap_pm_suspend)(void); +#ifdef CONFIG_PM /** * struct omap2_oscillator - Describe the board main oscillator latencies * @startup_time: oscillator startup latency @@ -68,6 +69,7 @@ void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) *tstart = oscillator.startup_time; *tshut = oscillator.shutdown_time; } +#endif static int __init _init_omap_device(char *name) { diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 4db7b23..02c291c 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -135,7 +135,7 @@ extern void omap_pm_get_oscillator(u32 *tstart, u32 *tshut); extern void omap_pm_setup_sr_i2c_pcb_length(u32 mm); #else static inline void omap_pm_setup_oscillator(u32 tstart, u32 tshut) { } -static inline void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) { } +static inline void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) { *tstart = *tshut = 0; } static inline void omap_pm_setup_sr_i2c_pcb_length(u32 mm) { } #endif diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 687aa86..a89ec8a 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -666,6 +666,7 @@ static u8 omap_vc_calc_vsel(struct voltagedomain *voltdm, u32 uvolt) return voltdm->pmic->uv_to_vsel(uvolt); } +#ifdef CONFIG_PM /** * omap_pm_setup_sr_i2c_pcb_length - set length of SR I2C traces on PCB * @mm: length of the PCB trace in millimetres @@ -678,6 +679,7 @@ void __init omap_pm_setup_sr_i2c_pcb_length(u32 mm) { sr_i2c_pcb_length = mm; } +#endif void __init omap_vc_init_channel(struct voltagedomain *voltdm) {