From patchwork Wed May 22 02:24:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2599781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id A66D5DFB79 for ; Wed, 22 May 2013 02:25:28 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ueyjf-0007aX-OF; Wed, 22 May 2013 02:25:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeyjM-0005Em-Uh; Wed, 22 May 2013 02:24:44 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UeyjK-0005Dv-DF for linux-arm-kernel@lists.infradead.org; Wed, 22 May 2013 02:24:42 +0000 Received: by mail-pd0-f174.google.com with SMTP id 14so1214025pdj.5 for ; Tue, 21 May 2013 19:24:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:mime-version:content-transfer-encoding :x-gm-message-state; bh=a+Pv+1c/yTNhfq0WofPUb+UIJEptMDXn0cSXyNQzgCY=; b=DoYIROTiQmGGHseEy5bJQfxqAvS+Nre1QEKgpXf8eFeO4ewB2AcS3q04ORCdJp9V6R 56/NSrdhGKuNIEtgk99wFhJm+jmJUC3AT/65huJeELxqLbGRJTRAvjV/u+L32wAeqYxL gxj0tTqj+jVbEuqHU2xpTXL1NIpuCs2gWHobDm783ebuZ2NLb88PTEC9cVWBmUL7BbFA SHShLr8fXBdUGWktbxwZEpX5h+otynGMIRp4BNYSL2FDRnVMiM+gT+TQQdkfMswwQ8Vt CfBkV6phZFSUAqcrcj7cvI3pJBjJDwrCyCKkgc/zw5+W+iq/wlUcGaY82eHaQS1Naco5 Gm0A== X-Received: by 10.66.160.104 with SMTP id xj8mr6069236pab.3.1369189461055; Tue, 21 May 2013 19:24:21 -0700 (PDT) Received: from [192.168.0.101] (114-39-105-194.dynamic.hinet.net. [114.39.105.194]) by mx.google.com with ESMTPSA id t1sm5806369pab.12.2013.05.21.19.24.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 May 2013 19:24:20 -0700 (PDT) Message-ID: <1369189456.19416.1.camel@phoenix> Subject: [RESEND][PATCH 2/2] clk: wm831x: Fix wm831x_clkout_get_parent From: Axel Lin To: Mike Turquette Date: Wed, 22 May 2013 10:24:16 +0800 In-Reply-To: <1369189396.19416.0.camel@phoenix> References: <1369189396.19416.0.camel@phoenix> X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQk/trkefOApp5ssaw8ARZua92Qy2gAHOrnwsjVuZvb45qWOcfln7fChtOI76YbYAIO9Bdiu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130521_222442_539386_A67B988B X-CRM114-Status: GOOD ( 12.46 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.174 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Current code looks strange because calling wm831x_clkout_set_parent() with 0 as parent parameter, wm831x_clkout_get_parent() will return 1. According to the datasheet: R16528 (4090h) Clock Control1 BIT 0: CLKOUT output source select 0 = FLL output 1 = 32.768kHz oscillator Thus fix the entry order in wm831x_clkout_parents[] to make it has the same meaning as the datasheet and make the return value of wm831x_clkout_get_parent() consistent with the parent pass to wm831x_clkout_set_parent(). Signed-off-by: Axel Lin Acked-by: Mark Brown --- drivers/clk/clk-wm831x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c index 4bdf0b0..58d08a6 100644 --- a/drivers/clk/clk-wm831x.c +++ b/drivers/clk/clk-wm831x.c @@ -299,8 +299,8 @@ static void wm831x_clkout_unprepare(struct clk_hw *hw) } static const char *wm831x_clkout_parents[] = { - "xtal", "fll", + "xtal", }; static u8 wm831x_clkout_get_parent(struct clk_hw *hw) @@ -318,9 +318,9 @@ static u8 wm831x_clkout_get_parent(struct clk_hw *hw) } if (ret & WM831X_CLKOUT_SRC) - return 0; - else return 1; + else + return 0; } static int wm831x_clkout_set_parent(struct clk_hw *hw, u8 parent)